From 98b370ca33c1a6914ec09ccbfecd12739f61a0b4 Mon Sep 17 00:00:00 2001 From: nitrotap <9121718+nitrotap@users.noreply.github.com> Date: Sun, 4 Jun 2023 22:47:14 -0600 Subject: [PATCH 1/3] connecting task page to backend --- client/src/app/quiz/quiz.page.html | 92 ++++++++++++++++-------------- client/src/app/quiz/quiz.page.scss | 90 ++++++++++++----------------- client/src/app/quiz/quiz.page.ts | 67 +++++++++++++++++++++- 3 files changed, 153 insertions(+), 96 deletions(-) diff --git a/client/src/app/quiz/quiz.page.html b/client/src/app/quiz/quiz.page.html index 7e21293..b19a4e1 100644 --- a/client/src/app/quiz/quiz.page.html +++ b/client/src/app/quiz/quiz.page.html @@ -1,27 +1,27 @@ - - - Home - -
Home
-
- - - Education - -
Cog Load Page
-
Strategies
-
Measure
-
- - - Quiz - -
Quiz - Builder
-
New Task
-
Quiz - Task Load
-
Quiz - Results
-
+ + + Home + +
Home
+
+ + + Education + +
Cog Load Page
+
Strategies
+
Measure
+
+ + + Quiz + +
Quiz - Builder
+
New Task
+
Quiz - Task Load
+
Quiz - Results
+
@@ -31,30 +31,36 @@ - - - - *QUESTION TYPE / QUESTION TIME* - - - - *GENERATED QUESTION TYPE* - - - + + + Quiz Page + + + - aria-label="Custom range" - [min]="0" - [max]="10" - [value]="5" - [pin]="true" - [ticks]="true" - [snaps]="true" + + + + {{taskName}} + -> + +
+

{{question.text}}

