Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Feature/mvp #26

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
env.php
scratch.*
scratch/
vendor/
# Logs
logs
*.log
Expand Down
Binary file removed client/CapstonePalette.PNG
Binary file not shown.
21 changes: 7 additions & 14 deletions client/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ const routes: Routes = [
path: 'strategies',
loadChildren: () => import('./strategies/strategies.module').then(m => m.StrategiesPageModule)
},
{
path: 'test',
loadChildren: () => import('./test/test.module').then(m => m.TestPageModule)
},
{
path: 'navigation',
loadChildren: () => import('./navigation/navigation.module').then(m => m.NavigationPageModule)
},
{
path: 'login',
loadChildren: () => import('./login/login.module').then(m => m.LoginPageModule)
Expand All @@ -57,12 +49,13 @@ const routes: Routes = [
},
{
path: 'policy',
loadChildren: () => import('./policy/policy.module').then( m => m.PolicyPageModule)
}, {
path: 'footer',
loadChildren: () => import('./footer/footer.module').then( m => m.FooterPageModule)
},

loadChildren: () => import('./policy/policy.module').then(m => m.PolicyPageModule)
},
{
path: 'footer',
loadChildren: () => import('./footer/footer.module').then(m => m.FooterPageModule)
},




Expand Down
23 changes: 10 additions & 13 deletions client/src/app/education/education.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
</ion-header>
<ion-content [fullscreen]="true">
<app-nav></app-nav>
<ion-title>
<h1>Cognitive Load</h1>
</ion-title>

<ion-grid>
<ion-row>
<ion-col size-sm="12" size-md="6">
Expand All @@ -21,11 +17,12 @@ <h1>Cognitive Load</h1>
</ion-card-header>
<ion-card-content>
<ion-card-subtitle class="ion-padding">
<span style="font-style: italic">
Cognitive Load is the <span style="font-weight: bolder;">mental effort</span> required to
complete a
task.
</span>
<span style="font-style: italic">
Cognitive Load is the <span style="font-weight: bolder;">mental effort</span>
required to
complete a
task.
</span>
</ion-card-subtitle>
<ion-card-subtitle class="ion-padding">
There are three types of Cognitive Load:
Expand All @@ -46,7 +43,7 @@ <h1>Cognitive Load</h1>
</li>
</ol>
</ion-content>

</ng-template>
</ion-popover>

Expand Down Expand Up @@ -104,19 +101,19 @@ <h1>Cognitive Load</h1>
<ion-row>
<ion-col>
<ion-button id="" [disabled]="currentLoad === 'intrinsic'" (click)="cogLoad('i')"
class="hover-trigger">Intrinsic
class="hover-trigger">Intrinsic
</ion-button>
<!--These 3 now have borders that light up when you hover-->
</ion-col>
<ion-col>
<ion-button id="" [disabled]="currentLoad === 'extraneous'" (click)="cogLoad('e')"
class="hover-trigger">Extraneous
class="hover-trigger">Extraneous
</ion-button>
<!--These 3 now have borders that light up when you hover-->
</ion-col>
<ion-col>
<ion-button id="" [disabled]="currentLoad === 'germane'" (click)="cogLoad('g')"
class="hover-trigger">Germane
class="hover-trigger">Germane
</ion-button>
<!--These 3 now have borders that light up when you hover-->
</ion-col>
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/login/login.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ion-content [fullscreen]="true">
<app-nav></app-nav>
<div style="display: flex; justify-content: center; align-items: center;">
<div class="form-container" style="width: 60vw;">
<div class="form-container" style="width: 80vw;">
<form #f="ngForm" (ngSubmit)="login(f.value.email, f.value.password)">
<ion-card>
<ion-card-header>
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/nav/nav.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
<div class="ion-padding hover" slot="content" (click)="goQuiz()">Quiz - NASA TLX</div>
<div class="ion-padding hover" slot="content" (click)="goTask()">New Task</div>
<div class="ion-padding hover" slot="content" (click)="goResults()">Results</div>
<div class="ion-padding hover" slot="content" (click)="goTest()">Test</div>
<!-- <div class="ion-padding hover" slot="content" (click)="goTest()">Test</div> -->
</ion-accordion>
</ion-accordion-group>
44 changes: 38 additions & 6 deletions client/src/app/nav/nav.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {Component, OnInit} from '@angular/core';
import {IonicModule} from '@ionic/angular';
import {Router} from '@angular/router';


