ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestScoringGUI Class Reference

Scoring class for tests. 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 (bool $contextResultPresentation)
 
 setParticipantData (ilTestParticipantData $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 $objective_oriented_container)
 
 getObjectiveOrientedContainer ()
 
 executeCommand ()
 execute command More...
 
 getCommand ($cmd)
 Retrieves the ilCtrl command. More...
 
 buildPassOverviewTableGUI (ilTestEvaluationGUI $target_gui)
 
 getPassListOfAnswers (&$result_array, $active_id, $pass, $show_solutions=false, $only_answered_questions=false, $show_question_only=false, $show_reached_points=false, $anchorNav=false, ilTestQuestionRelatedObjectivesList $objectives_list=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 $objectives_list=null)
 Returns an output of the solution to an answer compared to the correct solution. More...
 
 getResultsOfUserOutput (ilTestSession $testSession, int $active_id, int $pass, ilParticipantsTestResultsGUI $target_gui, bool $show_pass_details=true, bool $show_answers=true, bool $show_question_only=false, bool $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 (int $question_id, int $test_id)
 
 getObject ()
 

Data Fields

const PART_FILTER_ALL_USERS = 3
 
const PART_FILTER_MANSCORING_DONE = 4
 
const PART_FILTER_MANSCORING_NONE = 5
 

Protected Member Functions

 buildSubTabs ($active_sub_tab='man_scoring_by_qst')
 
 getDefaultCommand ()
 
 getActiveSubTabId ()
 
- Protected Member Functions inherited from ilTestServiceGUI
 getPassDetailsOverviewTableGUI (array $result_array, int $active_id, int $pass, ilTestServiceGUI|ilParticipantsTestResultsGUI $target_gui, string $target_cmd, ilTestQuestionRelatedObjectivesList $objectives_list=null, bool $multiple_objectives_involved=true)
 
 buildPassDetailsOverviewTableGUI (ilTestServiceGUI|ilParticipantsTestResultsGUI $target_gui, string $target_cmd)
 
 isGradingMessageRequired ()
 
 getGradingMessageBuilder (int $active_id)
 
 buildQuestionRelatedObjectivesList (ilLOTestQuestionAdapter $objectives_adapter, ilTestQuestionSequence $test_sequence)
 
 getFilteredTestResult (int $active_id, int $pass, bool $considerHiddenQuestions, bool $considerOptionalQuestions)
 
 populateContent ($content)
 
 buildUserTestResultsToolbarGUI ()
 
 outCorrectSolutionCmd ()
 
 outCorrectSolution ()
 Creates an output of the solution of an answer compared to the correct solution. More...
 
 populatePassFinishDate (ilTemplate $tpl, ?int $pass_finish_date)
 
 populateExamId (ilTemplate $tpl, int $active_id, int $pass)
 

Protected Attributes

 $testAccess
 
- Protected Attributes inherited from ilTestServiceGUI
InternalRequestService $testrequest
 
ILIAS TestQuestionPool QuestionInfoService $questioninfo
 
ilTestService $service = null
 
ilDBInterface $db
 
ilLanguage $lng
 
LoggingServices $logging_services
 
ilHelpGUI $help
 
ilRbacSystem $rbac_system
 
ilGlobalTemplateInterface ilTemplate $tpl
 sk 2023-08-01: We need this union type, even if it is wrong! To change this More...
 
ContentStyle $content_style
 
ilErrorHandling $error
 
ilAccess $access
 
HTTPServices $http
 
ilCtrl $ctrl
 
ilToolbarGUI $toolbar
 
ilTabsGUI $tabs
 
ilObjectDataCache $obj_cache
 
ilComponentRepository $component_repository
 
ilObjUser $user
 
ArrayBasedRequestWrapper $post_wrapper
 
ilNavigationHistory $navigation_history
 
Refinery $refinery
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
SkillService $skills_service
 
ilTestShuffler $shuffler
 
ilTestResultsFactory $results_factory
 
ilTestResultsPresentationFactory $results_presentation_factory
 
ILIAS $ilias
 
ilSetting $settings
 
GlobalScreenServices $global_screen
 
ilTree $tree
 
int $ref_id
 
ilTestSessionFactory $testSessionFactory = null
 
ilTestSequenceFactory $testSequenceFactory = null
 
ilTestParticipantData $participantData = null
 
ilTestParticipantAccessFilterFactory $participant_access_filter
 

Private Member Functions

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

Detailed Description

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 30 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 50 of file class.ilTestScoringGUI.php.

References ILIAS\MetaData\Repository\Validation\Data\__construct().

51  {
52  parent::__construct($a_object);
53  }
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ applyManScoringParticipantsFilter()

ilTestScoringGUI::applyManScoringParticipantsFilter ( )
private

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

References buildManScoringParticipantsTable(), and showManScoringParticipantsTable().

156  : void
157  {
158  $table = $this->buildManScoringParticipantsTable(false);
159  $table->resetOffset();
160  $table->writeFilterToSession();
161 
163  }
buildManScoringParticipantsTable(bool $withData=false)
+ Here is the call graph for this function:

◆ buildManScoringParticipantForm()

ilTestScoringGUI::buildManScoringParticipantForm ( array  $questionGuiList,
int  $active_id,
int  $pass,
bool  $initValues = false 
)
private

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

References $check, assQuestion\_getReachedPoints(), ILIAS\Repository\ctrl(), ilObjTest\getSingleManualFeedback(), ilTestService\isManScoringDone(), ILIAS\Repository\lng(), and ilTextAreaInputGUI\setValue().

Referenced by saveManScoringParticipantScreen(), and showManScoringParticipantScreen().

368  $this->ctrl->setParameter($this, 'active_id', $active_id);
369  $this->ctrl->setParameter($this, 'pass', $pass);
370 
371  $form = new ilPropertyFormGUI();
372  $form->setFormAction($this->ctrl->getFormAction($this));
373 
374  $form->setTitle(sprintf($this->lng->txt('manscoring_results_pass'), $pass + 1));
375  $form->setTableWidth('100%');
376 
377  $autosave_enabled = $this->object->getAutosave();
378  $show_solutions_enabled = $this->object->getShowSolutionFeedback();
379  foreach ($questionGuiList as $questionId => $questionGUI) {
380  $questionHeader = sprintf($this->lng->txt('tst_manscoring_question_section_header'), $questionGUI->object->getTitleForHTMLOutput());
381  $questionSolution = $questionGUI->getSolutionOutput($active_id, $pass, false, false, true, false, false, true);
382  $bestSolution = $questionGUI->object->getSuggestedSolutionOutput();
383 
384  $feedback = $this->object->getSingleManualFeedback($active_id, $questionId, $pass);
385 
386  $disabled = false;
387  if (isset($feedback['finalized_evaluation']) && $feedback['finalized_evaluation'] == 1) {
388  $disabled = true;
389  }
390 
391  $sect = new ilFormSectionHeaderGUI();
392  $sect->setTitle($questionHeader . ' [' . $this->lng->txt('question_id_short') . ': ' . $questionGUI->object->getId() . ']');
393  $form->addItem($sect);
394 
395  $cust = new ilCustomInputGUI($this->lng->txt('tst_manscoring_input_question_and_user_solution'));
396  $cust->setHtml($questionSolution);
397  $form->addItem($cust);
398 
399  if ($autosave_enabled) {
400  $aresult_output = $questionGUI->getAutoSavedSolutionOutput(
401  $active_id,
402  $pass,
403  false,
404  false,
405  true,
406  $show_solutions_enabled,
407  false,
408  true,
409  false
410  );
411  if ($aresult_output) {
412  $cust = new ilCustomInputGUI($this->lng->txt('autosavecontent'));
413  $cust->setHtml($aresult_output);
414  $form->addItem($cust);
415  }
416  }
417 
418  $number_input_gui = new \ilNumberInputGUI($this->lng->txt('tst_change_points_for_question'), "question__{$questionId}__points");
419  $number_input_gui->allowDecimals(true);
420  if ($initValues) {
421  $number_input_gui->setValue((string) \assQuestion::_getReachedPoints($active_id, $questionId, $pass));
422  }
423  if ($disabled) {
424  $number_input_gui->setDisabled($disabled);
425  }
426  $form->addItem($number_input_gui);
427 
428  $nonedit = new ilNonEditableValueGUI($this->lng->txt('tst_manscoring_input_max_points_for_question'), "question__{$questionId}__maxpoints");
429  if ($initValues) {
430  $nonedit->setValue($this->questioninfo->getMaximumPoints($questionId));
431  }
432  $form->addItem($nonedit);
433 
434  $area = new ilTextAreaInputGUI($this->lng->txt('set_manual_feedback'), "question__{$questionId}__feedback");
435  $area->setUseRTE(true);
436  if ($initValues) {
437  $area->setValue(ilObjTest::getSingleManualFeedback((int) $active_id, (int) $questionId, (int) $pass)['feedback'] ?? '');
438  }
439  if ($disabled) {
440  $area->setDisabled($disabled);
441  }
442  $form->addItem($area);
443 
444  $check = new ilCheckboxInputGUI($this->lng->txt('finalized_evaluation'), "{$questionId}__evaluated");
445  if ($disabled) {
446  $check->setChecked(true);
447  }
448  $form->addItem($check);
449 
450  if (strlen(trim($bestSolution))) {
451  $cust = new ilCustomInputGUI($this->lng->txt('tst_show_solution_suggested'));
452  $cust->setHtml($bestSolution);
453  $form->addItem($cust);
454  }
455  }
456 
457  $sect = new ilFormSectionHeaderGUI();
458  $sect->setTitle($this->lng->txt('tst_participant'));
459  $form->addItem($sect);
460 
461  $check = new ilCheckboxInputGUI($this->lng->txt('set_manscoring_done'), 'manscoring_done');
462  if ($initValues && ilTestService::isManScoringDone($active_id)) {
463  $check->setChecked(true);
464  }
465  $form->addItem($check);
466 
467  $check = new ilCheckboxInputGUI($this->lng->txt('tst_manscoring_user_notification'), 'manscoring_notify');
468  $form->addItem($check);
469 
470  $form->addCommandButton('saveManScoringParticipantScreen', $this->lng->txt('save'));
471  $form->addCommandButton('saveReturnManScoringParticipantScreen', $this->lng->txt('save_return'));
472  $form->addCommandButton('saveNextManScoringParticipantScreen', $this->lng->txt('save_and_next'));
473 
474  return $form;
475  }
static isManScoringDone(int $active_id)
static getSingleManualFeedback(int $active_id, int $question_id, int $pass)
static _getReachedPoints(int $active_id, int $question_id, int $pass)
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 ( bool  $withData = false)
private

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