+ + 1 + 10 + +
+
+ SAVE + +
- + \ No newline at end of file diff --git a/client/src/app/quiz/quiz.page.scss b/client/src/app/quiz/quiz.page.scss index bd42840..707081a 100644 --- a/client/src/app/quiz/quiz.page.scss +++ b/client/src/app/quiz/quiz.page.scss @@ -1,55 +1,41 @@ -/* Navigation Styles */ +ion-range::part(tick) { + background: #a2d2ff; +} + +ion-range::part(tick-active) { + background: #bde0fe; +} + +ion-range::part(pin) { + display: inline-flex; + align-items: center; + justify-content: center; + + background: #fff; + color: #000000; + + border-radius: 50%; + transform: scale(1.01); + + top: -20px; + + min-width: 28px; + height: 28px; + transition: transform 120ms ease, background 120ms ease; +} + +ion-range::part(pin)::before { + content: none; +} + +ion-range::part(knob) { + background: #fff; +} -ion-accordion { - font-family: Arial, sans-serif; - font: 16px bold; - color: #f4f4f4; - +ion-range::part(bar) { + background: #a2d2ff; } -ion-range { - // Styles for the range component here - - ion-range::part(tick) { - background: #a2d2ff; - - } - - ion-range::part(tick-active) { - background: #bde0fe; - } - - ion-range::part(pin) { - display: inline-flex; - align-items: center; - justify-content: center; - - background: #ffafcc; - color: #fff; - - border-radius: 50%; - transform: scale(1.01); - - top: -20px; - - min-width: 28px; - height: 28px; - transition: transform 120ms ease, background 120ms ease; - } - - ion-range::part(pin)::before { - content: none; - } - - ion-range::part(knob) { - background: #ffc8dd; - } - - ion-range::part(bar) { - background: #a2d2ff; - } - - ion-range::part(bar-active) { - background: #bde0fe; - } - } \ No newline at end of file +ion-range::part(bar-active) { + background: #bde0fe; +} \ No newline at end of file diff --git a/client/src/app/quiz/quiz.page.ts b/client/src/app/quiz/quiz.page.ts index e9ef63d..1014ac1 100644 --- a/client/src/app/quiz/quiz.page.ts +++ b/client/src/app/quiz/quiz.page.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { AnswerDataService } from '../services/answer-data.service'; @Component({ selector: 'app-quiz', @@ -6,8 +7,72 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./quiz.page.scss'], }) export class QuizPage implements OnInit { + userID: string = '1'; + taskID: string = '1'; + + formData: any = {}; + + getFormData() { + const currentDate = new Date(); + const year = currentDate.getFullYear(); + const month = String(currentDate.getMonth() + 1).padStart(2, '0'); + const day = String(currentDate.getDate()).padStart(2, '0'); + const hours = String(currentDate.getHours()).padStart(2, '0'); + const minutes = String(currentDate.getMinutes()).padStart(2, '0'); + const seconds = String(currentDate.getSeconds()).padStart(2, '0'); + + this.formData = { + taskAnswer_1: this.questions[0].answer, + taskAnswer_2: this.questions[1].answer, + taskAnswer_3: this.questions[2].answer, + taskAnswer_4: this.questions[3].answer, + taskAnswer_5: this.questions[4].answer, + taskAnswer_6: this.questions[5].answer, + taskScoreTotal: this.questions.reduce((total, question) => total + question.answer, 0), + dateTaken: `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`, + userID: this.userID, + taskID: this.taskID, + }; + + console.log(this.formData) + + this.answerDataService.postData(this.formData).subscribe({ + next: response => console.log('Response from server:', response), + error: error => console.error('Error:', error) + }); + } + + constructor(private answerDataService: AnswerDataService) { } + + taskName: string = 'Task Name'; + + questions: any[] = [ + { + text: 'Mental Demand - How much mental and perceptual activity was required? Was the task easy or demanding, simple or complex?', + answer: 1 + }, + { + text: 'Physical Demand - How much physical activity was required? Was the task easy or demanding, slack or strenuous?', + answer: 1 + }, + { + text: 'Temporal Demand - How much time pressure did you feel due to the pace at which the tasks or task elements occurred? Was the pace slow or rapid?', + answer: 1 + }, + { + text: 'Own Performance - How successful were you in performing the task? How satisfied were you with your performance?', + answer: 1 + }, + { + text: 'Effort - How hard did you have to work (mentally and physically) to accomplish your level of performance?', + answer: 1 + }, + { + text: 'Frustration Level - How irritated, stressed, and annoyed versus content, relaxed, and complacent did you feel during the task?', + answer: 1 + }, + ]; - constructor() { } ngOnInit() { } From 53d1a3b5dc118139fc557537254ccf530d69ad0d Mon Sep 17 00:00:00 2001 From: nitrotap <9121718+nitrotap@users.noreply.github.com> Date: Mon, 5 Jun 2023 12:19:32 -0600 Subject: [PATCH 2/3] adding styles and content for about, edu, home, nav, signup, and login --- client/src/app/about/about.module.ts | 7 +- client/src/app/about/about.page.html | 62 +- client/src/app/app-routing.module.ts | 4 + client/src/app/education/education.module.ts | 6 +- client/src/app/education/education.page.html | 535 +++++++++++++++--- client/src/app/education/education.page.scss | 17 +- client/src/app/education/education.page.ts | 12 +- client/src/app/home/home.module.ts | 7 +- client/src/app/home/home.page.html | 144 +++-- client/src/app/home/home.page.scss | 94 ++- client/src/app/landingpage/landing.page.html | 18 - client/src/app/landingpage/landing.page.scss | 28 - client/src/app/landingpage/landing.page.ts | 12 - client/src/app/login/login.module.ts | 8 +- client/src/app/login/login.page.html | 30 +- client/src/app/measure/measure.module.ts | 7 +- client/src/app/measure/measure.page.html | 44 +- client/src/app/nav/nav.component.html | 29 + client/src/app/nav/nav.component.scss | 6 + client/src/app/nav/nav.component.spec.ts | 24 + client/src/app/nav/nav.component.ts | 70 +++ client/src/app/quiz/quiz.module.ts | 7 +- client/src/app/quiz/quiz.page.html | 30 +- .../src/app/results/results-routing.module.ts | 17 + client/src/app/results/results.module.ts | 22 + client/src/app/results/results.page.html | 15 + client/src/app/results/results.page.scss | 0 client/src/app/results/results.page.spec.ts | 17 + client/src/app/results/results.page.ts | 15 + client/src/app/services/user-data.service.ts | 9 +- client/src/app/signup/signup.module.ts | 8 +- client/src/app/signup/signup.page.html | 28 +- .../src/app/strategies/strategies.module.ts | 8 +- .../src/app/strategies/strategies.page.html | 66 +-- client/src/app/task/task.module.ts | 7 +- client/src/app/task/task.page.html | 40 +- client/src/app/task/task.page.ts | 43 +- client/src/app/test/test.module.ts | 3 + client/src/app/test/test.page.html | 27 +- 39 files changed, 1084 insertions(+), 442 deletions(-) delete mode 100644 client/src/app/landingpage/landing.page.html delete mode 100644 client/src/app/landingpage/landing.page.scss delete mode 100644 client/src/app/landingpage/landing.page.ts create mode 100644 client/src/app/nav/nav.component.html create mode 100644 client/src/app/nav/nav.component.scss create mode 100644 client/src/app/nav/nav.component.spec.ts create mode 100644 client/src/app/nav/nav.component.ts create mode 100644 client/src/app/results/results-routing.module.ts create mode 100644 client/src/app/results/results.module.ts create mode 100644 client/src/app/results/results.page.html create mode 100644 client/src/app/results/results.page.scss create mode 100644 client/src/app/results/results.page.spec.ts create mode 100644 client/src/app/results/results.page.ts diff --git a/client/src/app/about/about.module.ts b/client/src/app/about/about.module.ts index c6fb034..ea066db 100644 --- a/client/src/app/about/about.module.ts +++ b/client/src/app/about/about.module.ts @@ -8,13 +8,16 @@ import { AboutPageRoutingModule } from './about-routing.module'; import { AboutPage } from './about.page'; +import { NavComponent } from '../nav/nav.component'; + @NgModule({ imports: [ CommonModule, FormsModule, IonicModule, - AboutPageRoutingModule + AboutPageRoutingModule, + NavComponent ], declarations: [AboutPage] }) -export class AboutPageModule {} +export class AboutPageModule { } diff --git a/client/src/app/about/about.page.html b/client/src/app/about/about.page.html index 8bb3e9b..3d3a92a 100644 --- a/client/src/app/about/about.page.html +++ b/client/src/app/about/about.page.html @@ -1,31 +1,41 @@ - + - - About Us - + About Us - - - - - {{ member.name }} Avatar - - -

{{ member.name }}

-

Email: {{ member.email }}

-

GitHub: - {{ member.github }} -

-

LinkedIn: - {{ member.linkedin }} -

-

Personal Website: - {{ member.website }} -

-

{{ member.bio }}

-
-
-
+ + + + + + + Project Contributors + + + + + + + + + {{ member.name }} Avatar + + +

{{ member.name }}

+

Email: {{ member.email }}

+

GitHub: + {{ member.github }} +

+

LinkedIn: + {{ member.linkedin }} +

+

Personal Website: + {{ member.website }} +

+

{{ member.bio }}

+
+
+
+
\ No newline at end of file diff --git a/client/src/app/app-routing.module.ts b/client/src/app/app-routing.module.ts index 7e0a708..9e50e3f 100644 --- a/client/src/app/app-routing.module.ts +++ b/client/src/app/app-routing.module.ts @@ -51,6 +51,10 @@ const routes: Routes = [ path: 'task', loadChildren: () => import('./task/task.module').then(m => m.TaskPageModule) }, + { + path: 'results', + loadChildren: () => import('./results/results.module').then( m => m.ResultsPageModule) + }, diff --git a/client/src/app/education/education.module.ts b/client/src/app/education/education.module.ts index bd2b94e..2f95561 100644 --- a/client/src/app/education/education.module.ts +++ b/client/src/app/education/education.module.ts @@ -8,12 +8,16 @@ import { EducationPageRoutingModule } from './education-routing.module'; import { EducationPage } from './education.page'; +import { NavComponent } from '../nav/nav.component'; + + @NgModule({ imports: [ CommonModule, FormsModule, IonicModule, - EducationPageRoutingModule + EducationPageRoutingModule, + NavComponent ], declarations: [EducationPage] }) diff --git a/client/src/app/education/education.page.html b/client/src/app/education/education.page.html index 1ac025c..8dc3297 100644 --- a/client/src/app/education/education.page.html +++ b/client/src/app/education/education.page.html @@ -1,91 +1,446 @@ - - - - Home - -
Home
-
- - - Education - -
Cog Load Page
-
Strategies
-
Measure
-
- - - Quiz - -
Quiz - Builder
-
New Task
-
Quiz - Task Load
-
Quiz - Results
-
-
- - - - Education - Cog Load Page - The mental work to complete a task - - - - Brain Lift helps users understand how their cognitive load affects their learning and performance. - Use the NASA Task Load Index to measure and track your cognitive load for different tasks. - - - - - - - Intrinsic - (examples) - - - - - - - - - - Extraneous - (examples) - - - - - - - - - - Germane - (examples) - - - - - - - - - - Measure with TLX - (examples) - - - - - - - -

Content

-
- - - -

© 2023 Cognitive Load App. All rights reserved.

+ + + Cognitive Load -
\ No newline at end of file +
+ + + + Learn about Cognitive Load + + + + + + + What is Cognitive Load? + + + + Definition + + + Cognitive Load is the mental effort required to complete a task. + + + + + + + What is Brain Lift? + + Measure and track the mental effort to complete your tasks + + + + + Brain Lift helps users understand how their cognitive load affects their learning and performance. + Use the NASA Task Load Index to measure and track your cognitive load for different tasks. + + + + + + + + + Three Types of Cognitive Load + + + + + + Intrinsic + + + + + Extraneous + + + Germane + + + + + + + + + + + + + + Left facing head with gears + + + + Intrinsic Cognitive Load + + + + + + + + + Intrinsic Cognitive Load + Definition + + +
  • + The inherent complexity of a given task +
  • +
  • + Remains fairly constant +
  • +
    + +
    +
    + + + + Intrinsic Load Examples + Inherent Complexity + + +
  • + Weightlifting – lifting a weight +
  • +
  • + Washing Dishes – picking up plates and glassware, not breaking anything +
  • +
  • + Driving – focusing on traffic, arriving safely, not getting distracted or lost +
  • +
  • + PC RAM – RAM required to do a task (Chrome needs 1GB RAM) +
  • +
    +
    +
    +
    +
    + + + + + + + + + Extraneous Cognitive Load + Definition + + +
  • + Mental effort to process things that interfere with your ability to complete the task that are irrelevant + to the task +
  • +
  • + Irrelevant to task at hand +
  • +
    + +
    + + + + Extraneous Load + + + Three categories + + + +
      +
    1. + Mental Loads (mental illness symptoms, medications, symptoms of disability) +
    2. +
    3. + Physical Loads – being sick, hungry, thirsty, in pain, medications +
    4. +
    5. + Environmental Loads – Raining or snowing, too hot or cold, loud noises + +
    6. +
    +
    + +
    +
    + + + + + Extraneous Load + Mental Load Examples + + + + Illness Symptoms + +
  • Mood (feeling very sad or very happy) +
  • +
  • + Mood changes (rollercoaster days) + +
  • +
  • + Visual hallucinations - shimmering, past memory overlay, difficulty seeing properly, not seeing things + that + are there + +
  • +
  • Auditory hallucinations - voices, indistinct or command +
  • +
  • Intrusive thoughts - can't focus on conversations, song playing only in your head but too loud to hear + anything else +
  • +
  • Forgetfulness - issues with short term processing (having repeated conversations, forgetting important + tasks) - may be a symptom +
  • +
  • Medications
  • +
  • Brain fog, difficulty with speech, forgetting to take them +
  • + +
    +
    +
    + + + + Left facing head with gears + + + + Extraneous Cognitive Load + + + + Learn about strategies to deal with extraneous load + + +
    +
    + + + + + + + + Extraneous Cognitive Load + Physical Load Examples + + +
  • Being sick (runny nose, headache, coughing) +
  • +
  • Cravings for substances - cigs, weed, alcohol, other drugs +
  • +
  • Hungry/thirsty +
  • +
  • Extreme fatigue +
  • +
  • Pain +
  • +
  • + Double vision - making it hard to see +
  • +
  • + Medications (excessive sweating, akathisia) +
  • +
    + +
    +
    + + + + + Extraneous Load + Environmental Load Examples + + + + Illness Symptoms + + +
  • Raining or snowing + +
  • +
  • + Loud external noises (like a dog barking loudly or child screaming) +
  • +
  • + Temperature discomfort (feeling like it's too cold or hot) +
  • +
    +
    +
    + + + + + Extraneous Load + + + + + + Mental illness or other disabilities can interfere with the ability to complete tasks. Thus, the illness + or disability adds to an individual’s Extraneous load, and increases the overall mental effort required to + complete a task. + + + +
    +
    + + + + + + + + + Silhouette of head with keyhole + + + + Germane Cognitive Load + + + + + + + + + Germane Cognitive Load + Definition + + +
  • Mental effort related to helping yourself complete tasks +
  • +
  • Mental effort required to understand and retain information +
  • + + +
    + +
    +
    + + + + + Germane Load + How can we optimize our germane load to complement our extraneous loads? + + + + +
  • Weight-lifting and Exercise - keep it simple +
  • +
  • + Doing dishes – use other senses to determine clean +
  • +
  • + Driving – take a quiz or something to measure daily ability +
  • +
  • + PC RAM -write efficient code to use less RAM +
  • +
    +
    +
    +
    +
    + + + + + + + + + Silhouette of head with circuitry + + + + NASA Task Load Index + + + + + + + + NASA Task Load Index + Measure your cognitive load + + + + What is the Task Load Index? + + The NASA Task Load Index (NASA-TLX) was created in 1980 by a team of researchers led by Sandra G. Hart at + the NASA Ames Research Center. The rating scale was designed to assess the perceived workload and mental + demands of a task. + + + Start measuring your cognitive load + + + + + + NASA Task Load Index + The NASA TLX has six questions. + + + +
      + +
    1. + How much mental and perceptual activity was required? Was the task easy or demanding, simple or complex? +
    2. +
    3. + How much physical activity was required? Was the task easy or demanding, slack or strenuous? +
    4. +
    5. + How much time pressure did you feel due to the pace at which the tasks or task elements occurred? Was + the + pace slow or rapid? +
    6. +
    7. + How successful were you in performing the task? How satisfied were you with your performance? +
    8. +
    9. + How hard did you have to work (mentally and physically) to accomplish your level of performance? +
    10. +
    11. + How irritated, stressed, and annoyed versus content, relaxed, and complacent did you feel during the + task? +
    12. +
    + + +
    +
    +
    +
    +
    + + + +

    © 2023 Cognitive Load App. All rights reserved.

    +
    +
    +
    \ No newline at end of file diff --git a/client/src/app/education/education.page.scss b/client/src/app/education/education.page.scss index 21f3bc3..84cc15e 100644 --- a/client/src/app/education/education.page.scss +++ b/client/src/app/education/education.page.scss @@ -9,10 +9,21 @@ ion-accordion { /* Card Styles */ -ion-card { +ion-card, ion-title, ion-card-subtitle { --ion-item-border-color: #025E73; --ion-item-background: #80A7BF; --ion-text-color: #012E40; + overflow: visible; + color: black; + text-align: center; +} + +li { + text-align: left; +} + +ion-img { + width: 30%; } ion-button { @@ -21,10 +32,6 @@ ion-button { --ion-text-color: #012E40; } -ion-card { - width: auto; - height: fit-content; -} ion-img::part(image) { width: 50%; /* or whatever value */ diff --git a/client/src/app/education/education.page.ts b/client/src/app/education/education.page.ts index a7ae7e5..7add74e 100644 --- a/client/src/app/education/education.page.ts +++ b/client/src/app/education/education.page.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; - +import { Router } from '@angular/router'; @Component({ selector: 'app-education', templateUrl: './education.page.html', @@ -7,7 +7,15 @@ import { Component, OnInit } from '@angular/core'; }) export class EducationPage implements OnInit { - constructor() { } + constructor(private router: Router) { } + + goToStrategies() { + this.router.navigateByUrl('/strategies') + } + + goToMeasure() { + this.router.navigateByUrl('/measure') + } ngOnInit() { } diff --git a/client/src/app/home/home.module.ts b/client/src/app/home/home.module.ts index a554f01..4aa14c1 100644 --- a/client/src/app/home/home.module.ts +++ b/client/src/app/home/home.module.ts @@ -6,14 +6,17 @@ import { HomePage } from './home.page'; import { HomePageRoutingModule } from './home-routing.module'; +import { NavComponent } from '../nav/nav.component'; + @NgModule({ imports: [ CommonModule, FormsModule, IonicModule, - HomePageRoutingModule + HomePageRoutingModule, + NavComponent ], declarations: [HomePage] }) -export class HomePageModule {} +export class HomePageModule { } diff --git a/client/src/app/home/home.page.html b/client/src/app/home/home.page.html index 85515f6..a75cf3e 100644 --- a/client/src/app/home/home.page.html +++ b/client/src/app/home/home.page.html @@ -1,59 +1,99 @@ + Cognitive Load App + - - - - Welcome to the Cognitive Load App - Manage Your Mental Health - - -

    Reduce cognitive load and improve your mental health with our powerful app. Get personalized exercises and - techniques to help you optimize your cognitive performance and reduce stress.

    -

    Track your progress, set reminders, and receive helpful insights along the way. Start your journey to a - healthier mind today!

    -
    -
    - - Get Started - - - - - -

    Personalized Insights

    -

    Get personalized insights to understand your cognitive load and make informed decisions for better mental - health.

    -
    - - -

    Time Management

    -

    Learn effective time management techniques to optimize your cognitive performance and reduce overwhelm. -

    -
    -
    - - - -

    Mindfulness Exercises

    -

    Practice mindfulness exercises to enhance your focus, reduce stress, and improve your overall well-being. -

    -
    - - -

    Task Prioritization

    -

    Learn effective strategies to prioritize tasks and manage your cognitive load more efficiently.

    -
    -
    -
    - - - -

    © 2023 Cognitive Load App. All rights reserved.

    -
    -
    -
    \ No newline at end of file + +
    + Hero Image +
    +
    + + Welcome to Brain Lift + Manage Your Mental Health + +
    + +
    + + +

    Reduce cognitive load and improve your mental health with our powerful app. Get personalized exercises and + techniques to help you optimize your cognitive performance and reduce stress.

    +

    Track your progress, set reminders, and receive helpful insights along the way. Start your journey to a + healthier mind today!

    +
    +
    + + Get Started + + + + + +

    Personalized Insights

    +

    Get personalized insights to understand your cognitive load and make informed decisions for better mental + health.

    +
    + + +

    Time Management

    +

    Learn effective time management techniques to optimize your cognitive performance and reduce overwhelm. +

    +
    +
    + + + +

    Mindfulness Exercises

    +

    Practice mindfulness exercises to enhance your focus, reduce stress, and improve your overall well-being. +

    +
    + + +

    Task Prioritization

    +

    Learn effective strategies to prioritize tasks and manage your cognitive load more efficiently.

    +
    +
    +
    + +
    + +

    Mission

    +
    + +

    Our mission at Brain Lift is to enable individuals to optimize their cognitive performance and improve + their + learning abilities via the efficient management of cognitive load. We aim to provide users with a thorough + understanding of cognitive load, its impact on performance and learning, and practical techniques for + minimizing + cognitive overload. By integrating the NASA Task Load Index and our cognitive load application, Brain Lift, + we + enable users to evaluate their cognitive load across a variety of tasks and activities, allowing them to + make + informed decisions and schedule their time efficiently. Through our platform, users are able to identify + areas + of high cognitive load, implement cognitive load management strategies such as scaffolding, automaticity, + and + chunking, and ultimately achieve enhanced task completion, accelerated learning, and increased independence + in + daily life. +

    +
    +
    + + +
    +
    + + + + + + +

    © 2023 Cognitive Load App. All rights reserved.

    +
    +
    \ No newline at end of file diff --git a/client/src/app/home/home.page.scss b/client/src/app/home/home.page.scss index 456096a..6d8fcab 100644 --- a/client/src/app/home/home.page.scss +++ b/client/src/app/home/home.page.scss @@ -75,7 +75,7 @@ ion-card-title { ion-card-subtitle { font-size: 16px; - color: #888; + color: black; margin-top: 10px; } @@ -106,10 +106,102 @@ h3 { p { font-size: 14px; + color: black; + margin-top: 10px; +} +.hero { + position: relative; + + img { + width: 100%; + } + + + .hero-overlay { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + text-align: center; + background-color: rgb(255, 255, 255, .90); + padding: 16px; + width: 100%; + height: 100%; + + + h1 { + font-size: 24px; + font-weight: bold; + margin-bottom: 16px; + } + + p { + font-size: 16px; + } + } + } + + /* Global Styles */ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; +} + +ion-col { + background-color: white; +} + +/* Card Styles */ +ion-card { + max-width: 400px; + margin: 50px auto; + text-align: center; +} + +.logo { + width: 150px; + margin: 20px auto; +} + +ion-card-title { + font-size: 24px; + font-weight: bold; + margin-top: 20px; + +} + +ion-card-subtitle { + font-size: 16px; color: #888; margin-top: 10px; } +ion-card-content { + margin-top: 20px; +} + +/* Hero Section Styles */ +.hero { + position: relative; +} + +.hero-background { + width: 100%; + position: absolute; + top: 0; + left: 0; + z-index: -1; +} + +.hero-overlay { + position: relative; + text-align: center; + background-color: rgba(255, 255, 255, .95); + padding: 16px; +} + + /* Footer Styles */ ion-footer { margin-top: 50px; diff --git a/client/src/app/landingpage/landing.page.html b/client/src/app/landingpage/landing.page.html deleted file mode 100644 index a45a0ea..0000000 --- a/client/src/app/landingpage/landing.page.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - Brain Lift - - - - - -
    - Hero Image -
    -

    Welcome to Brain Lift

    -

    `Our mission at Brain Lift is to enable individuals to optimize their cognitive performance and improve their learning abilities via the efficient management of cognitive load. We aim to provide users with a thorough understanding of cognitive load, its impact on performance and learning, and practical techniques for minimizing cognitive overload. By integrating the NASA Task Load Index and our cognitive load application, Brain Lift, we enable users to evaluate their cognitive load across a variety of tasks and activities, allowing them to make informed decisions and schedule their time efficiently. Through our platform, users are able to identify areas of high cognitive load, implement cognitive load management strategies such as scaffolding, automaticity, and chunking, and ultimately achieve enhanced task completion, accelerated learning, and increased independence in daily life.` -

    -
    -
    - \ No newline at end of file diff --git a/client/src/app/landingpage/landing.page.scss b/client/src/app/landingpage/landing.page.scss deleted file mode 100644 index 3b9ff78..0000000 --- a/client/src/app/landingpage/landing.page.scss +++ /dev/null @@ -1,28 +0,0 @@ -.hero { - position: relative; - - img { - width: 100%; - } - - .hero-overlay { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - text-align: center; - color: #fff; - padding: 16px; - - h1 { - font-size: 24px; - font-weight: bold; - margin-bottom: 16px; - } - - p { - font-size: 16px; - } - } - } - \ No newline at end of file diff --git a/client/src/app/landingpage/landing.page.ts b/client/src/app/landingpage/landing.page.ts deleted file mode 100644 index 6ef2689..0000000 --- a/client/src/app/landingpage/landing.page.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-landing', - templateUrl: 'landing.page.html', - styleUrls: ['landing.page.scss'], -}) -export class LandingPage { - missionStatement: string = `Our mission at Brain Lift is to enable individuals to optimize their cognitive performance and improve their learning abilities via the efficient management of cognitive load. We aim to provide users with a thorough understanding of cognitive load, its impact on performance and learning, and practical techniques for minimizing cognitive overload. By integrating the NASA Task Load Index and our cognitive load application, Brain Lift, we enable users to evaluate their cognitive load across a variety of tasks and activities, allowing them to make informed decisions and schedule their time efficiently. Through our platform, users are able to identify areas of high cognitive load, implement cognitive load management strategies such as scaffolding, automaticity, and chunking, and ultimately achieve enhanced task completion, accelerated learning, and increased independence in daily life.`; - - constructor() { } -} diff --git a/client/src/app/login/login.module.ts b/client/src/app/login/login.module.ts index 5eda226..8f7f422 100644 --- a/client/src/app/login/login.module.ts +++ b/client/src/app/login/login.module.ts @@ -8,13 +8,17 @@ import { LoginPageRoutingModule } from './login-routing.module'; import { LoginPage } from './login.page'; +import { NavComponent } from '../nav/nav.component'; + + @NgModule({ imports: [ CommonModule, FormsModule, IonicModule, - LoginPageRoutingModule + LoginPageRoutingModule, + NavComponent ], declarations: [LoginPage] }) -export class LoginPageModule {} +export class LoginPageModule { } diff --git a/client/src/app/login/login.page.html b/client/src/app/login/login.page.html index a90bdb7..2a32f71 100644 --- a/client/src/app/login/login.page.html +++ b/client/src/app/login/login.page.html @@ -1,3 +1,4 @@ + Login @@ -5,20 +6,25 @@ - - Email (Username) - - +
    + + + Email (Username) + + - - Password - - + + Password + + - Login -

    {{ errorMessage }}

    + Login +

    {{ errorMessage }}

    + + +
    - \ No newline at end of file diff --git a/client/src/app/measure/measure.module.ts b/client/src/app/measure/measure.module.ts index 19b73a2..c10d5e3 100644 --- a/client/src/app/measure/measure.module.ts +++ b/client/src/app/measure/measure.module.ts @@ -8,13 +8,16 @@ import { MeasurePageRoutingModule } from './measure-routing.module'; import { MeasurePage } from './measure.page'; +import { NavComponent } from '../nav/nav.component'; + @NgModule({ imports: [ CommonModule, FormsModule, IonicModule, - MeasurePageRoutingModule + MeasurePageRoutingModule, + NavComponent ], declarations: [MeasurePage] }) -export class MeasurePageModule {} +export class MeasurePageModule { } diff --git a/client/src/app/measure/measure.page.html b/client/src/app/measure/measure.page.html index 50959ba..04c7692 100644 --- a/client/src/app/measure/measure.page.html +++ b/client/src/app/measure/measure.page.html @@ -1,34 +1,10 @@ - - - - Home - -
    Home
    -
    - - - Education - -
    Cog Load Page
    -
    Strategies
    -
    Measure
    -
    - - - Quiz - -
    Quiz - Builder
    -
    New Task
    -
    Quiz - Task Load
    -
    Quiz - Results
    -
    -
    + - - Education - Measure - NASA Task Load Index - + + Education - Measure + NASA Task Load Index +

    @@ -39,11 +15,11 @@

    -

    Content

    +

    Content

    - -

    © 2023 Cognitive Load App. All rights reserved.

    -
    -
    + +

    © 2023 Cognitive Load App. All rights reserved.

    +
    + \ No newline at end of file diff --git a/client/src/app/nav/nav.component.html b/client/src/app/nav/nav.component.html new file mode 100644 index 0000000..f3666f2 --- /dev/null +++ b/client/src/app/nav/nav.component.html @@ -0,0 +1,29 @@ + + + + Home + +
    Home
    +
    Login
    +
    Signup
    +
    + + + Education + + +
    Education
    +
    Cog Load Page
    +
    Strategies
    +
    Measure
    +
    + + + Quiz + +
    Quiz
    +
    New Task
    +
    Quiz - Results
    +
    Test
    +
    +
    \ No newline at end of file diff --git a/client/src/app/nav/nav.component.scss b/client/src/app/nav/nav.component.scss new file mode 100644 index 0000000..81faa3d --- /dev/null +++ b/client/src/app/nav/nav.component.scss @@ -0,0 +1,6 @@ +ion-accordion { + font-family: Arial, sans-serif; + font: 16px bold; + color: #f4f4f4; + background-color: #011411; +} \ No newline at end of file diff --git a/client/src/app/nav/nav.component.spec.ts b/client/src/app/nav/nav.component.spec.ts new file mode 100644 index 0000000..a94f19e --- /dev/null +++ b/client/src/app/nav/nav.component.spec.ts @@ -0,0 +1,24 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { NavComponent } from './nav.component'; + +describe('NavComponent', () => { + let component: NavComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ NavComponent ], + imports: [IonicModule.forRoot()] + }).compileComponents(); + + fixture = TestBed.createComponent(NavComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/client/src/app/nav/nav.component.ts b/client/src/app/nav/nav.component.ts new file mode 100644 index 0000000..790cfae --- /dev/null +++ b/client/src/app/nav/nav.component.ts @@ -0,0 +1,70 @@ +import { Component, OnInit } from '@angular/core'; +import { IonicModule } from '@ionic/angular'; +import { Router } from '@angular/router'; + + +@Component({ + selector: 'app-nav', + templateUrl: './nav.component.html', + styleUrls: ['./nav.component.scss'], + standalone: true, + imports: [IonicModule], + +}) +export class NavComponent implements OnInit { + + constructor(private router: Router) { } + + goHome() { + this.router.navigateByUrl('/home'); + } + + goAbout() { + this.router.navigateByUrl('/about'); + } + + goEducation() { + this.router.navigateByUrl('/education'); + } + + goLogin() { + this.router.navigateByUrl('/login'); + } + + goSignup() { + this.router.navigateByUrl('/signup'); + } + + goMeasure() { + this.router.navigateByUrl('/measure'); + } + + goQuiz() { + this.router.navigateByUrl('/quiz'); + } + + goStrategies() { + this.router.navigateByUrl('/strategies'); + } + + goTask() { + this.router.navigateByUrl('/task'); + } + + goTest() { + this.router.navigateByUrl('/test'); + } + + goResults() { + this.router.navigateByUrl('/results'); + } + + + + navigateTo(page: string) { + this.router.navigateByUrl('/' + page); + } + + ngOnInit() { + } +} diff --git a/client/src/app/quiz/quiz.module.ts b/client/src/app/quiz/quiz.module.ts index a05e492..4697247 100644 --- a/client/src/app/quiz/quiz.module.ts +++ b/client/src/app/quiz/quiz.module.ts @@ -8,13 +8,16 @@ import { QuizPageRoutingModule } from './quiz-routing.module'; import { QuizPage } from './quiz.page'; +import { NavComponent } from '../nav/nav.component'; + @NgModule({ imports: [ CommonModule, FormsModule, IonicModule, - QuizPageRoutingModule + QuizPageRoutingModule, + NavComponent ], declarations: [QuizPage] }) -export class QuizPageModule {} +export class QuizPageModule { } diff --git a/client/src/app/quiz/quiz.page.html b/client/src/app/quiz/quiz.page.html index b19a4e1..1056f3b 100644 --- a/client/src/app/quiz/quiz.page.html +++ b/client/src/app/quiz/quiz.page.html @@ -1,28 +1,4 @@ - - - - Home - -
    Home
    -
    - - - Education - -
    Cog Load Page
    -
    Strategies
    -
    Measure
    -
    - - - Quiz - -
    Quiz - Builder
    -
    New Task
    -
    Quiz - Task Load
    -
    Quiz - Results
    -
    -
    + @@ -30,9 +6,7 @@ - - - + diff --git a/client/src/app/results/results-routing.module.ts b/client/src/app/results/results-routing.module.ts new file mode 100644 index 0000000..3a264b4 --- /dev/null +++ b/client/src/app/results/results-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { ResultsPage } from './results.page'; + +const routes: Routes = [ + { + path: '', + component: ResultsPage + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class ResultsPageRoutingModule {} diff --git a/client/src/app/results/results.module.ts b/client/src/app/results/results.module.ts new file mode 100644 index 0000000..c0293b9 --- /dev/null +++ b/client/src/app/results/results.module.ts @@ -0,0 +1,22 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import { IonicModule } from '@ionic/angular'; + +import { ResultsPageRoutingModule } from './results-routing.module'; + +import { ResultsPage } from './results.page'; +import { NavComponent } from '../nav/nav.component'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + ResultsPageRoutingModule, + NavComponent + ], + declarations: [ResultsPage] +}) +export class ResultsPageModule { } diff --git a/client/src/app/results/results.page.html b/client/src/app/results/results.page.html new file mode 100644 index 0000000..54353e3 --- /dev/null +++ b/client/src/app/results/results.page.html @@ -0,0 +1,15 @@ + + + results + + + + + + + + + Results Page + + + \ No newline at end of file diff --git a/client/src/app/results/results.page.scss b/client/src/app/results/results.page.scss new file mode 100644 index 0000000..e69de29 diff --git a/client/src/app/results/results.page.spec.ts b/client/src/app/results/results.page.spec.ts new file mode 100644 index 0000000..a478065 --- /dev/null +++ b/client/src/app/results/results.page.spec.ts @@ -0,0 +1,17 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ResultsPage } from './results.page'; + +describe('ResultsPage', () => { + let component: ResultsPage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + fixture = TestBed.createComponent(ResultsPage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/client/src/app/results/results.page.ts b/client/src/app/results/results.page.ts new file mode 100644 index 0000000..7171ade --- /dev/null +++ b/client/src/app/results/results.page.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-results', + templateUrl: './results.page.html', + styleUrls: ['./results.page.scss'], +}) +export class ResultsPage implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/client/src/app/services/user-data.service.ts b/client/src/app/services/user-data.service.ts index 2253cd3..b5846d8 100644 --- a/client/src/app/services/user-data.service.ts +++ b/client/src/app/services/user-data.service.ts @@ -2,6 +2,7 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; import { HttpHeaders, HttpParams } from '@angular/common/http'; +import { Router } from '@angular/router'; @Injectable({ @@ -11,7 +12,7 @@ export class UserDataService { private url = 'https://www.brain-lift.org/brain-lift/server/api/user/'; - constructor(private http: HttpClient) { } + constructor(private http: HttpClient, private router: Router) { } getData(): Observable { return this.http.get(this.url); @@ -38,6 +39,12 @@ export class UserDataService { updateData(formData: any): Observable { + // // check for sessionID or send to login page + // const loggedIn = sessionStorage.getItem('sessionID'); + // if (!loggedIn) { + // this.router.navigateByUrl('/login'); + // } + const updateUrl = `${this.url}/update/`; const httpOptions = { diff --git a/client/src/app/signup/signup.module.ts b/client/src/app/signup/signup.module.ts index 295034b..950dd39 100644 --- a/client/src/app/signup/signup.module.ts +++ b/client/src/app/signup/signup.module.ts @@ -8,13 +8,17 @@ import { SignupPageRoutingModule } from './signup-routing.module'; import { SignupPage } from './signup.page'; +import { NavComponent } from '../nav/nav.component'; + + @NgModule({ imports: [ CommonModule, FormsModule, IonicModule, - SignupPageRoutingModule + SignupPageRoutingModule, + NavComponent ], declarations: [SignupPage] }) -export class SignupPageModule {} +export class SignupPageModule { } diff --git a/client/src/app/signup/signup.page.html b/client/src/app/signup/signup.page.html index f8384bb..d42a99f 100644 --- a/client/src/app/signup/signup.page.html +++ b/client/src/app/signup/signup.page.html @@ -1,3 +1,5 @@ + + Sign Up @@ -5,16 +7,22 @@ - - Email (Username) - - +
    + + + + Email (Username) + + + + + Password + + - - Password - - + Sign Up +

    {{ errorMessage }}

    +
    - Sign Up -

    {{ errorMessage }}

    +
    \ No newline at end of file diff --git a/client/src/app/strategies/strategies.module.ts b/client/src/app/strategies/strategies.module.ts index 10b3b04..783e6c0 100644 --- a/client/src/app/strategies/strategies.module.ts +++ b/client/src/app/strategies/strategies.module.ts @@ -8,13 +8,17 @@ import { StrategiesPageRoutingModule } from './strategies-routing.module'; import { StrategiesPage } from './strategies.page'; +import { NavComponent } from '../nav/nav.component'; + + @NgModule({ imports: [ CommonModule, FormsModule, IonicModule, - StrategiesPageRoutingModule + StrategiesPageRoutingModule, + NavComponent ], declarations: [StrategiesPage] }) -export class StrategiesPageModule {} +export class StrategiesPageModule { } diff --git a/client/src/app/strategies/strategies.page.html b/client/src/app/strategies/strategies.page.html index 6b0e612..1a1590c 100644 --- a/client/src/app/strategies/strategies.page.html +++ b/client/src/app/strategies/strategies.page.html @@ -1,65 +1,45 @@ - - - - Home - -
    Home
    -
    - - - Education - -
    Cog Load Page
    -
    Strategies
    -
    Measure
    -
    - - - Quiz - -
    Quiz - Builder
    -
    New Task
    -
    Quiz - Task Load
    -
    Quiz - Results
    -
    -
    + + - - Education - Strategies - How to Prevent Cognitive Overload - - - - - + + Education - Strategies + How to Prevent Cognitive Overload + + + + + - + Strategies to deal with cognitive overload - +
    - -EFT + +EFT EMDR DBT CBT
    - + Forum for Tasks
    - + -

    Content

    +

    Content


    - -

    © 2023 Cognitive Load App. All rights reserved.

    -
    + +

    © 2023 Cognitive Load App. All rights reserved.

    +
    \ No newline at end of file diff --git a/client/src/app/task/task.module.ts b/client/src/app/task/task.module.ts index fb21ab4..773a76e 100644 --- a/client/src/app/task/task.module.ts +++ b/client/src/app/task/task.module.ts @@ -10,6 +10,8 @@ import { IonicModule } from '@ionic/angular'; import { TaskPageRoutingModule } from './task-routing.module'; import { TaskPage } from './task.page'; +import { NavComponent } from '../nav/nav.component'; + const routes: Routes = [ { @@ -24,8 +26,9 @@ const routes: Routes = [ FormsModule, ReactiveFormsModule, IonicModule, - TaskPageRoutingModule + TaskPageRoutingModule, + NavComponent ], declarations: [TaskPage] }) -export class TaskPageModule {} +export class TaskPageModule { } diff --git a/client/src/app/task/task.page.html b/client/src/app/task/task.page.html index 59242df..0152863 100644 --- a/client/src/app/task/task.page.html +++ b/client/src/app/task/task.page.html @@ -1,28 +1,5 @@ - - - - Home - -
    Home
    -
    - - - Education - -
    Cog Load Page
    -
    Strategies
    -
    Measure
    -
    - - - Quiz - -
    Quiz - Builder
    -
    New Task
    -
    Quiz - Task Load
    -
    Quiz - Results
    -
    -
    + + @@ -35,19 +12,19 @@ -
    + Task Name - + - + Task Type Type A Type B Type C - + Task Time 5 min @@ -59,4 +36,7 @@
    -
    + + Save Task + +
    \ No newline at end of file diff --git a/client/src/app/task/task.page.ts b/client/src/app/task/task.page.ts index 2bad34b..b823c53 100644 --- a/client/src/app/task/task.page.ts +++ b/client/src/app/task/task.page.ts @@ -1,5 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { FormControl, FormGroup } from '@angular/forms'; +import { TaskDataService } from '../services/task-data.service'; @Component({ selector: 'app-task', @@ -7,17 +8,45 @@ import { FormControl, FormGroup } from '@angular/forms'; styleUrls: ['./task.page.scss'], }) export class TaskPage implements OnInit { - - taskForm: any - constructor() { } + taskForm = new FormGroup({ + taskName: new FormControl(''), + taskType: new FormControl(''), + taskTime: new FormControl(''), + userID: new FormControl(''), // todo + sessionID: new FormControl(''), // todo + }); + + constructor(private taskDataService: TaskDataService) { } ngOnInit() { } - selectTaskTime(time: any) { } - selectTaskType(type: any) { } + selectTaskTime(time: any) { + this.taskForm.controls['taskTime'].setValue(time); + } - + selectTaskType(type: any) { + this.taskForm.controls['taskType'].setValue(type); + } -} + saveTask() { + + console.log(this.taskForm.value) + this.taskForm.value["sessionID"] = sessionStorage.getItem("sessionID") + this.taskForm.value["userID"] = sessionStorage.getItem("sessionID") + + const formData = { + "taskName": this.taskForm.value.taskName, + "taskType": this.taskForm.value.taskType, + "taskTime": this.taskForm.value.taskTime, + "userID": this.taskForm.value.userID, + "sessionID": this.taskForm.value.sessionID + } + + this.taskDataService.postData(formData).subscribe({ + next: response => console.log('Response from server:', response), + error: error => console.error('Error:', error) + }); + } +} diff --git a/client/src/app/test/test.module.ts b/client/src/app/test/test.module.ts index e965001..de6465d 100644 --- a/client/src/app/test/test.module.ts +++ b/client/src/app/test/test.module.ts @@ -10,6 +10,8 @@ import { TestPage } from './test.page'; import { HttpClientModule } from '@angular/common/http'; +import { NavComponent } from '../nav/nav.component'; + @NgModule({ imports: [ @@ -18,6 +20,7 @@ import { HttpClientModule } from '@angular/common/http'; IonicModule, TestPageRoutingModule, HttpClientModule, + NavComponent ], declarations: [TestPage] }) diff --git a/client/src/app/test/test.page.html b/client/src/app/test/test.page.html index e7f34dd..cec2d67 100644 --- a/client/src/app/test/test.page.html +++ b/client/src/app/test/test.page.html @@ -1,29 +1,3 @@ - - - - Home - -
    Home
    -
    - - - Education - -
    Cog Load Page
    -
    Strategies
    -
    Measure
    -
    - - - Quiz - -
    Quiz - Builder
    -
    New Task
    -
    Quiz - Task Load
    -
    Quiz - Results
    -
    -
    - API Route Test Page @@ -31,6 +5,7 @@ + Task API Routes Get Task From 2b5898e787a2cb05831b32f3d86d529f3023c152 Mon Sep 17 00:00:00 2001 From: nitrotap <9121718+nitrotap@users.noreply.github.com> Date: Tue, 6 Jun 2023 01:18:36 -0600 Subject: [PATCH 3/3] adding content to front end --- client/src/app/about/about.page.scss | 8 + client/src/app/education/education.page.html | 2 +- client/src/app/education/education.page.scss | 3 +- client/src/app/home/home.page.html | 13 +- client/src/app/home/home.page.scss | 20 +- client/src/app/home/home.page.ts | 8 +- client/src/app/login/login.page.html | 7 +- client/src/app/login/login.page.scss | 7 + client/src/app/measure/measure.page.html | 37 +- client/src/app/measure/measure.page.scss | 6 +- client/src/app/nav/nav.component.html | 5 +- client/src/app/quiz/quiz.page.html | 14 +- client/src/app/quiz/quiz.page.scss | 6 +- client/src/app/results/results.page.html | 27 +- client/src/app/results/results.page.scss | 5 + client/src/app/results/results.page.ts | 29 +- client/src/app/signup/signup.page.scss | 5 + .../src/app/strategies/strategies.page.html | 387 ++++++++++++++++-- .../src/app/strategies/strategies.page.scss | 63 ++- client/src/app/task/task.page.html | 54 ++- client/src/app/task/task.page.scss | 10 +- client/src/app/task/task.page.ts | 12 +- server/api/task/index.php | 7 +- 23 files changed, 563 insertions(+), 172 deletions(-) diff --git a/client/src/app/about/about.page.scss b/client/src/app/about/about.page.scss index e69de29..19ae630 100644 --- a/client/src/app/about/about.page.scss +++ b/client/src/app/about/about.page.scss @@ -0,0 +1,8 @@ +ion-card, ion-title, ion-card-subtitle { + --ion-item-border-color: #025E73; + --ion-item-background: #80A7BF; + --ion-text-color: #012E40; + overflow: visible; + color: black; + text-align: center; +} \ No newline at end of file diff --git a/client/src/app/education/education.page.html b/client/src/app/education/education.page.html index 8dc3297..f9e6611 100644 --- a/client/src/app/education/education.page.html +++ b/client/src/app/education/education.page.html @@ -1,6 +1,6 @@ - Cognitive Load + Learn About Cognitive Load diff --git a/client/src/app/education/education.page.scss b/client/src/app/education/education.page.scss index 84cc15e..1df9f70 100644 --- a/client/src/app/education/education.page.scss +++ b/client/src/app/education/education.page.scss @@ -51,4 +51,5 @@ ion-footer p { font-size: 12px; color: #888; } - \ No newline at end of file + + diff --git a/client/src/app/home/home.page.html b/client/src/app/home/home.page.html index a75cf3e..7a5d6f9 100644 --- a/client/src/app/home/home.page.html +++ b/client/src/app/home/home.page.html @@ -1,12 +1,13 @@ - - - - Cognitive Load App + + + Home - + + +
    Hero Image @@ -28,7 +29,7 @@
    - Get Started + Get Started diff --git a/client/src/app/home/home.page.scss b/client/src/app/home/home.page.scss index 6d8fcab..867684b 100644 --- a/client/src/app/home/home.page.scss +++ b/client/src/app/home/home.page.scss @@ -33,25 +33,13 @@ body { padding: 0; } -/* Navigation Styles */ - -ion-accordion { - font-family: Arial, sans-serif; - font: 16px bold; - color: #f4f4f4; - +ion-card, ion-title, ion-card-subtitle { + overflow: visible; + color: black; + text-align: center; } -/* Header Styles */ -ion-header { - padding: 20px; -} -ion-title { - font-size: 24px; - font-weight: bold; - color: #fff; -} /* Card Styles */ ion-card { diff --git a/client/src/app/home/home.page.ts b/client/src/app/home/home.page.ts index 83522d5..2cb6dfa 100644 --- a/client/src/app/home/home.page.ts +++ b/client/src/app/home/home.page.ts @@ -1,12 +1,14 @@ import { Component } from '@angular/core'; - +import { Router } from '@angular/router'; @Component({ selector: 'app-home', templateUrl: 'home.page.html', styleUrls: ['home.page.scss'], }) export class HomePage { - - constructor() {} + goSignup() { + this.router.navigateByUrl('/signup'); + } + constructor(private router: Router) { } } diff --git a/client/src/app/login/login.page.html b/client/src/app/login/login.page.html index 2a32f71..dbe9c96 100644 --- a/client/src/app/login/login.page.html +++ b/client/src/app/login/login.page.html @@ -1,11 +1,12 @@ - - + Login - + + +
    diff --git a/client/src/app/login/login.page.scss b/client/src/app/login/login.page.scss index e69de29..97a908f 100644 --- a/client/src/app/login/login.page.scss +++ b/client/src/app/login/login.page.scss @@ -0,0 +1,7 @@ +ion-card, ion-title, ion-card-subtitle { + --ion-item-border-color: #025E73; + --ion-text-color: #012E40; + overflow: visible; + color: black; + text-align: center; +} \ No newline at end of file diff --git a/client/src/app/measure/measure.page.html b/client/src/app/measure/measure.page.html index 04c7692..3c89e9a 100644 --- a/client/src/app/measure/measure.page.html +++ b/client/src/app/measure/measure.page.html @@ -1,25 +1,16 @@ - + + + Measure your cognitive load + + - - - Education - Measure - NASA Task Load Index - - -
    -
    -Explanation -
    -
    -How to Use -
    -
    - -

    Content

    -
    + - - -

    © 2023 Cognitive Load App. All rights reserved.

    -
    -
    \ No newline at end of file + + + + + +

    © 2023 Cognitive Load App. All rights reserved.

    +
    +
    \ No newline at end of file diff --git a/client/src/app/measure/measure.page.scss b/client/src/app/measure/measure.page.scss index 6445ca8..0c11c7a 100644 --- a/client/src/app/measure/measure.page.scss +++ b/client/src/app/measure/measure.page.scss @@ -6,7 +6,11 @@ ion-accordion { color: #f4f4f4; } - +ion-card, ion-title, ion-card-subtitle { + overflow: visible; + color: black; + text-align: center; +} /* Card Styles */ ion-card { --ion-item-border-color: #025E73; diff --git a/client/src/app/nav/nav.component.html b/client/src/app/nav/nav.component.html index f3666f2..24430aa 100644 --- a/client/src/app/nav/nav.component.html +++ b/client/src/app/nav/nav.component.html @@ -13,9 +13,8 @@
    Education
    -
    Cog Load Page
    Strategies
    -
    Measure
    + @@ -23,7 +22,7 @@
    Quiz
    New Task
    -
    Quiz - Results
    +
    Results
    Test
    \ No newline at end of file diff --git a/client/src/app/quiz/quiz.page.html b/client/src/app/quiz/quiz.page.html index 1056f3b..1607425 100644 --- a/client/src/app/quiz/quiz.page.html +++ b/client/src/app/quiz/quiz.page.html @@ -1,19 +1,13 @@ - - Quiz - - - - - Quiz Page - - - + + + + diff --git a/client/src/app/quiz/quiz.page.scss b/client/src/app/quiz/quiz.page.scss index 707081a..a171241 100644 --- a/client/src/app/quiz/quiz.page.scss +++ b/client/src/app/quiz/quiz.page.scss @@ -23,7 +23,11 @@ ion-range::part(pin) { height: 28px; transition: transform 120ms ease, background 120ms ease; } - +ion-card, ion-title, ion-card-subtitle { + overflow: visible; + color: black; + text-align: center; +} ion-range::part(pin)::before { content: none; } diff --git a/client/src/app/results/results.page.html b/client/src/app/results/results.page.html index 54353e3..234e018 100644 --- a/client/src/app/results/results.page.html +++ b/client/src/app/results/results.page.html @@ -1,15 +1,30 @@ - results + Results + See Your Past Results + + + Task ID: {{ demoResult.taskID }} + Answer ID: {{ demoResult.answerID }} + Mental Demand: {{ demoResult.taskAnswer_1 }} + Physical Demand: {{ demoResult.answerID }} + Time (Temporal) Demand: {{ demoResult.answerID }} + Self Performance: {{ demoResult.answerID }} + Effort: {{ demoResult.answerID }} + Frustration Level: {{ demoResult.answerID }} - - - Results Page - - + + + + View Your Tasks + + Task ID: {{ demoResult.taskID }} + + + Take a New Quiz \ No newline at end of file diff --git a/client/src/app/results/results.page.scss b/client/src/app/results/results.page.scss index e69de29..0bf84bf 100644 --- a/client/src/app/results/results.page.scss +++ b/client/src/app/results/results.page.scss @@ -0,0 +1,5 @@ +ion-card, ion-title, ion-card-subtitle { + overflow: visible; + color: black; + text-align: center; +} \ No newline at end of file diff --git a/client/src/app/results/results.page.ts b/client/src/app/results/results.page.ts index 7171ade..4494740 100644 --- a/client/src/app/results/results.page.ts +++ b/client/src/app/results/results.page.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; @Component({ selector: 'app-results', @@ -6,8 +7,34 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./results.page.scss'], }) export class ResultsPage implements OnInit { + results: any; + demoResults = [ + { + "answerID": 10, "taskAnswer_1": 5, "taskAnswer_2": 5, "taskAnswer_3": 5, "taskAnswer_4": 5, "taskAnswer_5": 5, "taskAnswer_6": 5, "taskScore": 30, "dateTaken": "2023-05-15 11:30:00", "userID": 1, "taskID": 1 + }, + { + "answerID": 11, "taskAnswer_1": 4, "taskAnswer_2": 5, "taskAnswer_3": 4, "taskAnswer_4": 5, "taskAnswer_5": 5, "taskAnswer_6": 5, "taskScore": 28, "dateTaken": "2023-05-15 11:30:00", "userID": 1, "taskID": 1 + }, + { + "answerID": 10, "taskAnswer_1": 5, "taskAnswer_2": 5, "taskAnswer_3": 5, "taskAnswer_4": 5, "taskAnswer_5": 5, "taskAnswer_6": 5, "taskScore": 30, "dateTaken": "2023-05-15 11:30:00", "userID": 1, "taskID": 3 + }, + { + "answerID": 11, "taskAnswer_1": 4, "taskAnswer_2": 5, "taskAnswer_3": 4, "taskAnswer_4": 5, "taskAnswer_5": 5, "taskAnswer_6": 5, "taskScore": 28, "dateTaken": "2023-05-15 11:30:00", "userID": 1, "taskID": 3 + }, + { + "answerID": 10, "taskAnswer_1": 5, "taskAnswer_2": 5, "taskAnswer_3": 5, "taskAnswer_4": 5, "taskAnswer_5": 5, "taskAnswer_6": 5, "taskScore": 30, "dateTaken": "2023-05-15 11:30:00", "userID": 1, "taskID": 4 + }, + { + "answerID": 11, "taskAnswer_1": 4, "taskAnswer_2": 5, "taskAnswer_3": 4, "taskAnswer_4": 5, "taskAnswer_5": 5, "taskAnswer_6": 5, "taskScore": 28, "dateTaken": "2023-05-15 11:30:00", "userID": 1, "taskID": 4 + }, + ] - constructor() { } + + constructor(private router: Router) { } + + goQuiz() { + this.router.navigateByUrl('/quiz'); + } ngOnInit() { } diff --git a/client/src/app/signup/signup.page.scss b/client/src/app/signup/signup.page.scss index e69de29..0bf84bf 100644 --- a/client/src/app/signup/signup.page.scss +++ b/client/src/app/signup/signup.page.scss @@ -0,0 +1,5 @@ +ion-card, ion-title, ion-card-subtitle { + overflow: visible; + color: black; + text-align: center; +} \ No newline at end of file diff --git a/client/src/app/strategies/strategies.page.html b/client/src/app/strategies/strategies.page.html index 1a1590c..6450b6f 100644 --- a/client/src/app/strategies/strategies.page.html +++ b/client/src/app/strategies/strategies.page.html @@ -1,42 +1,373 @@ - + + + Strategies + + + - - - Education - Strategies - How to Prevent Cognitive Overload - + - - - + + + Preventing Cognitive Overload + + + Preventing cognitive overload is certainly harder than it sounds. + There are a few ways to help deal with overload, but be sure to consult with a therapist or psychiatrist before + relying on any of these methods. These methods are provided as a sample to help those in the moment, and is not to + be substituted for health advice. + + - - Strategies to deal with cognitive overload - - -
    + + Tips for Intrinsic Load + + + + + + + + + Chunking + + + Split up a task into smaller parts + + + + Chunking describes the strategy of splitting up a single task into smaller, more manageable chunks. + By grouping related pieces of information together, individuals can reduce cognitive load and enhance + their ability to process and retain information effectively. Chunking helps simplify complex tasks by + organizing them into manageable and interconnected parts, making it easier to remember and execute the + individual steps involved. It facilitates efficiency, pattern recognition, and problem-solving by + promoting a more streamlined approach to task execution. + + -EFT -EMDR -DBT -CBT + + + + + + Sequencing + + + Split up a task in a + specific order to complete it + -
    +
    + + Sequencing refers to the logical order and arrangement of steps or actions in a process or task. It + involves breaking down a complex task into smaller, manageable steps that need to be performed in a + specific order to achieve the desired outcome. Sequencing helps ensure that each step is + completed before + moving on to the next, ensuring efficiency, accuracy, and successful completion of the task. Whether it's + in activities like laundry or cooking, sequencing plays a crucial role in organizing the workflow, + maintaining consistency, and achieving optimal results. -Forum for Tasks + +
    +
    + + + + + Scaffolding + + + Using aids to lessen cognitive effort needed to complete the task + + + + Scaffolding can take different forms, such as verbal instructions, visual aids, demonstrations, or + physical assistance. The goal of scaffolding is to gradually reduce support as as time goes on. It serves + as a temporary framework that assists individuals in acquiring and refining the necessary skills to + perform tasks effectively and autonomously. + + + +
    +
    +
    -
    + + Tips for Extraneous Load + + + + + + + + + Simplification + + + Modify your goals to support the cognitive load framework + + + + Keep things simple. Modify your existing goals to support the cognitive load framework, and base your + success on + how well you are accomplishing preventing cognitive overload or slowly gaining independence in the task. + Write + your goals to gradually reduce extraneous demands on your mental resources. + + + + + + + + Therapy + + + Provides a supportive and safe environment for individuals to explore their thoughts, emotions, and + behaviors + + + + Therapy can provide a supportive and safe environment for individuals to explore their thoughts, emotions, + and + behaviors, leading to increased self-awareness, improved coping skills, and enhanced overall mental + well-being. + + + + + + + + Medication + + + Can help alleviate symptoms, restore chemical imbalances in the brain, and improve overall quality of + life + + + + For those with mental illness, psychiatric medication can help alleviate symptoms, restore chemical + imbalances + in the brain, and improve overall quality of life by reducing distress and promoting stability. + + + + + + - -

    Content

    -
    + + Tips for Germane Load + + + + + Reflection + + + Thinking about tasks and events in advance and after completion + + + + Reflection is a powerful tool for managing cognitive load. Thinking about tasks and experiences lets us gain + insight into our thinking processes, identify areas of improvement, and make adjustments for more efficient + cognitive functioning. By reflecting on our performance, we think about an experience or task outside of the + event, helping us to identify and to distinguish between the hard parts of a task and the easy parts. It helps us + be strategic with our cognitive effort, and it can help us decrease overall cognitive load. Reflection also + provides an opportunity to really understand ourselves and our challenges, all while preparing for the future. + + + + + Interweaving + + + + + + + + Task Switching + + + Interweave different tasks within a single session + + + + Instead of completing one ADL entirely before moving on to the next, you can interweave different tasks + within a single session. For example, you can switch between folding laundry, preparing a meal, and + organizing your workspace, allowing your brain to transition between different activities and engage with + varied cognitive demands. + + + + + + + + + Multitasking with Intention + + + Combining activities strategically to make the most of your time + + + + While multitasking can sometimes lead to decreased productivity, interweaving tasks with intention can be + beneficial. For instance, while waiting for water to boil on the stove, you can use that time to wash a + few dishes or sort through your mail. By combining activities strategically, you can make the most of your + time and accomplish multiple tasks simultaneously. + + + + + + + + Sequential Overlapping + + + Overlap steps or actions in different tasks + + + + Instead of completing each ADL in isolation, look for opportunities to overlap steps or actions. For + instance, while cooking, you can start a load of laundry and let it run in the background while you + continue with meal preparation. This way, you're interweaving different tasks and utilizing time and + resources more effectively. + + + + + + + + + + + Dealing with Cognitive Overload + Emotional Freedom Techniques (EFT) + +
      +
    1. + Establish a phrase accepting yourself specific the problem you're facing +
    2. +
        +
      • "While I am hearing voices, I know the voices aren't real."
      • +
      • "While I am feeling very sad, I know the sad feelings are temporary."
      • +
      • "Even though this is happening, I know I will get through it"
      • +
      +
    3. Now, tap each of the following points seven (7) times.
    4. +
      Start with the side of your hand.
      +
        +
      1. + Side of hand opposite of your thumb. +
      2. +
      3. In between your eyebrows
      4. +
      5. End of your right eyebrow
      6. +
      7. Under your right eye
      8. +
      9. Right under your nose
      10. +
      11. In between your mouth and your chin
      12. +
      13. To the right of your upper sternum
      14. +
      15. Under your right armpit
      16. +
      17. Back to in between your eyebrows
      18. + + +
      +
    5. + Starting with the side of your hand opposite your thumb, tap each point seven times. +
    6. + +
    +
    + +
    + + + + Eye Movement Desensitization and Reprocessing +

    + EMDR therapy is a method used to help people deal with difficult memories and experiences that may be causing + emotional distress. While it's typically done with a trained therapist, there's a simplified technique you can try + at home called the "Butterfly Hug." Here's how you can do it: +

    +
      +
    1. + Sit comfortably and take a few deep breaths to relax. +
    2. +
    3. Cross your arms across your chest, with your hands resting lightly on your upper arms. +
    4. +
    5. Start tapping alternately with your right and left hands on your arms, like a butterfly's wings gently + fluttering. +
    6. +
    7. While tapping, bring to mind a specific memory or issue that's bothering you. It could be something that makes + you feel anxious, upset, or scared. +
    8. +
    9. Focus on the memory or issue and let the tapping continue for about 20-30 seconds. +
    10. +
    11. Take a deep breath and let it out slowly. +
    12. +
    13. Notice any thoughts, feelings, or sensations that arise during the process. +
    14. +
    + +

    + The idea behind this technique is that the bilateral tapping helps stimulate both sides of the brain, which can + aid + in processing and reducing the emotional intensity of the memory or issue. It's important to remember that this + simplified version may not be as effective as undergoing EMDR therapy with a trained professional, especially for + complex or severe issues. If you find that your distress persists or worsens, it's recommended to seek the help of + a + qualified mental health practitioner. +

    +
    -
    + + + + + + Education - Strategies + How to Prevent Cognitive Overload + + + + + + + + Strategies to deal with cognitive overload + + + +
    + + EFT + EMDR + DBT + CBT + +
    + + Forum for Tasks + +
    + + +

    Content

    +
    + +
    + +
    diff --git a/client/src/app/strategies/strategies.page.scss b/client/src/app/strategies/strategies.page.scss index b362da2..63ef411 100644 --- a/client/src/app/strategies/strategies.page.scss +++ b/client/src/app/strategies/strategies.page.scss @@ -1,39 +1,34 @@ -/* Navigation Styles */ - -ion-accordion { - font-family: Arial, sans-serif; - font: 16px bold; - color: #f4f4f4; - +ion-card, ion-title, ion-card-subtitle { + overflow: visible; + color: black; + text-align: center; } -/* Card Styles */ -ion-card { - --ion-item-border-color: #025E73; - --ion-item-background: #80A7BF; - --ion-text-color: #012E40; -} + // @media (max-width: 768px) { + // ion-grid { + // grid-template-columns: repeat(1, 1fr) !important; + // } + // } -ion-button { - --ion-item-border-color: #025E73; - --ion-item-background: #80A7BF; - --ion-text-color: #012E40; -} + // @media (min-width: 769px) { + // ion-grid { + // grid-template-columns: repeat(3, 1fr) !important; + // } + // } -ion-button.large { - --background: #025E73; - --ion-text-color: #012E40; -} + // ion-card { + // transition: transform 0.3s ease-in-out; + // } -/* Footer Styles */ -ion-footer { - margin-top: 50px; - background-color: #f4f4f4; - padding: 10px; -} - -ion-footer p { - font-size: 12px; - color: #888; -} - \ No newline at end of file + // ion-card:hover { + // transform: scale(1.05); + // } + + // ion-button { + // transition: background-color 0.3s ease-in-out, transform 0.3s ease-in-out; + // } + + // ion-button:hover { + // background-color: #dddddd; + // transform: scale(1.1); + // } diff --git a/client/src/app/task/task.page.html b/client/src/app/task/task.page.html index 0152863..de89f62 100644 --- a/client/src/app/task/task.page.html +++ b/client/src/app/task/task.page.html @@ -1,29 +1,41 @@ - - - - + - - New Task - + New Task - - - -
    + + + + + + + + - Task Name + Type a Task Name - + + + + - Task Type - Type A - Type B - Type C + Choose or Type a Task Type + + Intrinsic + Extraneous + Germane + + + Type a Task Type + + + + + + + Save Task diff --git a/client/src/app/task/task.page.scss b/client/src/app/task/task.page.scss index 1194df4..279e56b 100644 --- a/client/src/app/task/task.page.scss +++ b/client/src/app/task/task.page.scss @@ -1,8 +1,6 @@ -/* Navigation Styles */ -ion-accordion { - font-family: Arial, sans-serif; - font: 16px bold; - color: #f4f4f4; - +ion-card, ion-title, ion-card-subtitle, ion-item { + overflow: visible; + color: black; + text-align: center; } \ No newline at end of file diff --git a/client/src/app/task/task.page.ts b/client/src/app/task/task.page.ts index b823c53..e52f9d5 100644 --- a/client/src/app/task/task.page.ts +++ b/client/src/app/task/task.page.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { FormControl, FormGroup } from '@angular/forms'; import { TaskDataService } from '../services/task-data.service'; - +import { Router } from '@angular/router'; @Component({ selector: 'app-task', templateUrl: './task.page.html', @@ -16,7 +16,7 @@ export class TaskPage implements OnInit { sessionID: new FormControl(''), // todo }); - constructor(private taskDataService: TaskDataService) { } + constructor(private taskDataService: TaskDataService, private router: Router) { } ngOnInit() { } @@ -31,7 +31,7 @@ export class TaskPage implements OnInit { saveTask() { - console.log(this.taskForm.value) + // console.log(this.taskForm.value) this.taskForm.value["sessionID"] = sessionStorage.getItem("sessionID") this.taskForm.value["userID"] = sessionStorage.getItem("sessionID") @@ -40,8 +40,10 @@ export class TaskPage implements OnInit { "taskName": this.taskForm.value.taskName, "taskType": this.taskForm.value.taskType, "taskTime": this.taskForm.value.taskTime, - "userID": this.taskForm.value.userID, - "sessionID": this.taskForm.value.sessionID + "userID": 1, + + // "userID": this.taskForm.value.userID, + // "sessionID": this.taskForm.value.sessionID } this.taskDataService.postData(formData).subscribe({ diff --git a/server/api/task/index.php b/server/api/task/index.php index 6630ef0..5b298ba 100644 --- a/server/api/task/index.php +++ b/server/api/task/index.php @@ -59,17 +59,16 @@ sanitizeRequestStrings(); $requestData = $_REQUEST; // Check if required data is provided - if (isset($requestData['taskName']) && isset($requestData['taskType']) && isset($requestData['taskTime']) && isset($requestData['userID'])) { + if (isset($requestData['taskName']) && isset($requestData['taskType']) && isset($requestData['userID'])) { // Insert the data into the table // Prepare and bind parameters for an insert query - $query = "INSERT INTO $table (taskName, taskType, taskTime, userID) VALUES (:value1, :value2, :value3, :value4)"; + $query = "INSERT INTO $table (taskName, taskType, userID) VALUES (:value1, :value2, :value3)"; $stmt = $db->prepare($query); $stmt->bindParam(':value1', $requestData['taskName']); $stmt->bindParam(':value2', $requestData['taskType']); - $stmt->bindParam(':value3', $requestData['taskTime']); - $stmt->bindParam(':value4', $requestData['userID']); + $stmt->bindParam(':value3', $requestData['userID']); $stmt->execute();