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