commit
cb7328ad3a
|
@ -27,9 +27,11 @@
|
||||||
|
|
||||||
<!-- Attachments. -->
|
<!-- Attachments. -->
|
||||||
<ng-container *ngIf="question.allowsAttachments">
|
<ng-container *ngIf="question.allowsAttachments">
|
||||||
<core-attachments *ngIf="uploadFilesSupported" [files]="attachments" [component]="component" [componentId]="componentId" [maxSize]="question.attachmentsMaxBytes" [maxSubmissions]="question.attachmentsMaxFiles" [allowOffline]="offlineEnabled" [acceptedTypes]="question.attachmentsAcceptedTypes"></core-attachments>
|
<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>
|
||||||
|
|
||||||
<input item-content *ngIf="uploadFilesSupported" type="hidden" [name]="question.attachmentsDraftIdInput.name" [value]="question.attachmentsDraftIdInput.value" >
|
<core-files *ngIf="uploadFilesSupported && !question.attachmentsDraftIdInput" [files]="attachments" [component]="component" [componentId]="componentId"></core-files>
|
||||||
|
|
||||||
|
<input item-content *ngIf="question.attachmentsDraftIdInput" type="hidden" [name]="question.attachmentsDraftIdInput.name" [value]="question.attachmentsDraftIdInput.value" >
|
||||||
|
|
||||||
<!-- Attachments not supported in this site. -->
|
<!-- Attachments not supported in this site. -->
|
||||||
<ion-item text-wrap *ngIf="!uploadFilesSupported" class="core-danger-item">
|
<ion-item text-wrap *ngIf="!uploadFilesSupported" class="core-danger-item">
|
||||||
|
|
|
@ -364,7 +364,19 @@ export class AddonQtypeEssayHandler implements CoreQuestionHandler {
|
||||||
question.html, this.questionHelper.getResponseFileAreaFiles(question, 'answer'));
|
question.html, this.questionHelper.getResponseFileAreaFiles(question, 'answer'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add some HTML to the text if needed.
|
let isPlainText = false;
|
||||||
answers[textarea.name] = this.textUtils.formatHtmlLines(answers[textarea.name]);
|
if (question.isPlainText !== undefined) {
|
||||||
|
isPlainText = question.isPlainText;
|
||||||
|
} else if (question.settings) {
|
||||||
|
isPlainText = question.settings.responseformat == 'monospaced' || question.settings.responseformat == 'plain';
|
||||||
|
} else {
|
||||||
|
const questionEl = this.domUtils.convertToElement(question.html);
|
||||||
|
isPlainText = !!questionEl.querySelector('.qtype_essay_monospaced') || !!questionEl.querySelector('.qtype_essay_plain');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isPlainText) {
|
||||||
|
// Add some HTML to the text if needed.
|
||||||
|
answers[textarea.name] = this.textUtils.formatHtmlLines(answers[textarea.name]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue