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