very beginnings of test result reporting

This commit is contained in:
lingdocs 2021-09-18 20:25:32 -04:00
parent 7a3e972149
commit 6051dd15c1
3 changed files with 18 additions and 14 deletions

View File

@ -4,7 +4,7 @@
"private": true, "private": true,
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-free": "^5.15.2", "@fortawesome/fontawesome-free": "^5.15.2",
"@lingdocs/lingdocs-main": "^0.0.9", "@lingdocs/lingdocs-main": "^0.1.1",
"@lingdocs/pashto-inflector": "^1.0.5", "@lingdocs/pashto-inflector": "^1.0.5",
"@testing-library/jest-dom": "^4.2.4", "@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2", "@testing-library/react": "^9.3.2",

View File

@ -7,6 +7,10 @@ import "./timer.css";
import { import {
getPercentageDone, getPercentageDone,
} from "../lib/game-utils"; } from "../lib/game-utils";
import {
AT,
getTimestamp,
} from "@lingdocs/lingdocs-main";
import { import {
Types as T, Types as T,
} from "@lingdocs/pashto-inflector"; } from "@lingdocs/pashto-inflector";
@ -43,17 +47,17 @@ function GameCore<T>({ questions, Display, timeLimit, Instructions, studyLink, i
else setCurrent(next.value); else setCurrent(next.value);
} }
function handleFinish() { function handleFinish() {
if (user) {
// TODO: post results
console.log(
"will post results for",
user.userId,
"results id",
id,
);
}
setFinish("pass"); setFinish("pass");
rewardRef.current?.rewardMe(); rewardRef.current?.rewardMe();
if (user) {
const result: AT.TestResult = {
done: true,
time: getTimestamp(),
id,
};
// TODO: post results
console.log("will post result", JSON.stringify(result));
}
} }
function handleQuit() { function handleQuit() {
setFinish(null); setFinish(null);

View File

@ -1566,10 +1566,10 @@
"@types/yargs" "^15.0.0" "@types/yargs" "^15.0.0"
chalk "^4.0.0" chalk "^4.0.0"
"@lingdocs/lingdocs-main@^0.0.9": "@lingdocs/lingdocs-main@^0.1.1":
version "0.0.9" version "0.1.1"
resolved "https://npm.lingdocs.com/@lingdocs%2flingdocs-main/-/lingdocs-main-0.0.9.tgz#beaf25d0e6aad15594e595b2b17ed427c7cbb332" resolved "https://npm.lingdocs.com/@lingdocs%2flingdocs-main/-/lingdocs-main-0.1.1.tgz#b4b7b8774821e5188a8deb7312cd2db0410115d1"
integrity sha512-DIlMJb64etwXLLtzm2Gx9BUnXT2vuyc7i9YQHuYC1iaQESAAt49RvvQTIRz9B1F+U/faSvTno8W93PGNb0wgng== integrity sha512-Khh1bZ2ZB9BowB1Thp38hrJnHyVQfeQBFFYV1Juc0YLsGInCAAptI4QGSOL1PXRGhYIwQwrgu+1J/dFyDO/6CA==
dependencies: dependencies:
nano "^9.0.5" nano "^9.0.5"
passport-github2 "^0.1.12" passport-github2 "^0.1.12"