ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilQTISetvar.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
30{
31 public const ACTION_SET = "1";
32 public const ACTION_ADD = "2";
33 public const ACTION_SUBTRACT = "3";
34 public const ACTION_MULTIPLY = "4";
35 public const ACTION_DIVIDE = "5";
36
37 public ?string $varname = null;
38 public ?string $action = null;
39 public ?string $content = null;
40
41 public function setVarname(string $a_varname): void
42 {
43 $this->varname = $a_varname;
44 }
45
46 public function getVarname(): ?string
47 {
48 return $this->varname;
49 }
50
51 public function setAction(string $a_action): void
52 {
53 switch (strtolower($a_action)) {
54 case "set":
55 case "1":
56 $this->action = self::ACTION_SET;
57 break;
58 case "add":
59 case "2":
60 $this->action = self::ACTION_ADD;
61 break;
62 case "subtract":
63 case "3":
64 $this->action = self::ACTION_SUBTRACT;
65 break;
66 case "multiply":
67 case "4":
68 $this->action = self::ACTION_MULTIPLY;
69 break;
70 case "divide":
71 case "5":
72 $this->action = self::ACTION_DIVIDE;
73 break;
74 }
75 }
76
77 public function getAction(): ?string
78 {
79 return $this->action;
80 }
81
82 public function setContent(string $a_content): void
83 {
84 $this->content = $a_content;
85 }
86
87 public function getContent(): ?string
88 {
89 return $this->content;
90 }
91}
setContent(string $a_content)
setVarname(string $a_varname)
setAction(string $a_action)