1
|
|
|
<?php |
2
|
|
|
/* Source: https://github.com/moodle/moodle/blob/MOODLE_310_STABLE/backup/cc/cc_lib/cc_asssesment.php under GNU/GPL license */ |
3
|
|
|
|
4
|
|
|
class CcAssesmentQuestionEssay extends CcAssesmentQuestionProcBase |
5
|
|
|
{ |
6
|
|
|
public function __construct($quiz, $questions, $manifest, $section, $question, $rootpath, $contextid, $outdir) |
7
|
|
|
{ |
8
|
|
|
parent::__construct($quiz, $questions, $manifest, $section, $question, $rootpath, $contextid, $outdir); |
9
|
|
|
$this->qtype = CcQtiProfiletype::ESSAY; |
10
|
|
|
|
11
|
|
|
$questionScore = $question->ponderation; |
12
|
|
|
/* |
13
|
|
|
// Looks useless for CC13!? |
14
|
|
|
if (is_int($questionScore)) { |
15
|
|
|
$questionScore = ($questionScore).'.0000000'; |
16
|
|
|
} |
17
|
|
|
*/ |
18
|
|
|
$this->total_grade_value = $questionScore; |
19
|
|
|
$this->totalGradeValue = $questionScore; |
20
|
|
|
$this->qitem->setTitle($question->question); |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
public function onGenerateAnswers() |
24
|
|
|
{ |
25
|
|
|
//add responses holder |
26
|
|
|
$answerlist = []; |
27
|
|
|
$this->answerlist = $answerlist; |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
public function onGenerateFeedbacks() |
31
|
|
|
{ |
32
|
|
|
parent::onGenerateFeedbacks(); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
public function onGenerateResponseProcessing() |
36
|
|
|
{ |
37
|
|
|
parent::onGenerateResponseProcessing(); |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* General unconditional feedback must be added as a first respcondition |
41
|
|
|
* without any condition and just displayfeedback (if exists). |
42
|
|
|
*/ |
43
|
|
|
$qrespcondition = new CcAssesmentRespconditiontype(); |
44
|
|
|
$qrespcondition->setTitle('General feedback'); |
45
|
|
|
$this->qresprocessing->addRespcondition($qrespcondition); |
46
|
|
|
$qrespcondition->enableContinue(); |
47
|
|
|
} |
48
|
|
|
} |
49
|
|
|
|