@@ -107,8 +107,8 @@ export class CoreQuestionBaseComponent {
107107 this . question . select = selectModel ;
108108
109109 // Check which one should be displayed first: the select or the input.
110- if ( this . question . displayoptions ) {
111- this . question . selectFirst = this . question . displayoptions . unitsleft == '1' ;
110+ if ( this . question . settings ) {
111+ this . question . selectFirst = this . question . settings . unitsleft == '1' ;
112112 } else {
113113 const input = questionEl . querySelector ( 'input[type="text"][name*=answer]' ) ;
114114 this . question . selectFirst =
@@ -165,8 +165,8 @@ export class CoreQuestionBaseComponent {
165165 }
166166
167167 // Check which one should be displayed first: the options or the input.
168- if ( this . question . displayoptions ) {
169- this . question . optionsFirst = this . question . displayoptions . unitsleft == '1' ;
168+ if ( this . question . settings ) {
169+ this . question . optionsFirst = this . question . settings . unitsleft == '1' ;
170170 } else {
171171 const input = questionEl . querySelector ( 'input[type="text"][name*=answer]' ) ;
172172 this . question . optionsFirst =
@@ -216,11 +216,11 @@ export class CoreQuestionBaseComponent {
216216 const textarea = < HTMLTextAreaElement > questionEl . querySelector ( 'textarea[name*=_answer]' ) ;
217217 const answerDraftIdInput = < HTMLInputElement > questionEl . querySelector ( 'input[name*="_answer:itemid"]' ) ;
218218
219- if ( this . question . displayoptions ) {
220- this . question . allowsAttachments = this . question . displayoptions . attachments != '0' ;
221- this . question . allowsAnswerFiles = this . question . displayoptions . responseformat == 'editorfilepicker' ;
222- this . question . isMonospaced = this . question . displayoptions . responseformat == 'monospaced' ;
223- this . question . isPlainText = this . question . isMonospaced || this . question . displayoptions . responseformat == 'plain' ;
219+ if ( this . question . settings ) {
220+ this . question . allowsAttachments = this . question . settings . attachments != '0' ;
221+ this . question . allowsAnswerFiles = this . question . settings . responseformat == 'editorfilepicker' ;
222+ this . question . isMonospaced = this . question . settings . responseformat == 'monospaced' ;
223+ this . question . isPlainText = this . question . isMonospaced || this . question . settings . responseformat == 'plain' ;
224224 } else {
225225 this . question . allowsAttachments = ! ! questionEl . querySelector ( 'div[id*=filemanager]' ) ;
226226 this . question . allowsAnswerFiles = ! ! answerDraftIdInput ;
@@ -282,8 +282,11 @@ export class CoreQuestionBaseComponent {
282282 } ;
283283 }
284284
285- this . question . attachmentsMaxFiles = Number ( this . question . displayoptions . attachments ) ;
286- this . question . attachmentsAcceptedTypes = this . question . displayoptions . filetypeslist ;
285+ if ( this . question . settings ) {
286+ this . question . attachmentsMaxFiles = Number ( this . question . settings . attachments ) ;
287+ this . question . attachmentsAcceptedTypes = this . question . settings . filetypeslist &&
288+ this . question . settings . filetypeslist . join ( ',' ) ;
289+ }
287290
288291 if ( fileManagerUrl ) {
289292 const params = CoreUrlUtils . instance . extractUrlParams ( fileManagerUrl ) ;
0 commit comments