19 require_once
'Services/Form/classes/class.ilNumberInputGUI.php';
20 require_once
'Services/Table/classes/class.ilTable2GUI.php';
47 $ilCtrl = $DIC->ctrl();
48 $tpl = $DIC->ui()->mainTemplate();
49 $tpl->addJavaScript(
'./node_modules/tinymce/tinymce.js');
50 $this->
setId(
'man_scor_by_qst_' . $parentObj->getObject()->getId());
54 $this->
setFormAction($ilCtrl->getFormAction($parentObj, self::PARENT_DEFAULT_CMD));
55 $this->
setRowTemplate(
"tpl.il_as_tst_man_scoring_by_question_tblrow.html",
"Modules/Test");
66 $this->
addColumn($this->
lng->txt(
'tst_reached_points'),
'reached_points');
67 $this->
addColumn($this->
lng->txt(
'tst_maximum_points'),
'maximum_points');
68 $this->
addColumn($this->
lng->txt(
'tst_feedback'),
'feedback',
'30%');
69 $this->
addColumn($this->
lng->txt(
'finalized_evaluation'),
'finalized_evaluation');
70 $this->
addColumn($this->
lng->txt(
'finalized_by'),
'finalized_by_uid');
71 $this->
addColumn($this->
lng->txt(
'finalized_on'),
'finalized_tstamp');
87 include_once
'Services/Form/classes/class.ilSelectInputGUI.php';
89 $select_questions = array();
93 $questions = $this->
getParentObject()->getObject()->getPotentialRandomTestQuestions();
96 foreach ($questions as
$data) {
97 include_once
'Modules/TestQuestionPool/classes/class.assQuestion.php';
99 $type = $info[
"question_type_fi"];
100 if (in_array(
$type, $scoring)) {
102 if ($maxpoints == 1) {
103 $maxpoints =
' (' . $maxpoints .
' ' . $this->
lng->txt(
'point') .
')';
105 $maxpoints =
' (' . $maxpoints .
' ' . $this->
lng->txt(
'points') .
')';
108 $select_questions[$data[
"question_id"]] = $data[
'title'] . $maxpoints .
' [' . $this->
lng->txt(
'question_id_short') .
': ' . $data[
"question_id"] .
']';
111 if (!$select_questions) {
112 $select_questions[0] = $this->
lng->txt(
'tst_no_scorable_qst_available');
114 $available_questions->setOptions(array(
'' => $this->
lng->txt(
'please_choose')) + $select_questions);
116 $available_questions->readFromSession();
117 $this->
filter[
'question'] = $available_questions->getValue();
122 for (
$i = 1;
$i <= $max_pass;
$i++) {
125 $pass->setOptions($passes);
127 $pass->readFromSession();
128 $this->
filter[
'pass'] = $pass->getValue();
130 $only_answered =
new ilCheckboxInputGUI($this->
lng->txt(
'tst_man_scoring_only_answered'),
'only_answered');
132 $only_answered->readFromSession();
134 $this->
filter[
'only_answered'] = $only_answered->getChecked();
137 $this->
lng->txt(
'finalized_evaluation'),
138 'finalize_evaluation' 141 $this->
lng->txt(
'all_users'),
142 $this->
lng->txt(
'evaluated_users'),
143 $this->
lng->txt(
'not_evaluated_users')
145 $correction->setOptions($evaluated);
147 $correction->readFromSession();
148 $this->
filter[
'finalize_evaluation'] = $correction->getValue();
154 $ilCtrl = $DIC->ctrl();
155 $ilAccess = $DIC->access();
160 $this->getParentObject()->object->getAnonymity() == 2 &&
164 $this->tpl->setVariable(
'VAL_NAME', $this->
lng->txt(
"anonymous"));
166 $this->tpl->setVariable(
'VAL_NAME', $a_set[
'name']);
169 if (!$this->first_row_rendered) {
170 $this->first_row_rendered =
true;
171 $this->tpl->touchBlock(
'row_js');
174 $this->tpl->setVariable(
'VAL_REACHED_POINTS', $a_set[
'reached_points']);
175 $this->tpl->setVariable(
'VAL_MAX_POINTS', $a_set[
'maximum_points']);
176 $finalized = isset($a_set[
'finalized_evaluation']) && ((
int) $a_set[
'finalized_evaluation']) === 1;
177 $this->tpl->setVariable(
179 $finalized ? $this->
lng->txt(
'yes') : $this->
lng->txt(
'no')
181 $fin_usr_id = $a_set[
'finalized_by_usr_id'] ?? null;
183 $this->tpl->setVariable(
'VAL_MODAL_CORRECTION', $a_set[
'feedback'] ??
'');
184 if (is_numeric($fin_usr_id) && $fin_usr_id > 0) {
187 $fin_timestamp = $a_set[
'finalized_tstamp'] ?? 0;
188 if ($fin_timestamp > 0) {
193 $this->tpl->setVariable(
'VAL_PASS', $a_set[
'pass_id']);
194 $this->tpl->setVariable(
'VAL_ACTIVE_ID', $a_set[
'active_id']);
195 $this->tpl->setVariable(
'VAL_QUESTION_ID', $a_set[
'qst_id']);
197 if ($this->first_row) {
198 $this->tpl->touchBlock(
'scoring_by_question_refresher');
199 $this->tpl->parseCurrentBlock();
200 $this->first_row =
false;
203 $ilCtrl->setParameter($this->
getParentObject(),
'qst_id', $a_set[
'qst_id']);
204 $ilCtrl->setParameter($this->
getParentObject(),
'active_id', $a_set[
'active_id']);
205 $ilCtrl->setParameter($this->
getParentObject(),
'pass_id', $a_set[
'pass_id']);
206 $this->tpl->setVariable(
'VAL_LINK_ANSWER', $ilCtrl->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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupFullname(int $a_user_id)
setResetCommand(string $a_val, string $a_caption="")
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)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
getCurQuestionMaxPoints()
setFilterCommand(string $a_val, string $a_caption="")
setDefaultOrderDirection(string $a_defaultorderdirection)
static _getQuestionInfo(int $question_id)
const PARENT_SAVE_SCORING_CMD
static _getMaximumPoints(int $question_id)
Returns the maximum points, a learner can reach answering the question.
float $curQuestionMaxPoints
static _getManualScoring()
Retrieve the manual scoring settings.
__construct(Container $dic, ilPlugin $plugin)
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)