Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7,439 changes: 4,681 additions & 2,758 deletions package-lock.json

Large diffs are not rendered by default.

183 changes: 92 additions & 91 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,93 +1,94 @@
{
"name": "oi-project",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.11.3",
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.58",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^12.8.3",
"@types/jest": "^26.0.21",
"@types/qrcode.react": "^1.0.1",
"@types/react": "^16.14.5",
"@types/react-dom": "^16.9.11",
"@types/react-qr-reader": "^2.1.3",
"clsx": "^1.1.1",
"events": "^3.3.0",
"file-saver": "^2.0.5",
"fontsource-roboto": "^4.0.0",
"qrcode.react": "^1.0.1",
"react": "^17.0.1",
"react-copy-to-clipboard": "^5.0.3",
"react-dom": "^17.0.1",
"react-qr-reader": "^2.2.1",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"react-scrollable-feed": "^1.3.1",
"react-spinners": "^0.10.6",
"react-spring": "^9.1.2",
"react-use-websocket": "^2.5.0",
"typescript": "^4.2.3",
"use-lodash-debounce-throttle": "^0.3.5",
"uuid": "^8.3.2",
"web-vitals": "^0.2.4",
"workbox-background-sync": "^5.1.4",
"workbox-broadcast-update": "^5.1.4",
"workbox-cacheable-response": "^5.1.4",
"workbox-core": "^5.1.4",
"workbox-expiration": "^5.1.4",
"workbox-google-analytics": "^5.1.4",
"workbox-navigation-preload": "^5.1.4",
"workbox-precaching": "^5.1.4",
"workbox-range-requests": "^5.1.4",
"workbox-routing": "^5.1.4",
"workbox-strategies": "^5.1.4",
"workbox-streams": "^5.1.4"
},
"scripts": {
"start": "deno run --allow-read --allow-net=:${PORT} server/server.ts --port=${PORT}",
"build": "npm run build-all",
"eject": "react-scripts eject",
"start-lecturer": "set PORT=3000 && react-app-rewired start src/lecturer",
"build-lecturer": "react-app-rewired build src/lecturer public/lecturer build/lecturer",
"test-lecturer": "react-app-rewired test src/lecturer",
"start-student": "set PORT=3001 && react-app-rewired start src/student",
"build-student": "react-app-rewired build src/student public/student build/student",
"test-student": "react-app-rewired test src/student",
"start-all": "start npm run start-lecturer & start npm run start-student",
"build-all": "npm run build-lecturer & npm run build-student",
"server": "npm run open-browser & npm run deno",
"deno": "deno run --allow-read --allow-net=:8000 server/server.ts",
"launch": "npm run start-all & start npm run deno",
"launch-full": "npm install && (npm run start-all & (npm run build-all && start npm run deno))",
"open-browser": "deno run --allow-run scripts/open-browser.ts"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@types/file-saver": "^2.0.2",
"@types/node": "^12.20.7",
"@types/react-router-dom": "^5.1.7",
"@types/uuid": "^8.3.0",
"react-app-rewired": "^2.1.8"
},
"homepage": "."
"name": "oi-project",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.12.1",
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.60",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"@types/jest": "^26.0.24",
"@types/qrcode.react": "^1.0.2",
"@types/react": "^16.14.11",
"@types/react-dom": "^16.9.14",
"@types/react-qr-reader": "^2.1.4",
"clsx": "^1.1.1",
"events": "^3.3.0",
"file-saver": "^2.0.5",
"fontsource-roboto": "^4.0.0",
"qrcode.react": "^1.0.1",
"react": "^17.0.2",
"react-copy-to-clipboard": "^5.0.3",
"react-dom": "^17.0.2",
"react-qr-reader": "^2.2.1",
"react-router-dom": "^5.2.0",
"react-scrollable-feed": "^1.3.1",
"react-spinners": "^0.10.6",
"react-spring": "^9.2.3",
"react-use-websocket": "^2.7.1",
"typescript": "^4.3.5",
"use-interval": "^1.3.0",
"use-lodash-debounce-throttle": "^0.3.5",
"uuid": "^8.3.2",
"web-vitals": "^0.2.4",
"workbox-background-sync": "^5.1.4",
"workbox-broadcast-update": "^5.1.4",
"workbox-cacheable-response": "^5.1.4",
"workbox-core": "^5.1.4",
"workbox-expiration": "^5.1.4",
"workbox-google-analytics": "^5.1.4",
"workbox-navigation-preload": "^5.1.4",
"workbox-precaching": "^5.1.4",
"workbox-range-requests": "^5.1.4",
"workbox-routing": "^5.1.4",
"workbox-strategies": "^5.1.4",
"workbox-streams": "^5.1.4"
},
"scripts": {
"start": "deno run --allow-read --allow-net=:${PORT} server/server.ts --port=${PORT}",
"build": "npm run build-all",
"eject": "react-scripts eject",
"start-lecturer": "set PORT=3000 && react-app-rewired start src/lecturer",
"build-lecturer": "react-app-rewired build src/lecturer public/lecturer build/lecturer",
"test-lecturer": "react-app-rewired test src/lecturer",
"start-student": "set PORT=3001 && react-app-rewired start src/student",
"build-student": "react-app-rewired build src/student public/student build/student",
"test-student": "react-app-rewired test src/student",
"start-all": "start npm run start-lecturer & start npm run start-student",
"build-all": "npm run build-lecturer & npm run build-student",
"server": "npm run open-browser & npm run deno",
"deno": "deno run --allow-read --allow-net=:8000 server/server.ts",
"launch": "npm run start-all & start npm run deno",
"launch-full": "npm install && (npm run start-all & (npm run build-all && start npm run deno))",
"open-browser": "deno run --allow-run scripts/open-browser.ts"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@types/file-saver": "^2.0.3",
"@types/node": "^12.20.16",
"@types/react-router-dom": "^5.1.8",
"@types/uuid": "^8.3.1",
"react-app-rewired": "^2.1.8",
"react-scripts": "^4.0.3"
},
"homepage": "."
}
10 changes: 8 additions & 2 deletions server/Lecture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,17 @@ class Lecture {
reason: reason
}
};
this.wsc?.send(JSON.stringify(serverResponse));

