Compare commits
No commits in common. "20da4043a86dbfbed3eaa3ead403ffb9502aa9a8" and "01296702d3db3d22ba4051bfb3e3f8e04b1f7fed" have entirely different histories.
20da4043a8
...
01296702d3
9 changed files with 58 additions and 91 deletions
|
@ -12,7 +12,7 @@ import Manual from "./components/pages/Manual";
|
|||
import Secret from "./components/pages/Secret";
|
||||
import Umfrage from "./components/pages/Umfrage";
|
||||
import PrivateRoute from "./auth/PrivateRoute";
|
||||
import Study from "./components/pages/Study";
|
||||
import BehaviorNormal from "./components/pages/BehaviorNormal";
|
||||
|
||||
function App() {
|
||||
return (
|
||||
|
@ -28,7 +28,7 @@ function App() {
|
|||
<Route path="/register" component={Register} />
|
||||
<Route path="/manual" component={Manual} />
|
||||
<Route path="/ueber" component={Ueber} />
|
||||
<PrivateRoute path="/study" component={Study} />
|
||||
<PrivateRoute path="/behavior" component={BehaviorNormal} />
|
||||
<PrivateRoute path="/secret" component={Secret} />
|
||||
<PrivateRoute path="/umfrage" component={Umfrage} />
|
||||
</Switch>
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
import React from "react";
|
||||
import "../App.css";
|
||||
import GeneratedPassword from "./GeneratedPassword"
|
||||
|
||||
export default function BehaviorNormal() {
|
||||
return (
|
||||
<>
|
||||
<p>
|
||||
Zu Beginn geht es darum, dass Sie ganz normal den Benutzernamen und das
|
||||
Passwort eingeben. Verhalten Sie sich einfach so, als ob Sie sich
|
||||
normalerweise anmelden.
|
||||
</p>
|
||||
<GeneratedPassword />
|
||||
</>
|
||||
);
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
import React from "react";
|
||||
import "../App.css";
|
||||
|
||||
export default function BehaviorStudyInfo() {
|
||||
return (
|
||||
<>
|
||||
<p>
|
||||
Nachfolgend werden Sie einige Schritte durchlaufen, um ihre
|
||||
Nutzerinteraktion messen zu können. Verwenden Sie hierbei jeweils ihren
|
||||
Benutzernamen, welchen Sie bereits zuvor genutzt haben. Das Passwort
|
||||
wird jeweils generiert.
|
||||
</p>
|
||||
<p>
|
||||
Bitte klicken Sie auf weiter, um mit der Studie zu beginnen. Bitte lesen
|
||||
Sie die jeweilige Aufgabe jeweils genau.
|
||||
</p>
|
||||
|
||||
</>
|
||||
);
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
import React, { useEffect, useState } from "react";
|
||||
import "../App.css";
|
||||
|
||||
export default function GeneratedPassword() {
|
||||
const [genPassword, setGenPassword] = useState("");
|
||||
|
||||
const handleOnCopyEvent = (e) => {
|
||||
e.preventDefault();
|
||||
return false;
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
fetch("/api/protected/rcv_pw", {
|
||||
method: "get",
|
||||
}).then((response) => {
|
||||
response.json().then((resp) => {
|
||||
setGenPassword(resp.password);
|
||||
});
|
||||
});
|
||||
}, []);
|
||||
return (
|
||||
<>
|
||||
<p onCopy={handleOnCopyEvent}>
|
||||
Das Passwort für diese Situation lautet:{" "}
|
||||
<span className="generated-password">{genPassword}</span>
|
||||
</p>
|
||||
</>
|
||||
);
|
||||
}
|
|
@ -5,7 +5,7 @@ import "./HeroSection.css";
|
|||
import "@fortawesome/fontawesome-free/css/all.css";
|
||||
import { useAuth } from "../auth/AuthProvider";
|
||||
|
||||
export default function HeroSection() {
|
||||
function HeroSection() {
|
||||
const [isLoggedIn] = useAuth();
|
||||
|
||||
return (
|
||||
|
@ -17,7 +17,7 @@ export default function HeroSection() {
|
|||
className="btns"
|
||||
buttonStyle="btn--primary"
|
||||
buttonSize="btn--large"
|
||||
newTo="study"
|
||||
newTo="behavior"
|
||||
>
|
||||
Zur Studie
|
||||
</Button>
|
||||
|
@ -53,3 +53,5 @@ export default function HeroSection() {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default HeroSection;
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
import React, { useEffect } from "react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import "../../App.css";
|
||||
import Footer from "../../Footer";
|
||||
import InputField from "../InputField";
|
||||
import SubmitField from "../SubmitField";
|
||||
import { Logger } from "@behametrics/logger-web";
|
||||
import BehaviorStudyInfo from "../BehaviorStudyInfo";
|
||||
import BehaviorNormal from "../BehaviorNormal";
|
||||
import BehaviorStudyInfo from "./BehaviorStudyInfo";
|
||||
|
||||
export default function Study() {
|
||||
export default function BehaviorNormal() {
|
||||
let username = "";
|
||||
const setUsername = (tmp_username) => {
|
||||
username = tmp_username;
|
||||
|
@ -18,22 +17,23 @@ export default function Study() {
|
|||
password = tmp_password;
|
||||
};
|
||||
|
||||
const [genPassword, setGenPassword] = useState("");
|
||||
|
||||
let logger = new Logger({
|
||||
//inputs: ["cursor", "wheel", "keyboard", "touch"],
|
||||
inputs: ["keyboard"],
|
||||
// apiUrl: "https://behavior.marcocamenzind.ch",
|
||||
apiUrl: "http://localhost:5000",
|
||||
apiUrl: "https://behavior.marcocamenzind.ch",
|
||||
logToConsole: true,
|
||||
});
|
||||
|
||||
logger.init();
|
||||
|
||||
const handleLoggerOff = () => {
|
||||
const handleOff = () => {
|
||||
logger.stop();
|
||||
console.log("Logger ausgeschaltet");
|
||||
};
|
||||
|
||||
const handleLoggerOn = () => {
|
||||
const handleOn = () => {
|
||||
logger.start();
|
||||
console.log("start logging ");
|
||||
};
|
||||
|
@ -46,6 +46,11 @@ export default function Study() {
|
|||
setUsername(e.target.value);
|
||||
};
|
||||
|
||||
const handleOnCopyEvent = (e) => {
|
||||
e.preventDefault();
|
||||
return false;
|
||||
};
|
||||
|
||||
const handleOnPasteEvent = (e) => {
|
||||
e.preventDefault();
|
||||
return false;
|
||||
|
@ -75,21 +80,31 @@ export default function Study() {
|
|||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
fetch("/api/protected/rcv_pw", {
|
||||
method: "get",
|
||||
}).then((response) => {
|
||||
response.json().then((resp) => {
|
||||
setGenPassword(resp.password);
|
||||
});
|
||||
});
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="sitePage">
|
||||
<h1>Studie</h1>
|
||||
<button onClick={handleLoggerOn}>LOGGER StaRTEN</button>
|
||||
<BehaviorStudyInfo />{" "}
|
||||
<form id="behaviorNormal" action="#">
|
||||
<SubmitField
|
||||
LabelName="Starten mit der Studie"
|
||||
InputValue="next-situation"
|
||||
InputName="Weiter"
|
||||
onClick={handleLoggerOn}
|
||||
/>
|
||||
</form>{" "}
|
||||
<BehaviorNormal />
|
||||
<button onClick={handleOn}>LOGGER StaRTEN</button>
|
||||
<BehaviorStudyInfo />
|
||||
<p>
|
||||
Zu Beginn geht es darum, dass Sie ganz normal den Benutzernamen und
|
||||
das Passwort eingeben. Verhalten Sie sich einfach so, als ob Sie sich
|
||||
normalerweise anmelden.
|
||||
</p>
|
||||
<p onCopy={handleOnCopyEvent}>
|
||||
Das Passwort für diese Situation lautet:{" "}
|
||||
<span className="generated-password">{genPassword}</span>
|
||||
</p>
|
||||
<form id="behaviorNormal" action="#">
|
||||
<InputField
|
||||
LabelName="Benutzername"
|
||||
|
@ -97,6 +112,7 @@ export default function Study() {
|
|||
InputType="text"
|
||||
InputName="Benutzername"
|
||||
InputPlaceHolder="Benutzername"
|
||||
onCopy={handleOnCopyEvent}
|
||||
onPaste={handleOnPasteEvent}
|
||||
/>
|
||||
<InputField
|
||||
|
@ -105,6 +121,7 @@ export default function Study() {
|
|||
InputType="password"
|
||||
InputName="Passwort"
|
||||
InputPlaceHolder="Benutzername"
|
||||
onCopy={handleOnCopyEvent}
|
||||
onPaste={handleOnPasteEvent}
|
||||
/>
|
||||
<SubmitField
|
||||
|
@ -115,7 +132,7 @@ export default function Study() {
|
|||
onClick={onSubmitClick}
|
||||
/>
|
||||
</form>
|
||||
<button onClick={handleLoggerOff}>STOP THAT FUCKING LOGGER</button>
|
||||
<button onClick={handleOff}>STOP THAT FUCKING LOGGER</button>
|
||||
</div>
|
||||
<Footer />
|
||||
</>
|
13
frontend/src/components/pages/BehaviorStudyInfo.js
Normal file
13
frontend/src/components/pages/BehaviorStudyInfo.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
import React from "react";
|
||||
import "../../App.css";
|
||||
|
||||
export default function BehaviorStudyInfo() {
|
||||
return (
|
||||
<p>
|
||||
Nachfolgend werden Sie einige Schritte durchlaufen, um ihre
|
||||
Nutzerinteraktion messen zu können. Verwenden Sie hierbei jeweils ihren
|
||||
Benutzernamen, welchen Sie bereits zuvor genutzt haben. Das Passwort wird
|
||||
jeweils generiert.
|
||||
</p>
|
||||
);
|
||||
}
|
|
@ -70,7 +70,7 @@ export default function Login() {
|
|||
</form>
|
||||
) : (
|
||||
<>
|
||||
<Redirect to="/study" />
|
||||
<Redirect to="/behavior" />
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
@ -219,7 +219,7 @@ export default function Umfrage() {
|
|||
{!isSurveyValidBackend ? (
|
||||
<ErrorMessage message={backendErrorMessage} />
|
||||
) : (
|
||||
<Redirect to="/study" />
|
||||
<Redirect to="/behavior" />
|
||||
)}
|
||||
</div>
|
||||
<Footer />
|
||||
|
|
Loading…
Reference in a new issue