ILIAS  release_7 Revision v7.30-3-g800a261c036
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 ) {
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 {
312 }
313
314 try {
315 $this->setAdditionalContentEditingMode($data['add_cont_edit_mode']);
317 }
318 }
319 parent::loadFromDb($question_id);
320 }
321
327 public function duplicate($for_test = true, $title = "", $author = "", $owner = "", $testObjId = null)
328 {
329 if ($this->id <= 0) {
330 // The question has not been saved. It cannot be duplicated
331 return;
332 }
333 // duplicate the question in database
334 $this_id = $this->getId();
335 $thisObjId = $this->getObjId();
336
337 $clone = $this;
338 include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
340 $clone->id = -1;
341
342 if ((int) $testObjId > 0) {
343 $clone->setObjId($testObjId);
344 }
345
346 if ($title) {
347 $clone->setTitle($title);
348 }
349 if ($author) {
350 $clone->setAuthor($author);
351 }
352 if ($owner) {
353 $clone->setOwner($owner);
354 }
355 if ($for_test) {
356 $clone->saveToDb($original_id);
357 } else {
358 $clone->saveToDb();
359 }
360
361 // copy question page content
362 $clone->copyPageOfQuestion($this_id);
363 // copy XHTML media objects
364 $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
365 // duplicate the image
366 $clone->duplicateApplet($this_id, $thisObjId);
367
368 $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
369
370 return $clone->id;
371 }
372
380 public function copyObject($target_questionpool_id, $title = "")
381 {
382 if ($this->id <= 0) {
383 // The question has not been saved. It cannot be duplicated
384 return;
385 }
386 // duplicate the question in database
387 $clone = $this;
388 include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
390 $clone->id = -1;
391 $source_questionpool_id = $this->getObjId();
392 $clone->setObjId($target_questionpool_id);
393 if ($title) {
394 $clone->setTitle($title);
395 }
396 $clone->saveToDb();
397
398 // copy question page content
399 $clone->copyPageOfQuestion($original_id);
400 // copy XHTML media objects
401 $clone->copyXHTMLMediaObjectsOfQuestion($original_id);
402 // duplicate the image
403 $clone->copyApplet($original_id, $source_questionpool_id);
404
405 $clone->onCopy($source_questionpool_id, $original_id, $clone->getObjId(), $clone->getId());
406
407 return $clone->id;
408 }
409
410 public function createNewOriginalFromThisDuplicate($targetParentId, $targetQuestionTitle = "")
411 {
412 if ($this->id <= 0) {
413 // The question has not been saved. It cannot be duplicated
414 return;
415 }
416
417 include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
418
419 $sourceQuestionId = $this->id;
420 $sourceParentId = $this->getObjId();
421
422 // duplicate the question in database
423 $clone = $this;
424 $clone->id = -1;
425
426 $clone->setObjId($targetParentId);
427
428 if ($targetQuestionTitle) {
429 $clone->setTitle($targetQuestionTitle);
430 }
431
432 $clone->saveToDb();
433 // copy question page content
434 $clone->copyPageOfQuestion($sourceQuestionId);
435 // copy XHTML media objects
436 $clone->copyXHTMLMediaObjectsOfQuestion($sourceQuestionId);
437 // duplicate the image
438 $clone->copyApplet($sourceQuestionId, $sourceParentId);
439
440 $clone->onCopy($sourceParentId, $sourceQuestionId, $clone->getObjId(), $clone->getId());
441
442 return $clone->id;
443 }
444
445 public function duplicateApplet($question_id, $objectId = null)
446 {
447 $javapath = $this->getJavaPath();
448 $javapath_original = preg_replace("/([^\d])$this->id([^\d])/", "\${1}$question_id\${2}", $javapath);
449
450 if ((int) $objectId > 0) {
451 $javapath_original = str_replace("/$this->obj_id/", "/$objectId/", $javapath_original);
452 }
453
454 if (!file_exists($javapath)) {
455 ilUtil::makeDirParents($javapath);
456 }
458 if (!copy($javapath_original . $filename, $javapath . $filename)) {
459 print "java applet could not be duplicated!!!! ";
460 }
461 }
462
463 public function copyApplet($question_id, $source_questionpool)
464 {
465 $javapath = $this->getJavaPath();
466 $javapath_original = preg_replace("/([^\d])$this->id([^\d])/", "\${1}$question_id\${2}", $javapath);
467 $javapath_original = str_replace("/$this->obj_id/", "/$source_questionpool/", $javapath_original);
468 if (!file_exists($javapath)) {
469 ilUtil::makeDirParents($javapath);
470 }
472 if (!copy($javapath_original . $filename, $javapath . $filename)) {
473 print "java applet could not be copied!!!! ";
474 }
475 }
476
485 public function getJavaCode()
486 {
487 return $this->java_code;
488 }
489
498 public function getJavaCodebase()
499 {
501 }
502
511 public function getJavaArchive()
512 {
513 return $this->java_archive;
514 }
515
524 public function setJavaCode($java_code = "")
525 {
526 $this->java_code = $java_code;
527 }
528
537 public function setJavaCodebase($java_codebase = "")
538 {
539 $this->java_codebase = $java_codebase;
540 }
541
550 public function setJavaArchive($java_archive = "")
551 {
552 $this->java_archive = $java_archive;
553 }
554
563 public function getJavaWidth()
564 {
565 return $this->java_width;
566 }
567
575 public function setJavaWidth($java_width = "")
576 {
577 $this->java_width = $java_width;
578 }
579
588 public function getJavaHeight()
589 {
590 return $this->java_height;
591 }
592
601 public function setJavaHeight($java_height = "")
602 {
603 $this->java_height = $java_height;
604 }
605
617 public function calculateReachedPoints($active_id, $pass = null, $authorizedSolution = true, $returndetails = false)
618 {
619 if ($returndetails) {
620 throw new ilTestException('return details not implemented for ' . __METHOD__);
621 }
622
623 global $DIC;
624 $ilDB = $DIC['ilDB'];
625
626 $found_values = array();
627 if (is_null($pass)) {
628 $pass = $this->getSolutionMaxPass($active_id);
629 }
630
631 $result = $this->getCurrentSolutionResultSet($active_id, $pass, $authorizedSolution);
632
633 $points = 0;
634 while ($data = $ilDB->fetchAssoc($result)) {
635 $points += $data["points"];
636 }
637
638 return $points;
639 }
640
642 {
643 $points = 0;
644 foreach ($previewSession->getParticipantsSolution() as $solution) {
645 if (isset($solution['points'])) {
646 $points += $solution['points'];
647 }
648 }
649
650 $reachedPoints = $this->deductHintPointsFromReachedPoints($previewSession, $points);
651
652 return $this->ensureNonNegativePoints($reachedPoints);
653 }
654
655 // hey: prevPassSolutions - bypass intermediate solution requests and deligate
656 // to own implementation for requests to authorized solutions
657 public function getSolutionValues($active_id, $pass = null, $authorized = true)
658 {
659 if (!$authorized) {
660 return array();
661 }
662
663 return $this->getSolutionValuesRegardlessOfAuthorization($active_id, $pass);
664 }
665
666 public function getSolutionValuesRegardlessOfAuthorization($active_id, $pass = null)
667 {
668 // - similar to getSolutionValues in general
669 // - does not consider "step" in any kind
670 // - returns a customized associative array
671 // - is the original implementation for qtype
672 return $this->getReachedInformation($active_id, $pass);
673 }
674 // hey.
675
684 public function getReachedInformation($active_id, $pass = null)
685 {
686 global $DIC;
687 $ilDB = $DIC['ilDB'];
688
689 $found_values = array();
690 if (is_null($pass)) {
691 $pass = $this->getSolutionMaxPass($active_id);
692 }
693 $result = $ilDB->queryF(
694 "SELECT * FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
695 array('integer','integer','integer'),
696 array($active_id, $this->getId(), $pass)
697 );
698 $counter = 1;
699 $user_result = array();
700 while ($data = $ilDB->fetchAssoc($result)) {
701 $true = 0;
702 if ($data["points"] > 0) {
703 $true = 1;
704 }
705 $solution = array(
706 "order" => $counter,
707 "points" => $data["points"],
708 "true" => $true,
709 "value1" => $data["value1"],
710 "value2" => $data["value2"],
711 );
712 $counter++;
713 array_push($user_result, $solution);
714 }
715 return $user_result;
716 }
717
726 public function addParameter($name = "", $value = "")
727 {
729 if ($index > -1) {
730 $this->parameters[$index] = array("name" => $name, "value" => $value);
731 } else {
732 array_push($this->parameters, array("name" => $name, "value" => $value));
733 }
734 }
735
736 public function addParameterAtIndex($index = 0, $name = "", $value = "")
737 {
738 if (array_key_exists($index, $this->parameters)) {
739 // insert parameter
740 $newparams = array();
741 for ($i = 0; $i < $index; $i++) {
742 array_push($newparams, $this->parameters[$i]);
743 }
744 array_push($newparams, array($name, $value));
745 for ($i = $index; $i < count($this->parameters); $i++) {
746 array_push($newparams, $this->parameters[$i]);
747 }
748 $this->parameters = $newparams;
749 } else {
750 array_push($this->parameters, array($name, $value));
751 }
752 }
753
761 public function removeParameter($index)
762 {
763 if ($index < 0) {
764 return;
765 }
766 if (count($this->parameters) < 1) {
767 return;
768 }
769 if ($index >= count($this->parameters)) {
770 return;
771 }
772 unset($this->parameters[$index]);
773 $this->parameters = array_values($this->parameters);
774 }
775
784 public function getParameter($index)
785 {
786 if (($index < 0) or ($index >= count($this->parameters))) {
787 return undef;
788 }
789 return $this->parameters[$index];
790 }
791
800 public function getParameterIndex($name)
801 {
802 foreach ($this->parameters as $key => $value) {
803 if (array_key_exists($name, $value)) {
804 return $key;
805 }
806 }
807 return -1;
808 }
809
817 public function getParameterCount()
818 {
819 return count($this->parameters);
820 }
821
828 public function flushParams()
829 {
830 $this->parameters = array();
831 }
832
841 public function saveWorkingData($active_id, $pass = null, $authorized = true)
842 {
843 // nothing to save!
844
845 //$this->getProcessLocker()->requestUserSolutionUpdateLock();
846 // store in tst_solutions
847 //$this->getProcessLocker()->releaseUserSolutionUpdateLock();
848
849 return true;
850 }
851
852 protected function savePreviewData(ilAssQuestionPreviewSession $previewSession)
853 {
854 // nothing to save!
855
856 return true;
857 }
858
866 public function getJavaAppletFilename()
867 {
869 }
870
879 public function setJavaAppletFilename($javaapplet_filename, $javaapplet_tempfilename = "")
880 {
881 if (!empty($javaapplet_filename)) {
882 $this->javaapplet_filename = $javaapplet_filename;
883 }
884 if (!empty($javaapplet_tempfilename)) {
885 $javapath = $this->getJavaPath();
886 if (!file_exists($javapath)) {
887 ilUtil::makeDirParents($javapath);
888 }
889
890 if (!ilUtil::moveUploadedFile($javaapplet_tempfilename, $javaapplet_filename, $javapath . $javaapplet_filename)) {
891 $ilLog->write("ERROR: java applet question: java applet not uploaded: $javaapplet_filename");
892 } else {
893 $this->setJavaCodebase();
894 $this->setJavaArchive();
895 }
896 }
897 }
898
899 public function deleteJavaAppletFilename()
900 {
901 @unlink($this->getJavaPath() . $this->getJavaAppletFilename());
902 $this->javaapplet_filename = "";
903 }
904
910 public function getQuestionType()
911 {
912 return "assJavaApplet";
913 }
914
920 public function getAdditionalTableName()
921 {
922 return "qpl_qst_javaapplet";
923 }
924
930 {
931 return parent::getRTETextWithMediaObjects();
932 }
933
937 public function setExportDetailsXLS($worksheet, $startrow, $active_id, $pass)
938 {
939 parent::setExportDetailsXLS($worksheet, $startrow, $active_id, $pass);
940
941 $solutions = $this->getSolutionValues($active_id, $pass);
942
943 $i = 1;
944 foreach ($solutions as $solution) {
945 $worksheet->setCell($startrow + $i, 1, $this->lng->txt("result") . " $i");
946 if (strlen($solution["value1"])) {
947 $worksheet->setCell($startrow + $i, 1, $solution["value1"]);
948 }
949 if (strlen($solution["value2"])) {
950 $worksheet->setCell($startrow + $i, 2, $solution["value2"]);
951 }
952 $i++;
953 }
954
955 return $startrow + $i + 1;
956 }
957
958 public function isAutosaveable()
959 {
960 return false;
961 }
962
971 public function getOperators($expression)
972 {
973 require_once "./Modules/TestQuestionPool/classes/class.ilOperatorsExpressionMapping.php";
975 }
976
981 public function getExpressionTypes()
982 {
983 return array(
986 );
987 }
988
997 public function getUserQuestionResult($active_id, $pass)
998 {
999 $result = new ilUserQuestionResult($this, $active_id, $pass);
1000
1001 $points = $this->calculateReachedPoints($active_id, $pass);
1002 $max_points = $this->getMaximumPoints();
1003
1004 $result->setReachedPercentage(($points / $max_points) * 100);
1005
1006 return $result;
1007 }
1008
1017 public function getAvailableAnswerOptions($index = null)
1018 {
1019 return array();
1020 }
1021
1022 // fau: testNav - new function getTestQuestionConfig()
1027 // hey: refactored identifiers
1029 // hey.
1030 {
1031 // hey: refactored identifiers
1032 return parent::buildTestPresentationConfig()
1033 // hey.
1034 ->setFormChangeDetectionEnabled(false)
1035 ->setBackgroundChangeDetectionEnabled(true);
1036 }
1037 // fau.
1038}
$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.
setLifecycle(ilAssQuestionLifecycle $lifecycle)
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 moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static makeDirParents($a_dir)
Create a new directory and all parent directories.
global $DIC
Definition: goto.php:24
Class iQuestionCondition.
Interface ilObjQuestionScoringAdjustable.
if($format !==null) $name
Definition: metadata.php:230
$index
Definition: metadata.php:128
$i
Definition: metadata.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $ilDB
$data
Definition: storeScorm.php:23