Skip to content

Commit

Permalink
Fix examination question hide button accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
VirmasaloA committed Sep 3, 2024
1 parent 59bdc54 commit 900cc93
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ <h2 class="participation-heading">
>
<span [hidden]="showEvaluation">{{ 'i18n_comments_open' | translate }}</span>
<span [hidden]="!showEvaluation">{{ 'i18n_comments_hide' | translate }}</span>
<i [hidden]="showEvaluation" class="bi bi-chevron-right ms-2" alt="hide evaluation"></i>
<i [hidden]="!showEvaluation" class="bi bi-chevron-down ms-2" alt="show evaluation"></i>
<i [hidden]="showEvaluation" class="bi bi-chevron-right ms-2" alt=""></i>
<i [hidden]="!showEvaluation" class="bi bi-chevron-down ms-2" alt=""></i>
</button>
</div>
</div>
Expand Down
12 changes: 2 additions & 10 deletions ui/src/app/exam/editor/sections/section-question.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,8 @@
>
<span [hidden]="sectionQuestion.expanded">{{ 'i18n_show_more' | translate }}</span>
<span [hidden]="!sectionQuestion.expanded">{{ 'i18n_hide' | translate }}</span>
<i
[hidden]="sectionQuestion.expanded"
class="bi bi-chevron-right ms-2"
alt="hide evaluation"
></i>
<i
[hidden]="!sectionQuestion.expanded"
class="bi bi-chevron-down ms-2"
alt="show evaluation"
></i>
<i [hidden]="sectionQuestion.expanded" class="bi bi-chevron-right ms-2" alt=""></i>
<i [hidden]="!sectionQuestion.expanded" class="bi bi-chevron-down ms-2" alt=""></i>
</button>
}
</div>
Expand Down
27 changes: 14 additions & 13 deletions ui/src/app/examination/question/examination-question.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,21 @@
</div>
}
</div>
<!-- Expand button -->
<div class="col-auto order-2">
<button
tabindex="0"
class="pointer section-box-title arrow border-none background-none"
[attr.aria-label]="expanded ? ('i18n_collapse' | translate) : ('i18n_expand' | translate)"
[attr.aria-expanded]="expanded"
(click)="expanded = !expanded"
(keydown.enter)="expanded = !expanded"
>
<i [ngClass]="expanded ? 'bi-chevron-down' : 'bi-chevron-right'"></i>
</button>
</div>
<!-- question text -->
<div class="col mt-3">
<div class="col mt-3 order-1">
@if (sq.question.type !== 'ClozeTestQuestion') {
@if (expanded) {
<div class="section-box-title" [xmMathJax]="sq.question.question"></div>
Expand All @@ -32,18 +45,6 @@
</div>
}
</div>
<!-- Expand button -->
<div class="col-auto">
<div
tabindex="0"
class="pointer section-box-title arrow"
[attr.aria-label]="expanded ? ('i18n_collapse' | translate) : ('i18n_expand' | translate)"
(click)="expanded = !expanded"
(keydown.enter)="expanded = !expanded"
>
<i [ngClass]="expanded ? 'bi-chevron-down' : 'bi-chevron-right'"></i>
</div>
</div>
</div>
<!-- instruction -->
@if (sq.answerInstructions && expanded) {
Expand Down

0 comments on commit 900cc93

Please sign in to comment.