-
Notifications
You must be signed in to change notification settings - Fork 276
/
text-editor.component.html
120 lines (120 loc) · 6.69 KB
/
text-editor.component.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<div [id]="'exercise-' + textExercise?.id">
@if (displayHeader) {
<jhi-header-participation-page class="d-block mb-4" [exercise]="textExercise" [participation]="participation">
<span pagetitle>
{{ 'artemisApp.textSubmission.textEditor' | artemisTranslate }}:
<span class="font-weight-normal">{{ examMode ? textExercise.exerciseGroup?.title : textExercise?.title }}</span>
</span>
<ng-container submitbutton>
@if (isOwnerOfParticipation) {
<jhi-button
id="submit"
[title]="!isAllowedToSubmitAfterDueDate ? 'entity.action.submit' : 'entity.action.submitDueDateMissed'"
(onClick)="submit()"
[disabled]="!isActive || !submission"
[isLoading]="isSaving"
[btnType]="isAllowedToSubmitAfterDueDate ? ButtonType.WARNING : ButtonType.PRIMARY"
[tooltip]="submitButtonTooltip"
/>
}
</ng-container>
</jhi-header-participation-page>
}
<!--resizable container-->
@if (textExercise) {
<jhi-resizeable-container [isExerciseParticipation]="true" [expandProblemStatement]="expandProblemStatement">
<!--region Left Panel-->
<div left-body class="text-editor-grid ps-2 pb-2 w-100">
@if (textExercise?.teamMode && isActive) {
<div class="grid-area-team-info pb-4 ps-md-2">
<jhi-team-participate-info-box [exercise]="textExercise" [participation]="participation" [typing$]="textEditorInputObservable" [dockedToRightSide]="true" />
</div>
}
<div class="grid-area-main">
<div>
<span class="badge bg-primary mb-2" id="word-count">
{{ 'artemisApp.textExercise.wordCount' | artemisTranslate: { count: wordCount } }}
</span>
<span class="badge bg-primary mb-2" id="character-count">
{{ 'artemisApp.textExercise.characterCount' | artemisTranslate: { count: characterCount } }}
</span>
</div>
@if (!result) {
<textarea
id="text-editor"
#textEditor
class="text-editor-textarea"
[maxLength]="maxCharacterCount"
[(ngModel)]="answer"
[readOnly]="!isActive || !submission || !isOwnerOfParticipation"
[disabled]="!isActive || !submission || !isOwnerOfParticipation"
(keydown.tab)="onTextEditorTab(textEditor, $event)"
(input)="onTextEditorInput($event)"
></textarea>
@if (textExercise?.teamMode) {
<jhi-team-submission-sync
[exerciseType]="textExercise.type!"
[submissionObservable]="submissionObservable"
[participation]="participation"
(receiveSubmission)="onReceiveSubmissionFromTeam($event)"
/>
}
} @else {
@if (!result.feedbacks?.length) {
<div class="row">
<div class="col-md-12 col-lg-10 col-xl-8">
<b [jhiTranslate]="'artemisApp.textExercise.submission'">Submission:</b>
<hr />
<jhi-text-result [result]="result" [course]="course" />
<hr />
<i [jhiTranslate]="'artemisApp.textExercise.assessmentPending'">Assessment pending</i>
</div>
</div>
} @else {
<div class="row">
<div class="col-md-12 col-lg-10 col-xl-8">
<b>
{{
isOwnerOfParticipation
? ('artemisApp.textExercise.assessedSubmission' | artemisTranslate)
: ('artemisApp.textExercise.assessedSubmissionInstructor' | artemisTranslate)
}}:
</b>
<hr />
<jhi-text-result [result]="result" [course]="course" />
<hr />
</div>
@if (unreferencedFeedback && unreferencedFeedback!.length > 0) {
<jhi-additional-feedback
class="col-xl-8 alert unreferencedFeedback"
[feedback]="unreferencedFeedback || []"
[additional]="true"
[course]="course"
/>
}
@if (isOwnerOfParticipation) {
<jhi-rating class="col-md-12 col-lg-10 col-xl-8 mt-2 alert alert-info" [result]="result" />
}
</div>
}
}
@if (textExercise && result && participation && !examMode) {
<jhi-complaint-student-view [exercise]="textExercise" [result]="resultWithComplaint ? resultWithComplaint : result" [participation]="participation" />
}
</div>
</div>
<!--endregion-->
<!--region Right Panel-->
<fa-icon right-header [icon]="farListAlt" />
<span id="problem-statement" right-header jhiTranslate="artemisApp.exercise.problemStatement">Problem Statement</span>
<ng-container right-body>
@if (textExercise!.problemStatement) {
<p class="markdown-preview mb-3">
<span [innerHTML]="textExercise!.problemStatement! | htmlForMarkdown"></span>
</p>
}
</ng-container>
<!--endregion-->
</jhi-resizeable-container>
}
</div>