ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestScoringGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilTestScoringGUI:
+ Collaboration diagram for ilTestScoringGUI:

Public Member Functions

 __construct (ilObjTest $a_object)
 ilTestScoringGUI constructor More...
 
 getTestAccess ()
 
 setTestAccess ($testAccess)
 
 executeCommand ()
 execute command More...
 
- Public Member Functions inherited from ilTestServiceGUI
 isContextResultPresentation ()
 
 setContextResultPresentation ($contextResultPresentation)
 
 __construct (ilObjTest $a_object)
 The constructor takes the test object reference as parameter. More...
 
 setParticipantData ($participantData)
 
 getParticipantData ()
 
 getPassOverviewTableData (ilTestSession $testSession, $passes, $withResults)
 This method uses the data of a given test pass to create an evaluation for displaying into a table used in the ilTestEvaluationGUI. More...
 
 setObjectiveOrientedContainer (ilTestObjectiveOrientedContainer $objectiveOrientedContainer)
 
 getObjectiveOrientedContainer ()
 
 executeCommand ()
 execute command More...
 
 getCommand ($cmd)
 Retrieves the ilCtrl command. More...
 
 buildPassOverviewTableGUI ($targetGUI)
 
 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. More...
 
 getPassListOfAnswersWithScoring (&$result_array, $active_id, $pass, $show_solutions=false)
 Returns the list of answers of a users test pass and offers a scoring option. More...
 
 getResultsSignature ()
 Returns HTML code for a signature field. More...
 
 getAdditionalUsrDataHtmlAndPopulateWindowTitle ($testSession, $active_id, $overwrite_anonymity=false)
 Returns the user data for a test results output. More...
 
 getCorrectSolutionOutput ($question_id, $active_id, $pass, ilTestQuestionRelatedObjectivesList $objectivesList=null)
 Returns an output of the solution to an answer compared to the correct solution. More...
 
 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. More...
 
 getResultsHeadUserAndPass ($active_id, $pass)
 Returns the user and pass data for a test results output. More...
 
 getQuestionResultForTestUsers ($question_id, $test_id)
 Creates a HTML representation for the results of a given question in a test. More...
 
 populatePassFinishDate ($tpl, $passFinishDate)
 
 populateExamId (ilTemplate $tpl, int $activeId, int $pass)
 
 getObject ()
 

Data Fields

const PART_FILTER_ACTIVE_ONLY = 1
 
const PART_FILTER_INACTIVE_ONLY = 2
 
const PART_FILTER_ALL_USERS = 3
 
const PART_FILTER_MANSCORING_DONE = 4
 
const PART_FILTER_MANSCORING_NONE = 5
 
- Data Fields inherited from ilTestServiceGUI
 $object = null
 
 $service = null
 
 $lng
 
 $tpl
 
 $ctrl
 
 $ilias
 
 $tree
 
 $ref_id
 

Protected Member Functions

 getDefaultCommand ()
 
 getActiveSubTabId ()
 
