39 $this->preserve_manual_scores =
false;
41 $this->recalculatedPasses =
array();
43 require_once
'./Modules/Test/classes/class.ilObjTestGUI.php';
65 $participants = $this->test->getCompleteEvaluationData(
false)->getParticipants();
66 if (is_array($participants))
68 require_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
69 foreach ($participants as $active_id => $userdata)
71 if (is_object($userdata) && is_array($userdata->getPasses()))
86 $passes = $userdata->getPasses();
87 foreach ($passes as
$pass => $passdata)
89 if (is_object( $passdata ))
104 $questions = $passdata->getAnsweredQuestions();
105 if (is_array( $questions ))
107 foreach ($questions as $questiondata)
109 $question_gui = $this->test->createQuestionGUI(
"", $questiondata[
'id'] );
110 $this->recalculateQuestionScore( $question_gui, $active_id,
$pass, $questiondata );
122 public function recalculateQuestionScore($question_gui, $active_id,
$pass, $questiondata)
125 if (is_object( $question_gui ))
127 $reached = $question_gui->object->calculateReachedPoints( $active_id,
$pass );
128 $actual_reached = $question_gui->object->adjustReachedPointsByScoringOptions($reached, $active_id,
$pass);
130 if ($this->preserve_manual_scores ==
true && $questiondata[
'manual'] ==
'1')
141 $question_gui->object->getMaximumPoints(),
155 public function calculateBestSolutionForTest()
158 foreach ($this->test->getAllQuestions() as $question)
161 $question_gui = $this->test->createQuestionGUI(
"", $question[
'question_id'] );
162 $solution .= $question_gui->getSolutionOutput(0, null,
true,
true,
false,
false,
true,
false);
170 $this->recalculatedPasses =
array();
180 if( !is_array($this->recalculatedPasses[$activeId]) )
182 $this->recalculatedPasses[$activeId] =
array();
185 $this->recalculatedPasses[$activeId][] =
$pass;
static _updateTestResultCache($active_id, ilAssQuestionProcessLocker $processLocker=null)
Move this to a proper place.
recalculatePass($passdata, $active_id, $pass)
getRecalculatedPassesByActives()
static setForcePassResultUpdateEnabled($forcePassResultsUpdateEnabled)
addRecalculatedPassByActive($activeId, $pass)
__construct(ilObjTest $test)
Create styles array
The data for the language used.
resetRecalculatedPassesByActives()
setPreserveManualScores( $preserve_manual_scores)
getPreserveManualScores()
static _setReachedPoints($active_id, $question_id, $points, $maxpoints, $pass, $manualscoring, $obligationsEnabled)
Sets the points, a learner has reached answering the question Additionally objective results are upda...
recalculatePasses($userdata, $active_id)