References ILIAS\Repository\lng(), ILIAS\Repository\object(), and ILIAS\Repository\user().

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

482  {
483  $table = new ilTestManScoringParticipantsTableGUI($this);
484 
485  if ($withData) {
486  $participantStatusFilterValue = $table->getFilterItemByPostVar('participant_status')->getValue();
487 
488  $participant_list = new ilTestParticipantList($this->object, $this->user, $this->lng, $this->db);
489 
490  $participant_list->initializeFromDbRows(
491  $this->object->getTestParticipantsForManualScoring($participantStatusFilterValue)
492  );
493 
494  $filtered_participant_list = $participant_list->getAccessFilteredList(
495  $this->participant_access_filter->getScoreParticipantsUserFilter($this->ref_id)
496  );
497 
498  $table->setData($filtered_participant_list->getParticipantsTableRows());
499  }
500 
501  return $table;
502  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildSubTabs()

ilTestScoringGUI::buildSubTabs (   $active_sub_tab = 'man_scoring_by_qst')
protected
Parameters
string$active_sub_tab

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

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

Referenced by executeCommand().

75  {
76  $this->tabs->addSubTab('man_scoring_by_qst', $this->lng->txt('tst_man_scoring_by_qst'), $this->ctrl->getLinkTargetByClass('ilTestScoringByQuestionsGUI', 'showManScoringByQuestionParticipantsTable'));
77  $this->tabs->addSubTab('man_scoring', $this->lng->txt('tst_man_scoring_by_part'), $this->ctrl->getLinkTargetByClass('ilTestScoringGUI', 'showManScoringParticipantsTable'));
78  $this->tabs->setSubTabActive($active_sub_tab);
79  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilTestScoringGUI::executeCommand ( )

execute command

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

References ilObjAssessmentFolder\_mananuallyScoreableQuestionTypesExists(), buildSubTabs(), ILIAS\Repository\ctrl(), getActiveSubTabId(), getDefaultCommand(), getTestAccess(), ILIAS\Repository\lng(), ilTestTabsManager\TAB_ID_MANUAL_SCORING, and ILIAS\Repository\tabs().

116  {
117  if (!$this->getTestAccess()->checkScoreParticipantsAccess()) {
118  ilObjTestGUI::accessViolationRedirect();
119  }
120 
122  // allow only if at least one question type is marked for manual scoring
123  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("manscoring_not_allowed"), true);
124  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
125  }
126 
127  $this->tabs->activateTab(ilTestTabsManager::TAB_ID_MANUAL_SCORING);
128  $this->buildSubTabs($this->getActiveSubTabId());
129 
130  $nextClass = $this->ctrl->getNextClass($this);
131  $command = $this->ctrl->getCmd($this->getDefaultCommand());
132 
133  switch ($nextClass) {
134  default:
135  $this->$command();
136  break;
137  }
138  }
buildSubTabs($active_sub_tab='man_scoring_by_qst')
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 81 of file class.ilTestScoringGUI.php.

