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)) {
67 require_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
68 foreach ($participants as $active_id =>
$userdata) {
84 foreach ($passes as
$pass => $passdata) {
85 if (is_object($passdata)) {
99 $questions = $passdata->getAnsweredQuestions();
100 if (is_array($questions)) {
101 foreach ($questions as $questiondata) {
102 $question_gui = $this->test->createQuestionGUI(
"", $questiondata[
'id']);
103 $this->recalculateQuestionScore($question_gui, $active_id,
$pass, $questiondata);
114 public function recalculateQuestionScore($question_gui, $active_id,
$pass, $questiondata)
117 if (is_object($question_gui)) {
118 $reached = $question_gui->object->calculateReachedPoints($active_id,
$pass);
119 $actual_reached = $question_gui->object->adjustReachedPointsByScoringOptions($reached, $active_id,
$pass);
121 if ($this->preserve_manual_scores ==
true && $questiondata[
'manual'] ==
'1') {
130 $question_gui->object->getMaximumPoints(),
144 public function calculateBestSolutionForTest()
147 foreach ($this->test->getAllQuestions() as $question) {
149 $question_gui = $this->test->createQuestionGUI(
"", $question[
'question_id']);
150 $solution .= $question_gui->getSolutionOutput(0, null,
true,
true,
false,
false,
true,
false);
158 $this->recalculatedPasses =
array();
168 if (!is_array($this->recalculatedPasses[$activeId])) {
169 $this->recalculatedPasses[$activeId] =
array();
172 $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)
setPreserveManualScores($preserve_manual_scores)
Create styles array
The data for the language used.
resetRecalculatedPassesByActives()
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)