4 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
5 include_once
'Modules/Test/classes/class.ilTestService.php';
116 $this->tabs = $ilTabs;
117 $this->objCache = $ilObjDataCache;
119 $this->
object =& $a_object;
120 $this->tree =&
$tree;
121 $this->ref_id = $a_object->ref_id;
125 require_once
'Modules/Test/classes/class.ilTestSessionFactory.php';
128 require_once
'Modules/Test/classes/class.ilTestSequenceFactory.php';
131 $this->objectiveOrientedContainer = null;
161 $considerHiddenQuestions =
false;
163 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
168 $considerHiddenQuestions =
true;
171 $scoredPass = $this->
object->_getResultPass($testSession->
getActiveId());
173 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
178 foreach($passes as
$pass)
182 $considerOptionalQuestions =
true;
186 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($testSession->
getActiveId(),
$pass);
188 $testSequence->loadFromDb();
189 $testSequence->loadQuestions();
191 if($this->
object->isRandomTest() && !$testSequence->isAnsweringOptionalQuestionsConfirmed())
193 $considerOptionalQuestions =
false;
196 $testSequence->setConsiderHiddenQuestionsEnabled($considerHiddenQuestions);
197 $testSequence->setConsiderOptionalQuestionsEnabled($considerOptionalQuestions);
200 $objectivesList->loadObjectivesTitles();
202 $row[
'objectives'] = $objectivesList->getUniqueObjectivesStringForQuestions($testSequence->getUserSequenceQuestions());
207 $result_array = $this->
object->getTestResult($testSession->
getActiveId(),
$pass,
false, $considerHiddenQuestions, $considerOptionalQuestions);
209 foreach($result_array as $resultStructKEY => $question)
211 if( $resultStructKEY ===
'test' || $resultStructKEY ===
'pass' )
216 $requestData = $questionHintRequestRegister->getRequestByTestPassIndexAndQuestionId($pass, $question[
'qid']);
220 $result_array[
'pass'][
'total_requested_hints'] += $requestData->getRequestsCount();
222 $result_array[$resultStructKEY][
'requested_hints'] = $requestData->getRequestsCount();
223 $result_array[$resultStructKEY][
'hint_points'] = $requestData->getRequestsPoints();
227 if(!$result_array[
'pass'][
'total_max_points'])
232 $percentage = ($result_array[
'pass'][
'total_reached_points'] / $result_array[
'pass'][
'total_max_points']) * 100;
234 $total_max = $result_array[
'pass'][
'total_max_points'];
235 $total_reached = $result_array[
'pass'][
'total_reached_points'];
236 $total_requested_hints = $result_array[
'pass'][
'total_requested_hints'];
241 $row[
'scored'] = ($pass == $scoredPass);
248 $row[
'num_workedthrough_questions'] = $result_array[
'pass'][
'num_workedthrough'];
249 $row[
'num_questions_total'] = $result_array[
'pass'][
'num_questions_total'];
251 if($this->
object->isOfferingQuestionHintsEnabled())
253 $row[
'hints'] = $total_requested_hints;
256 $row[
'reached_points'] = $total_reached;
257 $row[
'max_points'] = $total_max;
258 $row[
'percentage'] = $percentage;
288 $cmd = $this->ctrl->getCmd();
289 $next_class = $this->ctrl->getNextClass($this);
315 require_once
'Services/Link/classes/class.ilLink.php';
317 $this->tabs->setBack2Target($this->lng->txt(
'back_to_objective_container'), $courseLink);
320 'results_pass_oriented', $this->lng->txt(
'tst_tab_results_pass_oriented'),
321 $this->ctrl->getLinkTargetByClass(
'ilTestEvaluationGUI',
'outUserResultsOverview')
325 'results_objective_oriented', $this->lng->txt(
'tst_tab_results_objective_oriented'),
326 $this->ctrl->getLinkTargetByClass(
'ilTestEvalObjectiveOrientedGUI',
'showVirtualPass')
329 $this->tabs->setTabActive($activeTabId);
338 if( !isset(
$_GET[
'pdf']) )
343 if( !(
bool)
$_GET[
'pdf'] )
356 require_once
'Modules/Test/classes/tables/class.ilTestPassOverviewTableGUI.php';
360 $table->setPdfPresentationEnabled(
364 $table->setObjectiveOrientedPresentationEnabled(
383 $maintemplate =
new ilTemplate(
"tpl.il_as_tst_list_of_answers.html", TRUE, TRUE,
"Modules/Test");
387 foreach ($result_array as $question_data)
389 if (($question_data[
"workedthrough"] == 1) || ($only_answered_questions == FALSE))
391 $template =
new ilTemplate(
"tpl.il_as_qpl_question_printview.html", TRUE, TRUE,
"Modules/TestQuestionPool");
392 $question = $question_data[
"qid"];
393 if (is_numeric($question))
395 $maintemplate->setCurrentBlock(
"printview_question");
396 $question_gui = $this->
object->createQuestionGUI(
"", $question);
397 if (is_object($question_gui))
406 $template->setCurrentBlock(
'block_id');
407 $template->setVariable(
'BLOCK_ID',
"detailed_answer_block_act_{$active_id}_qst_{$question}");
408 $template->parseCurrentBlock();
410 $template->setCurrentBlock(
'back_anchor');
411 $template->setVariable(
'HREF_BACK_ANCHOR',
"#pass_details_tbl_row_act_{$active_id}_qst_{$question}");
412 $template->setVariable(
'TXT_BACK_ANCHOR', $this->lng->txt(
'tst_back_to_question_list'));
413 $template->parseCurrentBlock();
416 if ($show_reached_points)
418 $template->setCurrentBlock(
"result_points");
419 $template->setVariable(
"RESULT_POINTS", $this->lng->txt(
"tst_reached_points") .
": " . $question_gui->object->getReachedPoints($active_id,
$pass) .
" " . $this->lng->txt(
"of") .
" " . $question_gui->object->getMaximumPoints());
420 $template->parseCurrentBlock();
422 $template->setVariable(
"COUNTER_QUESTION",
$counter.
". ");
423 $template->setVariable(
"TXT_QUESTION_ID", $this->lng->txt(
'question_id_short'));
424 $template->setVariable(
"QUESTION_ID", $question_gui->object->getId());
425 $template->setVariable(
"QUESTION_TITLE", $this->
object->getQuestionTitle($question_gui->object->getTitle()));
427 if( $objectivesList !== null )
429 $objectives = $this->lng->txt(
'tst_res_lo_objectives_header').
': ';
430 $objectives .= $objectivesList->getQuestionRelatedObjectiveTitles($question_gui->object->getId());
431 $template->setVariable(
"OBJECTIVES", $objectives);
434 $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ? TRUE : FALSE;
441 $compare_template =
new ilTemplate(
'tpl.il_as_tst_answers_compare.html', TRUE, TRUE,
'Modules/Test');
442 $compare_template->setVariable(
"HEADER_PARTICIPANT", $this->lng->txt(
'tst_header_participant'));
443 $compare_template->setVariable(
"HEADER_SOLUTION", $this->lng->txt(
'tst_header_solution'));
444 $result_output = $question_gui->getSolutionOutput($active_id,
$pass, $show_solutions, FALSE, $show_question_only, $showFeedback);
445 $best_output = $question_gui->getSolutionOutput($active_id,
$pass, FALSE, FALSE, $show_question_only, FALSE, TRUE);
447 $compare_template->setVariable(
'PARTICIPANT', $result_output);
448 $compare_template->setVariable(
'SOLUTION', $best_output);
449 $template->setVariable(
'SOLUTION_OUTPUT', $compare_template->get());
453 $result_output = $question_gui->getSolutionOutput($active_id,
$pass, $show_solutions, FALSE, $show_question_only, $showFeedback);
454 $template->setVariable(
'SOLUTION_OUTPUT', $result_output);
457 $maintemplate->setCurrentBlock(
"printview_question");
458 $maintemplate->setVariable(
"QUESTION_PRINTVIEW", $template->get());
459 $maintemplate->parseCurrentBlock();
466 if($testResultHeaderLabelBuilder !== null)
470 $headerText = $testResultHeaderLabelBuilder->getListOfAnswersHeaderLabel(
$pass + 1);
474 $headerText = $testResultHeaderLabelBuilder->getVirtualListOfAnswersHeaderLabel();
482 $maintemplate->setVariable(
"RESULTS_OVERVIEW", $headerText);
483 return $maintemplate->get();
500 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
502 $maintemplate =
new ilTemplate(
"tpl.il_as_tst_list_of_answers.html", TRUE, TRUE,
"Modules/Test");
504 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
509 foreach ($result_array as $question_data)
511 $question = $question_data[
"qid"];
512 if (is_numeric($question))
514 $question_gui = $this->
object->createQuestionGUI(
"", $question);
515 if (in_array($question_gui->object->getQuestionTypeID(), $scoring))
517 $template =
new ilTemplate(
"tpl.il_as_qpl_question_printview.html", TRUE, TRUE,
"Modules/TestQuestionPool");
518 $scoretemplate =
new ilTemplate(
"tpl.il_as_tst_manual_scoring_points.html", TRUE, TRUE,
"Modules/Test");
519 #mbecker: No such block. $this->tpl->setCurrentBlock("printview_question"); 520 $template->setVariable(
"COUNTER_QUESTION",
$counter.
". ");
521 $template->setVariable(
"QUESTION_TITLE", $this->
object->getQuestionTitle($question_gui->object->getTitle()));
522 $points = $question_gui->object->getMaximumPoints();
525 $template->setVariable(
"QUESTION_POINTS", $points .
" " . $this->lng->txt(
"point"));
529 $template->setVariable(
"QUESTION_POINTS", $points .
" " . $this->lng->txt(
"points"));
532 $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ? TRUE : FALSE;
533 $result_output = $question_gui->getSolutionOutput($active_id,
$pass, $show_solutions, FALSE, $show_question_only, $this->
object->getShowSolutionFeedback(), FALSE, TRUE);
535 $solout = $question_gui->object->getSuggestedSolutionOutput();
538 $scoretemplate->setCurrentBlock(
"suggested_solution");
539 $scoretemplate->setVariable(
"TEXT_SUGGESTED_SOLUTION", $this->lng->txt(
"solution_hint"));
540 $scoretemplate->setVariable(
"VALUE_SUGGESTED_SOLUTION", $solout);
541 $scoretemplate->parseCurrentBlock();
544 $scoretemplate->setCurrentBlock(
"feedback");
545 $scoretemplate->setVariable(
"FEEDBACK_NAME_INPUT", $question);
546 $feedback = $this->
object->getManualFeedback($active_id, $question,
$pass);
548 $scoretemplate->setVariable(
"TEXT_MANUAL_FEEDBACK", $this->lng->txt(
"set_manual_feedback"));
549 $scoretemplate->parseCurrentBlock();
551 $scoretemplate->setVariable(
"NAME_INPUT", $question);
552 $this->ctrl->setParameter($this,
"active_id", $active_id);
553 $this->ctrl->setParameter($this,
"pass",
$pass);
554 $scoretemplate->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"manscoring"));
555 $scoretemplate->setVariable(
"LABEL_INPUT", $this->lng->txt(
"tst_change_points_for_question"));
557 $scoretemplate->setVariable(
"VALUE_SAVE", $this->lng->txt(
"save"));
559 $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
560 $maintemplate->setCurrentBlock(
"printview_question");
561 $maintemplate->setVariable(
"QUESTION_PRINTVIEW", $template->get());
562 $maintemplate->setVariable(
"QUESTION_SCORING", $scoretemplate->get());
563 $maintemplate->parseCurrentBlock();
571 $maintemplate->setVariable(
"NO_QUESTIONS_FOUND", $this->lng->txt(
"manscoring_questions_not_found"));
573 $maintemplate->setVariable(
"RESULTS_OVERVIEW", sprintf($this->lng->txt(
"manscoring_results_pass"),
$pass+1));
575 include_once
"./Services/YUI/classes/class.ilYuiUtil.php";
578 return $maintemplate->get();
583 $this->ctrl->setParameter($targetGUI,
'active_id', $active_id);
584 $this->ctrl->setParameter($targetGUI,
'pass',
$pass);
588 $tableGUI->setAnswerListAnchorEnabled($questionAnchorNav);
589 $tableGUI->setSingleAnswerScreenCmd($questionDetailsCMD);
590 $tableGUI->setShowHintCount($this->
object->isOfferingQuestionHintsEnabled());
592 if( $objectivesList !== null )
594 $tableGUI->setQuestionRelatedObjectivesList($objectivesList);
595 $tableGUI->setObjectiveOrientedPresentationEnabled(
true);
598 $tableGUI->setMultipleObjectivesInvolved($multipleObjectivesInvolved);
600 $tableGUI->setActiveId($active_id);
601 $tableGUI->setShowSuggestedSolution(
false);
603 $usersQuestionSolutions =
array();
605 foreach($result_array as $key => $val)
607 if($key ===
'test' || $key ===
'pass')
612 if( $this->
object->getShowSolutionSuggested() && strlen($val[
'solution']) )
614 $tableGUI->setShowSuggestedSolution(
true);
617 if( isset($val[
'pass']) )
619 $tableGUI->setPassColumnEnabled(
true);
622 $usersQuestionSolutions[$key] = $val;
625 $tableGUI->initColumns()->initFilter();
627 $tableGUI->setFilterCommand($targetCMD.
'SetTableFilter');
628 $tableGUI->setResetCommand($targetCMD.
'ResetTableFilter');
630 $tableGUI->setData($usersQuestionSolutions);
643 if ($this->
object->getShowSolutionSignature() && !$this->
object->getAnonymity())
645 $template =
new ilTemplate(
"tpl.il_as_tst_results_userdata_signature.html", TRUE, TRUE,
"Modules/Test");
646 $template->setVariable(
"TXT_DATE", $this->lng->txt(
"date"));
651 $template->setVariable(
"TXT_SIGNATURE", $this->lng->txt(
"tst_signature"));
653 return $template->get();
672 if(!is_object($testSession))
throw new TestException();
673 $template =
new ilTemplate(
"tpl.il_as_tst_results_userdata.html", TRUE, TRUE,
"Modules/Test");
674 include_once
'./Services/User/classes/class.ilObjUser.php';
675 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
683 $user->setLastname($this->lng->txt(
"deleted_user"));
685 $t = $testSession->getSubmittedTimestamp();
688 $t = $this->
object->_getLastAccess($testSession->getActiveId());
693 $uname = $this->
object->userLookupFullName($user_id, $overwrite_anonymity);
694 $template->setCurrentBlock(
"name");
695 $template->setVariable(
'TXT_USR_NAME', $this->lng->txt(
"name"));
696 $template->setVariable(
'VALUE_USR_NAME', $uname);
697 $template->parseCurrentBlock();
701 if (strlen($user->getMatriculation()) && (($this->
object->getAnonymity() == FALSE) || ($overwrite_anonymity)))
703 $template->setCurrentBlock(
"matriculation");
704 $template->setVariable(
"TXT_USR_MATRIC", $this->lng->txt(
"matriculation"));
705 $template->setVariable(
"VALUE_USR_MATRIC", $user->getMatriculation());
706 $template->parseCurrentBlock();
707 $title_matric =
" - " . $this->lng->txt(
"matriculation") .
": " . $user->getMatriculation();
710 $invited_user = array_pop($this->
object->getInvitedUsers($user_id));
711 if (strlen($invited_user[
"clientip"]))
713 $template->setCurrentBlock(
"client_ip");
714 $template->setVariable(
"TXT_CLIENT_IP", $this->lng->txt(
"client_ip"));
715 $template->setVariable(
"VALUE_CLIENT_IP", $invited_user[
"clientip"]);
716 $template->parseCurrentBlock();
717 $title_client =
" - " . $this->lng->txt(
"clientip") .
": " . $invited_user[
"clientip"];
720 $template->setVariable(
"TXT_TEST_TITLE", $this->lng->txt(
"title"));
721 $template->setVariable(
"VALUE_TEST_TITLE", $this->
object->getTitle());
724 $pagetitle = $this->
object->getTitle() . $title_matric . $title_client;
725 $this->tpl->setHeaderPageTitle($pagetitle);
727 return $template->get();
743 $test_id = $this->
object->getTestId();
744 $question_gui = $this->
object->createQuestionGUI(
"", $question_id);
751 $template =
new ilTemplate(
"tpl.il_as_tst_correct_solution_output.html", TRUE, TRUE,
"Modules/Test");
752 $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ? TRUE : FALSE;
753 $result_output = $question_gui->getSolutionOutput($active_id,
$pass, TRUE, FALSE, $show_question_only, $this->
object->getShowSolutionFeedback(), FALSE, FALSE, TRUE);
754 $best_output = $question_gui->getSolutionOutput($active_id,
$pass, FALSE, FALSE, $show_question_only, FALSE, TRUE, FALSE, FALSE);
755 if( $this->
object->getShowSolutionFeedback() &&
$_GET[
'cmd'] !=
'outCorrectSolution' )
757 $specificAnswerFeedback = $question_gui->getSpecificFeedbackOutput($active_id,
$pass);
758 if( strlen($specificAnswerFeedback) )
760 $template->setCurrentBlock(
"outline_specific_feedback");
761 $template->setVariable(
"OUTLINE_SPECIFIC_FEEDBACK", $specificAnswerFeedback);
762 $template->parseCurrentBlock();
765 if ($this->
object->isBestSolutionPrintedWithResult() && strlen($best_output))
767 $template->setCurrentBlock(
"best_solution");
768 $template->setVariable(
"TEXT_BEST_SOLUTION", $this->lng->txt(
"tst_best_solution_is"));
769 $template->setVariable(
"BEST_OUTPUT", $best_output);
770 $template->parseCurrentBlock();
772 $template->setVariable(
"TEXT_YOUR_SOLUTION", $this->lng->txt(
"tst_your_answer_was"));
773 $maxpoints = $question_gui->object->getMaximumPoints();
776 $template->setVariable(
"QUESTION_TITLE", $this->
object->getQuestionTitle($question_gui->object->getTitle()) .
" (" . $maxpoints .
" " . $this->lng->txt(
"point") .
")");
780 $template->setVariable(
"QUESTION_TITLE", $this->
object->getQuestionTitle($question_gui->object->getTitle()) .
" (" . $maxpoints .
" " . $this->lng->txt(
"points") .
")");
782 if( $objectivesList !== null )
784 $objectives = $this->lng->txt(
'tst_res_lo_objectives_header').
': ';
785 $objectives .= $objectivesList->getQuestionRelatedObjectiveTitles($question_gui->object->getId());
786 $template->setVariable(
'OBJECTIVES', $objectives);
788 $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
789 $template->setVariable(
"RECEIVED_POINTS", sprintf($this->lng->txt(
"you_received_a_of_b_points"), $question_gui->object->getReachedPoints($active_id,
$pass), $maxpoints));
790 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
791 $template->setVariable(
"BACKLINK_TEXT",
"<< " . $this->lng->txt(
"back"));
792 return $template->get();
807 function getResultsOfUserOutput($testSession, $active_id,
$pass, $targetGUI, $show_pass_details = TRUE, $show_answers = TRUE, $show_question_only = FALSE, $show_reached_points = FALSE)
809 global $ilObjDataCache;
811 include_once(
"./Services/UICore/classes/class.ilTemplate.php");
812 $template =
new ilTemplate(
"tpl.il_as_tst_results_participant.html", TRUE, TRUE,
"Modules/Test");
816 $user_id = $this->participantData->getUserIdByActiveId($active_id);
817 $uname = $this->participantData->getConcatedFullnameByActiveId($active_id,
false);
821 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
822 $uname = $this->
object->userLookupFullName($user_id, TRUE);
825 if (((array_key_exists(
"pass",
$_GET)) && (strlen(
$_GET[
"pass"]) > 0)) || (!is_null(
$pass)))
832 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
835 $objectivesList = null;
839 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id,
$pass);
840 $testSequence->loadFromDb();
841 $testSequence->loadQuestions();
843 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
847 $objectivesList->loadObjectivesTitles();
849 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
850 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
851 $testResultHeaderLabelBuilder->setTestObjId($this->
object->getId());
852 $testResultHeaderLabelBuilder->setTestRefId($this->
object->getRefId());
853 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
856 $result_array = $this->
object->getTestResult(
860 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
861 $showAllAnswers = TRUE;
862 if ($this->
object->isExecutable($testSession, $user_id))
864 $showAllAnswers = FALSE;
869 $result_array, $active_id,
$pass,
$_SESSION[
'tst_results_show_best_solutions'],
870 $showAllAnswers, $show_question_only, $show_reached_points, $show_pass_details,
871 $objectivesList, $testResultHeaderLabelBuilder
873 $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
876 if ($show_pass_details)
879 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
880 $template->setVariable(
"PASS_DETAILS", $overviewTableGUI->getHTML());
884 $template->setVariable(
"SIGNATURE", $signature);
886 if ($this->
object->isShowExamIdInTestResultsEnabled())
888 $template->setCurrentBlock(
'exam_id_footer');
890 $testSession->getActiveId(),
$pass 892 $template->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
893 $template->parseCurrentBlock();
897 $template->setCurrentBlock(
'participant_back_anchor');
898 $template->setVariable(
"HREF_PARTICIPANT_BACK_ANCHOR",
"#tst_results_toolbar");
899 $template->setVariable(
"TXT_PARTICIPANT_BACK_ANCHOR", $this->lng->txt(
'tst_back_to_top'));
900 $template->parseCurrentBlock();
902 $template->setCurrentBlock(
'participant_block_id');
903 $template->setVariable(
"PARTICIPANT_BLOCK_ID",
"participant_active_{$active_id}");
904 $template->parseCurrentBlock();
909 $gradingMessageBuilder->buildList();
911 $template->setCurrentBlock(
'grading_message');
912 $template->setVariable(
'GRADING_MESSAGE', $gradingMessageBuilder->getList());
913 $template->parseCurrentBlock();
918 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
919 $template->setVariable(
"USER_DATA", $user_data);
923 return $template->get();
935 $template =
new ilTemplate(
"tpl.il_as_tst_results_head_user_pass.html", TRUE, TRUE,
"Modules/Test");
936 include_once
'./Services/User/classes/class.ilObjUser.php';
937 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
945 $user->setLastname($this->lng->txt(
"deleted_user"));
948 if (strlen($user->getMatriculation()) && (($this->
object->getAnonymity() == FALSE)))
950 $template->setCurrentBlock(
"user_matric");
951 $template->setVariable(
"TXT_USR_MATRIC", $this->lng->txt(
"matriculation"));
952 $template->parseCurrentBlock();
953 $template->setCurrentBlock(
"user_matric_value");
954 $template->setVariable(
"VALUE_USR_MATRIC", $user->getMatriculation());
955 $template->parseCurrentBlock();
956 $template->touchBlock(
"user_matric_separator");
957 $title_matric =
" - " . $this->lng->txt(
"matriculation") .
": " . $user->getMatriculation();
960 $invited_user = array_pop($this->
object->getInvitedUsers($user_id));
961 if (strlen($invited_user[
"clientip"]))
963 $template->setCurrentBlock(
"user_clientip");
964 $template->setVariable(
"TXT_CLIENT_IP", $this->lng->txt(
"client_ip"));
965 $template->parseCurrentBlock();
966 $template->setCurrentBlock(
"user_clientip_value");
967 $template->setVariable(
"VALUE_CLIENT_IP", $invited_user[
"clientip"]);
968 $template->parseCurrentBlock();
969 $template->touchBlock(
"user_clientip_separator");
970 $title_client =
" - " . $this->lng->txt(
"clientip") .
": " . $invited_user[
"clientip"];
973 $template->setVariable(
"TXT_USR_NAME", $this->lng->txt(
"name"));
974 $uname = $this->
object->userLookupFullName($user_id, FALSE);
975 $template->setVariable(
"VALUE_USR_NAME", $uname);
976 $template->setVariable(
"TXT_PASS", $this->lng->txt(
"scored_pass"));
977 $template->setVariable(
"VALUE_PASS",
$pass);
978 return $template->get();
991 require_once
'Services/PDFGeneration/classes/class.ilPDFGeneration.php';
995 $question_gui = $this->
object->createQuestionGUI(
"", $question_id);
997 $foundusers = $this->
object->getParticipantsForTestAndQuestion($test_id, $question_id);
999 foreach($foundusers as $active_id => $passes)
1001 $resultpass = $this->
object->_getResultPass($active_id);
1002 for($i = 0; $i < count($passes); $i++)
1004 if(($resultpass !== null) && ($resultpass == $passes[$i][
"pass"]))
1008 $output .=
"<br /><br /><br />";
1012 $question_gui = $this->
object->createQuestionGUI(
"", $passes[$i][
"qid"]);
1015 $output .= $question_gui->getSolutionOutput(
1018 $graphicalOutput = FALSE,
1019 $result_output = FALSE,
1020 $show_question_only = FALSE,
1021 $show_feedback = FALSE
1027 require_once
'./Modules/Test/classes/class.ilTestPDFGenerator.php';
1036 require_once
'Modules/Test/classes/tables/class.ilTestPassDetailsOverviewTableGUI.php';
1049 if( $this->
object->isShowGradingStatusEnabled() )
1054 if( $this->
object->isShowGradingMarkEnabled() )
1059 if( $this->
object->areObligationsEnabled() )
1073 require_once
'Modules/Test/classes/class.ilTestGradingMessageBuilder.php';
1076 $gradingMessageBuilder->setActiveId($activeId);
1078 return $gradingMessageBuilder;
1083 require_once
'Modules/Test/classes/class.ilTestQuestionRelatedObjectivesList.php';
1088 return $questionRelatedObjectivesList;
1093 global
$ilDB, $ilPluginAdmin;
1096 $table_gui->initFilter();
1098 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
1101 $questionList->setParentObjIdsFilter(
array($this->
object->getId()));
1104 foreach ($table_gui->getFilterItems() as $item)
1106 if( substr($item->getPostVar(), 0, strlen(
'tax_')) ==
'tax_' )
1108 $v = $item->getValue();
1110 if( is_array($v) && count($v) && !(
int)$v[0] )
1115 $taxId = substr($item->getPostVar(), strlen(
'tax_'));
1116 $questionList->addTaxonomyFilter($taxId, $item->getValue(), $this->
object->getId(),
'tst');
1118 elseif( $item->getValue() !== false )
1120 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
1124 $questionList->load();
1126 $filteredTestResult =
array();
1128 $resultData = $this->
object->getTestResult($active_id,
$pass,
false, $considerHiddenQuestions, $considerOptionalQuestions);
1130 foreach($resultData as $resultItemKey => $resultItemValue)
1132 if($resultItemKey ===
'test' || $resultItemKey ===
'pass')
1137 if( !$questionList->isInList($resultItemValue[
'qid']) )
1142 $filteredTestResult[] = $resultItemValue;
1145 return $filteredTestResult;
1155 require_once
'class.ilTestPDFGenerator.php';
1163 $this->tpl->setContent($content);
1172 require_once
'Modules/Test/classes/toolbars/class.ilTestResultsToolbarGUI.php';
1175 $toolbar->setSkillResultButtonEnabled($this->
object->isSkillServiceToBeConsidered());
1192 if( !$this->
object->getShowSolutionDetails() )
1195 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1198 $testSession = $this->testSessionFactory->getSession();
1199 $activeId = $testSession->getActiveId();
1201 if( !($activeId > 0) )
1203 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1206 $this->ctrl->saveParameter($this,
"pass");
1209 $questionId = (int)
$_GET[
'evaluation'];
1211 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($activeId,
$pass);
1212 $testSequence->loadFromDb();
1213 $testSequence->loadQuestions();
1215 if( !$testSequence->questionExists($questionId) )
1222 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($activeId,
$pass);
1223 $testSequence->loadFromDb();
1224 $testSequence->loadQuestions();
1226 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1229 $objectivesList->loadObjectivesTitles();
1233 $objectivesList = null;
1240 $ilTabs->setBackTarget(
1241 $this->lng->txt(
"tst_back_to_virtual_pass"), $this->ctrl->getLinkTarget($this,
'showVirtualPass')
1246 $ilTabs->setBackTarget(
1247 $this->lng->txt(
"tst_back_to_pass_details"), $this->ctrl->getLinkTarget($this,
'outUserPassDetails')
1251 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
1252 $this->tpl->setCurrentBlock(
"ContentStyle");
1254 $this->tpl->parseCurrentBlock();
1256 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1258 $this->tpl->parseCurrentBlock();
1261 if ($this->
object->getShowSolutionAnswersOnly())
1268 $this->tpl->setContent($solution);
1281 $tpl->setVariable(
"PASS_FINISH_DATE_LABEL", $this->lng->txt(
'tst_pass_finished_on'));
1282 $tpl->setVariable(
"PASS_FINISH_DATE_VALUE", $passFinishDate);
1289 $sort = (
$_GET[
"sort"]) ? (
$_GET[
"sort"]) :
"nr";
1290 $sortorder = (
$_GET[
"sortorder"]) ? (
$_GET[
"sortorder"]) :
"asc";
1291 if (strcmp($sortorder,
"asc"))
1301 if ($a[$sort] == $b[$sort])
return 0;
1302 return ($a[$sort] < $b[$sort]) ? $smaller : $greater;
static _lookupLogin($a_user_id)
lookup login
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getFilteredTestResult($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)
setContextResultPresentation($contextResultPresentation)
isContextResultPresentation()
getPassListOfAnswers(&$result_array, $active_id, $pass, $show_solutions=FALSE, $only_answered_questions=FALSE, $show_question_only=FALSE, $show_reached_points=FALSE, $anchorNav=false, ilTestQuestionRelatedObjectivesList $objectivesList=null, ilTestResultHeaderLabelBuilder $testResultHeaderLabelBuilder=null)
Returns the list of answers of a users test pass.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
getObjectiveOrientedContainer()
static setUseRelativeDates($a_status)
set use relative dates
getResultsSignature()
Returns HTML code for a signature field.
const QUESTION_INSTANCE_TYPE_DUPLICATES
static accessViolationRedirect()
static getRequestRequestStatisticDataRegisterByActiveId($activeId)
static useRelativeDates()
check if relative dates are used
isGradingMessageRequired()
buildUserTestResultsToolbarGUI()
getCorrectSolutionOutput($question_id, $active_id, $pass, ilTestQuestionRelatedObjectivesList $objectivesList=null)
Returns an output of the solution to an answer compared to the correct solution.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
static getInstance(ilTestSession $a_test_session)
getResultsHeadUserAndPass($active_id, $pass)
Returns the user and pass data for a test results output.
getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
populateContent($content)
static _getReachedPoints($active_id, $question_id, $pass=NULL)
Returns the points, a learner has reached answering the question.
getCommand($cmd)
Retrieves the ilCtrl command.
buildQuestionRelatedObjectiveList(ilTestQuestionSequence $a_test_sequence, ilTestQuestionRelatedObjectivesList $a_objectives_list)
special template class to simplify handling of ITX/PEAR
setParticipantData($participantData)
outCorrectSolution()
Creates an output of the solution of an answer compared to the correct solution.
static formatDate(ilDateTime $date)
Format a date public.
static initDomEvent()
Init YUI DomEvent.
redirection script todo: (a better solution should control the processing via a xml file) ...
Class ilTestPassOverviewTableGUI.
static getSyntaxStylePath()
get syntax style path
getResultsOfUserOutput($testSession, $active_id, $pass, $targetGUI, $show_pass_details=TRUE, $show_answers=TRUE, $show_question_only=FALSE, $show_reached_points=FALSE)
Output of the pass overview for a test called by a test participant.
Create styles array
The data for the language used.
$contextResultPresentation
$objectiveOrientedContainer
static getContentStylePath($a_style_id)
get content style path
static prepareGeneration()
Prepare the PDF generation This initializes the purpose for MathJax rendering It has to be called bef...
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
Create new PHPExcel object
obj_idprivate
static _getManualScoring()
Retrieve the manual scoring settings.
getGradingMessageBuilder($activeId)
__construct(ilObjTest $a_object)
The constructor takes the test object reference as parameter.
static generatePDF($pdf_output, $output_mode, $filename=null)
populatePassFinishDate($tpl, $passFinishDate)
executeCommand()
execute command
const RENDER_PURPOSE_PRINT_PDF
setObjectiveOrientedContainer(ilTestObjectiveOrientedContainer $objectiveOrientedContainer)
getPassListOfAnswersWithScoring(&$result_array, $active_id, $pass, $show_solutions=FALSE)
Returns the list of answers of a users test pass and offers a scoring option.
Service GUI class for tests.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=FALSE)
Returns the user data for a test results output.
buildPassOverviewTableGUI($targetGUI, $targetCmd='')
const PDF_OUTPUT_DOWNLOAD
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
getPassOverviewTableData(ilTestSession $testSession, $passes, $withResults)
getQuestionResultForTestUsers($question_id, $test_id)
Creates a HTML representation for the results of a given question in a test.
static lookupExamId($active_id, $pass)