References ILIAS\Repository\ctrl().

Referenced by saveManScoringParticipantScreen(), and showManScoringParticipantScreen().

81  : int
82  {
83  if (!$this->testrequest->isset('active_id') || $this->testrequest->int('active_id') === 0) {
84  $this->tpl->setOnScreenMessage('failure', 'no active id given!', true);
85  $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
86  }
87 
88  return $this->testrequest->int('active_id');
89  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchPassParameter()

ilTestScoringGUI::fetchPassParameter ( int  $active_id)
private

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

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

Referenced by saveManScoringParticipantScreen(), and showManScoringParticipantScreen().

91  : int
92  {
93  $max_pass = $this->object->_getMaxPass($active_id);
94 
95 
96  if ($this->testrequest->isset('pass')) {
97  $pass_from_request = $this->testrequest->int('pass');
98  if ($pass_from_request >= 0
99  && $pass_from_request <= $max_pass
100  ) {
101  return $pass_from_request;
102  }
103  }
104 
105  if ($this->object->getPassScoring() == SCORE_LAST_PASS) {
106  return $max_pass;
107  }
108 
109  return $this->object->_getResultPass($active_id);
110  }
const SCORE_LAST_PASS
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActiveSubTabId()

ilTestScoringGUI::getActiveSubTabId ( )
protected

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

Referenced by executeCommand().

145  : string
146  {
147  return 'man_scoring';
148  }
+ Here is the caller graph for this function:

◆ getDefaultCommand()

ilTestScoringGUI::getDefaultCommand ( )
protected

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

Referenced by executeCommand().

140  : string
141  {
142  return 'manscoring';
143  }
+ Here is the caller graph for this function:

◆ getTestAccess()

ilTestScoringGUI::getTestAccess ( )

◆ resetManScoringParticipantsFilter()

ilTestScoringGUI::resetManScoringParticipantsFilter ( )
private

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

References buildManScoringParticipantsTable(), and showManScoringParticipantsTable().

165  : void
166  {
167  $table = $this->buildManScoringParticipantsTable(false);
168  $table->resetOffset();
169  $table->resetFilter();
170 
172  }
buildManScoringParticipantsTable(bool $withData=false)
+ Here is the call graph for this function:

◆ saveManScoringParticipantScreen()

ilTestScoringGUI::saveManScoringParticipantScreen ( bool  $redirect = true)
private

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

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

Referenced by saveNextManScoringParticipantScreen(), and saveReturnManScoringParticipantScreen().

208  : bool
209  {
210  $active_id = $this->fetchActiveIdParameter();
211 
212  if (!$this->getTestAccess()->checkScoreParticipantsAccessForActiveId($active_id)) {
213  ilObjTestGUI::accessViolationRedirect();
214  }
215 
216  $pass = $this->fetchPassParameter($active_id);
217 
218  $questionGuiList = $this->service->getManScoringQuestionGuiList($active_id, $pass);
219  $form = $this->buildManScoringParticipantForm($questionGuiList, $active_id, $pass, false);
220 
221  $form->setValuesByPost();
222 
223  if (!$form->checkInput()) {
224  $this->tpl->setOnScreenMessage('failure', sprintf($this->lng->txt('tst_save_manscoring_failed'), $pass + 1));
225  $this->showManScoringParticipantScreen($form);
226  return false;
227  }
228 
229  $maxPointsByQuestionId = [];
230  $maxPointsExceeded = false;
231  foreach ($questionGuiList as $questionId => $questionGui) {
232  $reachedPoints = $form->getItemByPostVar("question__{$questionId}__points")->getValue();
233  $maxPoints = $this->questioninfo->getMaximumPoints($questionId);
234 
235  if ($reachedPoints > $maxPoints) {
236  $maxPointsExceeded = true;
237 
238  $form->getItemByPostVar("question__{$questionId}__points")->setAlert(sprintf(
239  $this->lng->txt('tst_manscoring_maxpoints_exceeded_input_alert'),
240  $maxPoints
241  ));
242  }
243 
244  $maxPointsByQuestionId[$questionId] = $maxPoints;
245  }
246 
247  if ($maxPointsExceeded) {
248  $this->tpl->setOnScreenMessage('failure', sprintf($this->lng->txt('tst_save_manscoring_failed'), $pass + 1));
249  $this->showManScoringParticipantScreen($form);
250  return false;
251  }
252 
253  foreach ($questionGuiList as $questionId => $questionGui) {
254  $old_points = assQuestion::_getReachedPoints($active_id, $questionId, $pass);
255  $reached_points = $this->refinery->byTrying([
256  $this->refinery->kindlyTo()->float(),
257  $this->refinery->always($old_points)
258  ])->transform($form->getItemByPostVar("question__{$questionId}__points")?->getValue());
259 
260  $finalized = (bool) $form->getItemByPostVar("{$questionId}__evaluated")?->getChecked();
261  // fix #35543: save manual points only if they differ from the existing points
262  // this prevents a question being set to "answered" if only feedback is entered
263  if ($reached_points !== $old_points) {
265  $active_id,
266  $questionId,
267  $reached_points,
268  $maxPointsByQuestionId[$questionId],
269  $pass,
270  true,
271  $this->object->areObligationsEnabled(),
272  $this->getTestAccess()->getTestId()
273  );
274  }
275 
276  $feedback = ilUtil::stripSlashes(
277  (string) $form->getItemByPostVar("question__{$questionId}__feedback")->getValue(),
278  false,
280  );
281 
282  $this->object->saveManualFeedback($active_id, (int) $questionId, $pass, $feedback, $finalized, true);
283 
284  $notificationData[$questionId] = [
285  'points' => $reached_points, 'feedback' => $feedback
286  ];
287  }
288 
290  $this->object->getId(),
292  );
293 
294  $manScoringDone = $form->getItemByPostVar("manscoring_done")->getChecked();
295  ilTestService::setManScoringDone($active_id, $manScoringDone);
296 
297  $manScoringNotify = $form->getItemByPostVar("manscoring_notify")->getChecked();
298  if ($manScoringNotify) {
299  $notification = new ilTestManScoringParticipantNotification(
300  $this->object->_getUserIdFromActiveId($active_id),
301  $this->object->getRefId()
302  );
303 
304  $notification->setAdditionalInformation(array(
305  'test_title' => $this->object->getTitle(),
306  'test_pass' => $pass + 1,
307  'questions_gui_list' => $questionGuiList,
308  'questions_scoring_data' => $notificationData
309  ));
310 
311  $notification->send();
312  }
313 
314  $scorer = new ilTestScoring($this->object, $this->db);
315  $scorer->setPreserveManualScores(true);
316  $scorer->recalculateSolution($active_id, $pass);
317 
318  if ($this->object->getAnonymity() == 0) {
320  $name_real_or_anon = $user_name['firstname'] . ' ' . $user_name['lastname'];
321  } else {
322  $name_real_or_anon = $this->lng->txt('anonymous');
323  }
324  $this->tpl->setOnScreenMessage('success', sprintf($this->lng->txt('tst_saved_manscoring_successfully'), $pass + 1, $name_real_or_anon), true);
325  if ($redirect == true) {
326  $this->ctrl->redirect($this, 'showManScoringParticipantScreen');
327  }
328  return true;
329  }
showManScoringParticipantScreen(ilPropertyFormGUI $form=null)
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
buildManScoringParticipantForm(array $questionGuiList, int $active_id, int $pass, bool $initValues=false)
static setManScoringDone(int $activeId, bool $manScoringDone)
static _getReachedPoints(int $active_id, int $question_id, int $pass)
static _getUsedHTMLTagsAsString(string $a_module="")
Returns a string of all allowed HTML tags for text editing.
Class ilTestScoring.
static _setReachedPoints(int $active_id, int $question_id, float $points, float $maxpoints, int $pass, bool $manualscoring, bool $obligationsEnabled, ?int $test_id=null)
Sets the points, a learner has reached answering the question Additionally objective results are upda...
setAdditionalInformation(array $a_info)
fetchPassParameter(int $active_id)
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 331 of file class.ilTestScoringGUI.php.

