Passed
Push — 1.11.x ( bce6cd...c146d9 )
by Angel Fernando Quiroz
12:25
created

src/lib/assesment/CcAssesmentItemfeedbacktype.php (1 issue)

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 CcAssesmentItemfeedbacktype extends CcQuestionMetadataBase
5
{
6
    protected $flowMat = null;
7
    protected $material = null;
8
    protected $solution = null;
9
    protected $hint = null;
10
11
    public function __construct()
12
    {
13
        $this->setSetting(CcQtiTags::IDENT, CcHelpers::uuidgen('I_'));
14
        $this->setSetting(CcQtiTags::TITLE);
15
    }
16
17
    /**
18
     * @param string $value
19
     */
20
    public function setIdent($value)
21
    {
22
        $this->setSetting(CcQtiTags::IDENT, $value);
23
    }
24
25
    /**
26
     * @param string $value
27
     */
28
    public function setTitle($value)
29
    {
30
        $this->setSetting(CcQtiTags::TITLE, $value);
31
    }
32
33
    public function setFlowMat(CcAssesmentFlowMattype $object)
34
    {
35
        $this->flowMat = $object;
36
    }
37
38
    public function setMaterial(CcAssesmentMaterial $object)
39
    {
40
        $this->material = $object;
41
    }
42
43
    public function set_solution(CcAssesmentItemfeedbackSolutiontype $object)
44
    {
45
        $this->solution = $object;
46
    }
47
48
    public function set_hint($object)
49
    {
50
        $this->hint = $object;
51
    }
52
53
    public function generate(XMLGenericDocument &$doc, DOMNode &$item, $namespace)
54
    {
55
        $node = $doc->appendNewElementNs($item, $namespace, CcQtiTags::ITEMFEEDBACK);
56
        $this->generateAttributes($doc, $node, $namespace);
57
58
        if (!empty($this->flowMat) && empty($this->material)) {
59
            $this->flowMat->generate($doc, $node, $namespace);
60
        }
61
62
        if (!empty($this->material) && empty($this->flowMat)) {
63
            $this->material->generate($doc, $node, $namespace);
64
        }
65
66
        if (!empty($this->solution)) {
67
            $this->solution->generate($doc, $node, $namespace);
68
        }
69
70
        if (!empty($this->itemfeedback)) {
71
            $this->itemfeedback->generate($doc, $node, $namespace);
0 ignored issues
show
Bug Best Practice introduced by
The property itemfeedback does not exist on CcAssesmentItemfeedbacktype. Did you maybe forget to declare it?
Loading history...
72
        }
73
    }
74
}
75