19 declare(strict_types=1);
46 $passOverwiewData = [];
48 $scoredPass = $this->
object->_getResultPass($active_id);
52 $testReachedPoints = 0;
55 for ($pass = 0; $pass <= $lastPass; $pass++) {
58 if ($passFinishDate <= 0) {
63 $resultData = &$this->
object->getTestResult($active_id, $pass);
65 if (!$resultData[
"pass"][
"total_max_points"]) {
68 $passPercentage = ($resultData[
"pass"][
"total_reached_points"] / $resultData[
"pass"][
"total_max_points"]) * 100;
71 $passMaxPoints = $resultData[
"pass"][
"total_max_points"];
72 $passReachedPoints = $resultData[
"pass"][
"total_reached_points"];
74 $passAnsweredQuestions = $this->
object->getAnsweredQuestionCount($active_id, $pass);
75 $passTotalQuestions = count($resultData) - 2;
77 if ($pass == $scoredPass) {
80 if (!$resultData[
"test"][
"total_max_points"]) {
83 $testPercentage = ($resultData[
"test"][
"total_reached_points"] / $resultData[
"test"][
"total_max_points"]) * 100;
86 $testMaxPoints = $resultData[
"test"][
"total_max_points"];
87 $testReachedPoints = $resultData[
"test"][
"total_reached_points"];
89 $passOverwiewData[
'test'] = array(
90 'active_id' => $active_id,
91 'scored_pass' => $scoredPass,
92 'max_points' => $testMaxPoints,
93 'reached_points' => $testReachedPoints,
94 'percentage' => $testPercentage
97 $isScoredPass =
false;
100 $passOverwiewData[
'passes'][] = array(
101 'active_id' => $active_id,
103 'finishdate' => $passFinishDate,
104 'max_points' => $passMaxPoints,
105 'reached_points' => $passReachedPoints,
106 'percentage' => $passPercentage,
107 'answered_questions' => $passAnsweredQuestions,
108 'total_questions' => $passTotalQuestions,
109 'is_scored_pass' => $isScoredPass
114 return $passOverwiewData;
124 $testResultData = $this->
object->getTestResult($active_id, $pass);
126 $manScoringQuestionGuiList = [];
128 foreach ($testResultData as $questionData) {
129 if (!isset($questionData[
'qid'])) {
133 if (!isset($questionData[
'type'])) {
137 $questionGUI = $this->
object->createQuestionGUI(
"", $questionData[
'qid']);
139 if (!in_array($questionGUI->object->getQuestionTypeID(), $manScoringQuestionTypes)) {
143 $manScoringQuestionGuiList[ $questionData[
'qid'] ] = $questionGUI;
146 return $manScoringQuestionGuiList;
163 if ($this->
object->isRandomTest()) {
169 $virtual_sequence->setActiveId($testSession->
getActiveId());
171 $virtual_sequence->init();
173 return $virtual_sequence;
181 $results = $this->
object->getTestResult(
192 $virtualPassResults = [];
195 foreach ($resultsByPass[$pass] as
$key => $questionResult) {
196 if (
$key ===
'test' ||
$key ===
'pass') {
200 if ($questionResult[
'qid'] == $questionId) {
201 $questionResult[
'pass'] = $pass;
202 $virtualPassResults[$questionId] = $questionResult;
208 return $virtualPassResults;
215 $marked_questions = [];
217 if ($this->
object->getShowMarker()) {
222 $firstQuestion =
true;
224 foreach ($result_array as
$key => $value) {
226 $this->
object->isFollowupQuestionAnswerFixationEnabled()
227 && !$value[
'presented'] && !$firstQuestion
231 if ($this->
object->getListOfQuestionsDescription()) {
232 $description = $value[
"description"];
236 if (!$this->
object->getTitleOutput()) {
237 $points = $value[
"points"];
241 if (count($marked_questions)) {
242 if (array_key_exists($value[
"qid"], $marked_questions)) {
243 $obj = $marked_questions[$value[
"qid"]];
244 if ($obj[
"solved"] == 1) {
254 'order' => $value[
"nr"],
255 'title' => $this->
object->getQuestionTitle($value[
"title"], $value[
"nr"], $value[
"points"]),
256 'description' => $description,
257 'disabled' => $disableLink,
258 'worked_through' => $value[
"worked_through"],
259 'postponed' => $value[
"postponed"],
262 'sequence' => $value[
"sequence"],
263 'obligatory' => $value[
'obligatory'],
264 'isAnswered' => $value[
'isAnswered'],
265 'has_authorized_answer' => $value[
'has_authorized_answer'],
268 $firstQuestion =
false;
getVirtualSequenceUserResults(ilTestVirtualSequence $virtualSequence)
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
Class ChatMainBarProvider .
static lookupPassResultsUpdateTimestamp($active_id, $pass)
getSequenceSummary(bool $obligationsFilterEnabled=false)
static isManScoringDone(int $active_id)
Base Exception for all Exceptions relating to Modules/Test.
getPassOverviewData(int $active_id, bool $short=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static setManScoringDone(int $activeId, bool $manScoringDone)
getManScoringQuestionGuiList(int $active_id, int $pass)
Returns the list of answers of a users test pass and offers a scoring option.
buildVirtualSequence(ilTestSession $testSession)
static _getSolvedQuestions($active_id, $question_fi=null)
get solved questions
getQuestionSummaryData(ilTestSequenceSummaryProvider $testSequence, bool $obligationsFilterEnabled)
static _getManualScoring()
Retrieve the manual scoring settings.
__construct(protected ilObjTest $object, protected ilDBInterface $db, protected \ILIAS\TestQuestionPool\QuestionInfoService $questioninfo)
public