References ilTestServiceGUI\$participantData, buildManScoringParticipantsTable(), ILIAS\Repository\ctrl(), and saveManScoringParticipantScreen().

331  : void
332  {
333  $table = $this->buildManScoringParticipantsTable(true);
334 
335  if ($this->saveManScoringParticipantScreen(false)) {
336  $participantData = $table->getInternalyOrderedDataValues();
337 
338  $nextIndex = null;
339  foreach ($participantData as $index => $participant) {
340  if ($participant['active_id'] == $this->testrequest->raw('active_id')) {
341  $nextIndex = $index + 1;
342  break;
343  }
344  }
345 
346  if ($nextIndex && isset($participantData[$nextIndex])) {
347  $this->ctrl->setParameter($this, 'active_id', $participantData[$nextIndex]['active_id']);
348  $this->ctrl->redirect($this, 'showManScoringParticipantScreen');
349  }
350 
351  $this->ctrl->redirectByClass("iltestscoringgui", "showManScoringParticipantsTable");
352  }
353  }
saveManScoringParticipantScreen(bool $redirect=true)
ilTestParticipantData $participantData
buildManScoringParticipantsTable(bool $withData=false)
+ Here is the call graph for this function:

◆ saveReturnManScoringParticipantScreen()

ilTestScoringGUI::saveReturnManScoringParticipantScreen ( )
private

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

