diff --git a/frontend/src/App.js b/frontend/src/App.js
index 20f00f1..415c951 100644
--- a/frontend/src/App.js
+++ b/frontend/src/App.js
@@ -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 BehaviorNormal from "./components/pages/BehaviorNormal";
+import Study from "./components/pages/Study";
function App() {
return (
@@ -28,7 +28,7 @@ function App() {
-
+
diff --git a/frontend/src/components/HeroSection.js b/frontend/src/components/HeroSection.js
index be197eb..1767dc4 100644
--- a/frontend/src/components/HeroSection.js
+++ b/frontend/src/components/HeroSection.js
@@ -17,7 +17,7 @@ function HeroSection() {
className="btns"
buttonStyle="btn--primary"
buttonSize="btn--large"
- newTo="behavior"
+ newTo="study"
>
Zur Studie
diff --git a/frontend/src/components/pages/Login.js b/frontend/src/components/pages/Login.js
index 46dd4c5..c6ea7f8 100644
--- a/frontend/src/components/pages/Login.js
+++ b/frontend/src/components/pages/Login.js
@@ -70,7 +70,7 @@ export default function Login() {
) : (
<>
-
+
>
)}
diff --git a/frontend/src/components/pages/Study.js b/frontend/src/components/pages/Study.js
new file mode 100644
index 0000000..a6bbeab
--- /dev/null
+++ b/frontend/src/components/pages/Study.js
@@ -0,0 +1,123 @@
+import React, { useEffect } 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";
+
+export default function Study() {
+ let username = "";
+ const setUsername = (tmp_username) => {
+ username = tmp_username;
+ };
+
+ let password = "";
+ const setPassword = (tmp_password) => {
+ password = tmp_password;
+ };
+
+ let logger = new Logger({
+ //inputs: ["cursor", "wheel", "keyboard", "touch"],
+ inputs: ["keyboard"],
+ // apiUrl: "https://behavior.marcocamenzind.ch",
+ apiUrl: "http://localhost:5000",
+ logToConsole: true,
+ });
+
+ logger.init();
+
+ const handleLoggerOff = () => {
+ logger.stop();
+ console.log("Logger ausgeschaltet");
+ };
+
+ const handleLoggerOn = () => {
+ logger.start();
+ console.log("start logging ");
+ };
+
+ const handlePasswordChange = (e) => {
+ setPassword(e.target.value);
+ };
+
+ const handleUsernameChange = (e) => {
+ setUsername(e.target.value);
+ };
+
+ const handleOnPasteEvent = (e) => {
+ e.preventDefault();
+ return false;
+ };
+
+ const onSubmitClick = (e) => {
+ e.preventDefault();
+ let opts = {
+ username: username,
+ password: password,
+ };
+ fetch("/api/protected/behavior", {
+ method: "post",
+ body: JSON.stringify(opts),
+ }).then((response) => {
+ console.log(response.status);
+ if (response.status === 401) {
+ response.json().then((resp) => {
+ console.log("nicht so wirklich gut");
+ // setErrorMessage(resp.message);
+ });
+ } else {
+ response.json().then((token) => {
+ console.log("Alles gut :-)");
+ });
+ }
+ });
+ };
+
+ return (
+ <>
+
+
Studie
+
+ {" "}
+ {" "}
+
+
+
+
+
+ >
+ );
+}
diff --git a/frontend/src/components/pages/Umfrage.js b/frontend/src/components/pages/Umfrage.js
index 7a7e9d8..33bc203 100644
--- a/frontend/src/components/pages/Umfrage.js
+++ b/frontend/src/components/pages/Umfrage.js
@@ -219,7 +219,7 @@ export default function Umfrage() {
{!isSurveyValidBackend ? (
) : (
-
+
)}