Skip to content

Commit

Permalink
Merge branch 'MDL-28129' of git://github.com/timhunt/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Jun 30, 2011
2 parents 4411596 + e5060e2 commit 70debd7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions question/type/questiontypebase.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,8 @@ public function save_hints($formdata, $withparts = false) {
global $DB;
$context = $formdata->context;

$oldhints = $DB->get_records('question_hints', array('questionid' => $formdata->id));
$oldhints = $DB->get_records('question_hints',
array('questionid' => $formdata->id), 'id ASC');

if (!empty($formdata->hint)) {
$numhints = max(array_keys($formdata->hint)) + 1;
Expand Down Expand Up @@ -628,8 +629,8 @@ public function get_question_options($question) {
$answer_extension_table = array_shift($extraanswerfields);
$question->options->answers = $DB->get_records_sql("
SELECT qa.*, qax." . implode(', qax.', $extraanswerfields) . "
FROM {question_answers} qa, {$answer_extension_table} qax
WHERE qa.questionid = ? AND qax.answerid = qa.id", array($question->id));
FROM {question_answers} qa, {{$answer_extension_table}} qax
WHERE qa.question = ? AND qax.answerid = qa.id", array($question->id));
if (!$question->options->answers) {
echo $OUTPUT->notification('Failed to load question answers from the table ' .
$answer_extension_table . 'for questionid ' . $question->id);
Expand Down

0 comments on commit 70debd7

Please sign in to comment.