MDL-30592 question_bank: make files in qtext work in the question list.
This commit is contained in:
+11
-5
@@ -791,16 +791,22 @@ class question_bank_question_text_row extends question_bank_row_base {
|
||||
}
|
||||
|
||||
protected function display_content($question, $rowclasses) {
|
||||
$text = format_text($question->questiontext, $question->questiontextformat,
|
||||
$this->formatoptions, $this->qbank->get_courseid());
|
||||
$text = question_rewrite_questiontext_preview_urls($question->questiontext,
|
||||
$question->contextid, 'question', $question->id);
|
||||
$text = format_text($text, $question->questiontextformat,
|
||||
$this->formatoptions);
|
||||
if ($text == '') {
|
||||
$text = ' ';
|
||||
}
|
||||
echo $text;
|
||||
}
|
||||
|
||||
public function get_extra_joins() {
|
||||
return array('qc' => 'JOIN {question_categories} qc ON qc.id = q.category');
|
||||
}
|
||||
|
||||
public function get_required_fields() {
|
||||
return array('q.questiontext', 'q.questiontextformat');
|
||||
return array('q.id', 'q.questiontext', 'q.questiontextformat', 'qc.contextid');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1100,10 +1106,10 @@ class question_bank_view {
|
||||
}
|
||||
|
||||
/// Build the where clause.
|
||||
$tests = array('parent = 0');
|
||||
$tests = array('q.parent = 0');
|
||||
|
||||
if (!$showhidden) {
|
||||
$tests[] = 'hidden = 0';
|
||||
$tests[] = 'q.hidden = 0';
|
||||
}
|
||||
|
||||
if ($recurse) {
|
||||
|
||||
Reference in New Issue
Block a user