3declare(strict_types=1);
80 public function setIdent(
string $a_ident): void
82 $this->ident = $a_ident;
90 public function setTitle(
string $a_title): void
92 $this->title = $a_title;
102 if (preg_match(
"/(.*?)\=(.*)/", $a_comment, $matches)) {
104 switch ($matches[1]) {
105 case "ILIAS Version":
106 $this->ilias_version = $matches[2];
109 $this->questiontype = $matches[2];
112 $this->author = $matches[2] ??
'';
126 if (preg_match(
"/P(\d+)Y(\d+)M(\d+)DT(\d+)H(\d+)M(\d+)S/", $a_duration, $matches)) {
127 $this->duration = array(
145 $this->questiontext = $a_questiontext;
155 $this->resprocessing[] = $a_resprocessing;
160 $this->itemfeedback[] = $a_itemfeedback;
165 $this->maxattempts = $a_maxattempts;
175 $this->label = $a_label;
185 $this->xmllang = $a_xmllang;
195 $this->presentation = $a_presentation;
205 $this->questiontype = $a_questiontype;
218 $this->presentationitem[] = $a_presentationitem;
223 switch ($this->questiontype) {
224 case "ORDERING QUESTION":
226 case "KPRIM CHOICE QUESTION":
228 case "LONG MENU QUESTION":
230 case "SINGLE CHOICE QUESTION":
232 case "MULTIPLE CHOICE QUESTION":
234 case "MATCHING QUESTION":
236 case "CLOZE QUESTION":
238 case "IMAGE MAP QUESTION":
240 case "TEXT QUESTION":
242 case "NUMERIC QUESTION":
244 case "TEXTSUBSET QUESTION":
247 if (!$this->presentation) {
250 foreach ($this->presentation->order as $entry) {
251 if (
'response' === $entry[
"type"]) {
252 $result = $this->
typeFromResponse($this->presentation->response[$entry[
"index"]]);
253 if (
null !== $result) {
258 if (strlen($this->questiontype) == 0) {
267 $this->author = $a_author;
297 $this->suggested_solutions[] = array(
"solution" => $a_solution,
"gap_index" => $a_gap_index);
305 $this->itemmetadata[] = $a_metadata;
315 foreach ($this->itemmetadata as $metadata) {
316 if ($metadata[
"label"] === $a_label) {
317 return $metadata[
"entry"];
342 default:
return null;
const QT_MULTIPLE_CHOICE_MR
addMetadata(array $a_metadata)
setPresentation(ilQTIPresentation $a_presentation)
const QT_MULTIPLE_CHOICE_SR
setAuthor(string $a_author)
setQuestiontext(ilQTIMaterial $a_questiontext)
setIdent(string $a_ident)
setQuestiontype(string $a_questiontype)
setComment(string $a_comment)
setLabel(string $a_label)
ilQTIMaterial $questiontext
array $suggested_solutions
addItemfeedback(ilQTIItemfeedback $a_itemfeedback)
const QT_ORDERING_HORIZONTAL
setTitle(string $a_title)
string $iliasSourceVersion
addResprocessing(ilQTIResprocessing $a_resprocessing)
getMetadataEntry(string $a_label)
setXmllang(string $a_xmllang)
setDuration(string $a_duration)
setIliasSourceVersion(?string $iliasSourceVersion)
addPresentationitem($a_presentationitem)
addSuggestedSolution(ilQTIMattext $a_solution, int $a_gap_index)
ilQTIPresentation $presentation
setMaxattempts(string $a_maxattempts)
typeFromResponse(ilQTIResponse $response)
setIliasSourceNic(?string $iliasSourceNic)
const R_CARDINALITY_MULTIPLE
const R_CARDINALITY_SINGLE
const R_CARDINALITY_ORDERED