From 6394135b0099ba2602adf122308b0cc6044360cd Mon Sep 17 00:00:00 2001 From: Matti Lupari Date: Tue, 6 Feb 2024 05:35:01 +0200 Subject: [PATCH] CSCEXAM-000 Formatting and lint fixes --- .../examination/examination.component.html | 40 +- .../app/examination/examination.component.ts | 24 +- .../examination-toolbar.component.html | 376 +++++++++--------- .../section/examination-section.component.ts | 2 +- .../review/assessment/assessment.service.ts | 2 +- .../assessment/feedback/feedback.component.ts | 5 +- .../feedback/statement.component.ts | 4 +- 7 files changed, 226 insertions(+), 227 deletions(-) diff --git a/ui/src/app/examination/examination.component.html b/ui/src/app/examination/examination.component.html index bad6c4c9e..94e50e826 100644 --- a/ui/src/app/examination/examination.component.html +++ b/ui/src/app/examination/examination.component.html @@ -4,20 +4,20 @@ }
- -
- - @if (exam) { - - - } -
+ +
+ + @if (exam) { + + + } +
- -
diff --git a/ui/src/app/examination/examination.component.ts b/ui/src/app/examination/examination.component.ts index 8fd6752e0..12f83ea2e 100644 --- a/ui/src/app/examination/examination.component.ts +++ b/ui/src/app/examination/examination.component.ts @@ -26,20 +26,20 @@ import { AnswerInstructionsComponent } from './instructions/answer-instructions. import { ExaminationNavigationComponent } from './navigation/examination-navigation.component'; import { ExaminationToolbarComponent } from './navigation/examination-toolbar.component'; import { ExaminationSectionComponent } from './section/examination-section.component'; -import {TranslateModule} from "@ngx-translate/core"; +import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'xm-examination', templateUrl: './examination.component.html', standalone: true, - imports: [ - ExaminationHeaderComponent, - ExaminationSectionComponent, - AnswerInstructionsComponent, - ExaminationNavigationComponent, - ExaminationToolbarComponent, - TranslateModule, - ], + imports: [ + ExaminationHeaderComponent, + ExaminationSectionComponent, + AnswerInstructionsComponent, + ExaminationNavigationComponent, + ExaminationToolbarComponent, + TranslateModule, + ], }) export class ExaminationComponent implements OnInit, OnDestroy { isCollaborative = false; @@ -103,9 +103,9 @@ export class ExaminationComponent implements OnInit, OnDestroy { ) .subscribe(); - getSkipLinkPath = (skipTarget: string) => { - return window.location.toString().includes(skipTarget) ? window.location : window.location + skipTarget; - }; + getSkipLinkPath = (skipTarget: string) => { + return window.location.toString().includes(skipTarget) ? window.location : window.location + skipTarget; + }; private logout = (msg: string, canFail: boolean) => this.Examination.logout(msg, this.exam.hash, this.exam.implementation === 'CLIENT_AUTH', canFail); diff --git a/ui/src/app/examination/navigation/examination-toolbar.component.html b/ui/src/app/examination/navigation/examination-toolbar.component.html index c5756d808..4e92c6253 100644 --- a/ui/src/app/examination/navigation/examination-toolbar.component.html +++ b/ui/src/app/examination/navigation/examination-toolbar.component.html @@ -1,210 +1,216 @@
- -
- -
-
- {{ displayUser() }} + +
+ +
+
+ {{ displayUser() }} +
-
-
- -
-
-
-
-
-@if (exam.course) { -
-
-
{{ exam.course.name }}
+
+ +
+
+
+
-
-} - - -
- -
- {{ exam.attachment?.fileName | uppercase | slice: 0 : 50 }} -
-
+ @if (exam.course) { +
+
+
{{ exam.course.name }}
+
+
+ } -
-
-
    -
  • +
    + - -
  • + {{ 'i18n_open_it' | translate }} {{ 'i18n_exam_attachment' | translate }} + attachment + +
    + {{ exam.attachment?.fileName | uppercase | slice: 0 : 50 }} +
    +
