ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilExcRandomAssignmentGUI Class Reference

UI for random assignment. More...

+ Collaboration diagram for ilExcRandomAssignmentGUI:

Public Member Functions

 __construct (\ILIAS\DI\UIServices $ui, ilToolbarGUI $toolbar, ilLanguage $lng, ilCtrl $ctrl, ilExcRandomAssignmentManager $random_manager)
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 renderStartPage ()
 Render start page. More...
 

Protected Member Functions

 startExercise ()
 

Protected Attributes

 $main_tpl
 
 $random_manager
 
 $toolbar
 
 $lng
 
 $ctrl
 
 $ui
 

Detailed Description

UI for random assignment.

(ui)

Author
killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 12 of file class.ilExcRandomAssignmentGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilExcRandomAssignmentGUI::__construct ( \ILIAS\DI\UIServices  $ui,
ilToolbarGUI  $toolbar,
ilLanguage  $lng,
ilCtrl  $ctrl,
ilExcRandomAssignmentManager  $random_manager 
)

Constructor.

Definition at line 48 of file class.ilExcRandomAssignmentGUI.php.

References $ctrl, $lng, $random_manager, $toolbar, $ui, and ui().

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  }
ui()
Definition: ui.php:5
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilExcRandomAssignmentGUI::executeCommand ( )

Execute command.

Definition at line 61 of file class.ilExcRandomAssignmentGUI.php.

References $ctrl.

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  }

◆ renderStartPage()

ilExcRandomAssignmentGUI::renderStartPage ( )

Render start page.

Definition at line 79 of file class.ilExcRandomAssignmentGUI.php.

References $lng, $toolbar, and ui().

80  {
82  $lng = $this->lng;
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  }
Class ilInfoScreenGUI.
ui()
Definition: ui.php:5
+ Here is the call graph for this function:

◆ startExercise()

ilExcRandomAssignmentGUI::startExercise ( )
protected
Parameters

Definition at line 113 of file class.ilExcRandomAssignmentGUI.php.

114  {
115  $this->random_manager->startExercise();
116  $this->ctrl->redirectByClass("ilObjExerciseGUI", "showOverview");
117  }

Field Documentation

◆ $ctrl

ilExcRandomAssignmentGUI::$ctrl
protected

Definition at line 38 of file class.ilExcRandomAssignmentGUI.php.

Referenced by __construct(), and executeCommand().

◆ $lng

ilExcRandomAssignmentGUI::$lng
protected

Definition at line 33 of file class.ilExcRandomAssignmentGUI.php.

Referenced by __construct(), and renderStartPage().

◆ $main_tpl

ilExcRandomAssignmentGUI::$main_tpl
protected

Definition at line 18 of file class.ilExcRandomAssignmentGUI.php.

◆ $random_manager

ilExcRandomAssignmentGUI::$random_manager
protected

Definition at line 23 of file class.ilExcRandomAssignmentGUI.php.

Referenced by __construct().

◆ $toolbar

ilExcRandomAssignmentGUI::$toolbar
protected

Definition at line 28 of file class.ilExcRandomAssignmentGUI.php.

Referenced by __construct(), and renderStartPage().

◆ $ui

ilExcRandomAssignmentGUI::$ui
protected

Definition at line 43 of file class.ilExcRandomAssignmentGUI.php.

Referenced by __construct().


The documentation for this class was generated from the following file: