return;
}
echo "<center>";
- echo format_text($category->info, FORMAT_MOODLE);
+ $formatoptions->noclean = true;
+ echo format_text($category->info, FORMAT_MOODLE, $formatoptions, $course->id);
echo '<table><tr>';
$editlink = link_to_popup_window('/question/question.php?id='.$question->id, $stredit, $linktext, 450, 550, $stredit, '', true);
}
+ $formatoptions->noclean = true;
+ $formatoptions->para = false;
+
$questiontext = format_text($question->questiontext,
$question->questiontextformat,
- NULL, $cmoptions->course);
+ $formatoptions, $cmoptions->course);
$image = get_question_image($question, $cmoptions->course);
include "$CFG->dirroot/question/questiontypes/description/question.html";
$answers = &$question->options->answers;
//$correctanswers = $this->get_correct_responses($question, $state); // no correct answers ;)
$readonly = empty($options->readonly) ? '' : 'disabled="disabled"';
+ $formatoptions->noclean = true;
+ $formatoptions->para = false;
$nameprefix = $question->name_prefix;
/// Print question text and media
echo format_text($question->questiontext,
$question->questiontextformat,
- NULL, $cmoptions->course);
+ $formatoptions, $cmoptions->course);
echo get_question_image($question, $cmoptions->course);
if (empty($value)) { // no comment yet
echo format_text(get_string('nocommentsyet', 'quiz'));
} else {
- echo format_text($value);
+ echo format_text($value, '', $formatoptions, $cmoptions->course);
}
echo '</div></p>';
}
// feedback
if ($options->feedback) {
foreach ($answers as $answer) {
- format_text("<p align=\"right\">$answer->feedback</p>");
+ format_text("<p align=\"right\">$answer->feedback</p>", '', $formatoptions, $cmoptions->course);
}
}
$this->print_question_submit_buttons($question, $state, $cmoptions, $options);
$answers = array();
$responses = &$state->responses;
+ $formatoptions->noclean = true;
+ $formatoptions->para = false;
foreach ($subquestions as $subquestion) {
foreach ($subquestion->options->answers as $ans) {
// Print formulation
$questiontext = format_text($question->questiontext,
$question->questiontextformat,
- NULL, $cmoptions->course);
+ $formatoptions, $cmoptions->course);
$image = get_question_image($question, $cmoptions->course);
///// Print the input controls //////
/// Subquestion text:
$a->text = format_text($subquestion->questiontext,
- $question->questiontextformat, NULL, $cmoptions->course);
+ $question->questiontextformat, $formatoptions, $cmoptions->course);
/// Drop-down list:
$menuname = $nameprefix.$subquestion->id;
function print_question_formulation_and_controls(&$question, &$state, $cmoptions, $options) {
global $QTYPES;
$readonly = empty($options->readonly) ? '' : 'readonly="readonly"';
+ $formatoptions->noclean = true;
+ $formatoptions->para = false;
$nameprefix = $question->name_prefix;
// For this question type, we better print the image on top:
$qtextremaining = format_text($question->questiontext,
$question->questiontextformat,
- NULL, $cmoptions->course);
+ $formatoptions, $cmoptions->course);
$strfeedback = get_string('feedback', 'quiz');
$readonly = empty($options->readonly) ? '' : 'readonly="readonly"';
$formatoptions = new stdClass;
+ $formatoptions->noclean = true;
$formatoptions->para = false;
// Print formulation
$questiontext = format_text($question->questiontext,
$question->questiontextformat,
- NULL, $cmoptions->course);
+ $formatoptions, $cmoptions->course);
$image = get_question_image($question, $cmoptions->course);
$answerprompt = ($question->options->single) ? get_string('singleanswer', 'quiz') :
get_string('multipleanswers', 'quiz');
'highlight' : '';
// Print the answer text
- $a->text = format_text("$qnumchar. $answer->answer", FORMAT_MOODLE, $formatoptions);
+ $a->text = format_text("$qnumchar. $answer->answer", FORMAT_MOODLE, $formatoptions, $cmoptions->course);
// Print feedback if feedback is on
$a->feedback = (($options->feedback || $options->correct_responses) && $checked) ?
- $feedback = format_text($answer->feedback, true, false) : '';
+ $feedback = format_text($answer->feedback, true, $formatoptions, $cmoptions->course) : '';
$anss[] = clone($a);
}
$answers = &$question->options->answers;
$correctanswers = $this->get_correct_responses($question, $state);
$readonly = empty($options->readonly) ? '' : 'readonly="readonly"';
+ $formatoptions->noclean = true;
+ $formatoptions->para = false;
$nameprefix = $question->name_prefix;
/// Print question text and media
$questiontext = format_text($question->questiontext,
$question->questiontextformat,
- NULL, $cmoptions->course);
+ $formatoptions, $cmoptions->course);
$image = get_question_image($question, $cmoptions->course);
/// Print input controls
if ($options->feedback) {
foreach($answers as $answer) {
if($answer->feedback and $this->test_response($question, $state, $answer)) {
- $feedback = format_text($answer->feedback, true, false);
+ $feedback = format_text($answer->feedback, true, $formatoptions, $cmoptions->course);
break;
}
}
global $CFG;
$readonly = $options->readonly ? ' readonly="readonly"' : '';
+ $formatoptions->noclean = true;
+ $formatoptions->para = false;
// Print question formulation
$questiontext = format_text($question->questiontext,
$question->questiontextformat,
- NULL, $cmoptions->course);
+ $formatoptions, $cmoptions->course);
$image = get_question_image($question, $cmoptions->course);
$answers = &$question->options->answers;
$feedback = '';
if ($options->feedback and isset($answers[$state->responses['']])) {
$chosenanswer = $answers[$state->responses['']];
- $feedback = format_text($chosenanswer->feedback, true, false);
+ $feedback = format_text($chosenanswer->feedback, true, $formatoptions, $cmoptions->course);
}
include("$CFG->dirroot/question/questiontypes/truefalse/display.html");