-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
706 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
<header data-cy="site-header" class="bg-neutral-700 text-white p-1" aria-labelledby="siteTitle"> | ||
<h1 id="siteTitle" class="text-lg font-extrabold"><a routerLink="/">{{title}}</a></h1> | ||
<header data-cy="site-header" class="md:flex bg-neutral-700 text-white px-4" aria-labelledby="siteTitle"> | ||
<h1 id="siteTitle" class="grow text-lg font-extrabold"><a routerLink="/">{{title}}</a></h1> | ||
|
||
<nav aria-label="main site navigation"> | ||
<ul class="flex flex-wrap gap-3"> | ||
<li><a routerLink="/quiz">Take the Quiz</a></li> | ||
<li><a routerLink="/citations">Read Citations</a></li> | ||
</ul> | ||
</nav> | ||
</header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@for (group of questionGroup(); track group.title) { | ||
<article class="mb-8" [attr.aria-labelledby]="group.title"> | ||
<h2 [id]="group.title" class="text-xl capitalize font-bold mb-2">{{ group.title }}</h2> | ||
|
||
@if (group.questions && group.questions.length >= 1) { | ||
|
||
@for (question of group.questions; track question.question) { | ||
<h3 class="text-lg font-bold mb-2">{{question.question}}</h3> | ||
<p>{{question.description}}</p> | ||
|
||
<div class="flex flex-col gap-2 mb-3"> | ||
@if (question.type === 'radio') { | ||
@for(answer of question.answers; track answer.answer) { | ||
<label class=""> | ||
<input type="radio" [value]="answer.value"> | ||
{{answer.answer}} | ||
</label> | ||
} | ||
} | ||
|
||
@if (question.type === 'checkbox') { | ||
@for(answer of question.answers; track answer.answer) { | ||
<label> | ||
<input type="checkbox" [value]="answer.value"> | ||
{{answer.answer}} | ||
</label> | ||
} | ||
} | ||
</div> | ||
} | ||
} | ||
</article> | ||
} |
23 changes: 23 additions & 0 deletions
23
src/app/quiz/question-group/question-group.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { QuestionGroupComponent } from './question-group.component'; | ||
|
||
describe('QuestionGroupComponent', () => { | ||
let component: QuestionGroupComponent; | ||
let fixture: ComponentFixture<QuestionGroupComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [QuestionGroupComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(QuestionGroupComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { Component, input } from '@angular/core'; | ||
import { IQuestionGroup } from '../../../interfaces/questions'; | ||
|
||
@Component({ | ||
selector: 'app-question-group', | ||
standalone: true, | ||
imports: [CommonModule], | ||
templateUrl: './question-group.component.html', | ||
styleUrl: './question-group.component.css' | ||
}) | ||
export class QuestionGroupComponent { | ||
questionGroup = input.required<IQuestionGroup[]>() | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<h1 class="page-heading">{{title}}</h1> | ||
|
||
<app-question-group [questionGroup]="screeningQuestions"></app-question-group> | ||
<app-question-group [questionGroup]="mitigationQuestions"></app-question-group> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { QuizComponent } from './quiz.component'; | ||
|
||
describe('QuizComponent', () => { | ||
let component: QuizComponent; | ||
let fixture: ComponentFixture<QuizComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [QuizComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(QuizComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { Component} from '@angular/core'; | ||
|
||
import { QuestionGroupComponent } from "./question-group/question-group.component"; | ||
import { IQuestionGroup } from '../../interfaces/questions'; | ||
|
||
import * as ScreeningJSON from '../../data/screening.json'; | ||
import * as MitigationJSON from '../../data/mitigation.json'; | ||
|
||
@Component({ | ||
selector: 'app-quiz', | ||
standalone: true, | ||
imports: [CommonModule, QuestionGroupComponent], | ||
templateUrl: './quiz.component.html', | ||
styleUrl: './quiz.component.css' | ||
}) | ||
export class QuizComponent { | ||
screeningQuestions: IQuestionGroup[] = ScreeningJSON.screening; | ||
mitigationQuestions: IQuestionGroup[] = MitigationJSON.mitigation; | ||
title = 'Quiz' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
{ | ||
"activities": [ | ||
{ | ||
"title": "activities", | ||
"questions": [ | ||
{ | ||
"question": "Do you do any of the following?", | ||
"description": "", | ||
"type": "checkbox", | ||
"answers": [ | ||
{ | ||
"answer": "Work", | ||
"value": 1 | ||
}, | ||
{ | ||
"answer": "School", | ||
"value": 1 | ||
}, | ||
{ | ||
"answer": "Attend events", | ||
"value": 1 | ||
}, | ||
{ | ||
"answer": "Attend social gatherings", | ||
"value": 1 | ||
}, | ||
{ | ||
"answer": "Run domestic errands", | ||
"value": 1 | ||
}, | ||
{ | ||
"answer": "Seek medical care", | ||
"value": 1 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"title": "activity details", | ||
"questions": [ | ||
{ | ||
"question": "are you attending:", | ||
"description": "", | ||
"type": "radio", | ||
"answers": [ | ||
{ | ||
"answer": "in person", | ||
"value": 2 | ||
}, | ||
{ | ||
"answer": "hybrid", | ||
"value": 1 | ||
}, | ||
{ | ||
"answer": "remote", | ||
"value": 0 | ||
} | ||
] | ||
}, | ||
{ | ||
"question": "are you attending:", | ||
"description": "", | ||
"type": "radio", | ||
"answers": [ | ||
{ | ||
"answer": "daily", | ||
"value": 4 | ||
}, | ||
{ | ||
"answer": "weekly", | ||
"value": 3 | ||
}, | ||
{ | ||
"answer": "monthly", | ||
"value": 2 | ||
}, | ||
{ | ||
"answer": "quarterly", | ||
"value": 1 | ||
}, | ||
{ | ||
"answer": "yearly", | ||
"value": 0 | ||
} | ||
] | ||
}, | ||
{ | ||
"question": "how many others are attending:", | ||
"description": "", | ||
"type": "radio", | ||
"answers": [ | ||
{ | ||
"answer": "35+", | ||
"value": 4 | ||
}, | ||
{ | ||
"answer": "20 - 35", | ||
"value": 3 | ||
}, | ||
{ | ||
"answer": "10 - 19", | ||
"value": 2 | ||
}, | ||
{ | ||
"answer": "4 - 9", | ||
"value": 1 | ||
}, | ||
{ | ||
"answer": "0 - 3", | ||
"value": 0 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"title": "ventilation", | ||
"questions": [ | ||
{ | ||
"question": "Are you able to improve air quality with good ventilation?", | ||
"description": "", | ||
"type": "checkbox", | ||
"answers": [ | ||
{ | ||
"answer": "Outside, with a breeze", | ||
"value": 6 | ||
}, | ||
{ | ||
"answer": "Inside, maintaining an optimal humidity level, between 30% and 50%", | ||
"value": 5 | ||
}, | ||
{ | ||
"answer": "Inside, running exhaust fans that are vented to the outside", | ||
"value": 3 | ||
}, | ||
{ | ||
"answer": "Inside, air purifier with HEPA or MERV≥13 filter", | ||
"value": 3 | ||
}, | ||
{ | ||
"answer": "Inside, air purifier with HEPA or MERV≥13 filter, with high enough CADR for the space", | ||
"value": 4 | ||
}, | ||
{ | ||
"answer": "Inside, open windows", | ||
"value": 2 | ||
}, | ||
{ | ||
"answer": "Inside, large space with distance from others", | ||
"value": 2 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.