ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
SeqRollupRule.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
21/*
22 PHP port of ADL SeqRollupRule.java
23 @author Hendrik Holtmann <holtmann@mac.com>
24
25 This .php file is GPL licensed (see above) but based on
26 SeqRollupRule.java by ADL Co-Lab, which is licensed as:
27
28 Advanced Distributed Learning Co-Laboratory (ADL Co-Lab) Hub grants you
29 ("Licensee") a non-exclusive, royalty free, license to use, modify and
30 redistribute this software in source and binary code form, provided that
31 i) this copyright notice and license appear on all copies of the software;
32 and ii) Licensee does not utilize the software in a manner which is
33 disparaging to ADL Co-Lab Hub.
34
35 This software is provided "AS IS," without a warranty of any kind. ALL
36 EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
37 ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
38 OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. ADL Co-Lab Hub AND ITS LICENSORS
39 SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
40 USING, MODIFYING OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO
41 EVENT WILL ADL Co-Lab Hub OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE,
42 PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
43 INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE
44 THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE
45 SOFTWARE, EVEN IF ADL Co-Lab Hub HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
46 DAMAGES.
47*/
48
49
50define("ROLLUP_ACTION_NOCHANGE", 0);
51define("ROLLUP_ACTION_SATISFIED", 1);
52define("ROLLUP_ACTION_NOTSATISFIED", 2);
53define("ROLLUP_ACTION_COMPLETED", 3);
54define("ROLLUP_ACTION_INCOMPLETE", 4);
55
56define("ROLLUP_CONSIDER_ALWAYS", "always");
57define("ROLLUP_CONSIDER_ATTEMPTED", "ifAttempted");
58define("ROLLUP_CONSIDER_NOTSKIPPED", "ifNotSkipped");
59define("ROLLUP_CONSIDER_NOTSUSPENDED", "ifNotSuspended");
60
61define("ROLLUP_SET_ALL", "all");
62define("ROLLUP_SET_ANY", "any");
63define("ROLLUP_SET_NONE", "none");
64define("ROLLUP_SET_ATLEASTCOUNT", "atLeastCount");
65define("ROLLUP_SET_ATLEASTPERCENT", "atLeastPercent");
66
68{
70
72
73 public int $mMinCount = 0;
74
75 public float $mMinPercent = 0.0;
76
77 public ?array $mConditions = null;
78
79 public function __construct()
80 {
81 //$this->mRules=$iRules;
82 }
83
84 public function setRollupAction(string $iAction): void
85 {
86 if ($iAction === "satisfied") {
87 $this->mAction = ROLLUP_ACTION_SATISFIED;
88 } elseif ($iAction === "notSatisfied") {
89 $this->mAction = ROLLUP_ACTION_NOTSATISFIED;
90 } elseif ($iAction === "completed") {
91 $this->mAction = ROLLUP_ACTION_COMPLETED;
92 } elseif ($iAction === "incomplete") {
93 $this->mAction = ROLLUP_ACTION_INCOMPLETE;
94 }
95 }
96}
const ROLLUP_ACTION_NOTSATISFIED
const ROLLUP_ACTION_SATISFIED
const ROLLUP_SET_ALL
const ROLLUP_ACTION_COMPLETED
const ROLLUP_ACTION_INCOMPLETE
string $mChildActivitySet
setRollupAction(string $iAction)