ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.assAnswerMultipleResponseImage.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 require_once './Modules/Test/classes/inc.AssessmentConstants.php';
22 
36 {
37  public ?string $image = null;
38 
52  public function __construct(
53  string $answertext = '',
54  float $points = 0.0,
55  int $order = 0,
56  int $id = -1,
57  int $state = 0
58  ) {
60  }
61 
62  public function getImage(): ?string
63  {
64  return $this->image;
65  }
66 
67  public function setImage(?string $image = null): void
68  {
69  if ($image === '') {
70  throw new \Exception('imagename must not be empty');
71  }
72  $this->image = $image;
73  }
74 
75  public function hasImage(): bool
76  {
77  return $this->image !== null;
78  }
79 }
ASS_AnswerBinaryStateImage is a class for answers with a binary state indicator (checked/unchecked, set/unset) and an image file.
__construct(string $answertext='', float $points=0.0, int $order=0, int $id=-1, int $state=0)
ASS_AnswerMultipleResponse constructor.
__construct(VocabulariesInterface $vocabularies)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...