-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exam mode: Add save exercise button to exercises (#9569)
- Loading branch information
Showing
22 changed files
with
343 additions
and
87 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
8 changes: 8 additions & 0 deletions
8
...p/app/exam/participate/exercises/exercise-save-button/exercise-save-button.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<button id="save-exam" type="submit" [disabled]="submission()?.isSynced" class="btn btn-primary" (click)="onSave()"> | ||
<fa-icon class="saved" [fixedWidth]="true" [icon]="submission()?.submitted && submission()?.isSynced ? facSaveSuccess : faFloppyDisk"> </fa-icon> | ||
<span | ||
class="d-none d-sm-inline" | ||
[jhiTranslate]="submission()?.submitted && submission()?.isSynced ? 'artemisApp.examParticipation.exerciseSaved' : 'artemisApp.examParticipation.saveExercise'" | ||
> | ||
</span> | ||
</button> |
3 changes: 3 additions & 0 deletions
3
...p/app/exam/participate/exercises/exercise-save-button/exercise-save-button.component.scss
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,3 @@ | ||
.saved { | ||
--fa-secondary-opacity: 1; | ||
} |
25 changes: 25 additions & 0 deletions
25
...app/app/exam/participate/exercises/exercise-save-button/exercise-save-button.component.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,25 @@ | ||
import { Component, input, output } from '@angular/core'; | ||
import { FaIconComponent } from '@fortawesome/angular-fontawesome'; | ||
import { faFloppyDisk } from '@fortawesome/free-solid-svg-icons'; | ||
import { facSaveSuccess } from '../../../../../content/icons/icons'; | ||
import { Submission } from 'app/entities/submission.model'; | ||
import { TranslateDirective } from 'app/shared/language/translate.directive'; | ||
|
||
@Component({ | ||
selector: 'jhi-exercise-save-button', | ||
templateUrl: './exercise-save-button.component.html', | ||
styleUrls: ['./exercise-save-button.component.scss'], | ||
standalone: true, | ||
imports: [FaIconComponent, TranslateDirective], | ||
}) | ||
export class ExerciseSaveButtonComponent { | ||
protected readonly faFloppyDisk = faFloppyDisk; | ||
protected readonly facSaveSuccess = facSaveSuccess; | ||
|
||
submission = input<Submission>(); | ||
save = output<void>(); | ||
|
||
onSave() { | ||
this.save.emit(); | ||
} | ||
} |
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
17 changes: 9 additions & 8 deletions
17
src/main/webapp/app/exam/participate/exercises/quiz/quiz-exam-submission.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
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
Oops, something went wrong.