ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.assJavaApplet.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
5require_once './Modules/Test/classes/inc.AssessmentConstants.php';
6require_once './Modules/TestQuestionPool/interfaces/interface.ilObjQuestionScoringAdjustable.php';
7require_once './Modules/TestQuestionPool/interfaces/interface.iQuestionCondition.php';
8require_once './Modules/TestQuestionPool/classes/class.ilUserQuestionResult.php';
9
24{
33
41 public $java_code;
42
51
60
69
78
87
102 public function __construct(
103 $title = "",
104 $comment = "",
105 $author = "",
106 $owner = -1,
107 $question = "",
109 ) {
110 parent::__construct($title, $comment, $author, $owner, $question);
111 $this->javaapplet_filename = $javaapplet_filename;
112 $this->parameters = array();
113 }
114
122 public function splitParams($params = "")
123 {
124 $params_array = explode("<separator>", $params);
125 foreach ($params_array as $pair) {
126 if (preg_match("/(.*?)\=(.*)/", $pair, $matches)) {
127 switch ($matches[1]) {
128 case "java_code":
129 $this->java_code = $matches[2];
130 break;
131 case "java_codebase":
132 $this->java_codebase = $matches[2];
133 break;
134 case "java_archive":
135 $this->java_archive = $matches[2];
136 break;
137 case "java_width":
138 $this->java_width = $matches[2];
139 break;
140 case "java_height":
141 $this->java_height = $matches[2];
142 break;
143 }
144 if (preg_match("/param_name_(\d+)/", $matches[1], $found_key)) {
145 $this->parameters[$found_key[1]]["name"] = $matches[2];
146 }
147 if (preg_match("/param_value_(\d+)/", $matches[1], $found_key)) {
148 $this->parameters[$found_key[1]]["value"] = $matches[2];
149 }
150 }
151 }
152 }
153
161 public function buildParams()
162 {
163 $params_array = array();
164 if ($this->java_code) {
165 array_push($params_array, "java_code=$this->java_code");
166 }
167 if ($this->java_codebase) {
168 array_push($params_array, "java_codebase=$this->java_codebase");
169 }
170 if ($this->java_archive) {
171 array_push($params_array, "java_archive=$this->java_archive");
172 }
173 if ($this->java_width) {
174 array_push($params_array, "java_width=$this->java_width");
175 }
176 if ($this->java_height) {
177 array_push($params_array, "java_height=$this->java_height");
178 }
179 foreach ($this->parameters as $key => $value) {
180 array_push($params_array, "param_name_$key=" . $value["name"]);
181 array_push($params_array, "param_value_$key=" . $value["value"]);
182 }
183
184 return join("<separator>", $params_array);
185 }
186
192 public function buildParamsOnly()
193 {
194 $params_array = array();
195 if ($this->java_code) {
196 array_push($params_array, "java_code=$this->java_code");
197 array_push($params_array, "java_codebase=$this->java_codebase");
198 array_push($params_array, "java_archive=$this->java_archive");
199 }
200 foreach ($this->parameters as $key => $value) {
201 array_push($params_array, "param_name_$key=" . $value["name"]);
202 array_push($params_array, "param_value_$key=" . $value["value"]);
203 }
204 return join("<separator>", $params_array);
205 }
206
212 public function isComplete()
213 {
214 if (strlen($this->title)
215 && $this->author
216 && $this->question
217 && $this->javaapplet_filename
218 && $this->java_width
219 && $this->java_height
220 && $this->getPoints() > 0
221 ) {
222 return true;
223 } elseif (strlen($this->title)
224 && $this->author
225 && $this->question
226 && $this->getJavaArchive()
227 && $this->getJavaCodebase()
228 && $this->java_width
229 && $this->java_height
230 && $this->getPoints() > 0
231 ) {
232 return true;
233 }
234 return false;
235 }
236
237
245 public function saveToDb($original_id = "")
246 {
249 parent::saveToDb($original_id);
250 }
251
253 {
254 global $DIC;
255 $ilDB = $DIC['ilDB'];
256 $params = $this->buildParams();
257 // save additional data
258 $ilDB->manipulateF(
259 "DELETE FROM " . $this->getAdditionalTableName() . " WHERE question_fi = %s",
260 array( "integer" ),
261 array( $this->getId() )
262 );
263 $ilDB->manipulateF(
264 "INSERT INTO " . $this->getAdditionalTableName(
265 ) . " (question_fi, image_file, params) VALUES (%s, %s, %s)",
266 array( "integer", "text", "text" ),
267 array(
268 $this->getId(),
269 $this->javaapplet_filename,
270 $params
271 )
272 );
273 }
274
281 public function loadFromDb($question_id)
282 {
283 global $DIC;
284 $ilDB = $DIC['ilDB'];
285
286 $result = $ilDB->queryF(
287 "SELECT qpl_questions.*, " . $this->getAdditionalTableName() . ".* FROM qpl_questions LEFT JOIN " . $this->getAdditionalTableName() . " ON " . $this->getAdditionalTableName() . ".question_fi = qpl_questions.question_id WHERE qpl_questions.question_id = %s",
288 array("integer"),
289 array($question_id)
290 );
291 if ($result->numRows() == 1) {
292 $data = $ilDB->fetchAssoc($result);
293 $this->setId($question_id);
294 $this->setObjId($data["obj_fi"]);
295 $this->setNrOfTries($data['nr_of_tries']);
296 $this->setTitle($data["title"]);
297 $this->setComment($data["description"]);
298 $this->setOriginalId($data["original_id"]);
299 $this->setAuthor($data["author"]);
300 $this->setPoints($data["points"]);
301 $this->setOwner($data["owner"]);
302 include_once("./Services/RTE/classes/class.ilRTE.php");
303 $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc($data["question_text"], 1));
304 $this->setJavaAppletFilename($data["image_file"]);
305 $this->splitParams($data["params"]);
306 $this->setEstimatedWorkingTime(substr($data["working_time"], 0, 2), substr($data["working_time"], 3, 2), substr($data["working_time"], 6, 2));
307
308 try {
309 $this->setAdditionalContentEditingMode($data['add_cont_edit_mode']);
310 } catch (ilTestQuestionPoolException $e) {
311 }
312 }
313 parent::loadFromDb($question_id);
314 }
315
321 public function duplicate($for_test = true, $title = "", $author = "", $owner = "", $testObjId = null)
322 {
323 if ($this->id <= 0) {
324 // The question has not been saved. It cannot be duplicated
325 return;
326 }
327 // duplicate the question in database
328 $this_id = $this->getId();
329 $thisObjId = $this->getObjId();
330
331 $clone = $this;
332 include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
334 $clone->id = -1;
335
336 if ((int) $testObjId > 0) {
337 $clone->setObjId($testObjId);
338 }
339
340 if ($title) {
341 $clone->setTitle($title);
342 }
343 if ($author) {
344 $clone->setAuthor($author);
345 }
346 if ($owner) {
347 $clone->setOwner($owner);
348 }
349 if ($for_test) {
350 $clone->saveToDb($original_id);
351 } else {
352 $clone->saveToDb();
353 }
354
355 // copy question page content
356 $clone->copyPageOfQuestion($this_id);
357 // copy XHTML media objects
358 $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
359 // duplicate the image
360 $clone->duplicateApplet($this_id, $thisObjId);
361
362 $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
363
364 return $clone->id;
365 }
366
374 public function copyObject($target_questionpool_id, $title = "")
375 {
376 if ($this->id <= 0) {
377 // The question has not been saved. It cannot be duplicated
378 return;
379 }
380 // duplicate the question in database
381 $clone = $this;
382 include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
384 $clone->id = -1;
385 $source_questionpool_id = $this->getObjId();
386 $clone->setObjId($target_questionpool_id);
387 if ($title) {
388 $clone->setTitle($title);
389 }
390 $clone->saveToDb();
391
392 // copy question page content
393 $clone->copyPageOfQuestion($original_id);
394 // copy XHTML media objects
395 $clone->copyXHTMLMediaObjectsOfQuestion($original_id);
396 // duplicate the image
397 $clone->copyApplet($original_id, $source_questionpool_id);
398
399 $clone->onCopy($source_questionpool_id, $original_id, $clone->getObjId(), $clone->getId());
400
401 return $clone->id;
402 }
403
404 public function createNewOriginalFromThisDuplicate($targetParentId, $targetQuestionTitle = "")
405 {
406 if ($this->id <= 0) {
407 // The question has not been saved. It cannot be duplicated
408 return;
409 }
410
411 include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
412
413 $sourceQuestionId = $this->id;
414 $sourceParentId = $this->getObjId();
415
416 // duplicate the question in database
417 $clone = $this;
418 $clone->id = -1;
419
420 $clone->setObjId($targetParentId);
421
422 if ($targetQuestionTitle) {
423 $clone->setTitle($targetQuestionTitle);
424 }
425
426 $clone->saveToDb();
427 // copy question page content
428 $clone->copyPageOfQuestion($sourceQuestionId);
429 // copy XHTML media objects
430 $clone->copyXHTMLMediaObjectsOfQuestion($sourceQuestionId);
431 // duplicate the image
432 $clone->copyApplet($sourceQuestionId, $sourceParentId);
433
434 $clone->onCopy($sourceParentId, $sourceQuestionId, $clone->getObjId(), $clone->getId());
435
436 return $clone->id;
437 }
438
439 public function duplicateApplet($question_id, $objectId = null)
440 {
441 $javapath = $this->getJavaPath();
442 $javapath_original = preg_replace("/([^\d])$this->id([^\d])/", "\${1}$question_id\${2}", $javapath);
443
444 if ((int) $objectId > 0) {
445 $javapath_original = str_replace("/$this->obj_id/", "/$objectId/", $javapath_original);
446 }
447
448 if (!file_exists($javapath)) {
449 ilUtil::makeDirParents($javapath);
450 }
452 if (!copy($javapath_original . $filename, $javapath . $filename)) {
453 print "java applet could not be duplicated!!!! ";
454 }
455 }
456
457 public function copyApplet($question_id, $source_questionpool)
458 {
459 $javapath = $this->getJavaPath();
460 $javapath_original = preg_replace("/([^\d])$this->id([^\d])/", "\${1}$question_id\${2}", $javapath);
461 $javapath_original = str_replace("/$this->obj_id/", "/$source_questionpool/", $javapath_original);
462 if (!file_exists($javapath)) {
463 ilUtil::makeDirParents($javapath);
464 }
466 if (!copy($javapath_original . $filename, $javapath . $filename)) {
467 print "java applet could not be copied!!!! ";
468 }
469 }
470
479 public function getJavaCode()
480 {
481 return $this->java_code;
482 }
483
492 public function getJavaCodebase()
493 {
495 }
496
505 public function getJavaArchive()
506 {
507 return $this->java_archive;
508 }
509
518 public function setJavaCode($java_code = "")
519 {
520 $this->java_code = $java_code;
521 }
522
531 public function setJavaCodebase($java_codebase = "")
532 {
533 $this->java_codebase = $java_codebase;
534 }
535
544 public function setJavaArchive($java_archive = "")
545 {
546 $this->java_archive = $java_archive;
547 }
548
557 public function getJavaWidth()
558 {
559 return $this->java_width;
560 }
561
569 public function setJavaWidth($java_width = "")
570 {
571 $this->java_width = $java_width;
572 }
573
582 public function getJavaHeight()
583 {
584 return $this->java_height;
585 }
586
595 public function setJavaHeight($java_height = "")
596 {
597 $this->java_height = $java_height;
598 }
599
611 public function calculateReachedPoints($active_id, $pass = null, $authorizedSolution = true, $returndetails = false)
612 {
613 if ($returndetails) {
614 throw new ilTestException('return details not implemented for ' . __METHOD__);
615 }
616
617 global $DIC;
618 $ilDB = $DIC['ilDB'];
619
620 $found_values = array();
621 if (is_null($pass)) {
622 $pass = $this->getSolutionMaxPass($active_id);
623 }
624
625 $result = $this->getCurrentSolutionResultSet($active_id, $pass, $authorizedSolution);
626
627 $points = 0;
628 while ($data = $ilDB->fetchAssoc($result)) {
629 $points += $data["points"];
630 }
631
632 return $points;
633 }
634
636 {
637 $points = 0;
638 foreach ($previewSession->getParticipantsSolution() as $solution) {
639 if (isset($solution['points'])) {
640 $points += $solution['points'];
641 }
642 }
643
644 $reachedPoints = $this->deductHintPointsFromReachedPoints($previewSession, $points);
645
646 return $this->ensureNonNegativePoints($reachedPoints);
647 }
648
649 // hey: prevPassSolutions - bypass intermediate solution requests and deligate
650 // to own implementation for requests to authorized solutions
651 public function getSolutionValues($active_id, $pass = null, $authorized = true)
652 {
653 if (!$authorized) {
654 return array();
655 }
656
657 return $this->getSolutionValuesRegardlessOfAuthorization($active_id, $pass);
658 }
659
660 public function getSolutionValuesRegardlessOfAuthorization($active_id, $pass = null)
661 {
662 // - similar to getSolutionValues in general
663 // - does not consider "step" in any kind
664 // - returns a customized associative array
665 // - is the original implementation for qtype
666 return $this->getReachedInformation($active_id, $pass);
667 }
668 // hey.
669
678 public function getReachedInformation($active_id, $pass = null)
679 {
680 global $DIC;
681 $ilDB = $DIC['ilDB'];
682
683 $found_values = array();
684 if (is_null($pass)) {
685 $pass = $this->getSolutionMaxPass($active_id);
686 }
687 $result = $ilDB->queryF(
688 "SELECT * FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
689 array('integer','integer','integer'),
690 array($active_id, $this->getId(), $pass)
691 );
692 $counter = 1;
693 $user_result = array();
694 while ($data = $ilDB->fetchAssoc($result)) {
695 $true = 0;
696 if ($data["points"] > 0) {
697 $true = 1;
698 }
699 $solution = array(
700 "order" => $counter,
701 "points" => $data["points"],
702 "true" => $true,
703 "value1" => $data["value1"],
704 "value2" => $data["value2"],
705 );
706 $counter++;
707 array_push($user_result, $solution);
708 }
709 return $user_result;
710 }
711
720 public function addParameter($name = "", $value = "")
721 {
723 if ($index > -1) {
724 $this->parameters[$index] = array("name" => $name, "value" => $value);
725 } else {
726 array_push($this->parameters, array("name" => $name, "value" => $value));
727 }
728 }
729
730 public function addParameterAtIndex($index = 0, $name = "", $value = "")
731 {
732 if (array_key_exists($index, $this->parameters)) {
733 // insert parameter
734 $newparams = array();
735 for ($i = 0; $i < $index; $i++) {
736 array_push($newparams, $this->parameters[$i]);
737 }
738 array_push($newparams, array($name, $value));
739 for ($i = $index; $i < count($this->parameters); $i++) {
740 array_push($newparams, $this->parameters[$i]);
741 }
742 $this->parameters = $newparams;
743 } else {
744 array_push($this->parameters, array($name, $value));
745 }
746 }
747
755 public function removeParameter($index)
756 {
757 if ($index < 0) {
758 return;
759 }
760 if (count($this->parameters) < 1) {
761 return;
762 }
763 if ($index >= count($this->parameters)) {
764 return;
765 }
766 unset($this->parameters[$index]);
767 $this->parameters = array_values($this->parameters);
768 }
769
778 public function getParameter($index)
779 {
780 if (($index < 0) or ($index >= count($this->parameters))) {
781 return undef;
782 }
783 return $this->parameters[$index];
784 }
785
794 public function getParameterIndex($name)
795 {
796 foreach ($this->parameters as $key => $value) {
797 if (array_key_exists($name, $value)) {
798 return $key;
799 }
800 }
801 return -1;
802 }
803
811 public function getParameterCount()
812 {
813 return count($this->parameters);
814 }
815
822 public function flushParams()
823 {
824 $this->parameters = array();
825 }
826
835 public function saveWorkingData($active_id, $pass = null, $authorized = true)
836 {
837 // nothing to save!
838
839 //$this->getProcessLocker()->requestUserSolutionUpdateLock();
840 // store in tst_solutions
841 //$this->getProcessLocker()->releaseUserSolutionUpdateLock();
842
843 return true;
844 }
845
846 protected function savePreviewData(ilAssQuestionPreviewSession $previewSession)
847 {
848 // nothing to save!
849
850 return true;
851 }
852
860 public function getJavaAppletFilename()
861 {
863 }
864
873 public function setJavaAppletFilename($javaapplet_filename, $javaapplet_tempfilename = "")
874 {
875 if (!empty($javaapplet_filename)) {
876 $this->javaapplet_filename = $javaapplet_filename;
877 }
878 if (!empty($javaapplet_tempfilename)) {
879 $javapath = $this->getJavaPath();
880 if (!file_exists($javapath)) {
881 ilUtil::makeDirParents($javapath);
882 }
883
884 if (!ilUtil::moveUploadedFile($javaapplet_tempfilename, $javaapplet_filename, $javapath . $javaapplet_filename)) {
885 $ilLog->write("ERROR: java applet question: java applet not uploaded: $javaapplet_filename");
886 } else {
887 $this->setJavaCodebase();
888 $this->setJavaArchive();
889 }
890 }
891 }
892
893 public function deleteJavaAppletFilename()
894 {
895 @unlink($this->getJavaPath() . $this->getJavaAppletFilename());
896 $this->javaapplet_filename = "";
897 }
898
904 public function getQuestionType()
905 {
906 return "assJavaApplet";
907 }
908
914 public function getAdditionalTableName()
915 {
916 return "qpl_qst_javaapplet";
917 }
918
924 {
925 return parent::getRTETextWithMediaObjects();
926 }
927
931 public function setExportDetailsXLS($worksheet, $startrow, $active_id, $pass)
932 {
933 parent::setExportDetailsXLS($worksheet, $startrow, $active_id, $pass);
934
935 $solutions = $this->getSolutionValues($active_id, $pass);
936
937 $i = 1;
938 foreach ($solutions as $solution) {
939 $worksheet->setCell($startrow + $i, 1, $this->lng->txt("result") . " $i");
940 if (strlen($solution["value1"])) {
941 $worksheet->setCell($startrow + $i, 1, $solution["value1"]);
942 }
943 if (strlen($solution["value2"])) {
944 $worksheet->setCell($startrow + $i, 2, $solution["value2"]);
945 }
946 $i++;
947 }
948
949 return $startrow + $i + 1;
950 }
951
952 public function isAutosaveable()
953 {
954 return false;
955 }
956
965 public function getOperators($expression)
966 {
967 require_once "./Modules/TestQuestionPool/classes/class.ilOperatorsExpressionMapping.php";
969 }
970
975 public function getExpressionTypes()
976 {
977 return array(
980 );
981 }
982
991 public function getUserQuestionResult($active_id, $pass)
992 {
993 $result = new ilUserQuestionResult($this, $active_id, $pass);
994
995 $points = $this->calculateReachedPoints($active_id, $pass);
996 $max_points = $this->getMaximumPoints();
997
998 $result->setReachedPercentage(($points / $max_points) * 100);
999
1000 return $result;
1001 }
1002
1011 public function getAvailableAnswerOptions($index = null)
1012 {
1013 return array();
1014 }
1015
1016 // fau: testNav - new function getTestQuestionConfig()
1021 // hey: refactored identifiers
1023 // hey.
1024 {
1025 // hey: refactored identifiers
1026 return parent::buildTestPresentationConfig()
1027 // hey.
1028 ->setFormChangeDetectionEnabled(false)
1029 ->setBackgroundChangeDetectionEnabled(true);
1030 }
1031 // fau.
1032}
$result
if(! $in) print
$filename
Definition: buildRTE.php:89
An exception for terminatinating execution or to throw for unit testing.
Class for Java Applet Questions.
flushParams()
Removes all applet parameters.
getAvailableAnswerOptions($index=null)
If index is null, the function returns an array with all anwser options Else it returns the specific ...
addParameterAtIndex($index=0, $name="", $value="")
setJavaCode($java_code="")
Sets the java applet code parameter.
getReachedInformation($active_id, $pass=null)
Returns the evaluation data, a learner has entered to answer the question.
getAdditionalTableName()
Returns the name of the additional question data table in the database.
getJavaCode()
Returns the java applet code parameter.
createNewOriginalFromThisDuplicate($targetParentId, $targetQuestionTitle="")
setJavaWidth($java_width="")
Sets the java applet width parameter.
getOperators($expression)
Get all available operations for a specific question.
getJavaCodebase()
Returns the java applet codebase parameter.
buildParamsOnly()
Returns a string containing the additional applet parameters.
getJavaAppletFilename()
Gets the java applet file name.
duplicate($for_test=true, $title="", $author="", $owner="", $testObjId=null)
Duplicates an assJavaApplet.
getExpressionTypes()
Get all available expression types for a specific question.
saveWorkingData($active_id, $pass=null, $authorized=true)
Saves the learners input of the question to the database.
buildParams()
Returns a string containing the applet parameters.
getSolutionValuesRegardlessOfAuthorization($active_id, $pass=null)
saveToDb($original_id="")
Saves a assJavaApplet object to a database.
getRTETextWithMediaObjects()
Collects all text in the question which could contain media objects which were created with the Rich ...
duplicateApplet($question_id, $objectId=null)
__construct( $title="", $comment="", $author="", $owner=-1, $question="", $javaapplet_filename="")
assJavaApplet constructor
savePreviewData(ilAssQuestionPreviewSession $previewSession)
getJavaWidth()
Returns the java applet width parameter.
addParameter($name="", $value="")
Adds a new parameter value to the parameter list.
saveAdditionalQuestionDataToDb()
Saves a record to the question types additional data table.
copyApplet($question_id, $source_questionpool)
buildTestPresentationConfig()
Get the test question configuration.
setExportDetailsXLS($worksheet, $startrow, $active_id, $pass)
{Creates an Excel worksheet for the detailed cumulated results of this question.object}
getQuestionType()
Returns the question type of the question.
getParameterIndex($name)
Returns the index of an applet parameter.
removeParameter($index)
Removes a parameter value from the parameter list.
getJavaHeight()
Returns the java applet height parameter.
getParameter($index)
Returns the paramter at a given index.
copyObject($target_questionpool_id, $title="")
Copies an assJavaApplet object.
setJavaHeight($java_height="")
Sets the java applet height parameter.
loadFromDb($question_id)
Loads a assJavaApplet object from a database.
setJavaAppletFilename($javaapplet_filename, $javaapplet_tempfilename="")
Sets the java applet file name.
getJavaArchive()
Returns the java applet archive parameter.
getUserQuestionResult($active_id, $pass)
Get the user solution for a question by active_id and the test pass.
calculateReachedPoints($active_id, $pass=null, $authorizedSolution=true, $returndetails=false)
Returns the points, a learner has reached answering the question.
setJavaArchive($java_archive="")
Sets the java applet archive parameter.
getSolutionValues($active_id, $pass=null, $authorized=true)
Loads solutions of a given user from the database an returns it.
splitParams($params="")
Sets the applet parameters from a parameter string containing all parameters in a list.
isComplete()
Returns true, if a imagemap question is complete for use.
getParameterCount()
Returns the number of additional applet parameters.
setJavaCodebase($java_codebase="")
Sets the java applet codebase parameter.
calculateReachedPointsFromPreviewSession(ilAssQuestionPreviewSession $previewSession)
Abstract basic class which is to be extended by the concrete assessment question type classes.
getCurrentSolutionResultSet($active_id, $pass, $authorized=true)
Get a restulset for the current user solution for a this question by active_id and pass.
static _getOriginalId($question_id)
Returns the original id of a question.
setId($id=-1)
Sets the id of the assQuestion object.
setOriginalId($original_id)
setObjId($obj_id=0)
Set the object id of the container object.
getSolutionMaxPass($active_id)
Returns the maximum pass a users question solution.
saveQuestionDataToDb($original_id="")
getId()
Gets the id of the assQuestion object.
getObjId()
Get the object id of the container object.
setTitle($title="")
Sets the title string of the assQuestion object.
setOwner($owner="")
Sets the creator/owner ID of the assQuestion object.
getJavaPath()
Returns the image path for web accessable images of a question.
setEstimatedWorkingTime($hour=0, $min=0, $sec=0)
Sets the estimated working time of a question from given hour, minute and second.
deductHintPointsFromReachedPoints(ilAssQuestionPreviewSession $previewSession, $reachedPoints)
setAuthor($author="")
Sets the authors name of the assQuestion object.
getPoints()
Returns the maximum available points for the question.
setPoints($a_points)
Sets the maximum available points for the question.
setComment($comment="")
Sets the comment string of the assQuestion object.
setNrOfTries($a_nr_of_tries)
setAdditionalContentEditingMode($additinalContentEditingMode)
setter for additional content editing mode for this question
setQuestion($question="")
Sets the question string of the question object.
getMaximumPoints()
Returns the maximum points, a learner can reach answering the question.
ensureNonNegativePoints($points)
static _replaceMediaObjectImageSrc($a_text, $a_direction=0, $nic=IL_INST_ID)
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
Base Exception for all Exceptions relating to Modules/Test.
Class ilUserQuestionResult.
static makeDirParents($a_dir)
Create a new directory and all parent directories.
$key
Definition: croninfo.php:18
$i
Definition: disco.tpl.php:19
Class iQuestionCondition.
Interface ilObjQuestionScoringAdjustable.
$index
Definition: metadata.php:60
global $DIC
Definition: saml.php:7
global $ilDB
$data
Definition: bench.php:6