@@ -28,7 +28,7 @@ import {
2828import { CoreTime } from '@singletons/time' ;
2929import { CoreUtils } from '@services/utils/utils' ;
3030import { AddonModLessonPageSubtype } from '../constants' ;
31- import { convertHTMLToHTMLElement } from '@/core/utils/create-html-element' ;
31+ import { convertTextToHTMLElement } from '@/core/utils/create-html-element' ;
3232
3333/**
3434 * Helper service that provides some features for quiz.
@@ -47,7 +47,7 @@ export class AddonModLessonHelperProvider {
4747 * @returns Formatted data.
4848 */
4949 formatActivityLink ( activityLink : string ) : AddonModLessonActivityLink {
50- const element = convertHTMLToHTMLElement ( activityLink ) ;
50+ const element = convertTextToHTMLElement ( activityLink ) ;
5151 const anchor = element . querySelector ( 'a' ) ;
5252
5353 if ( ! anchor ) {
@@ -77,7 +77,7 @@ export class AddonModLessonHelperProvider {
7777 buttonText : '' ,
7878 content : '' ,
7979 } ;
80- const element = convertHTMLToHTMLElement ( html ) ;
80+ const element = convertTextToHTMLElement ( html ) ;
8181
8282 // Search the input button.
8383 const button = < HTMLInputElement > element . querySelector ( 'input[type="button"]' ) ;
@@ -101,7 +101,7 @@ export class AddonModLessonHelperProvider {
101101 */
102102 getPageButtonsFromHtml ( html : string ) : AddonModLessonPageButton [ ] {
103103 const buttons : AddonModLessonPageButton [ ] = [ ] ;
104- const element = convertHTMLToHTMLElement ( html ) ;
104+ const element = convertTextToHTMLElement ( html ) ;
105105
106106 // Get the container of the buttons if it exists.
107107 let buttonsContainer = element . querySelector ( '.branchbuttoncontainer' ) ;
@@ -153,7 +153,7 @@ export class AddonModLessonHelperProvider {
153153 */
154154 getPageContentsFromPageData ( data : AddonModLessonGetPageDataWSResponse ) : string {
155155 // Search the page contents inside the whole page HTML. Use data.pagecontent because it's filtered.
156- const element = convertHTMLToHTMLElement ( data . pagecontent || '' ) ;
156+ const element = convertTextToHTMLElement ( data . pagecontent || '' ) ;
157157 const contents = element . querySelector ( '.contents' ) ;
158158
159159 if ( contents ) {
@@ -179,7 +179,7 @@ export class AddonModLessonHelperProvider {
179179 * @returns Question data.
180180 */
181181 getQuestionFromPageData ( questionForm : FormGroup , pageData : AddonModLessonGetPageDataWSResponse ) : AddonModLessonQuestion {
182- const element = convertHTMLToHTMLElement ( pageData . pagecontent || '' ) ;
182+ const element = convertTextToHTMLElement ( pageData . pagecontent || '' ) ;
183183
184184 // Get the container of the question answers if it exists.
185185 const fieldContainer = < HTMLElement > element . querySelector ( '.fcontainer' ) ;
@@ -464,7 +464,7 @@ export class AddonModLessonHelperProvider {
464464 * @returns Object with the data to render the answer. If the answer doesn't require any parsing, return a string with the HTML.
465465 */
466466 getQuestionPageAnswerDataFromHtml ( html : string ) : AddonModLessonAnswerData {
467- const element = convertHTMLToHTMLElement ( html ) ;
467+ const element = convertTextToHTMLElement ( html ) ;
468468
469469 // Check if it has a checkbox.
470470 let input = element . querySelector < HTMLInputElement > ( 'input[type="checkbox"][name*="answer"]' ) ;
@@ -589,7 +589,7 @@ export class AddonModLessonHelperProvider {
589589 * @returns Feedback without the question text.
590590 */
591591 removeQuestionFromFeedback ( html : string ) : string {
592- const element = convertHTMLToHTMLElement ( html ) ;
592+ const element = convertTextToHTMLElement ( html ) ;
593593
594594 // Remove the question text.
595595 CoreDomUtils . removeElement ( element , '.generalbox:not(.feedback):not(.correctanswer)' ) ;
0 commit comments