19 declare(strict_types=1);
36 private bool $anonymity =
false,
37 private bool $offeringQuestionHintsEnabled =
false 39 $this->
setId(
'tst_eval_all');
44 $this->
setStyle(
'table',
'fullwidth');
48 if (!$this->anonymity) {
50 if (strcmp(
$c,
'email') == 0) {
53 if (strcmp(
$c,
'exam_id') == 0 && $this->parent_obj->getObject()->isShowExamIdInTestResultsEnabled()) {
54 $this->
addColumn($this->
lng->txt(
"exam_id_label"),
'exam_id',
'');
56 if (strcmp(
$c,
'institution') == 0) {
57 $this->
addColumn($this->
lng->txt(
"institution"),
'institution',
'');
59 if (strcmp(
$c,
'street') == 0) {
60 $this->
addColumn($this->
lng->txt(
"street"),
'street',
'');
62 if (strcmp(
$c,
'city') == 0) {
65 if (strcmp(
$c,
'zipcode') == 0) {
66 $this->
addColumn($this->
lng->txt(
"zipcode"),
'zipcode',
'');
70 $this->
addColumn($this->
lng->txt(
"country"),
'country',
'');
74 $this->
addColumn($this->
lng->txt(
"country"),
'sel_country',
'');
77 if (strcmp(
$c,
'department') == 0) {
78 $this->
addColumn($this->
lng->txt(
"department"),
'department',
'');
80 if (strcmp(
$c,
'matriculation') == 0) {
81 $this->
addColumn($this->
lng->txt(
"matriculation"),
'matriculation',
'');
86 $this->
addColumn($this->
lng->txt(
"tst_reached_points"),
"reached",
"");
88 if ($this->offeringQuestionHintsEnabled) {
89 $this->
addColumn($this->
lng->txt(
"tst_question_hints_requested_hint_count_header"),
"hint_count",
"");
92 $this->
addColumn($this->
lng->txt(
"tst_mark"),
"mark",
"");
94 $this->
addColumn($this->
lng->txt(
"tst_answered_questions"),
"answered",
"");
95 $this->
addColumn($this->
lng->txt(
"working_time"),
"working_time",
"");
96 $this->
addColumn($this->
lng->txt(
"detailed_evaluation"),
"",
"");
99 $this->
setRowTemplate(
"tpl.table_evaluation_all.html",
"Modules/Test");
110 $this->
lng->loadLanguageModule(
'meta');
122 if ($this->anonymity) {
143 if (!$this->anonymity) {
144 $cols[
"email"] = array(
145 "txt" => $this->
lng->txt(
"email"),
148 $cols[
"institution"] = array(
149 "txt" => $this->
lng->txt(
"institution"),
152 $cols[
"street"] = array(
153 "txt" => $this->
lng->txt(
"street"),
156 $cols[
"city"] = array(
157 "txt" => $this->
lng->txt(
"city"),
160 $cols[
"zipcode"] = array(
161 "txt" => $this->
lng->txt(
"zipcode"),
165 $cols[
"country"] = array(
166 "txt" => $this->
lng->txt(
"country"),
171 $cols[
"sel_country"] = array(
172 "txt" => $this->
lng->txt(
"country"),
176 $cols[
"department"] = array(
177 "txt" => $this->
lng->txt(
"department"),
180 $cols[
"matriculation"] = array(
181 "txt" => $this->
lng->txt(
"matriculation"),
184 if ($this->parent_obj->getObject()->isShowExamIdInTestResultsEnabled()) {
185 $cols[
"exam_id"] = array(
186 "txt" => $this->
lng->txt(
"exam_id_label"),
200 $ti->setMaxLength(64);
201 $ti->setValidationRegexp(
'/^[^%]*$/is');
204 $ti->readFromSession();
208 $ti->setMaxLength(64);
209 $ti->setValidationRegexp(
'/^[^%]*$/is');
212 $ti->readFromSession();
216 $ti->setMaxLength(64);
218 $ti->setValidationRegexp(
'/^[^%]*$/is');
220 $ti->readFromSession();
224 $si->readFromSession();
231 protected function fillRow(array $a_set): void
233 $this->tpl->setVariable(
"NAME", $a_set[
'name']);
234 $this->tpl->setVariable(
"LOGIN", $a_set[
'login']);
236 if (!$this->anonymity) {
237 if (strcmp($c,
'email') == 0) {
238 $this->tpl->setCurrentBlock(
'email');
239 $this->tpl->setVariable(
"EMAIL", strlen($a_set[
'email']) ? $a_set[
'email'] :
' ');
240 $this->tpl->parseCurrentBlock();
242 if (strcmp($c,
'institution') == 0) {
243 $this->tpl->setCurrentBlock(
'institution');
244 $this->tpl->setVariable(
"INSTITUTION", strlen($a_set[
'institution']) ? $a_set[
'institution'] :
' ');
245 $this->tpl->parseCurrentBlock();
247 if (strcmp($c,
'street') == 0) {
248 $this->tpl->setCurrentBlock(
'street');
249 $this->tpl->setVariable(
"STREET", strlen($a_set[
'street']) ? $a_set[
'street'] :
' ');
250 $this->tpl->parseCurrentBlock();
252 if (strcmp($c,
'city') == 0) {
253 $this->tpl->setCurrentBlock(
'city');
254 $this->tpl->setVariable(
"CITY", strlen($a_set[
'city']) ? $a_set[
'city'] :
' ');
255 $this->tpl->parseCurrentBlock();
257 if (strcmp($c,
'zipcode') == 0) {
258 $this->tpl->setCurrentBlock(
'zipcode');
259 $this->tpl->setVariable(
"ZIPCODE", strlen($a_set[
'zipcode']) ? $a_set[
'zipcode'] :
' ');
260 $this->tpl->parseCurrentBlock();
263 $this->tpl->setCurrentBlock(
'country');
264 $this->tpl->setVariable(
"COUNTRY", strlen($a_set[
'country']) ? $a_set[
'country'] :
' ');
265 $this->tpl->parseCurrentBlock();
268 $this->tpl->setCurrentBlock(
'country');
269 $this->tpl->setVariable(
"COUNTRY", strlen($a_set[
'sel_country']) ? $this->
getCountryTranslation($a_set[
'sel_country']) :
' ');
270 $this->tpl->parseCurrentBlock();
272 if (strcmp($c,
'department') == 0) {
273 $this->tpl->setCurrentBlock(
'department');
274 $this->tpl->setVariable(
"DEPARTMENT", strlen($a_set[
'department']) ? $a_set[
'department'] :
' ');
275 $this->tpl->parseCurrentBlock();
277 if (strcmp($c,
'matriculation') == 0) {
278 $this->tpl->setCurrentBlock(
'matriculation');
279 $this->tpl->setVariable(
"MATRICULATION", strlen($a_set[
'matriculation']) ? $a_set[
'matriculation'] :
' ');
280 $this->tpl->parseCurrentBlock();
282 if (strcmp($c,
'exam_id') == 0 && $this->parent_obj->getObject()->isShowExamIdInTestResultsEnabled()) {
283 $this->tpl->setCurrentBlock(
'exam_id');
284 $examId = is_string($a_set[
'exam_id']) && strlen($a_set[
'exam_id']) ? $a_set[
'exam_id'] :
' ';
285 $this->tpl->setVariable(
'EXAM_ID', $examId);
286 $this->tpl->parseCurrentBlock();
290 $reachedPercent = !$a_set[
'max'] ? 0 : $a_set[
'reached'] / $a_set[
'max'] * 100;
291 $reached = $a_set[
'reached'] .
" " . strtolower($this->
lng->txt(
"of")) .
" " . $a_set[
'max'] .
" (" . sprintf(
"%2.2f", $reachedPercent) .
" %)";
292 $this->tpl->setVariable(
"REACHED", $reached);
294 if ($this->offeringQuestionHintsEnabled) {
295 $this->tpl->setVariable(
"HINT_COUNT", $a_set[
'hint_count']);
298 $a_set[
'answered'] = $a_set[
'questions_worked_through'] .
" " . strtolower($this->
lng->txt(
"of")) .
" " . $a_set[
'number_of_questions'] .
" (" . sprintf(
"%2.2f", $a_set[
'answered']) .
" %" .
")";
300 $this->tpl->setVariable(
"MARK", $a_set[
'mark']);
301 $this->tpl->setVariable(
"ANSWERED", $a_set[
'answered']);
302 $this->tpl->setVariable(
"WORKING_TIME", $a_set[
'working_time']);
303 $this->tpl->setVariable(
"DETAILED", $a_set[
'details']);
308 $scol = parent::getSelectedColumns();
311 if (!is_array($cols)) {
315 $fields_to_unset = array_diff(array_keys($scol), array_keys($cols));
317 foreach ($fields_to_unset as
$key) {
326 return $this->
lng->txt(
'meta_c_' . $countryCode);
331 if ($this->
settings->get(
"usr_settings_hide_" . $fieldIdentifier)) {
335 if (!$this->
settings->get(
'usr_settings_visib_reg_' . $fieldIdentifier)) {
339 if (!$this->
settings->get(
'usr_settings_visib_lua_' . $fieldIdentifier)) {
343 if ($this->
settings->get(
"usr_settings_disable_" . $fieldIdentifier)) {
347 if (!$this->
settings->get(
'usr_settings_changeable_lua_' . $fieldIdentifier)) {
getCountryTranslation($countryCode)
enable(string $a_module_name)
setFormAction(string $a_form_action, bool $a_multipart=false)
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
setResetCommand(string $a_val, string $a_caption="")
TableGUI class for evaluation of all users.
setFormName(string $a_name="")
setStyle(string $a_element, string $a_style)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setFilterCommand(string $a_val, string $a_caption="")
isFieldEnabledEnoughByAdministration($fieldIdentifier)
Output class for assessment test evaluation.
setDefaultOrderDirection(string $a_defaultorderdirection)
fillRow(array $a_set)
Standard Version of Fill Row.
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)
__construct(ilObjTestGUI|ilTestEvaluationGUI $parent_obj, string $parent_cmd, private ilSetting $settings, private bool $anonymity=false, private bool $offeringQuestionHintsEnabled=false)
numericOrdering(string $a_field)
Should this field be sorted numeric?