Skip to content

Commit

Permalink
Merge branch 'dev' into CSCEXAM-1389
Browse files Browse the repository at this point in the history
  • Loading branch information
VirmasaloA authored Jan 10, 2025
2 parents 59b3438 + 61826fc commit 6b73636
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 71 deletions.
100 changes: 52 additions & 48 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,55 @@ name: Build
on: [push]

jobs:
build:
runs-on: ubuntu-latest

services:
postgres:
image: postgres
env:
POSTGRES_DB: exam_test
POSTGRES_USER: exam
POSTGRES_PASSWORD: exam
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Check REUSE compliance
uses: fsfe/reuse-action@v4

- name: Build UI
run: |
rm -rf node_modules
npm i
npm run check-format
npm run check-lint
npm run build
- name: Build backend and run tests
run: |
sed -i 's/\/var\/log\/exam/logs/g' $GITHUB_WORKSPACE/conf/logback.xml
sbt test
build:
runs-on: ubuntu-latest

services:
postgres:
image: postgres
env:
POSTGRES_DB: exam_test
POSTGRES_USER: exam
POSTGRES_PASSWORD: exam
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
cache: sbt

- name: Set up SBT
uses: sbt/setup-sbt@v1

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Check REUSE compliance
uses: fsfe/reuse-action@v4

- name: Build UI
run: |
rm -rf node_modules
npm i
npm run check-format
npm run check-lint
npm run build
- name: Build backend and run tests
run: |
sed -i 's/\/var\/log\/exam/logs/g' $GITHUB_WORKSPACE/conf/logback.xml
sbt test
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ import { QuestionService } from 'src/app/question/question.service';
</div>
@if (allowRemoval) {
<div (click)="removeOption()" class="col-md-1 question-option-trash">
<button (click)="removeOption()" class="col-md-1 question-option-trash btn btn-link">
<i class="bi-trash" title="{{ 'i18n_remove' | translate }}"></i>
</div>
</button>
}
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions ui/src/app/question/basequestion/multiple-choice.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ import { WeightedMultipleChoiceOptionEditorComponent } from './weighted-multiple
}
<div class="row mt-3">
<div class="col-md-12">
<a (click)="addNewOption()" class="attachment-link pointer">
<button (click)="addNewOption()" class="attachment-link pointer btn btn-sm btn-link">
<i class="bi-plus"></i>
{{ 'i18n_question_add_new_option' | translate }}
</a>
</button>
</div>
</div>
`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,13 @@ import { FixedPrecisionValidatorDirective } from 'src/app/shared/validation/fixe
[disabled]="lotteryOn"
/>
</div>
<div class="col-md-1 question-option-trash pointer" [hidden]="lotteryOn" (click)="removeOption()">
<button
class="col-md-1 question-option-trash pointer btn btn-link "
[hidden]="lotteryOn"
(click)="removeOption()"
>
<i class="bi-trash" title="{{ 'i18n_remove' | translate }}"></i>
</div>
</button>
</div>
</div>
`,
Expand Down
8 changes: 6 additions & 2 deletions ui/src/app/question/examquestion/multichoice.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ import { ExamSectionQuestionOption } from 'src/app/question/question.model';
/>
}
</div>
<div [hidden]="lotteryOn()" (click)="removeOption(option)" class="col-md-1 question-option-trash">
<button
[hidden]="lotteryOn()"
(click)="removeOption(option)"
class="col-md-1 question-option-trash btn btn-link"
>
<i class="bi-trash" title="{{ 'i18n_remove' | translate }}"></i>
</div>
</button>
</div>
}
<div class="row mt-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ import { ExamSectionQuestionOption } from 'src/app/question/question.model';
[disabled]="lotteryOn()"
/>
</div>
<div
class="col-md-1 question-option-trash pointer"
<button
class="col-md-1 question-option-trash pointer btn btn-link"
[hidden]="lotteryOn()"
(click)="removeOption(option)"
>
<i class="bi-trash" title="{{ 'i18n_remove' | translate }}"></i>
</div>
</button>
</div>
}
<div class="row">
Expand All @@ -98,10 +98,10 @@ import { ExamSectionQuestionOption } from 'src/app/question/question.model';
</div>
<div class="row mt-2">
<div class="col-md-12">
<a (click)="addNewOption()" class="attachment-link pointer">
<button (click)="addNewOption()" class="attachment-link pointer btn btn-sm btn-link">
<i class="bi-plus"></i>
{{ 'i18n_question_add_new_option' | translate }}
</a>
</button>
</div>
</div>
`,
Expand Down
8 changes: 4 additions & 4 deletions ui/src/app/review/assessment/assessment.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ <h3>
<xm-course-code [course]="exam.course"></xm-course-code> -
}
{{ exam.name }}
<a class="pointer" (click)="hideGeneralInfo = !hideGeneralInfo">
<button class="pointer btn btn-link" (click)="hideGeneralInfo = !hideGeneralInfo">
@if (hideGeneralInfo) {
<img src="/assets/images/icon_list_show_right.svg" alt="" />
}
@if (!hideGeneralInfo) {
<img src="/assets/images/icon_list_show_down.svg" alt="" />
}
</a>
</button>
</h3>
<!-- General Information -->
<div class="row" [ngbCollapse]="hideGeneralInfo">
Expand Down Expand Up @@ -57,12 +57,12 @@ <h3>
<h4 class="row mt-2">
<div class="col-12">
{{ 'i18n_grading_info' | translate }}
<a (click)="hideGradeInfo = !hideGradeInfo">
<button class="btn btn-link" (click)="hideGradeInfo = !hideGradeInfo">
@if (hideGradeInfo) {
<img src="/assets/images/icon_list_show_right.svg" alt="" />
}
<img [hidden]="hideGradeInfo" src="/assets/images/icon_list_show_down.svg" alt="" />
</a>
</button>
</div>
</h4>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
<div class="col-md-12">
<!-- question text -->
<div class="float-end">
<a class="float-end" (click)="reviewExpanded = !reviewExpanded" [attr.aria-expanded]="reviewExpanded">
<button
class="float-end btn btn-link"
(click)="reviewExpanded = !reviewExpanded"
[attr.aria-expanded]="reviewExpanded"
>
@if (!reviewExpanded) {
<img src="/assets/images/icon_list_show_right.svg" alt="" />
}
@if (reviewExpanded) {
<img src="/assets/images/icon_list_show_down.svg" alt="" />
}
</a>
</button>
<!-- grade -->
<div class="pe-3 me-2">
<!-- grade -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
</div>
}
<!--chevron -->
<a
<button
class="float-end btn btn-link"
(click)="reviewExpanded = !reviewExpanded"
[attr.aria-label]="reviewExpanded ? ('i18n_collapse' | translate) : ('i18n_expand' | translate)"
>
Expand All @@ -57,7 +58,7 @@
@if (reviewExpanded) {
<img src="/assets/images/icon_list_show_down.svg" alt="" />
}
</a>
</button>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@
/ {{ getCorrectClaimChoiceOptionScore() }} {{ 'i18n_unit_points' | translate }}
</div>
}
<a class="d-inline-block" (click)="reviewExpanded = !reviewExpanded">
<button class="d-inline-block btn btn-link" (click)="reviewExpanded = !reviewExpanded">
@if (!reviewExpanded) {
<img src="/assets/images/icon_list_show_right.svg" alt="" />
}
@if (reviewExpanded) {
<img src="/assets/images/icon_list_show_down.svg" alt="" />
}
</a>
</button>
</div>
</div>

Expand Down

0 comments on commit 6b73636

Please sign in to comment.