ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilTestRandomQuestionsSrcPoolDefinitionQuantitiesCalculation.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
11 {
16 
21 
26 
31 
36 
43  {
44  $this->setSourcePoolDefinition($sourcePoolDefinition);
45  }
46 
50  public function getSourcePoolDefinition()
51  {
53  }
54 
59  {
60  $this->sourcePoolDefinition = $sourcePoolDefinition;
61  }
62 
67  {
69  }
70 
75  {
76  $this->intersectionQuantitySharingDefinitionList = $intersectionQuantitySharingDefinitionList;
77  }
78 
82  public function getOverallQuestionAmount()
83  {
85  }
86 
91  {
92  $this->overallQuestionAmount = $overallQuestionAmount;
93  }
94 
98  public function getExclusiveQuestionAmount()
99  {
101  }
102 
107  {
108  $this->exclusiveQuestionAmount = $exclusiveQuestionAmount;
109  }
110 
115  {
117  }
118 
123  {
124  $this->availableSharedQuestionAmount = $availableSharedQuestionAmount;
125  }
126 
130  protected function getReservedSharedQuestionAmount()
131  {
132  return $this->getOverallQuestionAmount() - (
134  );
135  }
136 
141  {
142  $requiredQuestionAmount = $this->getSourcePoolDefinition()->getQuestionAmount();
144 
145  return $requiredQuestionAmount - $exclusiveQuestionAmount;
146  }
147 
152  {
153  $requiredQuestionAmount = $this->getSourcePoolDefinition()->getQuestionAmount();
155 
156  return $overallQuestionAmount >= $requiredQuestionAmount;
157  }
158 
163  {
164  $requiredQuestionAmount = $this->getSourcePoolDefinition()->getQuestionAmount();
166 
167  return $exclusiveQuestionAmount >= $requiredQuestionAmount;
168  }
169 
174  {
175  $remainingRequiredQuestionAmount = $this->getRemainingRequiredQuestionAmount();
177 
178  return $availableSharedQuestionAmount >= $remainingRequiredQuestionAmount;
179  }
180 
185  {
186  if ($this->getIntersectionQuantitySharingDefinitionList()->getDefinitionCount() > 0) {
187  return true;
188  }
189 
190  return false;
191  }
192 
197  {
199  return true;
200  }
201 
203  return true;
204  }
205 
206  return false;
207  }
208 
210  {
211  $report = $this->getRuleSatisfactionResultMessage($lng);
212 
214  $report .= ' ' . $this->getConcurrentRuleConflictMessage($lng);
215  }
216 
217  return $report;
218  }
219 
221  {
223  return sprintf(
224  $lng->txt('tst_msg_rand_quest_set_rule_not_satisfied_reserved'),
225  $this->getSourcePoolDefinition()->getSequencePosition(),
226  $this->getSourcePoolDefinition()->getQuestionAmount(),
227  $this->getOverallQuestionAmount()
228  );
229  }
230 
231  return sprintf(
232  $lng->txt('tst_msg_rand_quest_set_rule_not_satisfied_missing'),
233  $this->getSourcePoolDefinition()->getSequencePosition(),
234  $this->getSourcePoolDefinition()->getQuestionAmount(),
235  $this->getOverallQuestionAmount()
236  );
237  }
238 
240  {
241  $definitionsString = '<br />' . $this->buildIntersectionQuestionSharingDefinitionsString($lng);
242 
244  return sprintf(
245  $lng->txt('tst_msg_rand_quest_set_rule_not_satisfied_reserved_shared'),
247  $definitionsString
248  );
249  }
250 
251  return sprintf(
252  $lng->txt('tst_msg_rand_quest_set_rule_not_satisfied_missing_shared'),
254  $definitionsString
255  );
256  }
257 
263  {
264  $definitionsString = array();
265 
266  foreach ($this->getIntersectionQuantitySharingDefinitionList() as $definition) {
267  $definitionsString[] = sprintf(
268  $lng->txt('tst_msg_rand_quest_set_rule_label'),
269  $definition->getSequencePosition()
270  );
271  }
272 
273  $definitionsString = '<ul><li>' . implode('</li><li>', $definitionsString) . '</li></ul>';
274  return $definitionsString;
275  }
276 }
$lng
__construct(ilTestRandomQuestionSetSourcePoolDefinition $sourcePoolDefinition)
ilTestRandomQuestionsSrcPoolDefinitionQuantitiesCheck constructor.
language handling
txt($a_topic, $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...