ILIAS  release_8 Revision v8.24
class.assMark.php
Go to the documentation of this file.
1<?php
2
19require_once './Modules/Test/classes/inc.AssessmentConstants.php';
20
30{
34 public string $short_name;
35
39 public string $official_name;
40
44 public float $minimum_level = 0;
45
49 public int $passed;
50
51 public function __construct(
52 string $short_name = "",
53 string $official_name = "",
54 float $minimum_level = 0,
55 int $passed = 0
56 ) {
57 $this->setShortName($short_name);
58 $this->setOfficialName($official_name);
59 $this->setMinimumLevel($minimum_level);
60 $this->setPassed($passed);
61 }
62
67 public function __unserialize(array $data): void
68 {
69 $this->short_name = $data['short_name'];
70 $this->official_name = $data['short_name'];
71 $this->minimum_level = (float) $data['minimum_level'];
72 $this->passed = (int) $data['passed'];
73 }
74
75 public function getShortName(): string
76 {
77 return $this->short_name;
78 }
79
80 public function getPassed(): int
81 {
82 return $this->passed;
83 }
84
85 public function getOfficialName(): string
86 {
88 }
89
90 public function getMinimumLevel(): float
91 {
93 }
94
95 public function setShortName(string $short_name = ""): void
96 {
97 $this->short_name = $short_name;
98 }
99
100 public function setPassed($passed = 0): void
101 {
102 $this->passed = $passed;
103 }
104
105 public function setOfficialName(string $official_name = ""): void
106 {
107 $this->official_name = $official_name;
108 }
109
110 public function setMinimumLevel($minimum_level): void
111 {
113
114 if (($minimum_level >= 0) && ($minimum_level <= 100)) {
115 $this->minimum_level = $minimum_level;
116 } else {
117 throw new Exception('Markstep: minimum level must be between 0 and 100');
118 }
119 }
120}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setMinimumLevel($minimum_level)
__construct(string $short_name="", string $official_name="", float $minimum_level=0, int $passed=0)
setOfficialName(string $official_name="")
setShortName(string $short_name="")
setPassed($passed=0)
float $minimum_level
The minimum percentage level reaching the mark.
string $short_name
The short name of the mark, e.g.
__unserialize(array $data)
Stephan Kergomard, 2023-11-08: We need an explicit __unserialize function here because of changes to ...
string $official_name
The official name of the mark, e.g.
int $passed
The passed status of the mark.