ILIAS  release_8 Revision v8.24
class.ilQTIMaterial.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
31{
32 public ?string $label = null;
33 public int $flow = 0;
34
38 public array $materials = [];
39
40 public function addMattext(ilQTIMattext $a_mattext): void
41 {
42 $this->materials[] = array("material" => $a_mattext, "type" => "mattext");
43 }
44
45 public function addMatimage(ilQTIMatimage $a_matimage): void
46 {
47 $this->materials[] = array("material" => $a_matimage, "type" => "matimage");
48 }
49
50 public function addMatapplet(ilQTIMatapplet $a_matapplet): void
51 {
52 $this->materials[] = array("material" => $a_matapplet, "type" => "matapplet");
53 }
54
55 public function getMaterialCount(): int
56 {
57 return count($this->materials);
58 }
59
63 public function getMaterial(int $a_index)
64 {
65 if (array_key_exists($a_index, $this->materials)) {
66 return $this->materials[$a_index];
67 }
68
69 return false;
70 }
71
72 public function setFlow(int $a_flow): void
73 {
74 $this->flow = $a_flow;
75 }
76
77 public function getFlow(): int
78 {
79 return $this->flow;
80 }
81
82 public function setLabel(string $a_label): void
83 {
84 $this->label = $a_label;
85 }
86
87 public function getLabel(): ?string
88 {
89 return $this->label;
90 }
91}
addMatapplet(ilQTIMatapplet $a_matapplet)
setLabel(string $a_label)
getMaterial(int $a_index)
setFlow(int $a_flow)
addMatimage(ilQTIMatimage $a_matimage)
addMattext(ilQTIMattext $a_mattext)