19 declare(strict_types=1);
45 public function init(): void
47 $this->static_link_enabled =
true;
48 $this->delete_enabled =
true;
49 $this->cut_enabled =
true;
50 $this->copy_enabled =
true;
51 $this->subscribe_enabled =
true;
52 $this->link_enabled =
true;
53 $this->info_screen_enabled =
true;
55 $this->gui_class_name =
"ilobjtestgui";
70 if (TestDIC::dic()[
'settings.main.repository']->getForObjFi($obj_id)
71 ->getAdditionalSettings()->getHideInfoTab()) {
103 $props = parent::getProperties();
105 $participant_access = $this->test_access->isParticipantAllowed(
110 if ($participant_access !== ParticipantAccess::ALLOWED) {
111 $props[] = [
'alert' =>
true,
'property' => $this->
lng->txt(
'status'),
112 'value' => $participant_access->getAccessForbiddenMessage($this->
lng)];
116 if ($this->obj_test_access->showCertificateFor($this->user->getId(),
$this->obj_id)) {
117 $this->
lng->loadLanguageModule(
'certificate');
118 $this->
ctrl->setParameterByClass(ilTestEvaluationGUI::class,
'ref_id', $this->ref_id);
121 'property' => $this->
lng->txt(
'certificate'),
122 'value' => $this->
ui->renderer()->render(
123 $this->
ui->factory()->link()->standard(
124 $this->
lng->txt(
'download_certificate'),
125 $this->
ctrl->getLinkTargetByClass(
128 ilTestEvaluationGUI::class
135 $this->
ctrl->setParameterByClass(ilTestEvaluationGUI::class,
'ref_id',
null);
143 $cmd = explode(
'::', $cmd);
145 if (count($cmd) === 2) {
146 $cmd_link = $this->
ctrl->getLinkTargetByClass([ilRepositoryGUI::class, ilObjTestGUI::class, $cmd[0]], $cmd[1]);
148 $cmd_link = $this->
ctrl->getLinkTargetByClass(
'ilObjTestGUI', $cmd[0]);
151 $params = array_merge([
'ref_id' => $this->ref_id], $this->command_link_params);
162 if ($this->test_access->isParticipantAllowed($this->obj_id, $this->user->getId())
163 === ParticipantAccess::BROKEN_TEST) {
167 if ($this->
access->checkAccess(
'read',
'', $this->ref_id)) {
194 $this->command_link_params = $a_param;
205 $card = parent::getAsCard($ref_id, $obj_id, $type, $title, $description);
206 if ($this->obj_test_access->showCertificateFor($this->user->getId(),
$obj_id)) {
207 $card = $card->withCertificateIcon(
true);
216 return parent::modifyTitleLink($default_link);
219 $path = $this->tree->getPathFull($this->ref_id);
221 while ($parent = array_pop(
$path)) {
222 if ($parent[
'type'] ===
'crs') {
223 $parent_crs_ref_id = $parent[
'ref_id'];
228 $this->
ctrl->setParameterByClass(ilObjCourseGUI::class,
'ref_id', $parent_crs_ref_id);
229 $this->
ctrl->setParameterByClass(ilObjCourseGUI::class,
'tid', $this->ref_id);
230 $cmd_link = $this->
ctrl->getLinkTargetByClass([ilRepositoryGUI::class, ilObjCourseGUI::class],
'redirectLocToTest');
231 $this->
ctrl->clearParametersByClass(
'ilrepositorygui');
233 return parent::modifyTitleLink($cmd_link);
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
enableMultiDownload(bool $value)
Toggles whether multiple objects can be downloaded at once or not.
initItem(int $ref_id, int $obj_id, string $type, string $title='', string $description='')
enableSubscribe(bool $status)
ilObjTestAccess $obj_test_access
getProperties()
Get item properties.
enableInfoScreen(bool $info_screen)
modifyTitleLink(string $default_link)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
enableComments(bool $value, bool $enable_comments_settings=true)
enableLPSettingsCommand(bool $enabled)
getAsCard(int $ref_id, int $obj_id, string $type, string $title, string $description)
Get card object.
addCommandLinkParameter($a_param)
add command link parameters
disableTitleLink(bool $status)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
enableLearningProgress(bool $enabled)
static isObjectiveTest(int $a_trst_ref_id)
Check if test ref_id is used in an objective course.
createDefaultCommand(array $command)
overwritten from base class for course objectives
enableTimings(bool $status)
enable timings link
ilTestAccess $test_access
insertCommand(string $href, string $text, string $frame='', string $img='', string $cmd='', string $onclick='')
insert command button
getCommandLink(string $cmd)