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 foreach($passes as
$pass)
177 $considerOptionalQuestions =
true;
181 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($testSession->
getActiveId(),
$pass);
183 $testSequence->loadFromDb();
184 $testSequence->loadQuestions();
186 if($this->object->isRandomTest() && !$testSequence->isAnsweringOptionalQuestionsConfirmed())
188 $considerOptionalQuestions =
false;
191 $testSequence->setConsiderHiddenQuestionsEnabled($considerHiddenQuestions);
192 $testSequence->setConsiderOptionalQuestionsEnabled($considerOptionalQuestions);
195 $objectivesList->loadObjectivesTitles();
197 $row[
'objectives'] = $objectivesList->getUniqueObjectivesStringForQuestions($testSequence->getUserSequenceQuestions());
202 $result_array = $this->
object->getTestResult($testSession->
getActiveId(),
$pass,
false, $considerHiddenQuestions, $considerOptionalQuestions);
203 if(!$result_array[
'pass'][
'total_max_points'])
208 $percentage = ($result_array[
'pass'][
'total_reached_points'] / $result_array[
'pass'][
'total_max_points']) * 100;
210 $total_max = $result_array[
'pass'][
'total_max_points'];
211 $total_reached = $result_array[
'pass'][
'total_reached_points'];
212 $total_requested_hints = $result_array[
'pass'][
'total_requested_hints'];
217 $row[
'scored'] = ($pass == $scoredPass);
224 $row[
'num_workedthrough_questions'] = $result_array[
'pass'][
'num_workedthrough'];
225 $row[
'num_questions_total'] = $result_array[
'pass'][
'num_questions_total'];
227 if($this->object->isOfferingQuestionHintsEnabled())
229 $row[
'hints'] = $total_requested_hints;
232 $row[
'reached_points'] = $total_reached;
233 $row[
'max_points'] = $total_max;
234 $row[
'percentage'] = $percentage;
264 $cmd = $this->ctrl->getCmd();
265 $next_class = $this->ctrl->getNextClass($this);
291 require_once
'Services/Link/classes/class.ilLink.php';
293 $this->tabs->setBack2Target($this->lng->txt(
'back_to_objective_container'), $courseLink);
296 'results_pass_oriented', $this->lng->txt(
'tst_tab_results_pass_oriented'),
297 $this->ctrl->getLinkTargetByClass(
'ilTestEvaluationGUI',
'outUserResultsOverview')
301 'results_objective_oriented', $this->lng->txt(
'tst_tab_results_objective_oriented'),
302 $this->ctrl->getLinkTargetByClass(
'ilTestEvalObjectiveOrientedGUI',
'showVirtualPass')
305 $this->tabs->setTabActive($activeTabId);
314 if( !isset(
$_GET[
'pdf']) )
319 if( !(
bool)
$_GET[
'pdf'] )
332 require_once
'Modules/Test/classes/tables/class.ilTestPassOverviewTableGUI.php';
336 $table->setPdfPresentationEnabled(
340 $table->setObjectiveOrientedPresentationEnabled(
359 $maintemplate =
new ilTemplate(
"tpl.il_as_tst_list_of_answers.html", TRUE, TRUE,
"Modules/Test");
363 foreach ($result_array as $question_data)
365 if (($question_data[
"workedthrough"] == 1) || ($only_answered_questions == FALSE))
367 $template =
new ilTemplate(
"tpl.il_as_qpl_question_printview.html", TRUE, TRUE,
"Modules/TestQuestionPool");
368 $question = $question_data[
"qid"];
369 if (is_numeric($question))
371 $maintemplate->setCurrentBlock(
"printview_question");
372 $question_gui = $this->
object->createQuestionGUI(
"", $question);
373 if (is_object($question_gui))
382 $template->setCurrentBlock(
'block_id');
383 $template->setVariable(
'BLOCK_ID',
"detailed_answer_block_act_{$active_id}_qst_{$question}");
384 $template->parseCurrentBlock();
386 $template->setCurrentBlock(
'back_anchor');
387 $template->setVariable(
'HREF_BACK_ANCHOR',
"#pass_details_tbl_row_act_{$active_id}_qst_{$question}");
388 $template->setVariable(
'TXT_BACK_ANCHOR', $this->lng->txt(
'tst_back_to_question_list'));
389 $template->parseCurrentBlock();
392 if ($show_reached_points)
394 $template->setCurrentBlock(
"result_points");
395 $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());
396 $template->parseCurrentBlock();
398 $template->setVariable(
"COUNTER_QUESTION", $counter.
". ");
399 $template->setVariable(
"TXT_QUESTION_ID", $this->lng->txt(
'question_id_short'));
400 $template->setVariable(
"QUESTION_ID", $question_gui->object->getId());
401 $template->setVariable(
"QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()));
403 if( $objectivesList !== null )
405 $objectives = $this->lng->txt(
'tst_res_lo_objectives_header').
': ';
406 $objectives .= $objectivesList->getQuestionRelatedObjectiveTitles($question_gui->object->getId());
407 $template->setVariable(
"OBJECTIVES", $objectives);
410 $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ? TRUE : FALSE;
417 $compare_template =
new ilTemplate(
'tpl.il_as_tst_answers_compare.html', TRUE, TRUE,
'Modules/Test');
418 $compare_template->setVariable(
"HEADER_PARTICIPANT", $this->lng->txt(
'tst_header_participant'));
419 $compare_template->setVariable(
"HEADER_SOLUTION", $this->lng->txt(
'tst_header_solution'));
420 $result_output = $question_gui->getSolutionOutput($active_id,
$pass, $show_solutions, FALSE, $show_question_only, $showFeedback);
421 $best_output = $question_gui->getSolutionOutput($active_id,
$pass, FALSE, FALSE, $show_question_only, FALSE, TRUE);
423 $compare_template->setVariable(
'PARTICIPANT', $result_output);
424 $compare_template->setVariable(
'SOLUTION', $best_output);
425 $template->setVariable(
'SOLUTION_OUTPUT', $compare_template->get());
429 $result_output = $question_gui->getSolutionOutput($active_id,
$pass, $show_solutions, FALSE, $show_question_only, $showFeedback);
430 $template->setVariable(
'SOLUTION_OUTPUT', $result_output);
433 $maintemplate->setCurrentBlock(
"printview_question");
434 $maintemplate->setVariable(
"QUESTION_PRINTVIEW", $template->get());
435 $maintemplate->parseCurrentBlock();
444 $headerText = $testResultHeaderLabelBuilder->getListOfAnswersHeaderLabel(
$pass + 1);
448 $headerText = $testResultHeaderLabelBuilder->getVirtualListOfAnswersHeaderLabel();
451 $maintemplate->setVariable(
"RESULTS_OVERVIEW", $headerText);
452 return $maintemplate->get();
469 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
471 $maintemplate =
new ilTemplate(
"tpl.il_as_tst_list_of_answers.html", TRUE, TRUE,
"Modules/Test");
473 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
478 foreach ($result_array as $question_data)
480 $question = $question_data[
"qid"];
481 if (is_numeric($question))
483 $question_gui = $this->
object->createQuestionGUI(
"", $question);
484 if (in_array($question_gui->object->getQuestionTypeID(), $scoring))
486 $template =
new ilTemplate(
"tpl.il_as_qpl_question_printview.html", TRUE, TRUE,
"Modules/TestQuestionPool");
487 $scoretemplate =
new ilTemplate(
"tpl.il_as_tst_manual_scoring_points.html", TRUE, TRUE,
"Modules/Test");
488 #mbecker: No such block. $this->tpl->setCurrentBlock("printview_question"); 489 $template->setVariable(
"COUNTER_QUESTION", $counter.
". ");
490 $template->setVariable(
"QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()));
491 $points = $question_gui->object->getMaximumPoints();
494 $template->setVariable(
"QUESTION_POINTS", $points .
" " . $this->lng->txt(
"point"));
498 $template->setVariable(
"QUESTION_POINTS", $points .
" " . $this->lng->txt(
"points"));
501 $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ? TRUE : FALSE;
502 $result_output = $question_gui->getSolutionOutput($active_id,
$pass, $show_solutions, FALSE, $show_question_only, $this->object->getShowSolutionFeedback(), FALSE, TRUE);
504 $solout = $question_gui->object->getSuggestedSolutionOutput();
507 $scoretemplate->setCurrentBlock(
"suggested_solution");
508 $scoretemplate->setVariable(
"TEXT_SUGGESTED_SOLUTION", $this->lng->txt(
"solution_hint"));
509 $scoretemplate->setVariable(
"VALUE_SUGGESTED_SOLUTION", $solout);
510 $scoretemplate->parseCurrentBlock();
513 $scoretemplate->setCurrentBlock(
"feedback");
514 $scoretemplate->setVariable(
"FEEDBACK_NAME_INPUT", $question);
515 $feedback = $this->
object->getManualFeedback($active_id, $question,
$pass);
516 $scoretemplate->setVariable(
"VALUE_FEEDBACK",
ilUtil::prepareFormOutput($this->object->prepareTextareaOutput($feedback, TRUE)));
517 $scoretemplate->setVariable(
"TEXT_MANUAL_FEEDBACK", $this->lng->txt(
"set_manual_feedback"));
518 $scoretemplate->parseCurrentBlock();
520 $scoretemplate->setVariable(
"NAME_INPUT", $question);
521 $this->ctrl->setParameter($this,
"active_id", $active_id);
522 $this->ctrl->setParameter($this,
"pass",
$pass);
523 $scoretemplate->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"manscoring"));
524 $scoretemplate->setVariable(
"LABEL_INPUT", $this->lng->txt(
"tst_change_points_for_question"));
526 $scoretemplate->setVariable(
"VALUE_SAVE", $this->lng->txt(
"save"));
528 $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
529 $maintemplate->setCurrentBlock(
"printview_question");
530 $maintemplate->setVariable(
"QUESTION_PRINTVIEW", $template->get());
531 $maintemplate->setVariable(
"QUESTION_SCORING", $scoretemplate->get());
532 $maintemplate->parseCurrentBlock();
540 $maintemplate->setVariable(
"NO_QUESTIONS_FOUND", $this->lng->txt(
"manscoring_questions_not_found"));
542 $maintemplate->setVariable(
"RESULTS_OVERVIEW", sprintf($this->lng->txt(
"manscoring_results_pass"),
$pass+1));
544 include_once
"./Services/YUI/classes/class.ilYuiUtil.php";
547 return $maintemplate->get();
552 $this->ctrl->setParameter($targetGUI,
'active_id', $active_id);
553 $this->ctrl->setParameter($targetGUI,
'pass',
$pass);
557 $tableGUI->setAnswerListAnchorEnabled($questionAnchorNav);
558 $tableGUI->setSingleAnswerScreenCmd($questionDetailsCMD);
559 $tableGUI->setShowHintCount($this->object->isOfferingQuestionHintsEnabled());
561 if( $objectivesList !== null )
563 $tableGUI->setQuestionRelatedObjectivesList($objectivesList);
564 $tableGUI->setObjectiveOrientedPresentationEnabled(
true);
567 $tableGUI->setActiveId($active_id);
568 $tableGUI->setShowSuggestedSolution(
false);
570 $usersQuestionSolutions = array();
572 foreach($result_array as $key => $val)
574 if($key ===
'test' || $key ===
'pass')
579 if( $this->object->getShowSolutionSuggested() && strlen($val[
'solution']) )
581 $tableGUI->setShowSuggestedSolution(
true);
584 if( isset($val[
'pass']) )
586 $tableGUI->setPassColumnEnabled(
true);
589 $usersQuestionSolutions[$key] = $val;
592 $tableGUI->initColumns()->initFilter();
594 $tableGUI->setFilterCommand($targetCMD.
'SetTableFilter');
595 $tableGUI->setResetCommand($targetCMD.
'ResetTableFilter');
597 $tableGUI->setData($usersQuestionSolutions);
610 if ($this->object->getShowSolutionSignature() && !$this->
object->getAnonymity())
612 $template =
new ilTemplate(
"tpl.il_as_tst_results_userdata_signature.html", TRUE, TRUE,
"Modules/Test");
613 $template->setVariable(
"TXT_DATE", $this->lng->txt(
"date"));
618 $template->setVariable(
"TXT_SIGNATURE", $this->lng->txt(
"tst_signature"));
620 return $template->get();
639 if(!is_object($testSession))
throw new TestException();
640 $template =
new ilTemplate(
"tpl.il_as_tst_results_userdata.html", TRUE, TRUE,
"Modules/Test");
641 include_once
'./Services/User/classes/class.ilObjUser.php';
642 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
650 $user->setLastname($this->lng->txt(
"deleted_user"));
652 $t = $testSession->getSubmittedTimestamp();
655 $t = $this->
object->_getLastAccess($testSession->getActiveId());
660 $uname = $this->
object->userLookupFullName($user_id, $overwrite_anonymity);
661 $template->setCurrentBlock(
"name");
662 $template->setVariable(
'TXT_USR_NAME', $this->lng->txt(
"name"));
663 $template->setVariable(
'VALUE_USR_NAME', $uname);
664 $template->parseCurrentBlock();
668 if (strlen($user->getMatriculation()) && (($this->object->getAnonymity() == FALSE) || ($overwrite_anonymity)))
670 $template->setCurrentBlock(
"matriculation");
671 $template->setVariable(
"TXT_USR_MATRIC", $this->lng->txt(
"matriculation"));
672 $template->setVariable(
"VALUE_USR_MATRIC", $user->getMatriculation());
673 $template->parseCurrentBlock();
674 $title_matric =
" - " . $this->lng->txt(
"matriculation") .
": " . $user->getMatriculation();
677 $invited_user = array_pop($this->object->getInvitedUsers($user_id));
678 if (strlen($invited_user[
"clientip"]))
680 $template->setCurrentBlock(
"client_ip");
681 $template->setVariable(
"TXT_CLIENT_IP", $this->lng->txt(
"client_ip"));
682 $template->setVariable(
"VALUE_CLIENT_IP", $invited_user[
"clientip"]);
683 $template->parseCurrentBlock();
684 $title_client =
" - " . $this->lng->txt(
"clientip") .
": " . $invited_user[
"clientip"];
687 $template->setVariable(
"TXT_TEST_TITLE", $this->lng->txt(
"title"));
688 $template->setVariable(
"VALUE_TEST_TITLE", $this->object->getTitle());
691 $pagetitle = $this->
object->getTitle() . $title_matric . $title_client;
692 $this->tpl->setHeaderPageTitle($pagetitle);
694 return $template->get();
710 $test_id = $this->
object->getTestId();
711 $question_gui = $this->
object->createQuestionGUI(
"", $question_id);
718 $template =
new ilTemplate(
"tpl.il_as_tst_correct_solution_output.html", TRUE, TRUE,
"Modules/Test");
719 $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ? TRUE : FALSE;
720 $result_output = $question_gui->getSolutionOutput($active_id,
$pass, TRUE, FALSE, $show_question_only, $this->object->getShowSolutionFeedback(), FALSE, FALSE, TRUE);
721 $best_output = $question_gui->getSolutionOutput($active_id,
$pass, FALSE, FALSE, $show_question_only, FALSE, TRUE, FALSE, FALSE);
722 if( $this->object->getShowSolutionFeedback() &&
$_GET[
'cmd'] !=
'outCorrectSolution' )
724 $specificAnswerFeedback = $question_gui->getSpecificFeedbackOutput($active_id,
$pass);
725 if( strlen($specificAnswerFeedback) )
727 $template->setCurrentBlock(
"outline_specific_feedback");
728 $template->setVariable(
"OUTLINE_SPECIFIC_FEEDBACK", $specificAnswerFeedback);
729 $template->parseCurrentBlock();
732 if ($this->object->isBestSolutionPrintedWithResult() && strlen($best_output))
734 $template->setCurrentBlock(
"best_solution");
735 $template->setVariable(
"TEXT_BEST_SOLUTION", $this->lng->txt(
"tst_best_solution_is"));
736 $template->setVariable(
"BEST_OUTPUT", $best_output);
737 $template->parseCurrentBlock();
739 $template->setVariable(
"TEXT_YOUR_SOLUTION", $this->lng->txt(
"tst_your_answer_was"));
740 $maxpoints = $question_gui->object->getMaximumPoints();
743 $template->setVariable(
"QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()) .
" (" . $maxpoints .
" " . $this->lng->txt(
"point") .
")");
747 $template->setVariable(
"QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()) .
" (" . $maxpoints .
" " . $this->lng->txt(
"points") .
")");
749 if( $objectivesList !== null )
751 $objectives = $this->lng->txt(
'tst_res_lo_objectives_header').
': ';
752 $objectives .= $objectivesList->getQuestionRelatedObjectiveTitles($question_gui->object->getId());
753 $template->setVariable(
'OBJECTIVES', $objectives);
755 $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
756 $template->setVariable(
"RECEIVED_POINTS", sprintf($this->lng->txt(
"you_received_a_of_b_points"), $question_gui->object->getReachedPoints($active_id,
$pass), $maxpoints));
757 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
758 $template->setVariable(
"BACKLINK_TEXT",
"<< " . $this->lng->txt(
"back"));
759 return $template->get();
774 function getResultsOfUserOutput($testSession, $active_id,
$pass, $targetGUI, $show_pass_details = TRUE, $show_answers = TRUE, $show_question_only = FALSE, $show_reached_points = FALSE)
776 global $ilObjDataCache;
778 include_once(
"./Services/UICore/classes/class.ilTemplate.php");
779 $template =
new ilTemplate(
"tpl.il_as_tst_results_participant.html", TRUE, TRUE,
"Modules/Test");
783 $user_id = $this->participantData->getUserIdByActiveId($active_id);
784 $uname = $this->participantData->getConcatedFullnameByActiveId($active_id,
false);
788 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
789 $uname = $this->
object->userLookupFullName($user_id, TRUE);
792 if (((array_key_exists(
"pass",
$_GET)) && (strlen(
$_GET[
"pass"]) > 0)) || (!is_null(
$pass)))
799 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
802 $objectivesList = null;
806 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id,
$pass);
807 $testSequence->loadFromDb();
808 $testSequence->loadQuestions();
810 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
814 $objectivesList->loadObjectivesTitles();
816 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
817 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
818 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
819 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
820 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
823 $result_array = $this->
object->getTestResult(
827 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
828 $showAllAnswers = TRUE;
829 if ($this->object->isExecutable($testSession, $user_id))
831 $showAllAnswers = FALSE;
836 $result_array, $active_id,
$pass,
$_SESSION[
'tst_results_show_best_solutions'],
837 $showAllAnswers, $show_question_only, $show_reached_points, $show_pass_details,
838 $objectivesList, $testResultHeaderLabelBuilder
840 $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
843 if ($show_pass_details)
846 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
847 $template->setVariable(
"PASS_DETAILS", $overviewTableGUI->getHTML());
851 $template->setVariable(
"SIGNATURE", $signature);
853 if ($this->object->isShowExamIdInTestResultsEnabled())
855 $template->setCurrentBlock(
'exam_id_footer');
856 $template->setVariable(
'EXAM_ID_VAL', $this->object->lookupExamId(
857 $testSession->getActiveId(),
$pass 859 $template->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
860 $template->parseCurrentBlock();
864 $template->setCurrentBlock(
'participant_back_anchor');
865 $template->setVariable(
"HREF_PARTICIPANT_BACK_ANCHOR",
"#tst_results_toolbar");
866 $template->setVariable(
"TXT_PARTICIPANT_BACK_ANCHOR", $this->lng->txt(
'tst_back_to_top'));
867 $template->parseCurrentBlock();
869 $template->setCurrentBlock(
'participant_block_id');
870 $template->setVariable(
"PARTICIPANT_BLOCK_ID",
"participant_active_{$active_id}");
871 $template->parseCurrentBlock();
876 $gradingMessageBuilder->buildList();
878 $template->setCurrentBlock(
'grading_message');
879 $template->setVariable(
'GRADING_MESSAGE', $gradingMessageBuilder->getList());
880 $template->parseCurrentBlock();
885 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
886 $template->setVariable(
"USER_DATA", $user_data);
890 return $template->get();
902 $template =
new ilTemplate(
"tpl.il_as_tst_results_head_user_pass.html", TRUE, TRUE,
"Modules/Test");
903 include_once
'./Services/User/classes/class.ilObjUser.php';
904 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
912 $user->setLastname($this->lng->txt(
"deleted_user"));
915 if (strlen($user->getMatriculation()) && (($this->object->getAnonymity() == FALSE)))
917 $template->setCurrentBlock(
"user_matric");
918 $template->setVariable(
"TXT_USR_MATRIC", $this->lng->txt(
"matriculation"));
919 $template->parseCurrentBlock();
920 $template->setCurrentBlock(
"user_matric_value");
921 $template->setVariable(
"VALUE_USR_MATRIC", $user->getMatriculation());
922 $template->parseCurrentBlock();
923 $template->touchBlock(
"user_matric_separator");
924 $title_matric =
" - " . $this->lng->txt(
"matriculation") .
": " . $user->getMatriculation();
927 $invited_user = array_pop($this->object->getInvitedUsers($user_id));
928 if (strlen($invited_user[
"clientip"]))
930 $template->setCurrentBlock(
"user_clientip");
931 $template->setVariable(
"TXT_CLIENT_IP", $this->lng->txt(
"client_ip"));
932 $template->parseCurrentBlock();
933 $template->setCurrentBlock(
"user_clientip_value");
934 $template->setVariable(
"VALUE_CLIENT_IP", $invited_user[
"clientip"]);
935 $template->parseCurrentBlock();
936 $template->touchBlock(
"user_clientip_separator");
937 $title_client =
" - " . $this->lng->txt(
"clientip") .
": " . $invited_user[
"clientip"];
940 $template->setVariable(
"TXT_USR_NAME", $this->lng->txt(
"name"));
941 $uname = $this->
object->userLookupFullName($user_id, FALSE);
942 $template->setVariable(
"VALUE_USR_NAME", $uname);
943 $template->setVariable(
"TXT_PASS", $this->lng->txt(
"scored_pass"));
944 $template->setVariable(
"VALUE_PASS",
$pass);
945 return $template->get();
958 $question_gui = $this->
object->createQuestionGUI(
"", $question_id);
960 $foundusers = $this->
object->getParticipantsForTestAndQuestion($test_id, $question_id);
962 foreach($foundusers as $active_id => $passes)
964 $resultpass = $this->
object->_getResultPass($active_id);
965 for($i = 0; $i < count($passes); $i++)
967 if(($resultpass !== null) && ($resultpass == $passes[$i][
"pass"]))
971 $output .=
"<br /><br /><br />";
975 $question_gui = $this->
object->createQuestionGUI(
"", $passes[$i][
"qid"]);
978 $output .= $question_gui->getSolutionOutput(
981 $graphicalOutput = FALSE,
982 $result_output = FALSE,
983 $show_question_only = FALSE,
984 $show_feedback = FALSE
990 require_once
'./Modules/Test/classes/class.ilTestPDFGenerator.php';
999 require_once
'Modules/Test/classes/tables/class.ilTestPassDetailsOverviewTableGUI.php';
1012 if( $this->object->isShowGradingStatusEnabled() )
1017 if( $this->object->isShowGradingMarkEnabled() )
1022 if( $this->object->areObligationsEnabled() )
1036 require_once
'Modules/Test/classes/class.ilTestGradingMessageBuilder.php';
1039 $gradingMessageBuilder->setActiveId($activeId);
1041 return $gradingMessageBuilder;
1046 require_once
'Modules/Test/classes/class.ilTestQuestionRelatedObjectivesList.php';
1051 return $questionRelatedObjectivesList;
1056 global
$ilDB, $ilPluginAdmin;
1059 $table_gui->initFilter();
1061 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
1064 $questionList->setParentObjIdsFilter(array($this->object->getId()));
1067 foreach ($table_gui->getFilterItems() as $item)
1069 if( substr($item->getPostVar(), 0, strlen(
'tax_')) ==
'tax_' )
1071 $v = $item->getValue();
1073 if( is_array($v) && count($v) && !(
int)$v[0] )
1078 $taxId = substr($item->getPostVar(), strlen(
'tax_'));
1079 $questionList->addTaxonomyFilter($taxId, $item->getValue(), $this->
object->getId(),
'tst');
1081 elseif( $item->getValue() !== false )
1083 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
1087 $questionList->load();
1089 $filteredTestResult = array();
1091 $resultData = $this->
object->getTestResult($active_id,
$pass,
false, $considerHiddenQuestions, $considerOptionalQuestions);
1093 foreach($resultData as $resultItemKey => $resultItemValue)
1095 if($resultItemKey ===
'test' || $resultItemKey ===
'pass')
1100 if( !$questionList->isInList($resultItemValue[
'qid']) )
1105 $filteredTestResult[] = $resultItemValue;
1108 return $filteredTestResult;
1118 require_once
'class.ilTestPDFGenerator.php';
1126 $this->tpl->setContent($content);
1135 require_once
'Modules/Test/classes/toolbars/class.ilTestResultsToolbarGUI.php';
1138 $toolbar->setSkillResultButtonEnabled($this->object->isSkillServiceToBeConsidered());
1155 if( !$this->object->getShowSolutionDetails() )
1158 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1161 $testSession = $this->testSessionFactory->getSession();
1162 $activeId = $testSession->getActiveId();
1164 if( !($activeId > 0) )
1166 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1169 $this->ctrl->saveParameter($this,
"pass");
1172 $questionId = (int)
$_GET[
'evaluation'];
1176 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($activeId,
$pass);
1177 $testSequence->loadFromDb();
1178 $testSequence->loadQuestions();
1180 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1183 $objectivesList->loadObjectivesTitles();
1187 $objectivesList = null;
1194 $ilTabs->setBackTarget(
1195 $this->lng->txt(
"tst_back_to_virtual_pass"), $this->ctrl->getLinkTarget($this,
'showVirtualPass')
1200 $ilTabs->setBackTarget(
1201 $this->lng->txt(
"tst_back_to_pass_details"), $this->ctrl->getLinkTarget($this,
'outUserPassDetails')
1205 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1206 $this->tpl->setCurrentBlock(
"ContentStyle");
1208 $this->tpl->parseCurrentBlock();
1210 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1212 $this->tpl->parseCurrentBlock();
1215 if ($this->object->getShowSolutionAnswersOnly())
1222 $this->tpl->setContent($solution);
1235 $tpl->setVariable(
"PASS_FINISH_DATE_LABEL", $this->lng->txt(
'tst_pass_finished_on'));
1236 $tpl->setVariable(
"PASS_FINISH_DATE_VALUE", $passFinishDate);
1243 $sort = (
$_GET[
"sort"]) ? (
$_GET[
"sort"]) :
"nr";
1244 $sortorder = (
$_GET[
"sortorder"]) ? (
$_GET[
"sortorder"]) :
"asc";
1245 if (strcmp($sortorder,
"asc"))
1255 if ($a[$sort] == $b[$sort])
return 0;
1256 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.
getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null)
const QUESTION_INSTANCE_TYPE_DUPLICATES
getSyntaxStylePath()
get syntax style path
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)
static getInstance(ilTestSession $a_test_session)
getResultsHeadUserAndPass($active_id, $pass)
Returns the user and pass data for a test results output.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
populateContent($content)
getCommand($cmd)
Retrieves the ilCtrl command.
buildQuestionRelatedObjectiveList(ilTestQuestionSequence $a_test_sequence, ilTestQuestionRelatedObjectivesList $a_objectives_list)
special template class to simplify handling of ITX/PEAR
ilTestServiceGUI(ilObjTest $a_object)
The constructor takes the test object reference as parameter.
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.
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.
$contextResultPresentation
$objectiveOrientedContainer
_getReachedPoints($active_id, $question_id, $pass=NULL)
Returns the points, a learner has reached answering the question.
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
getContentStylePath($a_style_id)
get content style path
getGradingMessageBuilder($activeId)
static generatePDF($pdf_output, $output_mode, $filename=null)
populatePassFinishDate($tpl, $passFinishDate)
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.
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="")
_getManualScoring()
Retrieve the manual scoring settings.
getPassOverviewTableData(ilTestSession $testSession, $passes, $withResults)
& executeCommand()
execute command
getQuestionResultForTestUsers($question_id, $test_id)
Creates a HTML representation for the results of a given question in a test.