ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.assAnswerBinaryStateImage.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
37{
38 protected ?string $image = null;
39
50 public function __construct($answertext = "", $points = 0.0, $order = 0, $state = false, ?string $a_image = null, int $id = -1)
51 {
53 $this->setImage($a_image);
54 }
55
56 public function getImage(): ?string
57 {
58 return $this->image;
59 }
60
61 public function setImage(?string $image = null): void
62 {
63 if ($image === '') {
64 throw new \Exception('imagename must not be empty');
65 }
66 $this->image = $image;
67 }
68
69 public function hasImage(): bool
70 {
71 return $this->image !== null;
72 }
73}
Class for answers with a binary state indicator.
__construct($answertext="", $points=0.0, $order=0, $state=false, ?string $a_image=null, int $id=-1)
ASS_AnswerBinaryStateImage constructor The constructor takes possible arguments an creates an instanc...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc