MDL-20636 Actually, passing to get_question summary is silly. Revert.
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
<div class="qtext">
|
||||
<?php echo $questiontext; ?>
|
||||
</div>
|
||||
|
||||
<?php if ($anss) { ?>
|
||||
<div class="ablock clearfix">
|
||||
<div class="prompt">
|
||||
<?php print_string('answers', 'quiz'); ?>
|
||||
</div>
|
||||
<table class="answer">
|
||||
<?php $row = 1; foreach ($anss as $answer) { ?>
|
||||
<tr class="<?php echo 'r'.$row = $row ? 0 : 1; ?>">
|
||||
<td class="c1 text">
|
||||
<?php echo $answer->text; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php } ?>
|
||||
@@ -1,78 +0,0 @@
|
||||
<?php
|
||||
|
||||
///////////////////
|
||||
/// missingtype ///
|
||||
///////////////////
|
||||
|
||||
/// QUESTION TYPE CLASS //////////////////
|
||||
|
||||
/**
|
||||
* Missing question type class
|
||||
*
|
||||
* When a question is encountered with a type that is not installed then its
|
||||
* type is changed to 'missingtype'. This questiontype just makes sure that the
|
||||
* necessary information is printed about the question.
|
||||
* @package questionbank
|
||||
* @subpackage questiontypes
|
||||
*/
|
||||
class question_missingtype_qtype extends default_questiontype {
|
||||
|
||||
function name() {
|
||||
return 'missingtype';
|
||||
}
|
||||
|
||||
function menu_name() {
|
||||
return false;
|
||||
}
|
||||
|
||||
function is_usable_by_random() {
|
||||
return false;
|
||||
}
|
||||
|
||||
function print_question_formulation_and_controls(&$question, &$state, $cmoptions, $options) {
|
||||
global $CFG;
|
||||
|
||||
$answers = &$question->options->answers;
|
||||
|
||||
$formatoptions = new stdClass;
|
||||
$formatoptions->noclean = true;
|
||||
$formatoptions->para = false;
|
||||
|
||||
// Print formulation
|
||||
$questiontext = format_text($question->questiontext,
|
||||
$question->questiontextformat,
|
||||
$formatoptions, $cmoptions->course);
|
||||
|
||||
// Print each answer in a separate row if there are any
|
||||
$anss = array();
|
||||
if ($answers) {
|
||||
foreach ($answers as $answer) {
|
||||
$a = new stdClass;
|
||||
$a->text = format_text($answer->answer, $answer->answerformat, $formatoptions, $cmoptions->course);
|
||||
|
||||
$anss[] = clone($a);
|
||||
}
|
||||
}
|
||||
include("$CFG->dirroot/question/type/missingtype/display.html");
|
||||
}
|
||||
|
||||
function grade_responses(&$question, &$state, $cmoptions) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function display_question_editing_page(&$mform, $question, $wizardnow){
|
||||
global $OUTPUT;
|
||||
echo $OUTPUT->heading(get_string('warningmissingtype', 'qtype_missingtype'));
|
||||
|
||||
$mform->display();
|
||||
|
||||
}
|
||||
}
|
||||
//// END OF CLASS ////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//// INITIATION - Without this line the question type is not in use... ///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
question_register_questiontype(new question_missingtype_qtype());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user