Compare commits
2 commits
cf481d42e1
...
146b018ad1
Author | SHA1 | Date | |
---|---|---|---|
146b018ad1 | |||
65fcf8e4ab |
1 changed files with 7 additions and 20 deletions
|
@ -1,4 +1,4 @@
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useRef, useState } from "react";
|
||||||
import "../../App.css";
|
import "../../App.css";
|
||||||
import Footer from "../../Footer";
|
import Footer from "../../Footer";
|
||||||
import InputField from "../InputField";
|
import InputField from "../InputField";
|
||||||
|
@ -9,18 +9,17 @@ import BehaviorNormal from "../BehaviorNormal";
|
||||||
import { Button } from "../Button";
|
import { Button } from "../Button";
|
||||||
|
|
||||||
export default function Study() {
|
export default function Study() {
|
||||||
|
const _logger = useRef(0);
|
||||||
var [logger, setLogger] = useState();
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
logger = new Logger({
|
_logger.current = new Logger({
|
||||||
//inputs: ["cursor", "wheel", "keyboard", "touch"],
|
//inputs: ["cursor", "wheel", "keyboard", "touch"],
|
||||||
inputs: ["keyboard"],
|
inputs: ["keyboard"],
|
||||||
// apiUrl: "https://behavior.marcocamenzind.ch",
|
// apiUrl: "https://behavior.marcocamenzind.ch",
|
||||||
apiUrl: "http://localhost:5000",
|
apiUrl: "http://localhost:5000",
|
||||||
logToConsole: true,
|
logToConsole: true,
|
||||||
});
|
});
|
||||||
logger.init();
|
_logger.current.init();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
let username = "";
|
let username = "";
|
||||||
|
@ -33,29 +32,16 @@ export default function Study() {
|
||||||
password = tmp_password;
|
password = tmp_password;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
let isStepStart = true;
|
|
||||||
const setIsStepStart = (tmp) => {
|
|
||||||
isStepStart = tmp;
|
|
||||||
};
|
|
||||||
|
|
||||||
let isStepNormal = false;
|
|
||||||
const setIsStepNormal = (tmp) => {
|
|
||||||
isStepNormal = tmp;
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
const [isStepStart, setIsStepStart] = useState(true);
|
const [isStepStart, setIsStepStart] = useState(true);
|
||||||
const [isStepNormal, setIsStepNormal] = useState(false);
|
const [isStepNormal, setIsStepNormal] = useState(false);
|
||||||
|
|
||||||
|
|
||||||
const handleLoggerOff = () => {
|
const handleLoggerOff = () => {
|
||||||
logger.stop();
|
_logger.current.stop();
|
||||||
console.log("Logger ausgeschaltet");
|
console.log("Logger ausgeschaltet");
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleLoggerOn = () => {
|
const handleLoggerOn = () => {
|
||||||
logger.start();
|
_logger.current.start();
|
||||||
console.log("start logging ");
|
console.log("start logging ");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -77,6 +63,7 @@ export default function Study() {
|
||||||
console.log("isStepStar", isStepStart);
|
console.log("isStepStar", isStepStart);
|
||||||
setIsStepNormal(true);
|
setIsStepNormal(true);
|
||||||
console.log("isStepNormal", isStepNormal);
|
console.log("isStepNormal", isStepNormal);
|
||||||
|
handleLoggerOn();
|
||||||
// forceUpdate();
|
// forceUpdate();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue