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

src/lib/assesment/CcAssesmentFlowLabeltype.php (2 issues)

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 CcAssesmentFlowLabeltype extends CcQuestionMetadataBase
5
{
6
    protected $flowLabel = null;
7
    protected $responseLabel = null;
8
9
    public function __construct()
10
    {
11
        $this->setSetting(CcQtiTags::T_CLASS);
12
    }
13
14
    public function setClass($value)
15
    {
16
        $this->setSetting(CcQtiTags::T_CLASS, $value);
17
    }
18
19
    public function setFlowLabel(CcAssesmentFlowLabeltype $object)
20
    {
21
        $this->flowLabel = $object;
22
    }
23
24
    public function setResponseLabel(CcAssesmentResponseLabeltype $object)
25
    {
26
        $this->responseLabel = $object;
27
    }
28
29
    public function generate(XMLGenericDocument &$doc, DOMNode &$item, $namespace)
30
    {
31
        $node = $doc->appendNewElementNs($item, $namespace, CcQtiTags::FLOW_LABEL);
32
        $this->generateAttributes($doc, $node, $namespace);
33
34
        if (!empty($this->material)) {
35
            $this->material->generate($doc, $node, $namespace);
0 ignored issues
show
Bug Best Practice introduced by
The property material does not exist on CcAssesmentFlowLabeltype. Did you maybe forget to declare it?
Loading history...
36
        }
37
38
        if (!empty($this->materialRef)) {
39
            $this->materialRef->generate($doc, $node, $namespace);
0 ignored issues
show
Bug Best Practice introduced by
The property materialRef does not exist on CcAssesmentFlowLabeltype. Did you maybe forget to declare it?
Loading history...
40
        }
41
42
        if (!empty($this->responseLabel)) {
43
            $this->responseLabel->generate($doc, $node, $namespace);
44
        }
45
46
        if (!empty($this->flowLabel)) {
47
            $this->flowLabel->generate($doc, $node, $namespace);
48
        }
49
    }
50
}
51