- @for (section of exam.examSections | orderBy: 'sequenceNumber'; track section; let i = $index) { -
  • -
    - @if (getQuestionAmount(section, 'answered') === getQuestionAmount(section, 'total')) { -
    - {{ 'i18n_all_questions_answered' | translate }} -
    - } - @if (getQuestionAmount(section, 'answered') !== getQuestionAmount(section, 'total')) { -
    - {{ 'i18n_unanswered_questions_remain' | translate }} -
    - } -
    -
    - - {{ i + 1 }}. {{ section.name }} - -
    -
    - - {{ 'i18n_number_of_answered_questions' | translate }} - {{ getQuestionAmount(section, 'answered') }} - / - {{ getQuestionAmount(section, 'total') }} - - -
    -
  • - } - -
    -
    + - -
    -
    - + +
    + + } +
    - -
    -
    +
    - -
    -
    - -
    -
    -
    - + +
    + +
    + +
    +
    + +
    +
    -
    - -
    - -
    -
    - -
    -
    +
    + +
    +
    + +
    +
    - -
    -
    - -
    -
    -
    + +
    +
    + +
    +
    +
    diff --git a/ui/src/app/examination/section/examination-section.component.ts b/ui/src/app/examination/section/examination-section.component.ts index 07d838e9f..a8a8822b9 100644 --- a/ui/src/app/examination/section/examination-section.component.ts +++ b/ui/src/app/examination/section/examination-section.component.ts @@ -60,7 +60,7 @@ import { ExaminationQuestionComponent } from '../question/examination-question.c } - +
    @for (material of section.examMaterials; track material) { diff --git a/ui/src/app/review/assessment/assessment.service.ts b/ui/src/app/review/assessment/assessment.service.ts index 0dc9452ca..e833709d6 100644 --- a/ui/src/app/review/assessment/assessment.service.ts +++ b/ui/src/app/review/assessment/assessment.service.ts @@ -26,7 +26,7 @@ import { isRealGrade } from '../../exam/exam.model'; import { SessionService } from '../../session/session.service'; import { ConfirmationDialogService } from '../../shared/dialogs/confirmation-dialog.service'; import { CommonExamService } from '../../shared/miscellaneous/common-exam.service'; -import { Point } from 'chart.js'; +import { Point } from '@angular/cdk/drag-drop'; type Payload = { id: number; diff --git a/ui/src/app/review/assessment/feedback/feedback.component.ts b/ui/src/app/review/assessment/feedback/feedback.component.ts index 484be25fc..faa3f6eae 100644 --- a/ui/src/app/review/assessment/feedback/feedback.component.ts +++ b/ui/src/app/review/assessment/feedback/feedback.component.ts @@ -12,7 +12,7 @@ * on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the Licence for the specific language governing permissions and limitations under the Licence. */ -import { CdkDrag, Point } from '@angular/cdk/drag-drop'; +import { CdkDrag } from '@angular/cdk/drag-drop'; import { NgClass } from '@angular/common'; import { Component, Input, OnInit } from '@angular/core'; import { FormsModule } from '@angular/forms'; @@ -93,6 +93,7 @@ export class FeedbackComponent implements OnInit { feedbackComment = ''; title = ''; + fixPosition = this.Assessment.fixPosition; hideEditor = false; id = 0; ref = ''; @@ -153,8 +154,6 @@ export class FeedbackComponent implements OnInit { } }; - fixPosition = this.Assessment.fixPosition; - private _saveFeedback$ = () => this.Assessment.saveFeedback$(this.exam); private _saveCollaborativeFeedback$ = () => diff --git a/ui/src/app/review/assessment/feedback/statement.component.ts b/ui/src/app/review/assessment/feedback/statement.component.ts index 53b0fb5e7..c2479a27b 100644 --- a/ui/src/app/review/assessment/feedback/statement.component.ts +++ b/ui/src/app/review/assessment/feedback/statement.component.ts @@ -93,6 +93,8 @@ import { AssessmentService } from '../assessment.service'; }) export class StatementComponent { @Input() exam!: Exam; + + fixPosition = this.Assessment.fixPosition; hideEditor = false; constructor( @@ -124,6 +126,4 @@ export class StatementComponent { }), ); }; - - fixPosition = this.Assessment.fixPosition; }