Moodle editing quiz page doesn't show selected font

Re: Moodle editing quiz page doesn't show selected font

by Mayank Tyagi -
Number of replies: 0

Hi Martin,

Thanx for your valuable solution. 

I have already done the CSS hack mentioned by you. But I have only some question in Hindi.

I didn't come up with the solution when I applied the changes in (mod/quiz/renderer.php). I found another way to do it. What I did, modified the locallib.php (mod/quiz/locallib.php) with this code 

 if ($showquestiontext) {
preg_match('/style="(.+?)"/', $question->questiontext, $matches);
$style = $matches[1];
                $questiontext = question_utils::to_plain_text($question->questiontext,
                $question->questiontextformat, array('noclean' => true, 'para' => false));
                $questiontext = shorten_text($questiontext, 200);
                if ($questiontext) {
                       $result .= ' ' . html_writer::span(s($questiontext), 'questiontext', array('style' => $style));
             }
    }

It will add the font style in the span and give the desired output. But this solution is only for one selected Font. 

I want to add more than one font in my question. It works properly in the text editor as well as in preview the question. When I choose more than one font-style in the same question, It applies only the first style in the whole question. 

Is there any way to achieve this requirement completely? I look forward to your reply.