forked from EVOgeek/Vmeda.Online
		
	MOBILE-2272 essay: Don't format html if plain text
This commit is contained in:
		
							parent
							
								
									21eedf544a
								
							
						
					
					
						commit
						ab25f60482
					
				| @ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user