ILIAS  release_8 Revision v8.24
ilTestScoringByQuestionsGUI 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 ilTestScoringByQuestionsGUI:
+ Collaboration diagram for ilTestScoringByQuestionsGUI:

Public Member Functions

 __construct (ilObjTest $a_object)
 ilTestScoringGUI constructor More...
 
 checkConstraintsBeforeSaving ()
 
- Public Member Functions inherited from ilTestScoringGUI
 __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 EXCEPT_FINALIZED = 1
 
const ONLY_FINALIZED = 2
 
- Data Fields inherited from ilTestScoringGUI
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 ()
 
 showManScoringByQuestionParticipantsTable (array $manPointsPost=[])
 
 applyManScoringByQuestionFilter ()
 
 resetManScoringByQuestionFilter ()
 
 getAnswerDetail ()
 
 retrieveFeedback (int $active_id, int $qst_id, int $pass)
 
 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...
 

Private Member Functions

 appendUserNameToModal (ilTemplate $tmp_tpl, ilTestEvaluationUserData $participant)
 
 appendQuestionTitleToModal (ilTemplate $tmp_tpl, $question_id, $max_points, $title)
 
 appendFormToModal (ilTemplate $tmp_tpl, $pass, $active_id, $question_id, $max_points)
 
 appendSolutionAndPointsToModal (ilTemplate $tmp_tpl, $result_output, $reached_points, $max_points)
 
 saveFinalization (array $finalization, int $active_id, int $qst_id, int $pass, ?string $feedback, bool $is_single_feedback)
 
 doesValueExistsInPostArray (array $finalization, int $active_id, int $qst_id, int $pass)
 

Private Attributes

ILIAS HTTP GlobalHttpState $http
 

Additional Inherited Members

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

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

Definition at line 21 of file class.ilTestScoringByQuestionsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestScoringByQuestionsGUI::__construct ( ilObjTest  $a_object)

ilTestScoringGUI constructor

The constructor takes the test object reference as parameter

Parameters
object$a_objectAssociated ilObjTest class @access public

Reimplemented from ilTestScoringGUI.

Definition at line 28 of file class.ilTestScoringByQuestionsGUI.php.

29 {
30 global $DIC;
31 parent::__construct($a_object);
32 $this->http = $DIC->http();
33 }
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\FileDelivery\http().

+ Here is the call graph for this function:

Member Function Documentation

◆ appendFormToModal()

ilTestScoringByQuestionsGUI::appendFormToModal ( ilTemplate  $tmp_tpl,
  $pass,
  $active_id,
  $question_id,
  $max_points 
)
private
Parameters
$pass
$active_id
$question_id
$max_points

Definition at line 592 of file class.ilTestScoringByQuestionsGUI.php.