import { Component, OnInit } from '@angular/core';
import { IonicModule } from '@ionic/angular';
import { Router } from '@angular/router';
import { UserDataService } from '../services/user-data.service';
import { ToastController } from '@ionic/angular';
@Component({
selector: 'app-nav',
templateUrl: './nav.component.html',
Expand All @@ -13,7 +13,7 @@ import {Router} from '@angular/router';
})
export class NavComponent implements OnInit {

constructor(private router: Router) {
constructor(private router: Router, private userDataService: UserDataService, private toastController: ToastController) {
}

goHome() {
Expand Down Expand Up @@ -69,12 +69,44 @@ export class NavComponent implements OnInit {
}

logout() {
this.userDataService.logout().subscribe({
next: async (response: any) => {
const alert = await this.toastController.create({
message: 'Successfully logged out of your account!',
duration: 2000,
position: 'bottom',
color: 'success'
});
await alert.present();

sessionStorage.removeItem("sessionID")
sessionStorage.removeItem("access")
sessionStorage.removeItem("userID")

sessionStorage.clear();
this.router.navigateByUrl('/login');
},
error: async (error) => {
const alert = await this.toastController.create({
message: 'Error Logging Out. Please try again. If this error persists, please email support at kartikinpublic@gmail.com',
duration: 2000,
position: 'bottom',
color: 'danger'
});
await alert.present();

}

})

sessionStorage.removeItem("sessionID")
sessionStorage.removeItem("access")
sessionStorage.removeItem("userID")

sessionStorage.clear();



this.navigateTo('/login')
}
}
17 changes: 0 additions & 17 deletions client/src/app/navigation/navigation-routing.module.ts

This file was deleted.

20 changes: 0 additions & 20 deletions client/src/app/navigation/navigation.module.ts

This file was deleted.

25 changes: 0 additions & 25 deletions client/src/app/navigation/navigation.page.html

This file was deleted.

6 changes: 0 additions & 6 deletions client/src/app/navigation/navigation.page.scss

This file was deleted.

17 changes: 0 additions & 17 deletions client/src/app/navigation/navigation.page.spec.ts

This file was deleted.

15 changes: 0 additions & 15 deletions client/src/app/navigation/navigation.page.ts

This file was deleted.

27 changes: 20 additions & 7 deletions client/src/app/quiz/quiz.page.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {Component, OnInit} from '@angular/core';
import {AnswerDataService} from '../services/answer-data.service';
import {TaskDataService} from '../services/task-data.service';
import {ToastController} from '@ionic/angular';
import {Router} from '@angular/router';
import { Component, OnInit } from '@angular/core';
import { AnswerDataService } from '../services/answer-data.service';
import { TaskDataService } from '../services/task-data.service';
import { ToastController } from '@ionic/angular';
import { Router } from '@angular/router';

@Component({
selector: 'app-quiz',
Expand Down Expand Up @@ -122,8 +122,21 @@ export class QuizPage implements OnInit {
ngOnInit() {
}

ionViewDidEnter() {
this.getTasks()
async ionViewDidEnter() {
if (sessionStorage.getItem('sessionID') && sessionStorage.getItem('access') === 'true' && sessionStorage.getItem('userID')) {
this.getTasks()
} else {
const alert = this.toastController.create({
message: 'Not Logged In - Unable to take a quiz.',
duration: 2000,
position: 'bottom',
color: 'danger'
});
await (await alert).present();

await this.router.navigateByUrl('/login')

}
}

}
16 changes: 8 additions & 8 deletions client/src/app/results/results.page.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {Component, OnInit} from '@angular/core';
import {Router} from '@angular/router';
import {TaskDataService} from '../services/task-data.service';
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { TaskDataService } from '../services/task-data.service';

TaskDataService
import {AnswerDataService} from '../services/answer-data.service';
import {ToastController} from '@ionic/angular';
import { AnswerDataService } from '../services/answer-data.service';
import { ToastController } from '@ionic/angular';

@Component({
selector: 'app-results',
Expand Down Expand Up @@ -138,7 +138,7 @@ export class ResultsPage implements OnInit {
taskData.totalScore += taskScore;
}
} else {
taskScoresMap.set(taskID, {count: 1, totalScore: taskScore});
taskScoresMap.set(taskID, { count: 1, totalScore: taskScore });
}
}

Expand Down Expand Up @@ -185,13 +185,13 @@ export class ResultsPage implements OnInit {
}

async ionViewDidEnter() {
if (sessionStorage.getItem('sessionID')) {
if (sessionStorage.getItem('sessionID') && sessionStorage.getItem('access') === 'true' && sessionStorage.getItem('userID')) {
this.getTaskData();
this.getAnswerData();

} else {
const alert = this.toastController.create({
message: 'Not Logged In - Unable to view tasks.',
message: 'Not Logged In - Unable to view results.',
duration: 2000,
position: 'bottom',
color: 'danger'
Expand Down
Loading