ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilTestServiceGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once "./Modules/Test/classes/inc.AssessmentConstants.php";
5include_once 'Modules/Test/classes/class.ilTestService.php';
6
22{
26 public $object = null;
27
31 public $service = null;
32
36 protected $db;
37
38 var $lng;
39 var $tpl;
40
44 var $ctrl;
45
49 protected $tabs;
50
54 protected $objCache;
55
56 var $ilias;
57 var $tree;
59
65 protected $testSessionFactory = null;
66
72 protected $testSequenceFactory = null;
73
78
83
85
90 {
92 }
93
98 {
99 $this->contextResultPresentation = $contextResultPresentation;
100 }
101
108 public function __construct(ilObjTest $a_object)
109 {
110 global $lng, $tpl, $ilCtrl, $ilias, $tree, $ilDB, $ilPluginAdmin, $ilTabs, $ilObjDataCache;
111
112 $this->db = $ilDB;
113 $this->lng =& $lng;
114 $this->tpl =& $tpl;
115 $this->ctrl =& $ilCtrl;
116 $this->tabs = $ilTabs;
117 $this->objCache = $ilObjDataCache;
118 $this->ilias =& $ilias;
119 $this->object =& $a_object;
120 $this->tree =& $tree;
121 $this->ref_id = $a_object->ref_id;
122
123 $this->service = new ilTestService($a_object);
124
125 require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
126 $this->testSessionFactory = new ilTestSessionFactory($this->object);
127
128 require_once 'Modules/Test/classes/class.ilTestSequenceFactory.php';
129 $this->testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $this->object);
130
131 $this->objectiveOrientedContainer = null;
132 }
133
138 {
139 $this->participantData = $participantData;
140 }
141
145 public function getParticipantData()
146 {
148 }
149
155 public function getPassOverviewTableData(ilTestSession $testSession, $passes, $withResults)
156 {
157 $data = array();
158
159 if($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired())
160 {
161 $considerHiddenQuestions = false;
162
163 require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
164 $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
165 }
166 else
167 {
168 $considerHiddenQuestions = true;
169 }
170
171 $scoredPass = $this->object->_getResultPass($testSession->getActiveId());
172
173 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
175 $testSession->getActiveId()
176 );
177
178 foreach($passes as $pass)
179 {
180 $row = array();
181
182 $considerOptionalQuestions = true;
183
184 if($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired())
185 {
186 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($testSession->getActiveId(), $pass);
187
188 $testSequence->loadFromDb();
189 $testSequence->loadQuestions();
190
191 if($this->object->isRandomTest() && !$testSequence->isAnsweringOptionalQuestionsConfirmed())
192 {
193 $considerOptionalQuestions = false;
194 }
195
196 $testSequence->setConsiderHiddenQuestionsEnabled($considerHiddenQuestions);
197 $testSequence->setConsiderOptionalQuestionsEnabled($considerOptionalQuestions);
198
199 $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
200 $objectivesList->loadObjectivesTitles();
201
202 $row['objectives'] = $objectivesList->getUniqueObjectivesStringForQuestions($testSequence->getUserSequenceQuestions());
203 }
204
205 if($withResults)
206 {
207 $result_array = $this->object->getTestResult($testSession->getActiveId(), $pass, false, $considerHiddenQuestions, $considerOptionalQuestions);
208
209 foreach($result_array as $resultStructKEY => $question)
210 {
211 if( $resultStructKEY === 'test' || $resultStructKEY === 'pass' )
212 {
213 continue;
214 }
215
216 $requestData = $questionHintRequestRegister->getRequestByTestPassIndexAndQuestionId($pass, $question['qid']);
217
218 if( $requestData instanceof ilAssQuestionHintRequestStatisticData && $result_array[$resultStructKEY]['requested_hints'] === null )
219 {
220 $result_array['pass']['total_requested_hints'] += $requestData->getRequestsCount();
221
222 $result_array[$resultStructKEY]['requested_hints'] = $requestData->getRequestsCount();
223 $result_array[$resultStructKEY]['hint_points'] = $requestData->getRequestsPoints();
224 }
225 }
226
227 if(!$result_array['pass']['total_max_points'])
228 {
229 $percentage = 0;
230 } else
231 {
232 $percentage = ($result_array['pass']['total_reached_points'] / $result_array['pass']['total_max_points']) * 100;
233 }
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'];
237 }
238
239 if($withResults)
240 {
241 $row['scored'] = ($pass == $scoredPass);
242 }
243
244 $row['pass'] = $pass;
245 $row['date'] = $this->object->getPassFinishDate($testSession->getActiveId(), $pass);
246 if($withResults)
247 {
248 $row['num_workedthrough_questions'] = $result_array['pass']['num_workedthrough'];
249 $row['num_questions_total'] = $result_array['pass']['num_questions_total'];
250
251 if($this->object->isOfferingQuestionHintsEnabled())
252 {
253 $row['hints'] = $total_requested_hints;
254 }
255
256 $row['reached_points'] = $total_reached;
257 $row['max_points'] = $total_max;
258 $row['percentage'] = $percentage;
259 }
260
261 $data[] = $row;
262 }
263
264 return $data;
265 }
266
271 {
272 $this->objectiveOrientedContainer = $objectiveOrientedContainer;
273 }
274
279 {
281 }
282
286 function executeCommand()
287 {
288 $cmd = $this->ctrl->getCmd();
289 $next_class = $this->ctrl->getNextClass($this);
290
291 $cmd = $this->getCommand($cmd);
292 switch($next_class)
293 {
294 default:
295 $ret =& $this->$cmd();
296 break;
297 }
298 return $ret;
299 }
300
306 function getCommand($cmd)
307 {
308 return $cmd;
309 }
310
311 protected function handleTabs($activeTabId)
312 {
313 if( $this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
314 {
315 require_once 'Services/Link/classes/class.ilLink.php';
316 $courseLink = ilLink::_getLink($this->getObjectiveOrientedContainer()->getRefId());
317 $this->tabs->setBack2Target($this->lng->txt('back_to_objective_container'), $courseLink);
318
319 $this->tabs->addTab(
320 'results_pass_oriented', $this->lng->txt('tst_tab_results_pass_oriented'),
321 $this->ctrl->getLinkTargetByClass('ilTestEvaluationGUI', 'outUserResultsOverview')
322 );
323
324 $this->tabs->addTab(
325 'results_objective_oriented', $this->lng->txt('tst_tab_results_objective_oriented'),
326 $this->ctrl->getLinkTargetByClass('ilTestEvalObjectiveOrientedGUI', 'showVirtualPass')
327 );
328
329 $this->tabs->setTabActive($activeTabId);
330 }
331 }
332
336 protected function isPdfDeliveryRequest()
337 {
338 if( !isset($_GET['pdf']) )
339 {
340 return false;
341 }
342
343 if( !(bool)$_GET['pdf'] )
344 {
345 return false;
346 }
347
348 return true;
349 }
350
354 public function buildPassOverviewTableGUI($targetGUI, $targetCmd = '')
355 {
356 require_once 'Modules/Test/classes/tables/class.ilTestPassOverviewTableGUI.php';
357
358 $table = new ilTestPassOverviewTableGUI($targetGUI, $targetCmd);
359
360 $table->setPdfPresentationEnabled(
361 isset($_GET['pdf']) && $_GET['pdf'] == 1
362 );
363
364 $table->setObjectiveOrientedPresentationEnabled(
365 $this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
366 );
367
368 return $table;
369 }
370
381 function 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)
382 {
383 $maintemplate = new ilTemplate("tpl.il_as_tst_list_of_answers.html", TRUE, TRUE, "Modules/Test");
384
385 $counter = 1;
386 // output of questions with solutions
387 foreach ($result_array as $question_data)
388 {
389 if (($question_data["workedthrough"] == 1) || ($only_answered_questions == FALSE))
390 {
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))
394 {
395 $maintemplate->setCurrentBlock("printview_question");
396 $question_gui = $this->object->createQuestionGUI("", $question);
397 if (is_object($question_gui))
398 {
399 if( $this->isPdfDeliveryRequest() )
400 {
401 $question_gui->setRenderPurpose(assQuestionGUI::RENDER_PURPOSE_PRINT_PDF);
402 }
403
404 if($anchorNav)
405 {
406 $template->setCurrentBlock('block_id');
407 $template->setVariable('BLOCK_ID', "detailed_answer_block_act_{$active_id}_qst_{$question}");
408 $template->parseCurrentBlock();
409
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();
414 }
415
416 if ($show_reached_points)
417 {
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();
421 }
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()));
426
427 if( $objectivesList !== null )
428 {
429 $objectives = $this->lng->txt('tst_res_lo_objectives_header').': ';
430 $objectives .= $objectivesList->getQuestionRelatedObjectiveTitles($question_gui->object->getId());
431 $template->setVariable("OBJECTIVES", $objectives);
432 }
433
434 $show_question_only = ($this->object->getShowSolutionAnswersOnly()) ? TRUE : FALSE;
435
436 $showFeedback = $this->isContextResultPresentation() && $this->object->getShowSolutionFeedback();
437 $show_solutions = $this->isContextResultPresentation() && $show_solutions;
438
439 if($show_solutions)
440 {
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);
446
447 $compare_template->setVariable('PARTICIPANT', $result_output);
448 $compare_template->setVariable('SOLUTION', $best_output);
449 $template->setVariable('SOLUTION_OUTPUT', $compare_template->get());
450 }
451 else
452 {
453 $result_output = $question_gui->getSolutionOutput($active_id, $pass, $show_solutions, FALSE, $show_question_only, $showFeedback);
454 $template->setVariable('SOLUTION_OUTPUT', $result_output);
455 }
456
457 $maintemplate->setCurrentBlock("printview_question");
458 $maintemplate->setVariable("QUESTION_PRINTVIEW", $template->get());
459 $maintemplate->parseCurrentBlock();
460 $counter ++;
461 }
462 }
463 }
464 }
465
466 if($testResultHeaderLabelBuilder !== null)
467 {
468 if($pass !== null)
469 {
470 $headerText = $testResultHeaderLabelBuilder->getListOfAnswersHeaderLabel($pass + 1);
471 }
472 else
473 {
474 $headerText = $testResultHeaderLabelBuilder->getVirtualListOfAnswersHeaderLabel();
475 }
476 }
477 else
478 {
479 $headerText = '';
480 }
481
482 $maintemplate->setVariable("RESULTS_OVERVIEW", $headerText);
483 return $maintemplate->get();
484 }
485
498 function getPassListOfAnswersWithScoring(&$result_array, $active_id, $pass, $show_solutions = FALSE)
499 {
500 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
501
502 $maintemplate = new ilTemplate("tpl.il_as_tst_list_of_answers.html", TRUE, TRUE, "Modules/Test");
503
504 include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
506
507 $counter = 1;
508 // output of questions with solutions
509 foreach ($result_array as $question_data)
510 {
511 $question = $question_data["qid"];
512 if (is_numeric($question))
513 {
514 $question_gui = $this->object->createQuestionGUI("", $question);
515 if (in_array($question_gui->object->getQuestionTypeID(), $scoring))
516 {
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();
523 if ($points == 1)
524 {
525 $template->setVariable("QUESTION_POINTS", $points . " " . $this->lng->txt("point"));
526 }
527 else
528 {
529 $template->setVariable("QUESTION_POINTS", $points . " " . $this->lng->txt("points"));
530 }
531
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);
534
535 $solout = $question_gui->object->getSuggestedSolutionOutput();
536 if (strlen($solout))
537 {
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();
542 }
543
544 $scoretemplate->setCurrentBlock("feedback");
545 $scoretemplate->setVariable("FEEDBACK_NAME_INPUT", $question);
546 $feedback = $this->object->getManualFeedback($active_id, $question, $pass);
547 $scoretemplate->setVariable("VALUE_FEEDBACK", ilUtil::prepareFormOutput($this->object->prepareTextareaOutput($feedback, TRUE)));
548 $scoretemplate->setVariable("TEXT_MANUAL_FEEDBACK", $this->lng->txt("set_manual_feedback"));
549 $scoretemplate->parseCurrentBlock();
550
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"));
556 $scoretemplate->setVariable("VALUE_INPUT", " value=\"" . assQuestion::_getReachedPoints($active_id, $question_data["qid"], $pass) . "\"");
557 $scoretemplate->setVariable("VALUE_SAVE", $this->lng->txt("save"));
558
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();
564 }
565 $counter ++;
566 }
567 }
568 if ($counter == 1)
569 {
570 // no scorable questions found
571 $maintemplate->setVariable("NO_QUESTIONS_FOUND", $this->lng->txt("manscoring_questions_not_found"));
572 }
573 $maintemplate->setVariable("RESULTS_OVERVIEW", sprintf($this->lng->txt("manscoring_results_pass"), $pass+1));
574
575 include_once "./Services/YUI/classes/class.ilYuiUtil.php";
577
578 return $maintemplate->get();
579 }
580
581 protected function getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList = null, $multipleObjectivesInvolved = true)
582 {
583 $this->ctrl->setParameter($targetGUI, 'active_id', $active_id);
584 $this->ctrl->setParameter($targetGUI, 'pass', $pass);
585
586 $tableGUI = $this->buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD);
587
588 $tableGUI->setAnswerListAnchorEnabled($questionAnchorNav);
589 $tableGUI->setSingleAnswerScreenCmd($questionDetailsCMD);
590 $tableGUI->setShowHintCount($this->object->isOfferingQuestionHintsEnabled());
591
592 if( $objectivesList !== null )
593 {
594 $tableGUI->setQuestionRelatedObjectivesList($objectivesList);
595 $tableGUI->setObjectiveOrientedPresentationEnabled(true);
596 }
597
598 $tableGUI->setMultipleObjectivesInvolved($multipleObjectivesInvolved);
599
600 $tableGUI->setActiveId($active_id);
601 $tableGUI->setShowSuggestedSolution(false);
602
603 $usersQuestionSolutions = array();
604
605 foreach($result_array as $key => $val)
606 {
607 if($key === 'test' || $key === 'pass')
608 {
609 continue;
610 }
611
612 if( $this->object->getShowSolutionSuggested() && strlen($val['solution']) )
613 {
614 $tableGUI->setShowSuggestedSolution(true);
615 }
616
617 if( isset($val['pass']) )
618 {
619 $tableGUI->setPassColumnEnabled(true);
620 }
621
622 $usersQuestionSolutions[$key] = $val;
623 }
624
625 $tableGUI->initColumns()->initFilter();
626
627 $tableGUI->setFilterCommand($targetCMD.'SetTableFilter');
628 $tableGUI->setResetCommand($targetCMD.'ResetTableFilter');
629
630 $tableGUI->setData($usersQuestionSolutions);
631
632 return $tableGUI;
633 }
634
642 {
643 if ($this->object->getShowSolutionSignature() && !$this->object->getAnonymity())
644 {
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"));
649 $template->setVariable("VALUE_DATE", ilDatePresentation::formatDate(new ilDate(time(), IL_CAL_UNIX)));
651 $template->setVariable("TXT_SIGNATURE", $this->lng->txt("tst_signature"));
652 $template->setVariable("IMG_SPACER", ilUtil::getImagePath("spacer.png"));
653 return $template->get();
654 }
655 else
656 {
657 return "";
658 }
659 }
660
670 function getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity = FALSE)
671 {
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);
676 if (strlen(ilObjUser::_lookupLogin($user_id)) > 0)
677 {
678 $user = new ilObjUser($user_id);
679 }
680 else
681 {
682 $user = new ilObjUser();
683 $user->setLastname($this->lng->txt("deleted_user"));
684 }
685 $t = $testSession->getSubmittedTimestamp();
686 if (!$t)
687 {
688 $t = $this->object->_getLastAccess($testSession->getActiveId());
689 }
690
691 if( $this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
692 {
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();
698 }
699
700 $title_matric = "";
701 if (strlen($user->getMatriculation()) && (($this->object->getAnonymity() == FALSE) || ($overwrite_anonymity)))
702 {
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();
708 }
709
710 $invited_user = array_pop($this->object->getInvitedUsers($user_id));
711 if (strlen($invited_user["clientip"]))
712 {
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"];
718 }
719
720 $template->setVariable("TXT_TEST_TITLE", $this->lng->txt("title"));
721 $template->setVariable("VALUE_TEST_TITLE", $this->object->getTitle());
722
723 // change the pagetitle (tab title or title in title bar of window)
724 $pagetitle = $this->object->getTitle() . $title_matric . $title_client;
725 $this->tpl->setHeaderPageTitle($pagetitle);
726
727 return $template->get();
728 }
729
739 function getCorrectSolutionOutput($question_id, $active_id, $pass, ilTestQuestionRelatedObjectivesList $objectivesList = null)
740 {
741 global $ilUser;
742
743 $test_id = $this->object->getTestId();
744 $question_gui = $this->object->createQuestionGUI("", $question_id);
745
746 if( $this->isPdfDeliveryRequest() )
747 {
748 $question_gui->setRenderPurpose(assQuestionGUI::RENDER_PURPOSE_PRINT_PDF);
749 }
750
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' )
756 {
757 $specificAnswerFeedback = $question_gui->getSpecificFeedbackOutput($active_id, $pass);
758 if( strlen($specificAnswerFeedback) )
759 {
760 $template->setCurrentBlock("outline_specific_feedback");
761 $template->setVariable("OUTLINE_SPECIFIC_FEEDBACK", $specificAnswerFeedback);
762 $template->parseCurrentBlock();
763 }
764 }
765 if ($this->object->isBestSolutionPrintedWithResult() && strlen($best_output))
766 {
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();
771 }
772 $template->setVariable("TEXT_YOUR_SOLUTION", $this->lng->txt("tst_your_answer_was"));
773 $maxpoints = $question_gui->object->getMaximumPoints();
774 if ($maxpoints == 1)
775 {
776 $template->setVariable("QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()) . " (" . $maxpoints . " " . $this->lng->txt("point") . ")");
777 }
778 else
779 {
780 $template->setVariable("QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()) . " (" . $maxpoints . " " . $this->lng->txt("points") . ")");
781 }
782 if( $objectivesList !== null )
783 {
784 $objectives = $this->lng->txt('tst_res_lo_objectives_header').': ';
785 $objectives .= $objectivesList->getQuestionRelatedObjectiveTitles($question_gui->object->getId());
786 $template->setVariable('OBJECTIVES', $objectives);
787 }
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", "&lt;&lt; " . $this->lng->txt("back"));
792 return $template->get();
793 }
794
807 function getResultsOfUserOutput($testSession, $active_id, $pass, $targetGUI, $show_pass_details = TRUE, $show_answers = TRUE, $show_question_only = FALSE, $show_reached_points = FALSE)
808 {
809 global $ilObjDataCache;
810
811 include_once("./Services/UICore/classes/class.ilTemplate.php");
812 $template = new ilTemplate("tpl.il_as_tst_results_participant.html", TRUE, TRUE, "Modules/Test");
813
814 if( $this->participantData instanceof ilTestParticipantData )
815 {
816 $user_id = $this->participantData->getUserIdByActiveId($active_id);
817 $uname = $this->participantData->getConcatedFullnameByActiveId($active_id, false);
818 }
819 else
820 {
821 $user_id = $this->object->_getUserIdFromActiveId($active_id);
822 $uname = $this->object->userLookupFullName($user_id, TRUE);
823 }
824
825 if (((array_key_exists("pass", $_GET)) && (strlen($_GET["pass"]) > 0)) || (!is_null($pass)))
826 {
827 if (is_null($pass)) $pass = $_GET["pass"];
828 }
829
830 if (!is_null($pass))
831 {
832 require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
833 $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
834
835 $objectivesList = null;
836
837 if( $this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
838 {
839 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
840 $testSequence->loadFromDb();
841 $testSequence->loadQuestions();
842
843 require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
844 $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
845
846 $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
847 $objectivesList->loadObjectivesTitles();
848
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();
854 }
855
856 $result_array = $this->object->getTestResult(
857 $active_id, $pass, false, !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
858 );
859
860 $user_id = $this->object->_getUserIdFromActiveId($active_id);
861 $showAllAnswers = TRUE;
862 if ($this->object->isExecutable($testSession, $user_id))
863 {
864 $showAllAnswers = FALSE;
865 }
866 if ($show_answers)
867 {
868 $list_of_answers = $this->getPassListOfAnswers(
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
872 );
873 $template->setVariable("LIST_OF_ANSWERS", $list_of_answers);
874 }
875
876 if ($show_pass_details)
877 {
878 $overviewTableGUI = $this->getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $targetGUI, "getResultsOfUserOutput", '', $show_answers, $objectivesList);
879 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass + 1));
880 $template->setVariable("PASS_DETAILS", $overviewTableGUI->getHTML());
881 }
882
883 $signature = $this->getResultsSignature();
884 $template->setVariable("SIGNATURE", $signature);
885
886 if ($this->object->isShowExamIdInTestResultsEnabled())
887 {
888 $template->setCurrentBlock('exam_id_footer');
889 $template->setVariable('EXAM_ID_VAL', ilObjTest::lookupExamId(
890 $testSession->getActiveId(), $pass
891 ));
892 $template->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
893 $template->parseCurrentBlock();
894 }
895 }
896
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();
901
902 $template->setCurrentBlock('participant_block_id');
903 $template->setVariable("PARTICIPANT_BLOCK_ID", "participant_active_{$active_id}");
904 $template->parseCurrentBlock();
905
906 if( $this->isGradingMessageRequired() )
907 {
908 $gradingMessageBuilder = $this->getGradingMessageBuilder($active_id);
909 $gradingMessageBuilder->buildList();
910
911 $template->setCurrentBlock('grading_message');
912 $template->setVariable('GRADING_MESSAGE', $gradingMessageBuilder->getList());
913 $template->parseCurrentBlock();
914 }
915
916
917 $user_data = $this->getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, TRUE);
918 $template->setVariable("TEXT_HEADING", sprintf($this->lng->txt("tst_result_user_name"), $uname));
919 $template->setVariable("USER_DATA", $user_data);
920
921 $this->populatePassFinishDate($template, $this->object->getPassFinishDate($active_id, $pass));
922
923 return $template->get();
924 }
925
933 function getResultsHeadUserAndPass($active_id, $pass)
934 {
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);
938 if (strlen(ilObjUser::_lookupLogin($user_id)) > 0)
939 {
940 $user = new ilObjUser($user_id);
941 }
942 else
943 {
944 $user = new ilObjUser();
945 $user->setLastname($this->lng->txt("deleted_user"));
946 }
947 $title_matric = "";
948 if (strlen($user->getMatriculation()) && (($this->object->getAnonymity() == FALSE)))
949 {
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();
958 }
959
960 $invited_user = array_pop($this->object->getInvitedUsers($user_id));
961 if (strlen($invited_user["clientip"]))
962 {
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"];
971 }
972
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();
979 }
980
988 public function getQuestionResultForTestUsers($question_id, $test_id)
989 {
990 // prepare generation before contents are processed (for mathjax)
991 require_once 'Services/PDFGeneration/classes/class.ilPDFGeneration.php';
993
994 // REQUIRED, since we call this object regardless of the loop
995 $question_gui = $this->object->createQuestionGUI("", $question_id);
996
997 $foundusers = $this->object->getParticipantsForTestAndQuestion($test_id, $question_id);
998 $output = '';
999 foreach($foundusers as $active_id => $passes)
1000 {
1001 $resultpass = $this->object->_getResultPass($active_id);
1002 for($i = 0; $i < count($passes); $i++)
1003 {
1004 if(($resultpass !== null) && ($resultpass == $passes[$i]["pass"]))
1005 {
1006 if($output)
1007 {
1008 $output .= "<br /><br /><br />";
1009 }
1010
1011 // check if re-instantiation is really neccessary
1012 $question_gui = $this->object->createQuestionGUI("", $passes[$i]["qid"]);
1013 $output .= $this->getResultsHeadUserAndPass($active_id, $resultpass + 1);
1014 $question_gui->setRenderPurpose(assQuestionGUI::RENDER_PURPOSE_PRINT_PDF);
1015 $output .= $question_gui->getSolutionOutput(
1016 $active_id,
1017 $resultpass,
1018 $graphicalOutput = FALSE,
1019 $result_output = FALSE,
1020 $show_question_only = FALSE,
1021 $show_feedback = FALSE
1022 );
1023 }
1024 }
1025 }
1026
1027 require_once './Modules/Test/classes/class.ilTestPDFGenerator.php';
1028 ilTestPDFGenerator::generatePDF($output, ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $question_gui->object->getTitleFilenameCompliant());
1029 }
1030
1034 protected function buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
1035 {
1036 require_once 'Modules/Test/classes/tables/class.ilTestPassDetailsOverviewTableGUI.php';
1037 $tableGUI = new ilTestPassDetailsOverviewTableGUI($this->ctrl, $targetGUI, $targetCMD);
1038 $tableGUI->setIsPdfGenerationRequest($this->isPdfDeliveryRequest());
1039 return $tableGUI;
1040 }
1041
1042 protected function isGradingMessageRequired()
1043 {
1044 if( $this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
1045 {
1046 return false;
1047 }
1048
1049 if( $this->object->isShowGradingStatusEnabled() )
1050 {
1051 return true;
1052 }
1053
1054 if( $this->object->isShowGradingMarkEnabled() )
1055 {
1056 return true;
1057 }
1058
1059 if( $this->object->areObligationsEnabled() )
1060 {
1061 return true;
1062 }
1063
1064 return false;
1065 }
1066
1071 protected function getGradingMessageBuilder($activeId)
1072 {
1073 require_once 'Modules/Test/classes/class.ilTestGradingMessageBuilder.php';
1074 $gradingMessageBuilder = new ilTestGradingMessageBuilder($this->lng, $this->object);
1075
1076 $gradingMessageBuilder->setActiveId($activeId);
1077
1078 return $gradingMessageBuilder;
1079 }
1080
1081 protected function buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
1082 {
1083 require_once 'Modules/Test/classes/class.ilTestQuestionRelatedObjectivesList.php';
1084 $questionRelatedObjectivesList = new ilTestQuestionRelatedObjectivesList();
1085
1086 $objectivesAdapter->buildQuestionRelatedObjectiveList($testSequence, $questionRelatedObjectivesList);
1087
1088 return $questionRelatedObjectivesList;
1089 }
1090
1091 protected function getFilteredTestResult($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)
1092 {
1093 global $ilDB, $ilPluginAdmin;
1094
1095 $table_gui = $this->buildPassDetailsOverviewTableGUI($this, 'outUserPassDetails');
1096 $table_gui->initFilter();
1097
1098 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
1099 $questionList = new ilAssQuestionList($ilDB, $this->lng, $ilPluginAdmin);
1100
1101 $questionList->setParentObjIdsFilter(array($this->object->getId()));
1102 $questionList->setQuestionInstanceTypeFilter(ilAssQuestionList::QUESTION_INSTANCE_TYPE_DUPLICATES);
1103
1104 foreach ($table_gui->getFilterItems() as $item)
1105 {
1106 if( substr($item->getPostVar(), 0, strlen('tax_')) == 'tax_' )
1107 {
1108 $v = $item->getValue();
1109
1110 if( is_array($v) && count($v) && !(int)$v[0] )
1111 {
1112 continue;
1113 }
1114
1115 $taxId = substr($item->getPostVar(), strlen('tax_'));
1116 $questionList->addTaxonomyFilter($taxId, $item->getValue(), $this->object->getId(), 'tst');
1117 }
1118 elseif( $item->getValue() !== false )
1119 {
1120 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
1121 }
1122 }
1123
1124 $questionList->load();
1125
1126 $filteredTestResult = array();
1127
1128 $resultData = $this->object->getTestResult($active_id, $pass, false, $considerHiddenQuestions, $considerOptionalQuestions);
1129
1130 foreach($resultData as $resultItemKey => $resultItemValue)
1131 {
1132 if($resultItemKey === 'test' || $resultItemKey === 'pass')
1133 {
1134 continue;
1135 }
1136
1137 if( !$questionList->isInList($resultItemValue['qid']) )
1138 {
1139 continue;
1140 }
1141
1142 $filteredTestResult[] = $resultItemValue;
1143 }
1144
1145 return $filteredTestResult;
1146 }
1147
1151 protected function populateContent($content)
1152 {
1153 if($this->isPdfDeliveryRequest())
1154 {
1155 require_once 'class.ilTestPDFGenerator.php';
1156
1158 $content, ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitleFilenameCompliant()
1159 );
1160 }
1161 else
1162 {
1163 $this->tpl->setContent($content);
1164 }
1165 }
1166
1171 {
1172 require_once 'Modules/Test/classes/toolbars/class.ilTestResultsToolbarGUI.php';
1173 $toolbar = new ilTestResultsToolbarGUI($this->ctrl, $this->tpl, $this->lng);
1174
1175 $toolbar->setSkillResultButtonEnabled($this->object->isSkillServiceToBeConsidered());
1176
1177 return $toolbar;
1178 }
1179
1180 protected function outCorrectSolutionCmd()
1181 {
1182 $this->outCorrectSolution(); // cannot be named xxxCmd, because it's also called from context without Cmd in names
1183 }
1184
1190 protected function outCorrectSolution()
1191 {
1192 if( !$this->object->getShowSolutionDetails() )
1193 {
1194 ilUtil::sendInfo($this->lng->txt("no_permission"), true);
1195 $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1196 }
1197
1198 $testSession = $this->testSessionFactory->getSession();
1199 $activeId = $testSession->getActiveId();
1200
1201 if( !($activeId > 0) )
1202 {
1203 $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
1204 }
1205
1206 $this->ctrl->saveParameter($this, "pass");
1207 $pass = (int)$_GET['pass'];
1208
1209 $questionId = (int)$_GET['evaluation'];
1210
1211 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($activeId, $pass);
1212 $testSequence->loadFromDb();
1213 $testSequence->loadQuestions();
1214
1215 if( !$testSequence->questionExists($questionId) )
1216 {
1218 }
1219
1220 if( $this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
1221 {
1222 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($activeId, $pass);
1223 $testSequence->loadFromDb();
1224 $testSequence->loadQuestions();
1225
1226 require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1227 $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
1228 $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
1229 $objectivesList->loadObjectivesTitles();
1230 }
1231 else
1232 {
1233 $objectivesList = null;
1234 }
1235
1236 global $ilTabs;
1237
1238 if($this instanceof ilTestEvalObjectiveOrientedGUI)
1239 {
1240 $ilTabs->setBackTarget(
1241 $this->lng->txt("tst_back_to_virtual_pass"), $this->ctrl->getLinkTarget($this, 'showVirtualPass')
1242 );
1243 }
1244 else
1245 {
1246 $ilTabs->setBackTarget(
1247 $this->lng->txt("tst_back_to_pass_details"), $this->ctrl->getLinkTarget($this, 'outUserPassDetails')
1248 );
1249 }
1250
1251 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
1252 $this->tpl->setCurrentBlock("ContentStyle");
1253 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
1254 $this->tpl->parseCurrentBlock();
1255
1256 $this->tpl->setCurrentBlock("SyntaxStyle");
1257 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
1258 $this->tpl->parseCurrentBlock();
1259
1260 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
1261 if ($this->object->getShowSolutionAnswersOnly())
1262 {
1263 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
1264 }
1265
1266 $solution = $this->getCorrectSolutionOutput($questionId, $activeId, $pass, $objectivesList);
1267
1268 $this->tpl->setContent($solution);
1269 }
1270
1275 public function populatePassFinishDate($tpl, $passFinishDate)
1276 {
1279 $passFinishDate = ilDatePresentation::formatDate(new ilDateTime($passFinishDate, IL_CAL_UNIX));
1281 $tpl->setVariable("PASS_FINISH_DATE_LABEL", $this->lng->txt('tst_pass_finished_on'));
1282 $tpl->setVariable("PASS_FINISH_DATE_VALUE", $passFinishDate);
1283 }
1284}
1285
1286// internal sort function to sort the result array
1287function sortResults($a, $b)
1288{
1289 $sort = ($_GET["sort"]) ? ($_GET["sort"]) : "nr";
1290 $sortorder = ($_GET["sortorder"]) ? ($_GET["sortorder"]) : "asc";
1291 if (strcmp($sortorder, "asc"))
1292 {
1293 $smaller = 1;
1294 $greater = -1;
1295 }
1296 else
1297 {
1298 $smaller = -1;
1299 $greater = 1;
1300 }
1301 if ($a[$sort] == $b[$sort]) return 0;
1302 return ($a[$sort] < $b[$sort]) ? $smaller : $greater;
1303}
sprintf('%.4f', $callTime)
$_GET["client_id"]
$_SESSION["AccountId"]
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_UNIX
sortResults($a, $b)
static _getReachedPoints($active_id, $question_id, $pass=NULL)
Returns the points, a learner has reached answering the question.
static getRequestRequestStatisticDataRegisterByActiveId($activeId)
static setUseRelativeDates($a_status)
set use relative dates
static formatDate(ilDateTime $date)
Format a date @access public.
static useRelativeDates()
check if relative dates are used
@classDescription Date and time handling
Class for single dates.
buildQuestionRelatedObjectiveList(ilTestQuestionSequence $a_test_sequence, ilTestQuestionRelatedObjectivesList $a_objectives_list)
static getInstance(ilTestSession $a_test_session)
static _getManualScoring()
Retrieve the manual scoring settings.
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id)
get content style path
static accessViolationRedirect()
static lookupExamId($active_id, $pass)
static _lookupLogin($a_user_id)
lookup login
static prepareGeneration()
Prepare the PDF generation This initializes the purpose for MathJax rendering It has to be called bef...
special template class to simplify handling of ITX/PEAR
static generatePDF($pdf_output, $output_mode, $filename=null)
Class ilTestPassOverviewTableGUI.
Service GUI class for tests.
getFilteredTestResult($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)
outCorrectSolution()
Creates an output of the solution of an answer compared to the correct solution.
getCorrectSolutionOutput($question_id, $active_id, $pass, ilTestQuestionRelatedObjectivesList $objectivesList=null)
Returns an output of the solution to an answer compared to the correct solution.
getPassListOfAnswersWithScoring(&$result_array, $active_id, $pass, $show_solutions=FALSE)
Returns the list of answers of a users test pass and offers a scoring option.
buildPassOverviewTableGUI($targetGUI, $targetCmd='')
setObjectiveOrientedContainer(ilTestObjectiveOrientedContainer $objectiveOrientedContainer)
executeCommand()
execute command
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.
populatePassFinishDate($tpl, $passFinishDate)
__construct(ilObjTest $a_object)
The constructor takes the test object reference as parameter.
getResultsSignature()
Returns HTML code for a signature field.
getCommand($cmd)
Retrieves the ilCtrl command.
getQuestionResultForTestUsers($question_id, $test_id)
Creates a HTML representation for the results of a given question in a test.
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.
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=FALSE)
Returns the user data for a test results output.
setContextResultPresentation($contextResultPresentation)
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
getPassOverviewTableData(ilTestSession $testSession, $passes, $withResults)
getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)
getResultsHeadUserAndPass($active_id, $pass)
Returns the user and pass data for a test results output.
setParticipantData($participantData)
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
Service class for tests.
Test session handler.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
static initDomEvent()
Init YUI DomEvent.
$counter
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\s+" &#(? foreach( $entity_files as $file) $output
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file)
$ret
Definition: parser.php:6
$cmd
Definition: sahs_server.php:35
global $ilDB
$ilUser
Definition: imgupload.php:18