19 declare(strict_types=1);
45 $this->questioninfo = $DIC->testQuestionPool()->questionInfo();
47 $this->
setId(
'man_scor_by_qst_' . $parent_obj->
getObject()->getId());
54 $this->main_tpl->addJavaScript(
'./node_modules/tinymce/tinymce.js');
57 $this->
setFormAction($this->
ctrl->getFormAction($parent_obj, self::PARENT_DEFAULT_CMD));
58 $this->
setRowTemplate(
"tpl.il_as_tst_man_scoring_by_question_tblrow.html",
"Modules/Test");
69 $this->
addColumn($this->
lng->txt(
'tst_reached_points'),
'reached_points');
70 $this->
addColumn($this->
lng->txt(
'tst_maximum_points'),
'maximum_points');
71 $this->
addColumn($this->
lng->txt(
'tst_feedback'),
'feedback',
'30%');
72 $this->
addColumn($this->
lng->txt(
'finalized_evaluation'),
'finalized_evaluation');
73 $this->
addColumn($this->
lng->txt(
'finalized_by'),
'finalized_by_uid');
74 $this->
addColumn($this->
lng->txt(
'finalized_on'),
'finalized_tstamp');
91 $select_questions = array();
95 $questions = $this->
getParentObject()->getObject()->getPotentialRandomTestQuestions();
98 foreach ($questions as
$data) {
99 $info = $this->questioninfo->getQuestionInfo($data[
'question_id']);
100 $type = $info[
"question_type_fi"];
101 if (in_array($type, $scoring)) {
102 $maxpoints = $this->questioninfo->getMaximumPoints($data[
"question_id"]);
103 if ($maxpoints == 1) {
104 $maxpoints =
' (' . $maxpoints .
' ' . $this->
lng->txt(
'point') .
')';
106 $maxpoints =
' (' . $maxpoints .
' ' . $this->
lng->txt(
'points') .
')';
109 $select_questions[$data[
"question_id"]] = $data[
'title'] . $maxpoints .
' [' . $this->
lng->txt(
'question_id_short') .
': ' . $data[
"question_id"] .
']';
112 if (!$select_questions) {
113 $select_questions[0] = $this->
lng->txt(
'tst_no_scorable_qst_available');
115 $available_questions->setOptions(array(
'' => $this->
lng->txt(
'please_choose')) + $select_questions);
117 $available_questions->readFromSession();
118 $this->
filter[
'question'] = $available_questions->getValue();
123 for ($i = 1; $i <= $max_pass; $i++) {
128 $pass->readFromSession();
129 $this->
filter[
'pass'] = $pass->getValue();
131 $only_answered =
new ilCheckboxInputGUI($this->
lng->txt(
'tst_man_scoring_only_answered'),
'only_answered');
133 $only_answered->readFromSession();
135 $this->
filter[
'only_answered'] = $only_answered->getChecked();
138 $this->
lng->txt(
'finalized_evaluation'),
139 'finalize_evaluation' 142 '' => $this->
lng->txt(
'all_users'),
148 $correction->readFromSession();
149 $this->
filter[
'finalize_evaluation'] = $correction->getValue();
158 false == $this->
access->checkAccess(
'write',
'', $this->getParentObject()->getObject()->getRefId())
161 $this->tpl->setVariable(
'VAL_NAME', $this->
lng->txt(
"anonymous"));
163 $this->tpl->setVariable(
'VAL_NAME', $a_set[
'name']);
166 if (!$this->first_row_rendered) {
167 $this->first_row_rendered =
true;
168 $this->tpl->touchBlock(
'row_js');
171 $this->tpl->setVariable(
'VAL_REACHED_POINTS', $a_set[
'reached_points']);
172 $this->tpl->setVariable(
'VAL_MAX_POINTS', $a_set[
'maximum_points']);
173 $finalized = isset($a_set[
'finalized_evaluation']) && ((
int) $a_set[
'finalized_evaluation']) === 1;
174 $this->tpl->setVariable(
176 $finalized ? $this->
lng->txt(
'yes') : $this->
lng->txt(
'no')
178 $fin_usr_id = $a_set[
'finalized_by_usr_id'] ?? null;
180 $this->tpl->setVariable(
'VAL_MODAL_CORRECTION', $a_set[
'feedback'] ??
'');
181 if (is_numeric($fin_usr_id) && $fin_usr_id > 0) {
184 $fin_timestamp = $a_set[
'finalized_tstamp'] ?? 0;
185 if ($fin_timestamp > 0) {
190 $this->tpl->setVariable(
'VAL_PASS', $a_set[
'pass_id']);
191 $this->tpl->setVariable(
'VAL_ACTIVE_ID', $a_set[
'active_id']);
192 $this->tpl->setVariable(
'VAL_QUESTION_ID', $a_set[
'qst_id']);
194 if ($this->first_row) {
195 $this->tpl->touchBlock(
'scoring_by_question_refresher');
196 $this->tpl->parseCurrentBlock();
197 $this->first_row =
false;
203 $this->tpl->setVariable(
205 $this->
ctrl->getLinkTarget($this->getParentObject(),
'getAnswerDetail',
'',
true,
false)
210 $this->tpl->setVariable(
'VAL_TXT_ANSWER', $this->
lng->txt(
'tst_eval_show_answer'));
211 $this->tpl->setVariable(
'ANSWER_TITLE', $this->
lng->txt(
'answer_of') .
': ' . $a_set[
'name']);
enable(string $a_module_name)
setFormAction(string $a_form_action, bool $a_multipart=false)
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI
static _lookupFullname(int $a_user_id)
setResetCommand(string $a_val, string $a_caption="")
ILIAS TestQuestionPool QuestionInfoService $questioninfo
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
setDisableFilterHiding(bool $a_val=true)
const PARENT_RESET_FILTER_CMD
const PARENT_APPLY_FILTER_CMD
setCurQuestionMaxPoints(float $curQuestionMaxPoints)
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setDefaultOrderField(string $a_defaultorderfield)
__construct(ilTestScoringByQuestionsGUI $parent_obj, private ilAccess $access)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
getCurQuestionMaxPoints()
setFilterCommand(string $a_val, string $a_caption="")
setDefaultOrderDirection(string $a_defaultorderdirection)
const PARENT_SAVE_SCORING_CMD
float $curQuestionMaxPoints
static _getManualScoring()
Retrieve the manual scoring settings.
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)