Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Educator version #948

Open
wants to merge 137 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
a9f3c4c
feat: add supporting entity definitions
saachibm Dec 3, 2023
8880f9b
chore: add migration for education mode entities
sgfost Jan 29, 2024
2d09e8f
feat(WIP): set up initial client-side routes for edu-mode
sgfost Feb 5, 2024
53bcf4d
feat: add edu mode toggle and separate vue router instance
sgfost Feb 13, 2024
df79288
feat: add requiresTeacher client-side route guard
sgfost Feb 13, 2024
1409e31
WIP: Student login page with game code text field
saachibm Feb 19, 2024
8cedaae
fix: compile error with .ts settings, allow access to lobby
sgfost Feb 19, 2024
b763da8
FEAT (WIP): Add display wrapover for player grid
sabrinanel3 Mar 18, 2024
617082b
WIP: re-join game checkbox and password text field
saachibm Mar 11, 2024
4b7dd3a
FIX: Classroom Lobby layout & WIP Classroom Navbar
sabrinanel3 Apr 4, 2024
6c3e955
feat: add student login with classroom code
sgfost Mar 18, 2024
1acbf3f
Completed student login page/re-login page (correct)
saachibm Mar 27, 2024
0028e4a
feat: set-up routes and added first name, last name, password, and jo…
saachibm Apr 3, 2024
764b860
feat: add classroom/teacher creation, student login
sgfost Apr 8, 2024
9cddbb6
feat(WIP): edu mode password generation/student confirmation
sgfost Apr 15, 2024
83b96e8
FIX: tabs on login, teacher start btn in lobby
sabrinanel3 May 28, 2024
6741174
FEAT (WIP): Set up Teacher Dashboard & temp button in educator nav ba…
sabrinanel3 Jun 7, 2024
53d4210
feat: add/remove classroom buttons, set up tabs, organize student cards
sabrinanel3 Jun 7, 2024
ae60c30
feat: student auth and temporary rejoin code generation
sgfost Jun 10, 2024
1bfe08f
test: add educator service test suite
sgfost Jun 11, 2024
389343a
feat: added code generator for teacher password,
kellytea Jun 12, 2024
77d89b7
feat: fixed educator test suites and code generator
kellytea Jun 15, 2024
18d09a1
fix: add plus sign btn, fix group and class btns and indexes, add stu…
sabrinanel3 Jun 12, 2024
0164599
feat: add error message for wrong game code, add sidebar expand/colla…
sabrinanel3 Jun 14, 2024
bdb77a7
fix: educator mode build and typeorm changes
sgfost Jun 18, 2024
0e57042
fix: use sh shebang in build script
sabrinanel3 Jun 18, 2024
1488930
fix: teacher login and error messages
sabrinanel3 Jun 19, 2024
79867c9
feat (WIP): add verification for students and handle name setting
sabrinanel3 Jun 24, 2024
2ab1967
feat (WIP): Set up partitioning algo. for groups
kellytea Jun 24, 2024
b70a693
fix (WIP): edit student rejoin, set name, and verification functionality
sabrinanel3 Jun 26, 2024
1e8d218
feat: Fixed teacher dashboard list overflow + added classroom rename …
kellytea Jun 26, 2024
3465101
fix: rejoin code login
sabrinanel3 Jul 2, 2024
4448645
fix: remove profile editing from edu mode
sgfost Jul 3, 2024
f7a1172
feat: add classroom lobby game room
sgfost Jul 3, 2024
1c6baa4
fix: leave the classroom lobby when leaving the page
sgfost Jul 3, 2024
955819f
feat: add new educator routes and suporting services, fix minor UI da…
sabrinanel3 Jul 6, 2024
8ad0f2b
fix (WIP): set up group and reports containers for classrooms
kellytea Jul 6, 2024
7c8a90c
feat: add more educator routes and supporting services
sabrinanel3 Jul 8, 2024
96db7e2
fix: update educator routes and services
sabrinanel3 Jul 9, 2024
0af9f0c
fix: login flow visual tweaks and route guarding
sgfost Jul 9, 2024
f8b52cb
feat (WIP): teacher dashboard layout
kellytea Jul 10, 2024
a396bab
fix: add StudentData interface for getting students by classroom, upd…
sabrinanel3 Jul 10, 2024
833c54f
fix: connect dashboard to server side for add, delete, and update cla…
sabrinanel3 Jul 16, 2024
37af011
feat: reports container + additional UI fixes
kellytea Jul 15, 2024
4feb4c6
fix: (WIP) refresh issues for rename and delete classroom
sabrinanel3 Jul 17, 2024
cf4ced2
feat: start games button for educator
sgfost Jul 16, 2024
4212015
fix: classroom crud operations
sgfost Jul 18, 2024
e9d4740
chore: add educator setup script
sgfost Jul 19, 2024
d7efdfd
fix: add classroom error handling and modal conditions
sabrinanel3 Jul 19, 2024
c9bb48f
fix (WIP): filtering active rooms by classroomId, chat monitoring in …
kellytea Jul 19, 2024
a31a45f
feat: (WIP) completed games route & services
sabrinanel3 Jul 23, 2024
ee5cca2
fix: implement fetching active games
kellytea Jul 23, 2024
384542b
fix: refactor dashboard, fix lobby and completed games routes
sabrinanel3 Jul 27, 2024
3ab310d
fix: refactor dashboard, clean up educator routes + services
kellytea Jul 30, 2024
1bd3541
fix: add logging for startGames and remove games tab on dashboard
sabrinanel3 Jul 31, 2024
ca5dad4
fix: refactoring dashboard by tabs + UI fixes
kellytea Aug 7, 2024
59d44b8
fix: fetching selectedClassroom data
kellytea Aug 16, 2024
4be03ec
fix: cleanup request.ts, fix query params, fix server lint complaints
sabrinanel3 Aug 16, 2024
5027002
fix (WIP): request & service promises
kellytea Aug 20, 2024
19b1cb3
fix: student/teacher roles and cleanup
sgfost Aug 21, 2024
865fe2a
test: force delete classroom
sgfost Aug 21, 2024
8fdcbdb
fix: set client accepted game invitation to avoid delay
sgfost Sep 3, 2024
11a7db9
feat(WIP): include round introduction in game round snapshot
sgfost Sep 3, 2024
0cba9cb
feat: add educator privacy page
sabrinanel3 Sep 6, 2024
c36dc58
feat (WIP): refactor reports tab, add post-game stats
kellytea Sep 20, 2024
272a8d3
feat: add supporting entity definitions
saachibm Dec 3, 2023
c158da8
chore: add migration for education mode entities
sgfost Jan 29, 2024
53a4788
feat(WIP): set up initial client-side routes for edu-mode
sgfost Feb 5, 2024
7ade0b2
feat: add edu mode toggle and separate vue router instance
sgfost Feb 13, 2024
26ff24a
feat: add requiresTeacher client-side route guard
sgfost Feb 13, 2024
3b28d02
WIP: Student login page with game code text field
saachibm Feb 19, 2024
222adc7
fix: compile error with .ts settings, allow access to lobby
sgfost Feb 19, 2024
58edff9
FEAT (WIP): Add display wrapover for player grid
sabrinanel3 Mar 18, 2024
2afd1e1
WIP: re-join game checkbox and password text field
saachibm Mar 11, 2024
b2adb3d
FIX: Classroom Lobby layout & WIP Classroom Navbar
sabrinanel3 Apr 4, 2024
2679ebd
feat: add student login with classroom code
sgfost Mar 18, 2024
89e2260
Completed student login page/re-login page (correct)
saachibm Mar 27, 2024
e706439
feat: set-up routes and added first name, last name, password, and jo…
saachibm Apr 3, 2024
4c3c061
feat: add classroom/teacher creation, student login
sgfost Apr 8, 2024
efdc894
feat(WIP): edu mode password generation/student confirmation
sgfost Apr 15, 2024
969ed1d
FIX: tabs on login, teacher start btn in lobby
sabrinanel3 May 28, 2024
c4258a9
FEAT (WIP): Set up Teacher Dashboard & temp button in educator nav ba…
sabrinanel3 Jun 7, 2024
fe57fc8
feat: add/remove classroom buttons, set up tabs, organize student cards
sabrinanel3 Jun 7, 2024
aa16696
feat: student auth and temporary rejoin code generation
sgfost Jun 10, 2024
b791a8b
test: add educator service test suite
sgfost Jun 11, 2024
f51b49a
feat: added code generator for teacher password,
kellytea Jun 12, 2024
36f5fe7
feat: fixed educator test suites and code generator
kellytea Jun 15, 2024
26b84e7
fix: add plus sign btn, fix group and class btns and indexes, add stu…
sabrinanel3 Jun 12, 2024
3a67ffe
feat: add error message for wrong game code, add sidebar expand/colla…
sabrinanel3 Jun 14, 2024
16e483a
fix: educator mode build and typeorm changes
sgfost Jun 18, 2024
3e29780
fix: use sh shebang in build script
sabrinanel3 Jun 18, 2024
529a7ee
fix: teacher login and error messages
sabrinanel3 Jun 19, 2024
0484c69
feat (WIP): add verification for students and handle name setting
sabrinanel3 Jun 24, 2024
9d574f4
feat (WIP): Set up partitioning algo. for groups
kellytea Jun 24, 2024
b0b4b2e
fix (WIP): edit student rejoin, set name, and verification functionality
sabrinanel3 Jun 26, 2024
1532697
feat: Fixed teacher dashboard list overflow + added classroom rename …
kellytea Jun 26, 2024
81c6cb6
fix: rejoin code login
sabrinanel3 Jul 2, 2024
ea80df0
fix: remove profile editing from edu mode
sgfost Jul 3, 2024
4c4b33a
feat: add classroom lobby game room
sgfost Jul 3, 2024
c41ba93
fix: leave the classroom lobby when leaving the page
sgfost Jul 3, 2024
2a2f236
feat: add new educator routes and suporting services, fix minor UI da…
sabrinanel3 Jul 6, 2024
649bcb9
fix (WIP): set up group and reports containers for classrooms
kellytea Jul 6, 2024
ecb7d97
feat: add more educator routes and supporting services
sabrinanel3 Jul 8, 2024
30649d2
fix: update educator routes and services
sabrinanel3 Jul 9, 2024
355eb73
fix: login flow visual tweaks and route guarding
sgfost Jul 9, 2024
ecaaafc
feat (WIP): teacher dashboard layout
kellytea Jul 10, 2024
3f6ee46
fix: add StudentData interface for getting students by classroom, upd…
sabrinanel3 Jul 10, 2024
929c1ac
fix: connect dashboard to server side for add, delete, and update cla…
sabrinanel3 Jul 16, 2024
bbadba7
feat: reports container + additional UI fixes
kellytea Jul 15, 2024
e9cfaf4
fix: (WIP) refresh issues for rename and delete classroom
sabrinanel3 Jul 17, 2024
1c95939
feat: start games button for educator
sgfost Jul 16, 2024
a079a2a
fix: classroom crud operations
sgfost Jul 18, 2024
04c30a9
chore: add educator setup script
sgfost Jul 19, 2024
c80ebc4
fix: add classroom error handling and modal conditions
sabrinanel3 Jul 19, 2024
7a9b77f
fix (WIP): filtering active rooms by classroomId, chat monitoring in …
kellytea Jul 19, 2024
4a588bf
feat: (WIP) completed games route & services
sabrinanel3 Jul 23, 2024
1cbc309
fix: implement fetching active games
kellytea Jul 23, 2024
72f2569
fix: refactor dashboard, fix lobby and completed games routes
sabrinanel3 Jul 27, 2024
f7f8647
fix: refactor dashboard, clean up educator routes + services
kellytea Jul 30, 2024
b855778
fix: add logging for startGames and remove games tab on dashboard
sabrinanel3 Jul 31, 2024
a670fb6
fix: refactoring dashboard by tabs + UI fixes
kellytea Aug 7, 2024
6c58db5
fix: fetching selectedClassroom data
kellytea Aug 16, 2024
a0e694a
fix: cleanup request.ts, fix query params, fix server lint complaints
sabrinanel3 Aug 16, 2024
e4cad0e
fix (WIP): request & service promises
kellytea Aug 20, 2024
4691bbc
fix: student/teacher roles and cleanup
sgfost Aug 21, 2024
6905888
test: force delete classroom
sgfost Aug 21, 2024
2519f58
fix: set client accepted game invitation to avoid delay
sgfost Sep 3, 2024
a346315
feat(WIP): include round introduction in game round snapshot
sgfost Sep 3, 2024
41b040a
feat: add educator privacy page
sabrinanel3 Sep 6, 2024
ff5812b
feat (WIP): refactor reports tab, add post-game stats
kellytea Sep 20, 2024
a35dba8
feat: set up basic educator mode deployment
alee Oct 16, 2024
f7cf6aa
Merge branch 'educator-version' of https://github.com/sabrinanel3/por…
sabrinanel3 Oct 22, 2024
9048d1a
feat: add Educator tab to Admin page for teacher management
saachibm Oct 3, 2024
8b305ef
fix (WIP): fix completed games route and use data in reports
sabrinanel3 Nov 2, 2024
48dac26
fix: weird spacing for nav components + rerport UI tweaks
kellytea Nov 5, 2024
13d9960
fix: privacy page showing up in new round summary
kellytea Nov 18, 2024
36bc3a3
feat: refactored edu mode log-in & added user-friendly info
kellytea Dec 14, 2024
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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ release-version: .env

