-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make button separated from rubric table
- Loading branch information
Showing
2 changed files
with
58 additions
and
44 deletions.
There are no files selected for viewing
93 changes: 49 additions & 44 deletions
93
.../question-types/question-edit-answer-form/rubric-question-edit-answer-form.component.html
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,58 +1,63 @@ | ||
<table class="table table-bordered desktop-view" [attr.aria-label]="getAriaLabel()"> | ||
<thead> | ||
<tr> | ||
<td></td> | ||
<th *ngFor="let choice of questionDetails.rubricChoices" scope="col">{{ choice }}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr *ngFor="let rubricDescriptionRow of questionDetails.rubricDescriptions; let i = index;" | ||
[ngClass]="{ 'row-answered': i < responseDetails.answer.length && responseDetails.answer[i] !== RUBRIC_ANSWER_NOT_CHOSEN }"> | ||
<th class="fw-normal" scope="row">{{ questionDetails.rubricSubQuestions[i] }}</th> | ||
<td *ngFor="let rubricDescriptionCell of rubricDescriptionRow; let j = index;" class="text-secondary answer-cell" (click)="selectAnswer(i, j)"> | ||
<input | ||
type="radio" | ||
[disabled]="isDisabled" | ||
[name]="getInputId(id, i, j, 'desktop')" | ||
[id]="getInputId(id, i, j, 'desktop')" | ||
[checked]="i < responseDetails.answer.length && responseDetails.answer[i] === j" | ||
/> | ||
<label [for]="getInputId(id, i, j, 'desktop')" (click)="$event.stopPropagation()"> | ||
{{ rubricDescriptionCell }} | ||
</label> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<div class="mobile-view" [attr.aria-label]="getAriaLabel()"> | ||
<div class="card" *ngFor="let rubricDescriptionRow of questionDetails.rubricDescriptions; let i = index;"> | ||
<div class="card-header bg-light"> | ||
{{ questionDetails.rubricSubQuestions[i] }} | ||
</div> | ||
<div class="card-body" | ||
[ngClass]="{ 'row-answered': i < responseDetails.answer.length && responseDetails.answer[i] !== RUBRIC_ANSWER_NOT_CHOSEN }"> | ||
<div *ngFor="let rubricDescriptionCell of rubricDescriptionRow; let j = index;"> | ||
<label> | ||
<div class="table-container"> | ||
<table class="table table-bordered desktop-view" [attr.aria-label]="getAriaLabel()"> | ||
<thead> | ||
<tr> | ||
<td></td> | ||
<th *ngFor="let choice of questionDetails.rubricChoices" scope="col">{{ choice }}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr *ngFor="let rubricDescriptionRow of questionDetails.rubricDescriptions; let i = index;" | ||
[ngClass]="{ 'row-answered': i < responseDetails.answer.length && responseDetails.answer[i] !== RUBRIC_ANSWER_NOT_CHOSEN }"> | ||
<th class="fw-normal" scope="row">{{ questionDetails.rubricSubQuestions[i] }}</th> | ||
<td *ngFor="let rubricDescriptionCell of rubricDescriptionRow; let j = index;" class="text-secondary answer-cell" (click)="selectAnswer(i, j)"> | ||
<input | ||
type="radio" | ||
[disabled]="isDisabled" | ||
(click)="selectAnswer(i, j)" | ||
[name]="getInputId(id, i, j, 'mobile')" | ||
[name]="getInputId(id, i, j, 'desktop')" | ||
[id]="getInputId(id, i, j, 'desktop')" | ||
[checked]="i < responseDetails.answer.length && responseDetails.answer[i] === j" | ||
[attr.aria-label]="getAriaLabelForChoice(questionDetails.rubricChoices[j], rubricDescriptionCell, questionDetails.rubricSubQuestions[i])" | ||
> | ||
{{ getChoiceWithDescription(questionDetails.rubricChoices[j], rubricDescriptionCell) }} | ||
</label> | ||
/> | ||
<label [for]="getInputId(id, i, j, 'desktop')" (click)="$event.stopPropagation()"> | ||
{{ rubricDescriptionCell }} | ||
</label> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<div class="mobile-view" [attr.aria-label]="getAriaLabel()"> | ||
<div class="card" *ngFor="let rubricDescriptionRow of questionDetails.rubricDescriptions; let i = index;"> | ||
<div class="card-header bg-light"> | ||
{{ questionDetails.rubricSubQuestions[i] }} | ||
</div> | ||
<div class="card-body" | ||
[ngClass]="{ 'row-answered': i < responseDetails.answer.length && responseDetails.answer[i] !== RUBRIC_ANSWER_NOT_CHOSEN }"> | ||
<div *ngFor="let rubricDescriptionCell of rubricDescriptionRow; let j = index;"> | ||
<label> | ||
<input | ||
type="radio" | ||
[disabled]="isDisabled" | ||
(click)="selectAnswer(i, j)" | ||
[name]="getInputId(id, i, j, 'mobile')" | ||
[checked]="i < responseDetails.answer.length && responseDetails.answer[i] === j" | ||
[attr.aria-label]="getAriaLabelForChoice(questionDetails.rubricChoices[j], rubricDescriptionCell, questionDetails.rubricSubQuestions[i])" | ||
> | ||
{{ getChoiceWithDescription(questionDetails.rubricChoices[j], rubricDescriptionCell) }} | ||
</label> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<button | ||
|
||
<div class="button-container"> | ||
<button | ||
type="button" | ||
title="Reset choices" | ||
id="btn-reset" | ||
name="button-reset" | ||
class="btn btn-secondary" | ||
(click)="confirmReset()"> | ||
Reset choices | ||
</button> | ||
Reset choices | ||
</button> | ||
</div> |
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