ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilExcRandomAssignmentGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
13{
14
18 protected $main_tpl;
19
23 protected $random_manager;
24
28 protected $toolbar;
29
33 protected $lng;
34
38 protected $ctrl;
39
43 protected $ui;
44
49 {
50 $this->main_tpl = $ui->mainTemplate();
51 $this->ui = $ui;
52 $this->random_manager = $random_manager;
53 $this->toolbar = $toolbar;
54 $this->ctrl = $ctrl;
55 $this->lng = $lng;
56 }
57
61 public function executeCommand()
62 {
64
65 $next_class = $ctrl->getNextClass($this);
66 $cmd = $ctrl->getCmd("startExercise");
67
68 switch ($next_class) {
69 default:
70 if (in_array($cmd, array("startExercise"))) {
71 $this->$cmd();
72 }
73 }
74 }
75
79 public function renderStartPage()
80 {
83
84 $but = $this->ui->factory()->button()->primary(
85 $lng->txt("exc_start_exercise"),
86 $this->ctrl->getLinkTarget($this, "startExercise")
87 );
88 $toolbar->addComponent($but);
89 $info_gui = new ilInfoScreenGUI($this);
90
91 $info_gui->addSection($lng->txt("exc_random_assignment"));
92 $info_gui->addProperty(
93 " ",
94 $lng->txt("exc_random_assignment_info")
95 );
96 $info_gui->addProperty(
97 $lng->txt("exc_rand_overall_ass"),
98 $this->random_manager->getTotalNumberOfAssignments()
99 );
100 $info_gui->addProperty(
101 $lng->txt("exc_rand_nr_mandatory"),
102 $this->random_manager->getNumberOfMandatoryAssignments()
103 );
104 $this->main_tpl->setContent($info_gui->getHTML());
105 }
106
113 protected function startExercise()
114 {
115 $this->random_manager->startExercise();
116 $this->ctrl->redirectByClass("ilObjExerciseGUI", "showOverview");
117 }
118}
An exception for terminatinating execution or to throw for unit testing.
This class provides processing control methods.
__construct(\ILIAS\DI\UIServices $ui, ilToolbarGUI $toolbar, ilLanguage $lng, ilCtrl $ctrl, ilExcRandomAssignmentManager $random_manager)
Constructor.
Manages random mandatory assignments of an exercise.
Class ilInfoScreenGUI.
language handling
Class HTTPServicesTest.
Class ChatMainBarProvider \MainMenu\Provider.
ui()
Definition: ui.php:5