docker-compose.yml: base.yml $(DEPLOY_ENVIRONMENT).yml config.mk $(DB_DATA_PATH) $(DATA_DUMP_PATH) $(LOG_DATA_PATH) $(DYNAMIC_SETTINGS_PATH) secrets $(PGPASS_PATH) release-version
case "$(DEPLOY_ENVIRONMENT)" in \
dev|staging|prod) docker compose -f base.yml -f "$(DEPLOY_ENVIRONMENT).yml" config > docker-compose.yml;; \
*) echo "invalid environment. must be either dev, staging or prod" 1>&2; exit 1;; \
dev|staging|prod|learn) docker compose -f base.yml -f "$(DEPLOY_ENVIRONMENT).yml" config > docker-compose.yml;; \
*) echo "invalid environment. must be either dev, staging, prod, or learn" 1>&2; exit 1;; \
esac

.PHONY: build
Expand Down
27 changes: 27 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"bootstrap": "^4.5.3",
"bootstrap-vue": "^2.21.2",
"calendar-link": "^2.0.8",
"chart.js": "^4.4.4",
"colyseus.js": "^0.14.12",
"howler": "^2.2.3",
"jquery": "^3.5.1",
Expand All @@ -32,6 +33,7 @@
"popper.js": "^1.16.0",
"vue": "2.7",
"vue-carousel-3d": "^1.0.1",
"vue-chartjs": "^5.3.1",
"vue-class-component": "^7.2.6",
"vue-gtag": "^1.16.1",
"vue-meta": "^2.4.0",
Expand Down
12 changes: 11 additions & 1 deletion client/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<template>
<b-container class="h-100 p-0 m-0 bg" fluid>
<b-row no-gutters class="h-100 w-100">
<Navbar v-if="!isGamePage"></Navbar>
<span v-if="!isGamePage">
<EducatorNavbar v-if="isEducatorMode"></EducatorNavbar>
<Navbar v-else></Navbar>
</span>
<router-view :class="bodyClass" :key="topLevelPath"></router-view>
</b-row>
</b-container>
Expand All @@ -11,6 +14,7 @@
import { Component, Vue } from "vue-property-decorator";
import BootstrapVue from "bootstrap-vue";
import Navbar from "@port-of-mars/client/components/global/Navbar.vue";
import EducatorNavbar from "@port-of-mars/client/components/global/EducatorNavbar.vue";
import Footer from "@port-of-mars/client/components/global/Footer.vue";
import {
GAME_PAGE,
Expand All @@ -20,12 +24,14 @@ import {
ABOUT_PAGE,
PRIVACY_PAGE,
} from "@port-of-mars/shared/routes";
import { isEducatorMode } from "@port-of-mars/client/util";
import _ from "lodash";
Vue.use(BootstrapVue);

@Component({
components: {
Navbar,
EducatorNavbar,
Footer,
},
})
Expand All @@ -41,6 +47,10 @@ export default class App extends Vue {
return this.$route.path.split("/")[1];
}

get isEducatorMode() {
return isEducatorMode();
}

get isGamePage() {
if (_.isNil(this.$route.name)) {
return false;
Expand Down
110 changes: 110 additions & 0 deletions client/src/api/auth/request.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import { url } from "@port-of-mars/client/util";
import { TStore } from "@port-of-mars/client/plugins/tstore";
import { AjaxRequest } from "@port-of-mars/client/plugins/ajax";
import {
CLASSROOM_LOBBY_PAGE,
CONSENT_PAGE,
FREE_PLAY_LOBBY_PAGE,
STUDENT_CONFIRM_PAGE,
TEACHER_DASHBOARD_PAGE,
} from "@port-of-mars/shared/routes";
import VueRouter from "vue-router";

export class AuthAPI {
constructor(public store: TStore, public ajax: AjaxRequest, public router: VueRouter) {}

async devLogin(formData: { username: string; password: string }, shouldSkipVerification = true) {
try {
const devLoginUrl = url(`/auth/dev-login?shouldSkipVerification=${shouldSkipVerification}`);
await this.ajax.post(
devLoginUrl,
({ data, status }) => {
if (status === 200) {
this.store.commit("SET_USER", data.user);
// FIXME: not terribly important but we might want to move to the tournament dashboard if isTournamentEnabled
if (data.user.isVerified) this.router.push({ name: FREE_PLAY_LOBBY_PAGE });
else this.router.push({ name: CONSENT_PAGE });
} else {
return data;
}
},
formData
);
} catch (e) {
console.log("Unable to login");
console.log(e);
throw e;
}
}

async studentLogin(classroomAuthToken: string) {
try {
const loginUrl = url("/auth/student-login");
await this.ajax.post(
loginUrl,
({ data, status }) => {
if (status === 200) {
this.store.commit("SET_USER", data.user);
this.router.push({ name: STUDENT_CONFIRM_PAGE });
} else {
throw new Error(data.message || "Login failed");
}
},
{ classroomAuthToken, password: "unused" }
);
} catch (e) {
console.log("Unable to login");
console.log(e);
throw e;
}
}

async studentRejoin(rejoinCode: string) {
try {
const rejoinUrl = url("/auth/student-rejoin");
await this.ajax.post(
rejoinUrl,
({ data, status }) => {
if (status === 200) {
console.log(data);
this.store.commit("SET_USER", data.user);
if (data.user.isVerified) {
console.log("Student verified");
this.router.push({ name: CLASSROOM_LOBBY_PAGE });
} else {
console.log("Student not verified");
this.router.push({ name: STUDENT_CONFIRM_PAGE });
}
} else {
throw new Error(data.message || "Rejoin failed");
}
},
{ rejoinCode, password: "unused" }
);
} catch (e) {
console.log("Unable to rejoin", e);
throw new Error("Invalid rejoin code");
}
}

async teacherLogin(formData: { username: string; password: string }) {
try {
const loginUrl = url("/auth/teacher-login");
await this.ajax.post(
loginUrl,
({ data, status }) => {
if (status === 200) {
this.store.commit("SET_USER", data.user);
this.router.push({ name: TEACHER_DASHBOARD_PAGE });
} else {
throw new Error(data.message || "Login failed");
}
},
formData
);
} catch (e) {
console.log("Unable to login", e);
throw new Error("Invalid username or password");
}
}
}
Loading