References ILIAS\Repository\ctrl(), and saveManScoringParticipantScreen().

355  : void
356  {
357  if ($this->saveManScoringParticipantScreen(false)) {
358  $this->ctrl->redirectByClass("iltestscoringgui", "showManScoringParticipantsTable");
359  }
360  }
saveManScoringParticipantScreen(bool $redirect=true)
+ Here is the call graph for this function:

◆ sendManScoringParticipantNotification()

ilTestScoringGUI::sendManScoringParticipantNotification ( )
private

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

477  : void
478  {
479  }

◆ setTestAccess()

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

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

References $testAccess.

67  {
68  $this->testAccess = $testAccess;
69  }

◆ showManScoringParticipantScreen()

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

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

References buildManScoringParticipantForm(), fetchActiveIdParameter(), fetchPassParameter(), getTestAccess(), and ILIAS\Repository\lng().

Referenced by saveManScoringParticipantScreen().

174  : void
175  {
176  $active_id = $this->fetchActiveIdParameter();
177 
178  if (!$this->getTestAccess()->checkScoreParticipantsAccessForActiveId($active_id)) {
179  ilObjTestGUI::accessViolationRedirect();
180  }
181 
182  $pass = $this->fetchPassParameter($active_id);
183 
184  $content_html = '';
185 
186  $table = new ilTestPassManualScoringOverviewTableGUI($this, 'showManScoringParticipantScreen');
187 
188  $user_id = $this->object->_getUserIdFromActiveId($active_id);
189  $user_fullname = $this->object->userLookupFullName($user_id, false, true);
190  $table_title = sprintf($this->lng->txt('tst_pass_overview_for_participant'), $user_fullname);
191  $table->setTitle($table_title);
192 
193  $passOverviewData = $this->service->getPassOverviewData($active_id);
194  $table->setData($passOverviewData['passes']);
195 
196  $content_html .= $table->getHTML() . '<br />';
197 
198  if ($form === null) {
199  $question_gui_list = $this->service->getManScoringQuestionGuiList($active_id, $pass);
200  $form = $this->buildManScoringParticipantForm($question_gui_list, $active_id, $pass, true);
201  }
202 
203  $content_html .= $form->getHTML();
204 
205  $this->tpl->setContent($content_html);
206  }
buildManScoringParticipantForm(array $questionGuiList, int $active_id, int $pass, bool $initValues=false)
fetchPassParameter(int $active_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showManScoringParticipantsTable()

ilTestScoringGUI::showManScoringParticipantsTable ( )
private

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

References buildManScoringParticipantsTable().

Referenced by applyManScoringParticipantsFilter(), and resetManScoringParticipantsFilter().

150  : void
151  {
152  $table = $this->buildManScoringParticipantsTable(true);
153  $this->tpl->setContent($table->getHTML());
154  }
buildManScoringParticipantsTable(bool $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 40 of file class.ilTestScoringGUI.php.

Referenced by getTestAccess(), and setTestAccess().

◆ PART_FILTER_ALL_USERS

const ilTestScoringGUI::PART_FILTER_ALL_USERS = 3

◆ 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: