|
4 | 4 | <p><core-format-text [component]="component" [componentId]="componentId" [text]="question.text" [contextLevel]="contextLevel" [contextInstanceId]="contextInstanceId" [courseId]="courseId"></core-format-text></p> |
5 | 5 | </ion-item> |
6 | 6 |
|
7 | | - <!-- Textarea. --> |
8 | | - <ion-item *ngIf="question.textarea && (!question.hasDraftFiles || uploadFilesSupported)"> |
9 | | - <!-- "Format" and draftid hidden inputs --> |
10 | | - <input item-content *ngIf="question.formatInput" type="hidden" [name]="question.formatInput.name" [value]="question.formatInput.value" > |
11 | | - <input item-content *ngIf="question.answerDraftIdInput" type="hidden" [name]="question.answerDraftIdInput.name" [value]="question.answerDraftIdInput.value" > |
12 | | - <!-- Plain text textarea. --> |
13 | | - <ion-textarea *ngIf="question.isPlainText" class="core-question-textarea" [ngClass]='{"core-monospaced": question.isMonospaced}' placeholder="{{ 'core.question.answer' | translate }}" [attr.name]="question.textarea.name" aria-multiline="true" [ngModel]="question.textarea.text"></ion-textarea> |
14 | | - <!-- Rich text editor. --> |
15 | | - <core-rich-text-editor item-content *ngIf="!question.isPlainText" placeholder="{{ 'core.question.answer' | translate }}" [control]="formControl" [name]="question.textarea.name" [component]="component" [componentId]="componentId" [autoSave]="false"></core-rich-text-editor> |
16 | | - </ion-item> |
17 | | - |
18 | | - <!-- Draft files not supported. --> |
19 | | - <ng-container *ngIf="question.textarea && question.hasDraftFiles && !uploadFilesSupported"> |
20 | | - <ion-item text-wrap class="core-danger-item"> |
21 | | - <p class="core-question-warning">{{ 'core.question.errorembeddedfilesnotsupportedinsite' | translate }}</p> |
22 | | - </ion-item> |
23 | | - <ion-item text-wrap> |
24 | | - <p><core-format-text [component]="component" [componentId]="componentId" [text]="question.textarea.text" [contextLevel]="contextLevel" [contextInstanceId]="contextInstanceId" [courseId]="courseId"></core-format-text></p> |
| 7 | + <!-- Editing the question. --> |
| 8 | + <ng-container *ngIf="!review"> |
| 9 | + <!-- Textarea. --> |
| 10 | + <ion-item *ngIf="question.textarea && (!question.hasDraftFiles || uploadFilesSupported)"> |
| 11 | + <!-- "Format" and draftid hidden inputs --> |
| 12 | + <input item-content *ngIf="question.formatInput" type="hidden" [name]="question.formatInput.name" [value]="question.formatInput.value" > |
| 13 | + <input item-content *ngIf="question.answerDraftIdInput" type="hidden" [name]="question.answerDraftIdInput.name" [value]="question.answerDraftIdInput.value" > |
| 14 | + <!-- Plain text textarea. --> |
| 15 | + <ion-textarea *ngIf="question.isPlainText" class="core-question-textarea" [ngClass]='{"core-monospaced": question.isMonospaced}' placeholder="{{ 'core.question.answer' | translate }}" [attr.name]="question.textarea.name" aria-multiline="true" [ngModel]="question.textarea.text"></ion-textarea> |
| 16 | + <!-- Rich text editor. --> |
| 17 | + <core-rich-text-editor item-content *ngIf="!question.isPlainText" placeholder="{{ 'core.question.answer' | translate }}" [control]="formControl" [name]="question.textarea.name" [component]="component" [componentId]="componentId" [autoSave]="false"></core-rich-text-editor> |
25 | 18 | </ion-item> |
26 | | - </ng-container> |
27 | | - |
28 | | - <!-- Attachments. --> |
29 | | - <ng-container *ngIf="question.allowsAttachments"> |
30 | | - <core-attachments *ngIf="uploadFilesSupported && question.attachmentsDraftIdInput" [files]="attachments" [component]="component" [componentId]="componentId" [maxSize]="question.attachmentsMaxBytes" [maxSubmissions]="question.attachmentsMaxFiles" [allowOffline]="offlineEnabled" [acceptedTypes]="question.attachmentsAcceptedTypes"></core-attachments> |
31 | | - |
32 | | - <core-files *ngIf="uploadFilesSupported && !question.attachmentsDraftIdInput" [files]="attachments" [component]="component" [componentId]="componentId"></core-files> |
33 | 19 |
|
34 | | - <input item-content *ngIf="question.attachmentsDraftIdInput" type="hidden" [name]="question.attachmentsDraftIdInput.name" [value]="question.attachmentsDraftIdInput.value" > |
35 | | - |
36 | | - <!-- Attachments not supported in this site. --> |
37 | | - <ion-item text-wrap *ngIf="!uploadFilesSupported" class="core-danger-item"> |
38 | | - <p class="core-question-warning">{{ 'core.question.errorattachmentsnotsupportedinsite' | translate }}</p> |
39 | | - </ion-item> |
| 20 | + <!-- Draft files not supported. --> |
| 21 | + <ng-container *ngIf="question.textarea && question.hasDraftFiles && !uploadFilesSupported"> |
| 22 | + <ion-item text-wrap class="core-danger-item"> |
| 23 | + <p class="core-question-warning">{{ 'core.question.errorembeddedfilesnotsupportedinsite' | translate }}</p> |
| 24 | + </ion-item> |
| 25 | + <ion-item text-wrap> |
| 26 | + <p><core-format-text [component]="component" [componentId]="componentId" [text]="question.textarea.text" [contextLevel]="contextLevel" [contextInstanceId]="contextInstanceId" [courseId]="courseId"></core-format-text></p> |
| 27 | + </ion-item> |
| 28 | + </ng-container> |
| 29 | + |
| 30 | + <!-- Attachments. --> |
| 31 | + <ng-container *ngIf="question.allowsAttachments"> |
| 32 | + <core-attachments *ngIf="uploadFilesSupported && question.attachmentsDraftIdInput" [files]="attachments" [component]="component" [componentId]="componentId" [maxSize]="question.attachmentsMaxBytes" [maxSubmissions]="question.attachmentsMaxFiles" [allowOffline]="offlineEnabled" [acceptedTypes]="question.attachmentsAcceptedTypes"></core-attachments> |
| 33 | + |
| 34 | + <input item-content *ngIf="question.attachmentsDraftIdInput" type="hidden" [name]="question.attachmentsDraftIdInput.name" [value]="question.attachmentsDraftIdInput.value" > |
| 35 | + |
| 36 | + <!-- Attachments not supported in this site. --> |
| 37 | + <ion-item text-wrap *ngIf="!uploadFilesSupported" class="core-danger-item"> |
| 38 | + <p class="core-question-warning">{{ 'core.question.errorattachmentsnotsupportedinsite' | translate }}</p> |
| 39 | + </ion-item> |
| 40 | + </ng-container> |
40 | 41 | </ng-container> |
41 | 42 |
|
42 | | - <!-- Answer to the question and attachments (reviewing). --> |
43 | | - <ion-item text-wrap *ngIf="!question.textarea && (question.answer || question.answer == '')"> |
44 | | - <p><core-format-text [ngClass]='{"core-monospaced": question.isMonospaced}' [component]="component" [componentId]="componentId" [text]="question.answer" [contextLevel]="contextLevel" [contextInstanceId]="contextInstanceId" [courseId]="courseId"></core-format-text></p> |
45 | | - </ion-item> |
| 43 | + <!-- Reviewing the question. --> |
| 44 | + <ng-container *ngIf="review"> |
| 45 | + <!-- Answer to the question and attachments (reviewing). --> |
| 46 | + <ion-item text-wrap *ngIf="question.answer || question.answer == ''"> |
| 47 | + <p><core-format-text [ngClass]='{"core-monospaced": question.isMonospaced}' [component]="component" [componentId]="componentId" [text]="question.answer" [contextLevel]="contextLevel" [contextInstanceId]="contextInstanceId" [courseId]="courseId"></core-format-text></p> |
| 48 | + </ion-item> |
46 | 49 |
|
47 | | - <ion-item *ngIf="!question.textarea && question.attachments && question.attachments.length"> |
48 | | - <div no-lines> |
49 | | - <core-file *ngFor="let attachment of question.attachments" [file]="attachment" [component]="component" [componentId]="componentId"></core-file> |
50 | | - </div> |
51 | | - </ion-item> |
| 50 | + <!-- List of attachments when reviewing. --> |
| 51 | + <core-files *ngIf="question.attachments" [files]="question.attachments" [component]="component" [componentId]="componentId"></core-files> |
| 52 | + </ng-container> |
52 | 53 | </section> |
0 commit comments