if (!this.wsc?.isClosed)
this.wsc?.send(JSON.stringify(serverResponse))

if (reason === "quiz_timeout") {
serverResponse.data.quizID = quiz.IDFromServer;
const remainingStudents: Student[] = selectedStudents.filter((student: Student) => !quiz.answeredStudents().includes(student.id));
remainingStudents.forEach((student: Student) => student.wsc?.send(JSON.stringify(serverResponse)));
remainingStudents.forEach((student: Student) => {
if (!student.wsc?.isClosed)
student.wsc?.send(JSON.stringify(serverResponse))
});
}
quiz.removeListener("answersAdded", answersAddedHandler);
quiz.removeListener("quizEnded", quizEndedHandler);
Expand Down
3 changes: 3 additions & 0 deletions src/@types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ interface ScheduledQuiz {
timeSeconds?: number;
questionStats: QuestionStat[];
alreadyShowedResults: boolean;
inProgress?: boolean;
timeToEnd?: number;
}

interface AnswerStat {
Expand All @@ -67,6 +69,7 @@ interface QuizStat{
interface Statistic{
quizzes: QuizStat[];
}

type TimestampType =
"QuestionType" |
"LogType" |
Expand Down
2 changes: 1 addition & 1 deletion src/common/util/LazareLocalStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const loadForArray = (key: string, initialValue: any[]) => {

const save = (key: string, value: any) => {
if (value === undefined) return;
console.log("saveKey", value);
// console.log("saveKey", value);
return localStorage.setItem(makeKey(key), JSON.stringify(value));
}

Expand Down
Loading