Skip to content

Commit a924f60

Browse files
davidszkibamona-shakiba
authored andcommitted
WIP
1 parent 95790f4 commit a924f60

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

classes/teststrategy/strategy.php

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -187,20 +187,20 @@ public function return_next_testitem(array $context) {
187187
}
188188
}
189189

190-
if ($this->pre_check_first_question_selector()) {
191-
$res = $this->first_question_selector();
192-
if ($res->iserr()) {
193-
return $res;
194-
}
195-
$val = $res->unwrap();
196-
// If the result contains a single object, this is the question to be returned.
197-
// Othewise, it contains the updated $context array with the ability and standarderror set in such a way, that the
198-
// teststrategy will return the correct question (e.g. the question corresponding to mean ability of all students).
199-
if (is_object($val)) {
200-
return $res;
201-
}
202-
$this->context = $val;
203-
}
190+
//if ($this->pre_check_first_question_selector()) {
191+
// $res = $this->first_question_selector();
192+
// if ($res->iserr()) {
193+
// return $res;
194+
// }
195+
// $val = $res->unwrap();
196+
// // If the result contains a single object, this is the question to be returned.
197+
// // Othewise, it contains the updated $context array with the ability and standarderror set in such a way, that the
198+
// // teststrategy will return the correct question (e.g. the question corresponding to mean ability of all students).
199+
// if (is_object($val)) {
200+
// return $res;
201+
// }
202+
// $this->context = $val;
203+
//}
204204

205205
// Core methods called in every strategy.
206206
$res = $this->update_personability();
@@ -209,6 +209,19 @@ public function return_next_testitem(array $context) {
209209
}
210210
$context = $res->unwrap();
211211

212+
$res = $this->first_question_selector();
213+
if ($res->iserr()) {
214+
return $res;
215+
}
216+
$val = $res->unwrap();
217+
// If the result contains a single object, this is the question to be returned.
218+
// Othewise, it contains the updated $context array with the ability and standarderror set in such a way, that the
219+
// teststrategy will return the correct question (e.g. the question corresponding to mean ability of all students).
220+
if (is_object($val)) {
221+
return $res;
222+
}
223+
$this->context = $val;
224+
212225
foreach ($this->get_preselecttasks() as $modifier) {
213226
// When this is called for running tests, check if there is a
214227
// X_testing class and if so, use that one.

0 commit comments

Comments
 (0)