Skip to content

Commit

Permalink
TA, Question List: translate, fix modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
nhaagen committed Jul 13, 2023
1 parent 578c864 commit 2a7f35a
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 35 deletions.
66 changes: 33 additions & 33 deletions Modules/Test/classes/Screen/class.ilTestPlayerLayoutProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,46 +90,46 @@ public function getMainBarModification(CalledContexts $called_contexts): ?MainBa
$is_kiosk_mode = $this->isKioskModeEnabled($called_contexts);

if (! $is_kiosk_mode && ! $has_question_list) {
return null;
}

if ($is_kiosk_mode && ! $has_question_list) {
$mainbar_modification = static fn(?MainBar $mainbar): ?MainBar => null;
}

if ($has_question_list) {
$questionlist = false;
$questionlist = true;
if ($questionlist) {
$f = $this->dic->ui()->factory();
$r = $this->dic->ui()->renderer();
$lng = $this->dic->language();
$question_listing = $called_contexts->current()->getAdditionalData()->get(self::TEST_PLAYER_QUESTIONLIST);

$mainbar_modification = static function (?MainBar $mainbar) use ($f, $r, $lng, $question_listing, $is_kiosk_mode): ?MainBar {
$question_listing = $f->legacy($r->render($question_listing));

$entry = $f->maincontrols()->slate()->legacy(
$lng->txt('tst_mainbar_button_label_questionlist'),
$f->symbol()->icon()->standard("tst", "Question List"),
$question_listing
);

$icon = $f->symbol()->icon()->standard('tst', $lng->txt("more"));
$tools_button = $f->button()->bulky($icon, $lng->txt("tools"), "#")
->withEngagedState(true);

if ($is_kiosk_mode) {
$mainbar = $mainbar->withClearedEntries();
}
return $mainbar
->withToolsButton($tools_button)
->withAdditionalToolEntry('questionlist', $entry);
};
}
$f = $this->dic->ui()->factory();
$r = $this->dic->ui()->renderer();
$lng = $this->dic->language();
$question_listing = $called_contexts->current()->getAdditionalData()->get(self::TEST_PLAYER_QUESTIONLIST);

$mainbar_modification = static function (?MainBar $mainbar) use ($f, $r, $lng, $question_listing, $is_kiosk_mode): ?MainBar {
if ($is_kiosk_mode) {
$mainbar = $mainbar->withClearedEntries();
}

$icon = $f->symbol()->icon()->standard('tst', $lng->txt("more"));
$tools_button = $f->button()->bulky($icon, $lng->txt("tools"), "#")
->withEngagedState(true);

return $mainbar
->withModification($mainbar_modification)
->withHighPriority();
$question_listing = $f->legacy($r->render($question_listing));

$label = $lng->txt('mainbar_button_label_questionlist');
$entry = $f->maincontrols()->slate()->legacy(
$label,
$f->symbol()->icon()->standard("tst", $label),
$question_listing
);

return $mainbar
->withToolsButton($tools_button)
->withAdditionalToolEntry('questionlist', $entry);
};
}

return null;
return $mainbar
->withModification($mainbar_modification)
->withHighPriority();
}

public function getMetaBarModification(CalledContexts $called_contexts): ?MetaBarModification
Expand Down
2 changes: 1 addition & 1 deletion Modules/Test/classes/class.ilTestPlayerAbstractGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@ protected function showSideList($presentationMode, $currentSequenceElement)
}

$question_listing = $f->listing()->workflow()->linear(
$lng->txt('question_list'),
$this->lng->txt('mainbar_button_label_questionlist'),
$questions
)->withActive($active);

Expand Down
2 changes: 1 addition & 1 deletion Modules/Test/classes/class.ilTestServiceGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ public function getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $ac

$invited_user = array_pop($this->object->getInvitedUsers($user_id));
$title_client = '';
if ($invited_user["clientip"] !== null && strlen($invited_user["clientip"])) {
if ($invited_user && $invited_user["clientip"] !== null && strlen($invited_user["clientip"])) {
$template->setCurrentBlock("client_ip");
$template->setVariable("TXT_CLIENT_IP", $this->lng->txt("client_ip"));
$template->setVariable("VALUE_CLIENT_IP", $invited_user["clientip"]);
Expand Down
1 change: 1 addition & 0 deletions lang/ilias_de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,7 @@ assessment#:#longmenu_answeroptions_differ#:#Diese Frage funktioniert nicht rich
assessment#:#longmenu_text#:#‘Long Menu’-Text
assessment#:#mailnottype#:#Ein Versand findet auch beim Beenden einzelner Testdurchläufe statt
assessment#:#mailnottype_desc#:#Der Besitzer des Tests wird auch dann benachrichtigt, wenn die Anzahl Durchläufe nicht beschränkt ist.
assessment#:#mainbar_button_label_questionlist#:#Fragenliste
assessment#:#maintenance#:#Wartung
assessment#:#manscoring#:#Manuelle Bewertung
assessment#:#manscoring_done#:#Bereits bewertete Teilnehmer
Expand Down
1 change: 1 addition & 0 deletions lang/ilias_en.lang
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,7 @@ assessment#:#longmenu_answeroptions_differ#:#This question does not work correct
assessment#:#longmenu_text#:#Long Menu Text
assessment#:#mailnottype#:#Send a notification every time a test attempt is completed.
assessment#:#mailnottype_desc#:#Notify the owner of the test <strong>even if</strong> the number of test attempts has not been limited.
assessment#:#mainbar_button_label_questionlist#:#Questionlist
assessment#:#maintenance#:#Maintenance
assessment#:#manscoring#:#Manual Scoring
assessment#:#manscoring_done#:#Scored Participants
Expand Down

0 comments on commit 2a7f35a

Please sign in to comment.