ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilExcRandomAssignmentGUI.php
Go to the documentation of this file.
1<?php
2
21
28{
32 protected ilLanguage $lng;
33 protected ilCtrl $ctrl;
34 protected UIServices $ui;
35
36 public function __construct(
42 ) {
43 $this->main_tpl = $ui->mainTemplate();
44 $this->ui = $ui;
45 $this->random_manager = $random_manager;
46 $this->toolbar = $toolbar;
47 $this->ctrl = $ctrl;
48 $this->lng = $lng;
49 }
50
51 public function executeCommand(): void
52 {
54
55 $next_class = $ctrl->getNextClass($this);
56 $cmd = $ctrl->getCmd("startExercise");
57
58 switch ($next_class) {
59 default:
60 if ($cmd === "startExercise") {
61 $this->$cmd();
62 }
63 }
64 }
65
72 public function renderStartPage(): void
73 {
76
77 $but = $this->ui->factory()->button()->primary(
78 $lng->txt("exc_start_exercise"),
79 $this->ctrl->getLinkTarget($this, "startExercise")
80 );
82 $info_gui = new ilInfoScreenGUI($this);
83
84 $info_gui->addSection($lng->txt("exc_random_assignment"));
85 $info_gui->addProperty(
86 " ",
87 $lng->txt("exc_random_assignment_info")
88 );
89 $info_gui->addProperty(
90 $lng->txt("exc_rand_overall_ass"),
91 $this->random_manager->getTotalNumberOfAssignments()
92 );
93 $info_gui->addProperty(
94 $lng->txt("exc_rand_nr_mandatory"),
95 $this->random_manager->getNumberOfMandatoryAssignments()
96 );
97 $this->main_tpl->setContent($info_gui->getHTML());
98 }
99
100 protected function startExercise(): void
101 {
102 $this->random_manager->startExercise();
103 $this->ctrl->redirectByClass("ilObjExerciseGUI", "showOverview");
104 }
105}
Provides fluid interface to RBAC services.
Definition: UIServices.php:25
mainTemplate()
Get the ILIAS main template.
Definition: UIServices.php:54
Manages random mandatory assignments of an exercise (business logic)
Class ilCtrl provides processing control methods.
getNextClass($a_gui_class=null)
@inheritDoc
getCmd(?string $fallback_command=null)
@inheritDoc
UI for random assignment (ui)
__construct(UIServices $ui, ilToolbarGUI $toolbar, ilLanguage $lng, ilCtrl $ctrl, Mandatory\RandomAssignmentsManager $random_manager)
Mandatory RandomAssignmentsManager $random_manager
Class ilInfoScreenGUI.
language handling
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addComponent(\ILIAS\UI\Component\Component $a_comp)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...