592 : void
593 {
594 $post_var = '[' . $pass . '][' . $active_id . '][' . $question_id . ']';
595 $scoring_post_var = 'scoring' . $post_var;
596 $reached_points = assQuestion::_getReachedPoints($active_id, $question_id, $pass);
597 $form = new ilPropertyFormGUI();
598 $feedback = ilObjTest::getSingleManualFeedback((int) $active_id, (int) $question_id, (int) $pass);
599 $disable = false;
600 $form->setFormAction($this->ctrl->getFormAction($this, 'showManScoringByQuestionParticipantsTable'));
601 $form->setTitle($this->lng->txt('manscoring'));
602
603 if (isset($feedback['finalized_evaluation']) && $feedback['finalized_evaluation'] == 1) {
604 $disable = true;
605 $hidden_points = new ilHiddenInputGUI($scoring_post_var);
606 $scoring_post_var = $scoring_post_var . '_disabled';
607 $hidden_points->setValue((string) $reached_points);
608 $form->addItem($hidden_points);
609 }
610
611 $feedback_text = '';
612 if (array_key_exists('feedback', $feedback)) {
613 $feedback_text = $feedback['feedback'];
614 }
615
616 if ($disable) {
617 $feedback_input = new ilNonEditableValueGUI(
618 $this->lng->txt('set_manual_feedback'),
619 'm_feedback' . $post_var,
620 true
621 );
622 } else {
623 $tmp_tpl->setVariable('TINYMCE_ACTIVE', ilObjAdvancedEditing::_getRichTextEditor());
624 $feedback_input = new ilTextAreaInputGUI($this->lng->txt('set_manual_feedback'), 'm_feedback' . $post_var);
625 }
626 $feedback_input->setValue($feedback_text);
627 $form->addItem($feedback_input);
628
629 $reached_points_form = new ilNumberInputGUI(
630 $this->lng->txt('tst_change_points_for_question'),
631 $scoring_post_var
632 );
633 $reached_points_form->allowDecimals(true);
634 $reached_points_form->setSize(5);
635 $reached_points_form->setMaxValue($max_points, true);
636 $reached_points_form->setMinValue(0);
637 $reached_points_form->setDisabled($disable);
638 $reached_points_form->setValue((string) $reached_points);
639 $reached_points_form->setClientSideValidation(true);
640 $form->addItem($reached_points_form);
641
642 $hidden_points = new ilHiddenInputGUI('qst_max_points');
643 $hidden_points->setValue((string) $max_points);
644 $form->addItem($hidden_points);
645
646 $hidden_points_name = new ilHiddenInputGUI('qst_hidden_points_name');
647 $hidden_points_name->setValue('scoring' . $post_var);
648 $form->addItem($hidden_points_name);
649
650 $hidden_feedback_name = new ilHiddenInputGUI('qst_hidden_feedback_name');
651 $hidden_feedback_name->setValue('m_feedback' . $post_var);
652 $form->addItem($hidden_feedback_name);
653
654 $hidden_feedback_id = new ilHiddenInputGUI('qst_hidden_feedback_id');
655 $post_id = '__' . $pass . '____' . $active_id . '____' . $question_id . '__';
656 $hidden_feedback_id->setValue('m_feedback' . $post_id);
657 $form->addItem($hidden_feedback_id);
658
659 $evaluated = new ilCheckboxInputGUI($this->lng->txt('finalized_evaluation'), 'evaluated' . $post_var);
660 if (isset($feedback['finalized_evaluation']) && (int) $feedback['finalized_evaluation'] === 1) {
661 $evaluated->setChecked(true);
662 }
663 $form->addItem($evaluated);
664
665 $form->addCommandButton('checkConstraintsBeforeSaving', $this->lng->txt('save'));
666
667 $tmp_tpl->setVariable(
668 'MANUAL_FEEDBACK',
669 $form->getHTML()
670 );
671 $tmp_tpl->setVariable(
672 'MODAL_AJAX_URL',
673 $this->ctrl->getLinkTarget($this, 'checkConstraintsBeforeSaving', '', true, false)
674 );
675 $tmp_tpl->setVariable(
676 'INFO_TEXT_MAX_POINTS_EXCEEDS',
677 sprintf($this->lng->txt('tst_manscoring_maxpoints_exceeded_input_alert'), $max_points)
678 );
679 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
static _getReachedPoints(int $active_id, int $question_id, int $pass)
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a number property in a property form.
static _getRichTextEditor()
Returns the identifier for the Rich Text Editor.
static getSingleManualFeedback(int $active_id, int $question_id, int $pass)
This class represents a property form user interface.
This class represents a text area property in a property form.

References assQuestion\_getReachedPoints(), ilObjAdvancedEditing\_getRichTextEditor(), ILIAS\Repository\ctrl(), ilObjTest\getSingleManualFeedback(), ILIAS\Repository\lng(), and HTML_Template_IT\setVariable().

Referenced by getAnswerDetail().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ appendQuestionTitleToModal()

ilTestScoringByQuestionsGUI::appendQuestionTitleToModal ( ilTemplate  $tmp_tpl,
  $question_id,
  $max_points,
  $title 
)
private
Parameters
$question_id
$max_points
$title

Definition at line 571 of file class.ilTestScoringByQuestionsGUI.php.

571 : void
572 {
573 $add_title = ' [' . $this->lng->txt('question_id_short') . ': ' . $question_id . ']';
574 $question_title = $this->object->getQuestionTitle($title);
575 $lng = $this->lng->txt('points');
576 if ($max_points == 1) {
577 $lng = $this->lng->txt('point');
578 }
579
580 $tmp_tpl->setVariable(
581 'QUESTION_TITLE',
582 $question_title . ' (' . $max_points . ' ' . $lng . ')' . $add_title
583 );
584 }

References ilTestServiceGUI\$lng, ILIAS\Repository\lng(), and HTML_Template_IT\setVariable().

Referenced by getAnswerDetail().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ appendSolutionAndPointsToModal()

ilTestScoringByQuestionsGUI::appendSolutionAndPointsToModal ( ilTemplate  $tmp_tpl,
  $result_output,
  $reached_points,
  $max_points 
)
private
Parameters
$result_output
$reached_points
$max_points

Definition at line 686 of file class.ilTestScoringByQuestionsGUI.php.

691 : void {
692 $tmp_tpl->setVariable(
693 'SOLUTION_OUTPUT',
694 $result_output
695 );
696 $tmp_tpl->setVariable(
697 'RECEIVED_POINTS',
698 sprintf(
699 $this->lng->txt('part_received_a_of_b_points'),
700 $reached_points,
701 $max_points
702 )
703 );
704 }

Referenced by getAnswerDetail().

+ Here is the caller graph for this function:

◆ appendUserNameToModal()

ilTestScoringByQuestionsGUI::appendUserNameToModal ( ilTemplate  $tmp_tpl,
ilTestEvaluationUserData  $participant 
)
private

Definition at line 545 of file class.ilTestScoringByQuestionsGUI.php.

545 : void
546 {
547 global $DIC;
548 $ilAccess = $DIC->access();
549
550 $tmp_tpl->setVariable(
551 'TEXT_YOUR_SOLUTION',
552 $this->lng->txt('answers_of') . ' ' . $participant->getName()
553 );
554
555 if (
556 $this->object->getAnonymity() === 1 ||
557 ($this->object->getAnonymity() === 2 && !$ilAccess->checkAccess('write', '', $this->object->getRefId()))
558 ) {
559 $tmp_tpl->setVariable(
560 'TEXT_YOUR_SOLUTION',
561 $this->lng->txt('answers_of') . ' ' . $this->lng->txt('anonymous')
562 );
563 }
564 }

References $DIC, ilTestEvaluationUserData\getName(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and HTML_Template_IT\setVariable().

Referenced by getAnswerDetail().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyManScoringByQuestionFilter()

ilTestScoringByQuestionsGUI::applyManScoringByQuestionFilter ( )
protected

Definition at line 434 of file class.ilTestScoringByQuestionsGUI.php.

434 : void
435 {
437 $table->resetOffset();
438 $table->writeFilterToSession();
440 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
showManScoringByQuestionParticipantsTable(array $manPointsPost=[])

References showManScoringByQuestionParticipantsTable().

+ Here is the call graph for this function:

◆ checkConstraintsBeforeSaving()

ilTestScoringByQuestionsGUI::checkConstraintsBeforeSaving ( )

Definition at line 540 of file class.ilTestScoringByQuestionsGUI.php.

540 : void
541 {
542 $this->saveManScoringByQuestion(true);
543 }

◆ doesValueExistsInPostArray()

ilTestScoringByQuestionsGUI::doesValueExistsInPostArray ( array  $finalization,
int  $active_id,
int  $qst_id,
int  $pass 
)
private
Parameters
array<numeric-string|int,array<numeric-string|int,array<numeric-string|int,bool>>>$finalization

Definition at line 753 of file class.ilTestScoringByQuestionsGUI.php.

753 : bool
754 {
755 return isset($finalization[$pass][$active_id][$qst_id]);
756 }

◆ getActiveSubTabId()

ilTestScoringByQuestionsGUI::getActiveSubTabId ( )
protected
Returns
string

Reimplemented from ilTestScoringGUI.

Definition at line 40 of file class.ilTestScoringByQuestionsGUI.php.

40 : string
41 {
42 return 'man_scoring_by_qst';
43 }

◆ getAnswerDetail()

ilTestScoringByQuestionsGUI::getAnswerDetail ( )
protected

Definition at line 450 of file class.ilTestScoringByQuestionsGUI.php.

450 : void
451 {
452 $active_id = $this->testrequest->getActiveId();
453 $pass = $this->testrequest->getPassId();
454 $question_id = (int) $this->testrequest->raw('qst_id');
455
456 if (!$this->getTestAccess()->checkScoreParticipantsAccessForActiveId($active_id)) {
457 $this->http->close(); // illegal ajax call
458 }
459
460 $data = $this->object->getCompleteEvaluationData(false);
461 $participant = $data->getParticipant($active_id);
462 $question_gui = $this->object->createQuestionGUI('', $question_id);
463 $tmp_tpl = new ilTemplate('tpl.il_as_tst_correct_solution_output.html', true, true, 'Modules/Test');
464 if ($question_gui instanceof assTextQuestionGUI && $this->object->getAutosave()) {
465 $aresult_output = $question_gui->getAutoSavedSolutionOutput(
466 $active_id,
467 $pass,
468 false,
469 false,
470 false,
471 $this->object->getShowSolutionFeedback(),
472 false,
473 true,
474 false
475 );
476 $tmp_tpl->setVariable('TEXT_ASOLUTION_OUTPUT', $this->lng->txt('autosavecontent'));
477 $tmp_tpl->setVariable('ASOLUTION_OUTPUT', $aresult_output);
478 }
479 $result_output = $question_gui->getSolutionOutput(
480 $active_id,
481 $pass,
482 false,
483 false,
484 false,
485 $this->object->getShowSolutionFeedback(),
486 false,
487 true
488 );
489 $max_points = $question_gui->object->getMaximumPoints();
490
491 $this->appendUserNameToModal($tmp_tpl, $participant);
492 $this->appendQuestionTitleToModal($tmp_tpl, $question_id, $max_points, $question_gui->object->getTitleForHTMLOutput());
494 $tmp_tpl,
495 $result_output,
496 $question_gui->object->getReachedPoints($active_id, $pass),
497 $max_points
498 );
499 $this->appendFormToModal($tmp_tpl, $pass, $active_id, $question_id, $max_points);
500 $tmp_tpl->setVariable('TEXT_YOUR_SOLUTION', $this->lng->txt('answers_of') . ' ' . $participant->getName());
501 $suggested_solution = assQuestion::_getSuggestedSolutionOutput($question_id);
502 if ($this->object->getShowSolutionSuggested() && strlen($suggested_solution) > 0) {
503 $tmp_tpl->setVariable('TEXT_SOLUTION_HINT', $this->lng->txt("solution_hint"));
504 $tmp_tpl->setVariable("SOLUTION_HINT", assQuestion::_getSuggestedSolutionOutput($question_id));
505 }
506
507 $tmp_tpl->setVariable('TEXT_SOLUTION_OUTPUT', $this->lng->txt('question'));
508 $tmp_tpl->setVariable('TEXT_RECEIVED_POINTS', $this->lng->txt('scoring'));
509 $add_title = ' [' . $this->lng->txt('question_id_short') . ': ' . $question_id . ']';
510 $question_title = $this->object->getQuestionTitle($question_gui->object->getTitleForHTMLOutput());
511 $lng = $this->lng->txt('points');
512 if ($max_points == 1) {
513 $lng = $this->lng->txt('point');
514 }
515
516 $tmp_tpl->setVariable(
517 'QUESTION_TITLE',
518 $question_title . ' (' . $max_points . ' ' . $lng . ')' . $add_title
519 );
520 $tmp_tpl->setVariable('SOLUTION_OUTPUT', $result_output);
521
522 $tmp_tpl->setVariable(
523 'RECEIVED_POINTS',
524 sprintf(
525 $this->lng->txt('part_received_a_of_b_points'),
526 $question_gui->object->getReachedPoints($active_id, $pass),
527 $max_points
528 )
529 );
530
531 $this->http->saveResponse(
532 $this->http->response()->withBody(
533 \ILIAS\Filesystem\Stream\Streams::ofString($tmp_tpl->get())
534 )->withHeader(\ILIAS\HTTP\Response\ResponseHeader::CONTENT_TYPE, 'text/html')
535 );
536 $this->http->sendResponse();
537 $this->http->close();
538 }
static _getSuggestedSolutionOutput(int $question_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
appendUserNameToModal(ilTemplate $tmp_tpl, ilTestEvaluationUserData $participant)
appendSolutionAndPointsToModal(ilTemplate $tmp_tpl, $result_output, $reached_points, $max_points)
appendQuestionTitleToModal(ilTemplate $tmp_tpl, $question_id, $max_points, $title)
appendFormToModal(ilTemplate $tmp_tpl, $pass, $active_id, $question_id, $max_points)
Class FlySystemFileAccessTest \Provider\FlySystem @runTestsInSeparateProcesses @preserveGlobalState d...
Class ChatMainBarProvider \MainMenu\Provider.

References $data, ilTestServiceGUI\$lng, assQuestion\_getSuggestedSolutionOutput(), appendFormToModal(), appendQuestionTitleToModal(), appendSolutionAndPointsToModal(), appendUserNameToModal(), ilTestScoringGUI\getTestAccess(), ILIAS\FileDelivery\http(), ILIAS\Repository\int(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getDefaultCommand()

ilTestScoringByQuestionsGUI::getDefaultCommand ( )
protected
Returns
string

Reimplemented from ilTestScoringGUI.

Definition at line 35 of file class.ilTestScoringByQuestionsGUI.php.

35 : string
36 {
37 return 'showManScoringByQuestionParticipantsTable';
38 }

◆ resetManScoringByQuestionFilter()

ilTestScoringByQuestionsGUI::resetManScoringByQuestionFilter ( )
protected

Definition at line 442 of file class.ilTestScoringByQuestionsGUI.php.

442 : void
443 {
445 $table->resetOffset();
446 $table->resetFilter();
448 }

References showManScoringByQuestionParticipantsTable().

+ Here is the call graph for this function:

◆ retrieveFeedback()

ilTestScoringByQuestionsGUI::retrieveFeedback ( int  $active_id,
int  $qst_id,
int  $pass 
)
protected

Definition at line 706 of file class.ilTestScoringByQuestionsGUI.php.

706 : ?string
707 {
708 $feedback = $this->testrequest->raw('feedback');
709 if ($feedback === null || $feedback === '') {
710 $feedback = $this->testrequest->raw('m_feedback');
711 }
712
713 if ($feedback === null || $feedback === '') {
714 return null;
715 }
716
718 $feedback[$pass][$active_id][$qst_id],
719 false,
721 );
722 }
static _getUsedHTMLTagsAsString(string $a_module="")
Returns a string of all allowed HTML tags for text editing.
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")

References ilObjAdvancedEditing\_getUsedHTMLTagsAsString(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ saveFinalization()

ilTestScoringByQuestionsGUI::saveFinalization ( array  $finalization,
int  $active_id,
int  $qst_id,
int  $pass,
?string  $feedback,
bool  $is_single_feedback 
)
private
Parameters
array<numeric-string|int,array<numeric-string|int,array<numeric-string|int,bool>>>$finalization

Definition at line 727 of file class.ilTestScoringByQuestionsGUI.php.

734 : void {
735 $finalized = false;
736 if ($this->doesValueExistsInPostArray($finalization, $active_id, $qst_id, $pass)) {
737 $finalized = $finalization[$pass][$active_id][$qst_id] ?? false;
738 }
739
740 $this->object->saveManualFeedback(
741 $active_id,
742 $qst_id,
743 $pass,
744 $feedback,
745 $finalized,
746 $is_single_feedback
747 );
748 }
doesValueExistsInPostArray(array $finalization, int $active_id, int $qst_id, int $pass)

◆ showManScoringByQuestionParticipantsTable()

ilTestScoringByQuestionsGUI::showManScoringByQuestionParticipantsTable ( array  $manPointsPost = [])
protected
Parameters
array$manPointsPost

Definition at line 48 of file class.ilTestScoringByQuestionsGUI.php.

48 : void
49 {
50 global $DIC;
51
53
54 if (!$this->testAccess->checkScoreParticipantsAccess()) {
55 $this->tpl->setOnScreenMessage('info', $this->lng->txt('cannot_edit_test'), true);
56 $this->ctrl->redirectByClass('ilobjtestgui', 'infoScreen');
57 }
58
62
63 $mathJaxSetting = new ilSetting('MathJax');
64
65 if ($mathJaxSetting->get("enable")) {
66 $this->tpl->addJavaScript($mathJaxSetting->get("path_to_mathjax"));
67 }
68
69 $this->tpl->addJavaScript("./Services/JavaScript/js/Basic.js");
70 $this->tpl->addJavaScript("./Services/Form/js/Form.js");
71 $this->tpl->addJavascript('./Services/UIComponent/Modal/js/Modal.js');
72 $this->lng->toJSMap(['answer' => $this->lng->txt('answer')]);
73
75
76 $qst_id = (int) $table->getFilterItemByPostVar('question')->getValue();
77 $passNr = $table->getFilterItemByPostVar('pass')->getValue();
78 $finalized_filter = (int) $table->getFilterItemByPostVar('finalize_evaluation')->getValue();
79 $answered_filter = $table->getFilterItemByPostVar('only_answered')->getChecked();
80 $table_data = [];
81 $selected_questionData = null;
82 $complete_feedback = $this->object->getCompleteManualFeedback($qst_id);
83
84 if (is_numeric($qst_id)) {
85 $info = assQuestion::_getQuestionInfo($qst_id);
86 $selected_questionData = $info;
87 }
88
89 if ($selected_questionData && is_numeric($passNr)) {
90 $data = $this->object->getCompleteEvaluationData(false);
91 $participants = $data->getParticipants();
92 $participantData = new ilTestParticipantData($DIC->database(), $this->lng);
93 $participantData->setActiveIdsFilter(array_keys($data->getParticipants()));
94 $participantData->setParticipantAccessFilter(
96 );
97 $participantData->load($this->object->getTestId());
98
99 foreach ($participantData->getActiveIds() as $active_id) {
100 $participant = $participants[$active_id];
101 $testResultData = $this->object->getTestResult($active_id, $passNr - 1);
102
103 foreach ($testResultData as $questionData) {
104 $feedback = [];
105 $is_answered = (bool) ($questionData['answered'] ?? false);
106 $finalized_evaluation = (bool) ($questionData['finalized_evaluation'] ?? false);
107
108 if (isset($complete_feedback[$active_id][$passNr - 1][$qst_id])) {
109 $feedback = $complete_feedback[$active_id][$passNr - 1][$qst_id];
110 }
111
112 if (!isset($questionData['qid'])
113 || $questionData['qid'] !== $selected_questionData['question_id']
114 || $finalized_filter === self::ONLY_FINALIZED && !$finalized_evaluation
115 || $finalized_filter === self::EXCEPT_FINALIZED && $finalized_evaluation
116 || $answered_filter === true && !$is_answered) {
117 continue;
118 }
119
120 $table_data[] = [
121 'pass_id' => $passNr - 1,
122 'active_id' => $active_id,
123 'qst_id' => $questionData['qid'],
124 'reached_points' => assQuestion::_getReachedPoints(
125 $active_id,
126 (int) $questionData['qid'],
127 $passNr - 1
128 ),
129 'maximum_points' => assQuestion::_getMaximumPoints((int) $questionData['qid']),
130 'name' => $participant->getName()
131 ] + $feedback;
132 }
133 }
134 } else {
135 $table->disable('header');
136 }
137
138 $table->setTitle($this->lng->txt('tst_man_scoring_by_qst'));
139
140 if ($selected_questionData) {
141 $maxpoints = assQuestion::_getMaximumPoints((int) $selected_questionData['question_id']);
142 $table->setCurQuestionMaxPoints($maxpoints);
143 $maxpoints_txt = ' (' . $maxpoints . ' ' . $this->lng->txt('points') . ')';
144 if ($maxpoints == 1) {
145 $maxpoints_txt = ' (' . $maxpoints . ' ' . $this->lng->txt('point') . ')';
146 }
147
148 $table->setTitle(
149 $this->lng->txt('tst_man_scoring_by_qst') . ': ' . $selected_questionData['title'] . $maxpoints_txt .
150 ' [' . $this->lng->txt('question_id_short') . ': ' . $selected_questionData['question_id'] . ']'
151 );
152 }
153
154 $table->setData($table_data);
155 $this->tpl->setContent($table->getHTML());
156 }
static _getMaximumPoints(int $question_id)
Returns the maximum points, a learner can reach answering the question.
static _getQuestionInfo(int $question_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static initPanel(bool $a_resize=false, ?ilGlobalTemplateInterface $a_main_tpl=null)
Init yui panel used in Modules/Test, Services/TermsOfService (Jan 2022)
static initOverlay(?ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Overlay module used in Modules/Test, Services/TermsOfService, Services/Tracking,...
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
if(strpos( $jquery_path, './')===0) elseif(strpos($jquery_path, '.')===0) $mathJaxSetting
Definition: latex.php:54

References $data, $DIC, $mathJaxSetting, ilTestServiceGUI\$participantData, assQuestion\_getMaximumPoints(), assQuestion\_getQuestionInfo(), assQuestion\_getReachedPoints(), ILIAS\Repository\ctrl(), ilTestParticipantAccessFilter\getScoreParticipantsUserFilter(), iljQueryUtil\initjQuery(), ilYuiUtil\initOverlay(), ilYuiUtil\initPanel(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilTestTabsManager\TAB_ID_MANUAL_SCORING, and ILIAS\Repository\tabs().

Referenced by applyManScoringByQuestionFilter(), and resetManScoringByQuestionFilter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $http

ILIAS HTTP GlobalHttpState ilTestScoringByQuestionsGUI::$http
private

Definition at line 26 of file class.ilTestScoringByQuestionsGUI.php.

◆ EXCEPT_FINALIZED

const ilTestScoringByQuestionsGUI::EXCEPT_FINALIZED = 1

Definition at line 23 of file class.ilTestScoringByQuestionsGUI.php.

◆ ONLY_FINALIZED

const ilTestScoringByQuestionsGUI::ONLY_FINALIZED = 2

Definition at line 24 of file class.ilTestScoringByQuestionsGUI.php.


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