예제 #1
0
 public function __construct($quiz, $questions, $manifest, $section, $question_node, $rootpath, $contextid, $outdir)
 {
     parent::__construct($quiz, $questions, $manifest, $section, $question_node, $rootpath, $contextid, $outdir);
     $this->qtype = cc_qti_profiletype::essay;
     $maximum_quiz_grade = (int) $this->quiz->nodeValue('/activity/quiz/grade');
     $this->total_grade_value = $maximum_quiz_grade + 1 . '.0000000';
 }
 public function __construct($quiz, $questions, $manifest, $section, $question_node, $rootpath, $contextid, $outdir)
 {
     parent::__construct($quiz, $questions, $manifest, $section, $question_node, $rootpath, $contextid, $outdir);
     $this->qtype = cc_qti_profiletype::true_false;
     $this->correct_answer_node_id = $this->questions->nodeValue('plugin_qtype_truefalse_question/truefalse/trueanswer', $this->question_node);
     $maximum_quiz_grade = (int) $this->quiz->nodeValue('/activity/quiz/grade');
     $this->total_grade_value = $maximum_quiz_grade + 1 . '.0000000';
 }
예제 #3
0
 public function __construct($quiz, $questions, $manifest, $section, $question_node, $rootpath, $contextid, $outdir)
 {
     parent::__construct($quiz, $questions, $manifest, $section, $question_node, $rootpath, $contextid, $outdir);
     $this->qtype = cc_qti_profiletype::multiple_response;
     $correct_answer_nodes = $this->questions->nodeList("plugin_qtype_multichoice_question/answers/answer[fraction > 0]", $this->question_node);
     if ($correct_answer_nodes->length == 0) {
         throw new RuntimeException('No correct answer!');
     }
     $this->correct_answers = $correct_answer_nodes;
     //$this->correct_answer_node_id = $this->questions->nodeValue('@id', $correct_answer_node);
     $maximum_quiz_grade = (int) $this->quiz->nodeValue('/activity/quiz/grade');
     $this->total_grade_value = $maximum_quiz_grade + 1 . '.0000000';
 }
예제 #4
0
 public function __construct($quiz, $questions, $manifest, $section, $question_node, $rootpath, $contextid, $outdir)
 {
     parent::__construct($quiz, $questions, $manifest, $section, $question_node, $rootpath, $contextid, $outdir);
     $this->qtype = cc_qti_profiletype::multiple_choice;
     /**
      *
      * What is needed is a maximum grade value taken from the answer fraction
      * It is supposed to always be between 1 and 0 in decimal representation,
      * however that is not always the case so a change in test was needed
      * but since we support here one correct answer type
      * correct answer would always have to be 1
      */
     $correct_answer_node = $this->questions->node("plugin_qtype_multichoice_question/answers/answer[fraction!=0.0000000]", $this->question_node);
     if (empty($correct_answer_node)) {
         throw new RuntimeException('No correct answer!');
     }
     $this->correct_answer_node_id = $this->questions->nodeValue('@id', $correct_answer_node);
     $maximum_quiz_grade = (int) $this->quiz->nodeValue('/activity/quiz/grade');
     $this->total_grade_value = $maximum_quiz_grade + 1 . '.0000000';
 }
예제 #5
0
 public function __construct($quiz, $questions, $manifest, $section, $question_node, $rootpath, $contextid, $outdir)
 {
     parent::__construct($quiz, $questions, $manifest, $section, $question_node, $rootpath, $contextid, $outdir);
     $this->qtype = cc_qti_profiletype::multiple_choice;
     $correct_grade_value = $this->questions->nodeValue('defaultmark', $this->question_node);
     $correct_answer_node = $this->questions->node("plugin_qtype_multichoice_question/answers/answer[fraction={$correct_grade_value}]", $this->question_node);
     $this->correct_answer_node_id = $this->questions->nodeValue('@id', $correct_answer_node);
     $maximum_quiz_grade = (int) $this->quiz->nodeValue('/activity/quiz/grade');
     $this->total_grade_value = $maximum_quiz_grade + (int) $correct_grade_value . '.0000000';
 }