ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
base.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
7 function base()
8 {
9  global $DIC;
10  $ui_factory = $DIC->ui()->factory();
11  $data_factory = new \ILIAS\Data\Factory();
12  $renderer = $DIC->ui()->renderer();
13  $spacer = $ui_factory->divider()->horizontal();
14 
15  $url = $data_factory->uri($DIC->http()->request()->getUri()->__toString());
16 
17  $target = $data_factory->link('Start Test', $url);
18  $launcher = $ui_factory->launcher()
19  ->inline($target)
20  ->withDescription('<p>You will have <strong>90 minutes to answer all questions.</strong></p><p>Please make sure that you have the time to complete the test and that you will be undisturbed. There is no way for you to pause or re-take this test.</p>');
21 
22  $icon = $ui_factory->symbol()->icon()->standard('ps', '', 'large');
23 
24  $status_message = $ui_factory->messageBox()->failure("You have to complete all preconditions first.")
25  ->withLinks([
26  $ui_factory->link()->standard("Do this first", "#"),
27  $ui_factory->link()->standard("And this is mandatory, too", "#")
28  ]);
29 
30  $launcher2 = $launcher
31  ->withDescription('<p>This course goes into advanced knowledge for students preparing for the final exam. You should have a firm understanding of the basics before enrolling.</p>')
32  ->withButtonLabel('Course is locked', false)
33  ->withStatusIcon($icon)
34  ->withStatusMessageBox($status_message);
35 
36  $target = $data_factory->link('Continue Survey', $url);
37  $progressmeter = $ui_factory->chart()->progressMeter()->mini(100, 50, 100);
38  $status_message = $ui_factory->messageBox()->info("There are still 8 questions left in the survey.");
39  $launcher3 = $ui_factory->launcher()
40  ->inline($target)
41  ->withStatusIcon($progressmeter)
42  ->withStatusMessageBox($status_message)
43  ->withDescription('');
44 
45  $target = $data_factory->link('Repeat Test', $url);
46  $status_message = $ui_factory->messageBox()->success("You have completed this test already. If you want you can try it again.");
47  $icon = $ui_factory->symbol()->icon()->standard('task', '', 'large');
48  $launcher4 = $ui_factory->launcher()
49  ->inline($target)
50  ->withStatusIcon($icon)
51  ->withStatusMessageBox($status_message);
52 
53  return $renderer->render([
54  $launcher,
55  $spacer,
56  $launcher2,
57  $spacer,
58  $launcher3,
59  $spacer,
60  $launcher4
61  ]);
62 }
global $DIC
Definition: feed.php:28
$url
Definition: ltiregstart.php:35