- Protected Member Functions inherited from ilTestServiceGUI
 isPdfDeliveryRequest ()
 
 buildQuestionAnswerShuffler (int $question_id, int $active_id, int $pass_id)
 
 buildFixedShufflerSeed (int $question_id, int $pass_id, int $active_id)
 
 getPassDetailsOverviewTableGUI ( $result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)
 
 buildPassDetailsOverviewTableGUI ($targetGUI, $targetCMD)
 
 isGradingMessageRequired ()
 
 getGradingMessageBuilder ($activeId)
 
 buildQuestionRelatedObjectivesList (ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
 
 getFilteredTestResult ($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)
 
 populateContent ($content)
 
 buildUserTestResultsToolbarGUI ()
 
 outCorrectSolutionCmd ()
 
 outCorrectSolution ()
 Creates an output of the solution of an answer compared to the correct solution. More...
 

Protected Attributes

 $testAccess
 
- Protected Attributes inherited from ilTestServiceGUI
ILIAS Test InternalRequestService $testrequest
 
 $db
 
Refinery $refinery
 
 $tabs
 
 $objCache
 
 $testSessionFactory = null
 
 $testSequenceFactory = null
 
 $participantData
 

Private Member Functions

 fetchActiveIdParameter ()
 
 fetchPassParameter ($activeId)
 
 showManScoringParticipantsTable ()
 
 applyManScoringParticipantsFilter ()
 
 resetManScoringParticipantsFilter ()
 
 showManScoringParticipantScreen (ilPropertyFormGUI $form=null)
 
 saveManScoringParticipantScreen ($redirect=true)
 
 saveNextManScoringParticipantScreen ()
 
 saveReturnManScoringParticipantScreen ()
 
 buildManScoringParticipantForm ($questionGuiList, $activeId, $pass, $initValues=false)
 
 sendManScoringParticipantNotification ()
 
 buildManScoringParticipantsTable ($withData=false)
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Scoring class for tests

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Björn Heyser bheys.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 32 of file class.ilTestScoringGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestScoringGUI::__construct ( ilObjTest  $a_object)

ilTestScoringGUI constructor

The constructor takes the test object reference as parameter

Parameters
object$a_objectAssociated ilObjTest class public

Definition at line 54 of file class.ilTestScoringGUI.php.

References ILIAS\GlobalScreen\Provider\__construct().

55  {
56  parent::__construct($a_object);
57  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ applyManScoringParticipantsFilter()

ilTestScoringGUI::applyManScoringParticipantsFilter ( )
private

Definition at line 182 of file class.ilTestScoringGUI.php.

References buildManScoringParticipantsTable(), and showManScoringParticipantsTable().

183  {
184  $table = $this->buildManScoringParticipantsTable(false);
185 
186  $table->resetOffset();
187  $table->writeFilterToSession();
188 
190  }
buildManScoringParticipantsTable($withData=false)
+ Here is the call graph for this function:

◆ buildManScoringParticipantForm()

ilTestScoringGUI::buildManScoringParticipantForm (   $questionGuiList,
  $activeId,
  $pass,
  $initValues = false 
)
private

Definition at line 420 of file class.ilTestScoringGUI.php.

References $check, $DIC, ilTestServiceGUI\$lng, assQuestion\_getMaximumPoints(), assQuestion\_getReachedPoints(), ilObjTest\getSingleManualFeedback(), ilTestService\isManScoringDone(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilCustomInputGUI\setHtml(), ilTextAreaInputGUI\setValue(), and ilNonEditableValueGUI\setValue().

Referenced by saveManScoringParticipantScreen(), and showManScoringParticipantScreen().

421  {
422  global $DIC;
423  $ilCtrl = $DIC['ilCtrl'];
424  $lng = $DIC['lng'];
425 
426  require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
427  require_once 'Services/Form/classes/class.ilFormSectionHeaderGUI.php';
428  require_once 'Services/Form/classes/class.ilCustomInputGUI.php';
429  require_once 'Services/Form/classes/class.ilCheckboxInputGUI.php';
430  require_once 'Services/Form/classes/class.ilTextInputGUI.php';
431  require_once 'Services/Form/classes/class.ilTextAreaInputGUI.php';
432 
433  $ilCtrl->setParameter($this, 'active_id', $activeId);
434  $ilCtrl->setParameter($this, 'pass', $pass);
435 
436  $form = new ilPropertyFormGUI();
437  $form->setFormAction($ilCtrl->getFormAction($this));
438 
439  $form->setTitle(sprintf($lng->txt('manscoring_results_pass'), $pass + 1));
440  $form->setTableWidth('100%');
441 
442  foreach ($questionGuiList as $questionId => $questionGUI) {
443  $questionHeader = sprintf($lng->txt('tst_manscoring_question_section_header'), $questionGUI->object->getTitleForHTMLOutput());
444  $questionSolution = $questionGUI->getSolutionOutput($activeId, $pass, false, false, true, false, false, true);
445  $bestSolution = $questionGUI->object->getSuggestedSolutionOutput();
446 
447  $feedback = $this->object->getSingleManualFeedback($activeId, $questionId, $pass);
448 
449  $disabled = false;
450  if (isset($feedback['finalized_evaluation']) && $feedback['finalized_evaluation'] == 1) {
451  $disabled = true;
452  }
453 
454  $sect = new ilFormSectionHeaderGUI();
455  $sect->setTitle($questionHeader . ' [' . $this->lng->txt('question_id_short') . ': ' . $questionGUI->object->getId() . ']');
456  $form->addItem($sect);
457 
458  $cust = new ilCustomInputGUI($lng->txt('tst_manscoring_input_question_and_user_solution'));
459  $cust->setHtml($questionSolution);
460  $form->addItem($cust);
461 
462  if ($questionGUI instanceof assTextQuestionGUI && $this->object->getAutosave()) {
463  $aresult_output = $questionGUI->getAutoSavedSolutionOutput(
464  $activeId,
465  $pass,
466  false,
467  false,
468  false,
469  false,
470  false,
471  false,
472  false
473  );
474  $cust = new ilCustomInputGUI($this->lng->txt('autosavecontent'));
475  $cust->setHtml($aresult_output);
476  $form->addItem($cust);
477  }
478 
479  $text = new ilTextInputGUI($this->lng->txt('tst_change_points_for_question'), "question__{$questionId}__points");
480  if ($initValues) {
481  $text->setValue((string) assQuestion::_getReachedPoints($activeId, $questionId, $pass));
482  }
483  if ($disabled) {
484  $text->setDisabled($disabled);
485  }
486  $form->addItem($text);
487 
488  $nonedit = new ilNonEditableValueGUI($lng->txt('tst_manscoring_input_max_points_for_question'), "question__{$questionId}__maxpoints");
489  if ($initValues) {
490  $nonedit->setValue(assQuestion::_getMaximumPoints($questionId));
491  }
492  $form->addItem($nonedit);
493 
494  $area = new ilTextAreaInputGUI($lng->txt('set_manual_feedback'), "question__{$questionId}__feedback");
495  $area->setUseRTE(true);
496  if ($initValues) {
497  $area->setValue(ilObjTest::getSingleManualFeedback((int) $activeId, (int) $questionId, (int) $pass)['feedback'] ?? '');
498  }
499  if ($disabled) {
500  $area->setDisabled($disabled);
501  }
502  $form->addItem($area);
503 
504  $check = new ilCheckboxInputGUI($lng->txt('finalized_evaluation'), "{$questionId}__evaluated");
505  if ($disabled) {
506  $check->setChecked(true);
507  }
508  $form->addItem($check);
509 
510  if (strlen(trim($bestSolution))) {
511  $cust = new ilCustomInputGUI($lng->txt('tst_show_solution_suggested'));
512  $cust->setHtml($bestSolution);
513  $form->addItem($cust);
514  }
515  }
516 
517  $sect = new ilFormSectionHeaderGUI();
518  $sect->setTitle($lng->txt('tst_participant'));
519  $form->addItem($sect);
520 
521  $check = new ilCheckboxInputGUI($lng->txt('set_manscoring_done'), 'manscoring_done');
522  if ($initValues && ilTestService::isManScoringDone($activeId)) {
523  $check->setChecked(true);
524  }
525  $form->addItem($check);
526 
527  $check = new ilCheckboxInputGUI($lng->txt('tst_manscoring_user_notification'), 'manscoring_notify');
528  $form->addItem($check);
529 
530  $form->addCommandButton('saveManScoringParticipantScreen', $lng->txt('save'));
531  $form->addCommandButton('saveReturnManScoringParticipantScreen', $lng->txt('save_return'));
532  $form->addCommandButton('saveNextManScoringParticipantScreen', $lng->txt('save_and_next'));
533 
534  return $form;
535  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static isManScoringDone($activeId)
reads the flag wether manscoring is done for the given test active or not from the global settings (s...
This class represents a checkbox property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
static getSingleManualFeedback(int $active_id, int $question_id, int $pass)
static _getReachedPoints(int $active_id, int $question_id, int $pass)
static _getMaximumPoints(int $question_id)
Returns the maximum points, a learner can reach answering the question.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
$check
Definition: buildRTE.php:81
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildManScoringParticipantsTable()

ilTestScoringGUI::buildManScoringParticipantsTable (   $withData = false)
private
Returns
ilTestManScoringParticipantsTableGUI

Definition at line 544 of file class.ilTestScoringGUI.php.

References ilTestParticipantAccessFilter\getScoreParticipantsUserFilter(), and ILIAS\Repository\object().

Referenced by applyManScoringParticipantsFilter(), resetManScoringParticipantsFilter(), saveNextManScoringParticipantScreen(), and showManScoringParticipantsTable().

545  {
546  require_once 'Modules/Test/classes/tables/class.ilTestManScoringParticipantsTableGUI.php';
547  $table = new ilTestManScoringParticipantsTableGUI($this);
548 
549  if ($withData) {
550  $participantStatusFilterValue = $table->getFilterItemByPostVar('participant_status')->getValue();
551 
552  require_once 'Modules/Test/classes/class.ilTestParticipantList.php';
553  $participant_list = new ilTestParticipantList($this->object);
554 
555  $participant_list->initializeFromDbRows(
556  $this->object->getTestParticipantsForManualScoring($participantStatusFilterValue)
557  );
558 
559  $filtered_participant_list = $participant_list->getAccessFilteredList(
561  );
562 
563  $table->setData($filtered_participant_list->getParticipantsTableRows());
564  }
565 
566  return $table;
567  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilTestScoringGUI::executeCommand ( )

execute command

Definition at line 128 of file class.ilTestScoringGUI.php.

References $DIC, ilObjAssessmentFolder\_mananuallyScoreableQuestionTypesExists(), ilObjTestGUI\accessViolationRedirect(), ILIAS\Repository\ctrl(), getActiveSubTabId(), getDefaultCommand(), getTestAccess(), ILIAS\Repository\lng(), and ilTestTabsManager\TAB_ID_MANUAL_SCORING.

129  {
130  global $DIC; /* @var ILIAS\DI\Container $DIC */
131 
132  if (!$this->getTestAccess()->checkScoreParticipantsAccess()) {
134  }
135 
136  require_once 'Modules/Test/classes/class.ilObjAssessmentFolder.php';
138  // allow only if at least one question type is marked for manual scoring
139  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("manscoring_not_allowed"), true);
140  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
141  }
142 
143  $DIC->tabs()->activateTab(ilTestTabsManager::TAB_ID_MANUAL_SCORING);
144  $this->buildSubTabs($this->getActiveSubTabId());
145 
146  $nextClass = $this->ctrl->getNextClass($this);
147  $command = $this->ctrl->getCmd($this->getDefaultCommand());
148 
149  switch ($nextClass) {
150  default:
151  $this->$command();
152  break;
153  }
154  }
static accessViolationRedirect()
global $DIC
Definition: feed.php:28
static _mananuallyScoreableQuestionTypesExists()
Returns the fact wether manually scoreable question types exist or not.
+ Here is the call graph for this function:

◆ fetchActiveIdParameter()

ilTestScoringGUI::fetchActiveIdParameter ( )
private

Definition at line 91 of file class.ilTestScoringGUI.php.

References $DIC, and ILIAS\Repository\int().

Referenced by saveManScoringParticipantScreen(), and showManScoringParticipantScreen().

91  : int
92  {
93  global $DIC;
94  $ilCtrl = $DIC['ilCtrl'];
95 
96  // fetch active_id
97 
98  if (!$this->testrequest->isset('active_id') || !(int) $this->testrequest->raw('active_id')) {
99  // allow only write access
100  $this->tpl->setOnScreenMessage('failure', 'no active id given!', true);
101  $ilCtrl->redirectByClass("ilobjtestgui", "infoScreen");
102  } else {
103  $activeId = (int) $this->testrequest->raw('active_id');
104  }
105 
106  return $activeId;
107  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchPassParameter()

ilTestScoringGUI::fetchPassParameter (   $activeId)
private

Definition at line 109 of file class.ilTestScoringGUI.php.

References ILIAS\Repository\int(), ILIAS\Repository\object(), and SCORE_LAST_PASS.

Referenced by saveManScoringParticipantScreen(), and showManScoringParticipantScreen().

110  {
111  // fetch pass nr
112 
113  $maxPass = $this->object->_getMaxPass($activeId);
114  if ($this->testrequest->isset("pass") && 0 <= (int) $this->testrequest->raw("pass") && $maxPass >= (int) $this->testrequest->raw("pass")) {
115  $pass = $this->testrequest->raw("pass");
116  } elseif ($this->object->getPassScoring() == SCORE_LAST_PASS) {
117  $pass = $maxPass;
118  } else {
119  $pass = $this->object->_getResultPass($activeId);
120  }
121 
122  return $pass;
123  }
const SCORE_LAST_PASS
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActiveSubTabId()

ilTestScoringGUI::getActiveSubTabId ( )
protected
Returns
string

Definition at line 167 of file class.ilTestScoringGUI.php.

Referenced by executeCommand().

167  : string
168  {
169  return 'man_scoring';
170  }
+ Here is the caller graph for this function:

◆ getDefaultCommand()

ilTestScoringGUI::getDefaultCommand ( )
protected
Returns
string

Definition at line 159 of file class.ilTestScoringGUI.php.

Referenced by executeCommand().

159  : string
160  {
161  return 'manscoring';
162  }
+ Here is the caller graph for this function:

◆ getTestAccess()

ilTestScoringGUI::getTestAccess ( )

◆ resetManScoringParticipantsFilter()

ilTestScoringGUI::resetManScoringParticipantsFilter ( )
private

Definition at line 192 of file class.ilTestScoringGUI.php.

References buildManScoringParticipantsTable(), and showManScoringParticipantsTable().

193  {
194  $table = $this->buildManScoringParticipantsTable(false);
195 
196  $table->resetOffset();
197  $table->resetFilter();
198 
200  }
buildManScoringParticipantsTable($withData=false)
+ Here is the call graph for this function:

◆ saveManScoringParticipantScreen()

ilTestScoringGUI::saveManScoringParticipantScreen (   $redirect = true)
private
Parameters
bool$redirect
Returns
bool Returns a boolean flag, whether or not everything worked fine

Definition at line 250 of file class.ilTestScoringGUI.php.

References $DIC, ilTestServiceGUI\$lng, assQuestion\_getMaximumPoints(), ilObjTestAccess\_getParticipantId(), assQuestion\_getReachedPoints(), ilObjAdvancedEditing\_getUsedHTMLTagsAsString(), ilObjUser\_lookupName(), assQuestion\_setReachedPoints(), ilLPStatusWrapper\_updateStatus(), ilObjTestGUI\accessViolationRedirect(), buildManScoringParticipantForm(), fetchActiveIdParameter(), fetchPassParameter(), getTestAccess(), ILIAS\Repository\object(), ilMailNotification\setAdditionalInformation(), ilTestService\setManScoringDone(), showManScoringParticipantScreen(), and ilUtil\stripSlashes().

Referenced by saveNextManScoringParticipantScreen(), and saveReturnManScoringParticipantScreen().

251  {
252  global $DIC;
253  $ilCtrl = $DIC['ilCtrl'];
254  $lng = $DIC['lng'];
255 
256  $activeId = $this->fetchActiveIdParameter();
257 
258  if (!$this->getTestAccess()->checkScoreParticipantsAccessForActiveId($activeId)) {
260  }
261 
262  $pass = $this->fetchPassParameter($activeId);
263 
264  $questionGuiList = $this->service->getManScoringQuestionGuiList($activeId, $pass);
265  $form = $this->buildManScoringParticipantForm($questionGuiList, $activeId, $pass, false);
266 
267  $form->setValuesByPost();
268 
269  if (!$form->checkInput()) {
270  $this->tpl->setOnScreenMessage('failure', sprintf($lng->txt('tst_save_manscoring_failed'), $pass + 1));
271  $this->showManScoringParticipantScreen($form);
272  return false;
273  }
274 
275  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
276 
277  $maxPointsByQuestionId = array();
278  $maxPointsExceeded = false;
279  foreach ($questionGuiList as $questionId => $questionGui) {
280  $reachedPoints = $form->getItemByPostVar("question__{$questionId}__points")->getValue();
281  $maxPoints = assQuestion::_getMaximumPoints($questionId);
282 
283  if ($reachedPoints > $maxPoints) {
284  $maxPointsExceeded = true;
285 
286  $form->getItemByPostVar("question__{$questionId}__points")->setAlert(sprintf(
287  $lng->txt('tst_manscoring_maxpoints_exceeded_input_alert'),
288  $maxPoints
289  ));
290  }
291 
292  $maxPointsByQuestionId[$questionId] = $maxPoints;
293  }
294 
295  if ($maxPointsExceeded) {
296  $this->tpl->setOnScreenMessage('failure', sprintf($lng->txt('tst_save_manscoring_failed'), $pass + 1));
297  $this->showManScoringParticipantScreen($form);
298  return false;
299  }
300 
301  include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
302 
303  foreach ($questionGuiList as $questionId => $questionGui) {
304  $reachedPoints = $form->getItemByPostVar("question__{$questionId}__points")->getValue();
305 
306  $finalized = (bool) $form->getItemByPostVar("{$questionId}__evaluated")->getchecked();
307 
308  // fix #35543: save manual points only if they differ from the existing points
309  // this prevents a question being set to "answered" if only feedback is entered
310  $oldPoints = assQuestion::_getReachedPoints($activeId, $questionId, $pass);
311  if ($reachedPoints != $oldPoints) {
313  $activeId,
314  $questionId,
315  $reachedPoints,
316  $maxPointsByQuestionId[$questionId],
317  $pass,
318  true,
319  $this->object->areObligationsEnabled()
320  );
321  }
322 
323  $feedback = ilUtil::stripSlashes(
324  (string) $form->getItemByPostVar("question__{$questionId}__feedback")->getValue(),
325  false,
327  );
328 
329  $this->object->saveManualFeedback($activeId, (int) $questionId, (int) $pass, $feedback, $finalized, true);
330 
331  $notificationData[$questionId] = array(
332  'points' => $reachedPoints, 'feedback' => $feedback
333  );
334  }
335 
336  include_once "./Modules/Test/classes/class.ilObjTestAccess.php";
337  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
339  $this->object->getId(),
341  );
342 
343  $manScoringDone = $form->getItemByPostVar("manscoring_done")->getChecked();
344  ilTestService::setManScoringDone($activeId, $manScoringDone);
345 
346  $manScoringNotify = $form->getItemByPostVar("manscoring_notify")->getChecked();
347  if ($manScoringNotify) {
348  require_once 'Modules/Test/classes/notifications/class.ilTestManScoringParticipantNotification.php';
349 
350  $notification = new ilTestManScoringParticipantNotification(
351  $this->object->_getUserIdFromActiveId($activeId),
352  $this->object->getRefId()
353  );
354 
355  $notification->setAdditionalInformation(array(
356  'test_title' => $this->object->getTitle(),
357  'test_pass' => $pass + 1,
358  'questions_gui_list' => $questionGuiList,
359  'questions_scoring_data' => $notificationData
360  ));
361 
362  $notification->send();
363  }
364 
365  require_once './Modules/Test/classes/class.ilTestScoring.php';
366  $scorer = new ilTestScoring($this->object);
367  $scorer->setPreserveManualScores(true);
368  $scorer->recalculateSolutions();
369 
370  if ($this->object->getAnonymity() == 0) {
372  $name_real_or_anon = $user_name['firstname'] . ' ' . $user_name['lastname'];
373  } else {
374  $name_real_or_anon = $lng->txt('anonymous');
375  }
376  $this->tpl->setOnScreenMessage('success', sprintf($lng->txt('tst_saved_manscoring_successfully'), $pass + 1, $name_real_or_anon), true);
377  if ($redirect == true) {
378  $ilCtrl->redirect($this, 'showManScoringParticipantScreen');
379  }
380  return true;
381  }
showManScoringParticipantScreen(ilPropertyFormGUI $form=null)
static setManScoringDone($activeId, $manScoringDone)
stores the flag wether manscoring is done for the given test active or not within the global settings...
static _getParticipantId($active_id)
Get user id for active id.
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static _lookupName(int $a_user_id)
lookup user name
static accessViolationRedirect()
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getReachedPoints(int $active_id, int $question_id, int $pass)
buildManScoringParticipantForm($questionGuiList, $activeId, $pass, $initValues=false)
static _setReachedPoints(int $active_id, int $question_id, float $points, float $maxpoints, int $pass, bool $manualscoring, bool $obligationsEnabled)
Sets the points, a learner has reached answering the question Additionally objective results are upda...
static _getUsedHTMLTagsAsString(string $a_module="")
Returns a string of all allowed HTML tags for text editing.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getMaximumPoints(int $question_id)
Returns the maximum points, a learner can reach answering the question.
setAdditionalInformation(array $a_info)
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveNextManScoringParticipantScreen()

ilTestScoringGUI::saveNextManScoringParticipantScreen ( )
private

Definition at line 383 of file class.ilTestScoringGUI.php.

References $DIC, $index, ilTestServiceGUI\$participantData, buildManScoringParticipantsTable(), and saveManScoringParticipantScreen().

384  {
385  global $DIC;
386  $ilCtrl = $DIC['ilCtrl'];
387 
388  $table = $this->buildManScoringParticipantsTable(true);
389 
390  if ($this->saveManScoringParticipantScreen(false)) {
391  $participantData = $table->getInternalyOrderedDataValues();
392 
393  $nextIndex = null;
394  foreach ($participantData as $index => $participant) {
395  if ($participant['active_id'] == $this->testrequest->raw('active_id')) {
396  $nextIndex = $index + 1;
397  break;
398  }
399  }
400 
401  if ($nextIndex && isset($participantData[$nextIndex])) {
402  $ilCtrl->setParameter($this, 'active_id', $participantData[$nextIndex]['active_id']);
403  $ilCtrl->redirect($this, 'showManScoringParticipantScreen');
404  }
405 
406  $ilCtrl->redirectByClass("iltestscoringgui", "showManScoringParticipantsTable");
407  }
408  }
$index
Definition: metadata.php:145
global $DIC
Definition: feed.php:28
saveManScoringParticipantScreen($redirect=true)
buildManScoringParticipantsTable($withData=false)
+ Here is the call graph for this function:

◆ saveReturnManScoringParticipantScreen()

ilTestScoringGUI::saveReturnManScoringParticipantScreen ( )
private

Definition at line 410 of file class.ilTestScoringGUI.php.

References $DIC, and saveManScoringParticipantScreen().

411  {
412  global $DIC;
413  $ilCtrl = $DIC['ilCtrl'];
414 
415  if ($this->saveManScoringParticipantScreen(false)) {
416  $ilCtrl->redirectByClass("iltestscoringgui", "showManScoringParticipantsTable");
417  }
418  }
global $DIC
Definition: feed.php:28
saveManScoringParticipantScreen($redirect=true)
+ Here is the call graph for this function:

◆ sendManScoringParticipantNotification()

ilTestScoringGUI::sendManScoringParticipantNotification ( )
private

Definition at line 537 of file class.ilTestScoringGUI.php.

538  {
539  }

◆ setTestAccess()

ilTestScoringGUI::setTestAccess (   $testAccess)
Parameters
ilTestAccess$testAccess

Definition at line 70 of file class.ilTestScoringGUI.php.

References $DIC, $testAccess, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

71  {
72  $this->testAccess = $testAccess;
73  }
+ Here is the call graph for this function:

◆ showManScoringParticipantScreen()

ilTestScoringGUI::showManScoringParticipantScreen ( ilPropertyFormGUI  $form = null)
private

Definition at line 202 of file class.ilTestScoringGUI.php.

References $DIC, ilTestServiceGUI\$lng, ilTestServiceGUI\$tpl, ilObjTestGUI\accessViolationRedirect(), buildManScoringParticipantForm(), fetchActiveIdParameter(), fetchPassParameter(), and getTestAccess().

Referenced by saveManScoringParticipantScreen().

203  {
204  global $DIC;
205  $tpl = $DIC['tpl'];
206  $lng = $DIC['lng'];
207 
208  $activeId = $this->fetchActiveIdParameter();
209 
210  if (!$this->getTestAccess()->checkScoreParticipantsAccessForActiveId($activeId)) {
212  }
213 
214  $pass = $this->fetchPassParameter($activeId);
215 
216  $contentHTML = '';
217 
218  // pass overview table
219  require_once 'Modules/Test/classes/tables/class.ilTestPassManualScoringOverviewTableGUI.php';
220  $table = new ilTestPassManualScoringOverviewTableGUI($this, 'showManScoringParticipantScreen');
221 
222  $userId = $this->object->_getUserIdFromActiveId($activeId);
223  $userFullname = $this->object->userLookupFullName($userId, false, true);
224  $tableTitle = sprintf($lng->txt('tst_pass_overview_for_participant'), $userFullname);
225  $table->setTitle($tableTitle);
226 
227  $passOverviewData = $this->service->getPassOverviewData($activeId);
228  $table->setData($passOverviewData['passes']);
229 
230  $contentHTML .= $table->getHTML() . '<br />';
231 
232  // pass scoring form
233 
234  if ($form === null) {
235  $questionGuiList = $this->service->getManScoringQuestionGuiList($activeId, $pass);
236  $form = $this->buildManScoringParticipantForm($questionGuiList, $activeId, $pass, true);
237  }
238 
239  $contentHTML .= $form->getHTML();
240 
241  // set content
242 
243  $tpl->setContent($contentHTML);
244  }
static accessViolationRedirect()
global $DIC
Definition: feed.php:28
buildManScoringParticipantForm($questionGuiList, $activeId, $pass, $initValues=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showManScoringParticipantsTable()

ilTestScoringGUI::showManScoringParticipantsTable ( )
private

Definition at line 172 of file class.ilTestScoringGUI.php.

References $DIC, ilTestServiceGUI\$tpl, and buildManScoringParticipantsTable().

Referenced by applyManScoringParticipantsFilter(), and resetManScoringParticipantsFilter().

173  {
174  global $DIC;
175  $tpl = $DIC['tpl'];
176 
177  $table = $this->buildManScoringParticipantsTable(true);
178 
179  $tpl->setContent($table->getHTML());
180  }
global $DIC
Definition: feed.php:28
buildManScoringParticipantsTable($withData=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $testAccess

ilTestScoringGUI::$testAccess
protected

Definition at line 44 of file class.ilTestScoringGUI.php.

Referenced by getTestAccess(), and setTestAccess().

◆ PART_FILTER_ACTIVE_ONLY

const ilTestScoringGUI::PART_FILTER_ACTIVE_ONLY = 1

◆ PART_FILTER_ALL_USERS

const ilTestScoringGUI::PART_FILTER_ALL_USERS = 3

◆ PART_FILTER_INACTIVE_ONLY

const ilTestScoringGUI::PART_FILTER_INACTIVE_ONLY = 2

◆ PART_FILTER_MANSCORING_DONE

const ilTestScoringGUI::PART_FILTER_MANSCORING_DONE = 4

◆ PART_FILTER_MANSCORING_NONE

const ilTestScoringGUI::PART_FILTER_MANSCORING_NONE = 5

The documentation for this class was generated from the following file: