Ignore:
Timestamp:
May 2, 2016, 12:09:23 PM (3 years ago)
Author:
jrpelegrina
Message:

Updated to moodle 3.0.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • moodle/trunk/fuentes/backup/cc/cc_lib/cc_assesment_truefalse.php

    r136 r1331  
    2828        parent::__construct($quiz, $questions, $manifest, $section, $question_node, $rootpath, $contextid, $outdir);
    2929        $this->qtype = cc_qti_profiletype::true_false;
    30         $this->correct_answer_node_id = $this->questions->nodeValue(
    31             'plugin_qtype_truefalse_question/truefalse/trueanswer', $this->question_node);
     30
     31        // Determine the correct answer by finding out which answer has the non zero fraction...
     32        // This is because a true / false question type can have 'false' as the correct answer.
     33        $answers = $this->questions->nodeList('plugin_qtype_truefalse_question/answers/answer', $this->question_node);
     34        foreach ($answers as $answer) {
     35            $fraction = $this->questions->nodeValue('fraction', $answer);
     36
     37            if ($fraction != 0) {
     38                $this->correct_answer_node_id = (int)$this->questions->nodeValue('@id', $answer);
     39            }
     40        }
     41
    3242        $maximum_quiz_grade = (int)$this->quiz->nodeValue('/activity/quiz/grade');
    3343        $this->total_grade_value = ($maximum_quiz_grade + 1).'.0000000';
Note: See TracChangeset for help on using the changeset viewer.