ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
42
51
60
69
78
87
102 function __construct(
103 $title = "",
104 $comment = "",
105 $author = "",
106 $owner = -1,
107 $question = "",
109 )
110 {
111 parent::__construct($title, $comment, $author, $owner, $question);
112 $this->javaapplet_filename = $javaapplet_filename;
113 $this->parameters = array();
114 }
115
123 public function splitParams($params = "")
124 {
125 $params_array = split("<separator>", $params);
126 foreach ($params_array as $pair)
127 {
128 if (preg_match("/(.*?)\=(.*)/", $pair, $matches))
129 {
130 switch ($matches[1])
131 {
132 case "java_code" :
133 $this->java_code = $matches[2];
134 break;
135 case "java_codebase" :
136 $this->java_codebase = $matches[2];
137 break;
138 case "java_archive" :
139 $this->java_archive = $matches[2];
140 break;
141 case "java_width" :
142 $this->java_width = $matches[2];
143 break;
144 case "java_height" :
145 $this->java_height = $matches[2];
146 break;
147 }
148 if (preg_match("/param_name_(\d+)/", $matches[1], $found_key))
149 {
150 $this->parameters[$found_key[1]]["name"] = $matches[2];
151 }
152 if (preg_match("/param_value_(\d+)/", $matches[1], $found_key))
153 {
154 $this->parameters[$found_key[1]]["value"] = $matches[2];
155 }
156 }
157 }
158 }
159
167 public function buildParams()
168 {
169 $params_array = array();
170 if ($this->java_code)
171 {
172 array_push($params_array, "java_code=$this->java_code");
173 }
174 if ($this->java_codebase)
175 {
176 array_push($params_array, "java_codebase=$this->java_codebase");
177 }
178 if ($this->java_archive)
179 {
180 array_push($params_array, "java_archive=$this->java_archive");
181 }
182 if ($this->java_width)
183 {
184 array_push($params_array, "java_width=$this->java_width");
185 }
186 if ($this->java_height)
187 {
188 array_push($params_array, "java_height=$this->java_height");
189 }
190 foreach ($this->parameters as $key => $value)
191 {
192 array_push($params_array, "param_name_$key=" . $value["name"]);
193 array_push($params_array, "param_value_$key=" . $value["value"]);
194 }
195
196 return join($params_array, "<separator>");
197 }
198
204 public function buildParamsOnly()
205 {
206 $params_array = array();
207 if ($this->java_code)
208 {
209 array_push($params_array, "java_code=$this->java_code");
210 array_push($params_array, "java_codebase=$this->java_codebase");
211 array_push($params_array, "java_archive=$this->java_archive");
212 }
213 foreach ($this->parameters as $key => $value)
214 {
215 array_push($params_array, "param_name_$key=" . $value["name"]);
216 array_push($params_array, "param_value_$key=" . $value["value"]);
217 }
218 return join($params_array, "<separator>");
219 }
220
226 public function isComplete()
227 {
228 if (strlen($this->title)
229 && $this->author
230 && $this->question
231 && $this->javaapplet_filename
232 && $this->java_width
233 && $this->java_height
234 && $this->getPoints() > 0
235 )
236 {
237 return true;
238 }
239 else if (strlen($this->title)
240 && $this->author
241 && $this->question
242 && $this->getJavaArchive()
243 && $this->getJavaCodebase()
244 && $this->java_width
245 && $this->java_height
246 && $this->getPoints() > 0
247 )
248 {
249 return true;
250 }
251 return false;
252 }
253
254
262 public function saveToDb($original_id = "")
263 {
266 parent::saveToDb($original_id);
267 }
268
270 {
271 global $ilDB;
272 $params = $this->buildParams();
273 // save additional data
274 $ilDB->manipulateF( "DELETE FROM " . $this->getAdditionalTableName() . " WHERE question_fi = %s",
275 array( "integer" ),
276 array( $this->getId() )
277 );
278 $ilDB->manipulateF( "INSERT INTO " . $this->getAdditionalTableName(
279 ) . " (question_fi, image_file, params) VALUES (%s, %s, %s)",
280 array( "integer", "text", "text" ),
281 array(
282 $this->getId(),
283 $this->javaapplet_filename,
284 $params
285 )
286 );
287 }
288
295 public function loadFromDb($question_id)
296 {
297 global $ilDB;
298
299 $result = $ilDB->queryF("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",
300 array("integer"),
301 array($question_id)
302 );
303 if ($result->numRows() == 1)
304 {
305 $data = $ilDB->fetchAssoc($result);
306 $this->setId($question_id);
307 $this->setObjId($data["obj_fi"]);
308 $this->setNrOfTries($data['nr_of_tries']);
309 $this->setTitle($data["title"]);
310 $this->setComment($data["description"]);
311 $this->setOriginalId($data["original_id"]);
312 $this->setAuthor($data["author"]);
313 $this->setPoints($data["points"]);
314 $this->setOwner($data["owner"]);
315 include_once("./Services/RTE/classes/class.ilRTE.php");
316 $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc($data["question_text"], 1));
317 $this->setJavaAppletFilename($data["image_file"]);
318 $this->splitParams($data["params"]);
319 $this->setEstimatedWorkingTime(substr($data["working_time"], 0, 2), substr($data["working_time"], 3, 2), substr($data["working_time"], 6, 2));
320
321 try
322 {
323 $this->setAdditionalContentEditingMode($data['add_cont_edit_mode']);
324 }
326 {
327 }
328 }
329 parent::loadFromDb($question_id);
330 }
331
337 function duplicate($for_test = true, $title = "", $author = "", $owner = "", $testObjId = null)
338 {
339 if ($this->id <= 0)
340 {
341 // The question has not been saved. It cannot be duplicated
342 return;
343 }
344 // duplicate the question in database
345 $this_id = $this->getId();
346 $thisObjId = $this->getObjId();
347
348 $clone = $this;
349 include_once ("./Modules/TestQuestionPool/classes/class.assQuestion.php");
351 $clone->id = -1;
352
353 if( (int)$testObjId > 0 )
354 {
355 $clone->setObjId($testObjId);
356 }
357
358 if ($title)
359 {
360 $clone->setTitle($title);
361 }
362 if ($author)
363 {
364 $clone->setAuthor($author);
365 }
366 if ($owner)
367 {
368 $clone->setOwner($owner);
369 }
370 if ($for_test)
371 {
372 $clone->saveToDb($original_id);
373 }
374 else
375 {
376 $clone->saveToDb();
377 }
378
379 // copy question page content
380 $clone->copyPageOfQuestion($this_id);
381 // copy XHTML media objects
382 $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
383 // duplicate the image
384 $clone->duplicateApplet($this_id, $thisObjId);
385
386 $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
387
388 return $clone->id;
389 }
390
398 function copyObject($target_questionpool_id, $title = "")
399 {
400 if ($this->id <= 0)
401 {
402 // The question has not been saved. It cannot be duplicated
403 return;
404 }
405 // duplicate the question in database
406 $clone = $this;
407 include_once ("./Modules/TestQuestionPool/classes/class.assQuestion.php");
409 $clone->id = -1;
410 $source_questionpool_id = $this->getObjId();
411 $clone->setObjId($target_questionpool_id);
412 if ($title)
413 {
414 $clone->setTitle($title);
415 }
416 $clone->saveToDb();
417
418 // copy question page content
419 $clone->copyPageOfQuestion($original_id);
420 // copy XHTML media objects
421 $clone->copyXHTMLMediaObjectsOfQuestion($original_id);
422 // duplicate the image
423 $clone->copyApplet($original_id, $source_questionpool_id);
424
425 $clone->onCopy($source_questionpool_id, $original_id, $clone->getObjId(), $clone->getId());
426
427 return $clone->id;
428 }
429
430 public function createNewOriginalFromThisDuplicate($targetParentId, $targetQuestionTitle = "")
431 {
432 if ($this->id <= 0)
433 {
434 // The question has not been saved. It cannot be duplicated
435 return;
436 }
437
438 include_once ("./Modules/TestQuestionPool/classes/class.assQuestion.php");
439
440 $sourceQuestionId = $this->id;
441 $sourceParentId = $this->getObjId();
442
443 // duplicate the question in database
444 $clone = $this;
445 $clone->id = -1;
446
447 $clone->setObjId($targetParentId);
448
449 if ($targetQuestionTitle)
450 {
451 $clone->setTitle($targetQuestionTitle);
452 }
453
454 $clone->saveToDb();
455 // copy question page content
456 $clone->copyPageOfQuestion($sourceQuestionId);
457 // copy XHTML media objects
458 $clone->copyXHTMLMediaObjectsOfQuestion($sourceQuestionId);
459 // duplicate the image
460 $clone->copyApplet($sourceQuestionId, $sourceParentId);
461
462 $clone->onCopy($sourceParentId, $sourceQuestionId, $clone->getObjId(), $clone->getId());
463
464 return $clone->id;
465 }
466
467 function duplicateApplet($question_id, $objectId = null)
468 {
469 $javapath = $this->getJavaPath();
470 $javapath_original = preg_replace("/([^\d])$this->id([^\d])/", "\${1}$question_id\${2}", $javapath);
471
472 if( (int)$objectId > 0 )
473 {
474 $javapath_original = str_replace("/$this->obj_id/", "/$objectId/", $javapath_original);
475 }
476
477 if (!file_exists($javapath))
478 {
479 ilUtil::makeDirParents($javapath);
480 }
482 if (!copy($javapath_original . $filename, $javapath . $filename)) {
483 print "java applet could not be duplicated!!!! ";
484 }
485 }
486
487 function copyApplet($question_id, $source_questionpool)
488 {
489 $javapath = $this->getJavaPath();
490 $javapath_original = preg_replace("/([^\d])$this->id([^\d])/", "\${1}$question_id\${2}", $javapath);
491 $javapath_original = str_replace("/$this->obj_id/", "/$source_questionpool/", $javapath_original);
492 if (!file_exists($javapath))
493 {
494 ilUtil::makeDirParents($javapath);
495 }
497 if (!copy($javapath_original . $filename, $javapath . $filename)) {
498 print "java applet could not be copied!!!! ";
499 }
500 }
501
510 function getJavaCode()
511 {
512 return $this->java_code;
513 }
514
524 {
526 }
527
536 function getJavaArchive()
537 {
538 return $this->java_archive;
539 }
540
549 function setJavaCode($java_code = "")
550 {
551 $this->java_code = $java_code;
552 }
553
563 {
564 $this->java_codebase = $java_codebase;
565 }
566
576 {
577 $this->java_archive = $java_archive;
578 }
579
588 function getJavaWidth()
589 {
590 return $this->java_width;
591 }
592
600 public function setJavaWidth($java_width = "")
601 {
602 $this->java_width = $java_width;
603 }
604
613 function getJavaHeight()
614 {
615 return $this->java_height;
616 }
617
627 {
628 $this->java_height = $java_height;
629 }
630
642 public function calculateReachedPoints($active_id, $pass = NULL, $authorizedSolution = true, $returndetails = FALSE)
643 {
644 if( $returndetails )
645 {
646 throw new ilTestException('return details not implemented for '.__METHOD__);
647 }
648
649 global $ilDB;
650
651 $found_values = array();
652 if (is_null($pass))
653 {
654 $pass = $this->getSolutionMaxPass($active_id);
655 }
656
657 $result = $this->getCurrentSolutionResultSet($active_id, $pass, $authorizedSolution);
658
659 $points = 0;
660 while ($data = $ilDB->fetchAssoc($result))
661 {
662 $points += $data["points"];
663 }
664
665 return $points;
666 }
667
669 {
670 $points = 0;
671 foreach($previewSession->getParticipantsSolution() as $solution)
672 {
673 if( isset($solution['points']) )
674 {
675 $points += $solution['points'];
676 }
677 }
678 return $points;
679 }
680
681 // hey: prevPassSolutions - bypass intermediate solution requests and deligate
682 // to own implementation for requests to authorized solutions
683 public function getSolutionValues($active_id, $pass = NULL, $authorized = true)
684 {
685 if( !$authorized )
686 {
687 return array();
688 }
689
690 return $this->getSolutionValuesRegardlessOfAuthorization($active_id, $pass);
691 }
692
693 public function getSolutionValuesRegardlessOfAuthorization($active_id, $pass = NULL)
694 {
695 // - similar to getSolutionValues in general
696 // - does not consider "step" in any kind
697 // - returns a customized associative array
698 // - is the original implementation for qtype
699 return $this->getReachedInformation($active_id, $pass);
700 }
701 // hey.
702
711 public function getReachedInformation($active_id, $pass = NULL)
712 {
713 global $ilDB;
714
715 $found_values = array();
716 if (is_null($pass))
717 {
718 $pass = $this->getSolutionMaxPass($active_id);
719 }
720 $result = $ilDB->queryF("SELECT * FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
721 array('integer','integer','integer'),
722 array($active_id, $this->getId(), $pass)
723 );
724 $counter = 1;
725 $user_result = array();
726 while ($data = $ilDB->fetchAssoc($result))
727 {
728 $true = 0;
729 if ($data["points"] > 0)
730 {
731 $true = 1;
732 }
733 $solution = array(
734 "order" => $counter,
735 "points" => $data["points"],
736 "true" => $true,
737 "value1" => $data["value1"],
738 "value2" => $data["value2"],
739 );
740 $counter++;
741 array_push($user_result, $solution);
742 }
743 return $user_result;
744 }
745
754 function addParameter($name = "", $value = "")
755 {
756 $index = $this->getParameterIndex($name);
757 if ($index > -1)
758 {
759 $this->parameters[$index] = array("name" => $name, "value" => $value);
760 }
761 else
762 {
763 array_push($this->parameters, array("name" => $name, "value" => $value));
764 }
765 }
766
767 public function addParameterAtIndex($index = 0, $name = "", $value = "")
768 {
769 if (array_key_exists($index, $this->parameters))
770 {
771 // insert parameter
772 $newparams = array();
773 for ($i = 0; $i < $index; $i++)
774 {
775 array_push($newparams, $this->parameters[$i]);
776 }
777 array_push($newparams, array($name, $value));
778 for ($i = $index; $i < count($this->parameters); $i++)
779 {
780 array_push($newparams, $this->parameters[$i]);
781 }
782 $this->parameters = $newparams;
783 }
784 else
785 {
786 array_push($this->parameters, array($name, $value));
787 }
788 }
789
797 public function removeParameter($index)
798 {
799 if ($index < 0) return;
800 if (count($this->parameters) < 1) return;
801 if ($index >= count($this->parameters)) return;
802 unset($this->parameters[$index]);
803 $this->parameters = array_values($this->parameters);
804 }
805
814 function getParameter($index)
815 {
816 if (($index < 0) or ($index >= count($this->parameters)))
817 {
818 return undef;
819 }
820 return $this->parameters[$index];
821 }
822
831 function getParameterIndex($name)
832 {
833 foreach ($this->parameters as $key => $value)
834 {
835 if (array_key_exists($name, $value))
836 {
837 return $key;
838 }
839 }
840 return -1;
841 }
842
851 {
852 return count($this->parameters);
853 }
854
861 function flushParams()
862 {
863 $this->parameters = array();
864 }
865
874 public function saveWorkingData($active_id, $pass = NULL, $authorized = true)
875 {
876 // nothing to save!
877
878 //$this->getProcessLocker()->requestUserSolutionUpdateLock();
879 // store in tst_solutions
880 //$this->getProcessLocker()->releaseUserSolutionUpdateLock();
881
882 return true;
883 }
884
885 protected function savePreviewData(ilAssQuestionPreviewSession $previewSession)
886 {
887 // nothing to save!
888
889 return true;
890 }
891
899 protected function reworkWorkingData($active_id, $pass, $obligationsAnswered)
900 {
901 // nothing to rework!
902 }
903
912 {
914 }
915
924 public function setJavaAppletFilename($javaapplet_filename, $javaapplet_tempfilename = "")
925 {
926 if (!empty($javaapplet_filename))
927 {
928 $this->javaapplet_filename = $javaapplet_filename;
929 }
930 if (!empty($javaapplet_tempfilename))
931 {
932 $javapath = $this->getJavaPath();
933 if (!file_exists($javapath))
934 {
935 ilUtil::makeDirParents($javapath);
936 }
937
938 if (!ilUtil::moveUploadedFile($javaapplet_tempfilename, $javaapplet_filename, $javapath.$javaapplet_filename))
939 {
940 $ilLog->write("ERROR: java applet question: java applet not uploaded: $javaapplet_filename");
941 }
942 else
943 {
944 $this->setJavaCodebase();
945 $this->setJavaArchive();
946 }
947 }
948 }
949
951 {
952 @unlink($this->getJavaPath() . $this->getJavaAppletFilename());
953 $this->javaapplet_filename = "";
954 }
955
961 public function getQuestionType()
962 {
963 return "assJavaApplet";
964 }
965
971 public function getAdditionalTableName()
972 {
973 return "qpl_qst_javaapplet";
974 }
975
981 {
982 return parent::getRTETextWithMediaObjects();
983 }
984
997 public function setExportDetailsXLS(&$worksheet, $startrow, $active_id, $pass, &$format_title, &$format_bold)
998 {
999 include_once ("./Services/Excel/classes/class.ilExcelUtils.php");
1000 $solutions = $this->getSolutionValues($active_id, $pass);
1001 $worksheet->writeString($startrow, 0, ilExcelUtils::_convert_text($this->lng->txt($this->getQuestionType())), $format_title);
1002 $worksheet->writeString($startrow, 1, ilExcelUtils::_convert_text($this->getTitle()), $format_title);
1003 $i = 1;
1004 foreach ($solutions as $solution)
1005 {
1006 $worksheet->write($startrow + $i, 1, ilExcelUtils::_convert_text($this->lng->txt("result") . " $i"));
1007 if (strlen($solution["value1"])) $worksheet->write($startrow + $i, 1, ilExcelUtils::_convert_text($solution["value1"]));
1008 if (strlen($solution["value2"])) $worksheet->write($startrow + $i, 2, ilExcelUtils::_convert_text($solution["value2"]));
1009 $i++;
1010 }
1011 return $startrow + $i + 1;
1012 }
1013
1014 public function isAutosaveable()
1015 {
1016 return FALSE;
1017 }
1018
1027 public function getOperators($expression)
1028 {
1029 require_once "./Modules/TestQuestionPool/classes/class.ilOperatorsExpressionMapping.php";
1031 }
1032
1037 public function getExpressionTypes()
1038 {
1039 return array(
1042 );
1043 }
1044
1053 public function getUserQuestionResult($active_id, $pass)
1054 {
1055 $result = new ilUserQuestionResult($this, $active_id, $pass);
1056
1057 $points = $this->calculateReachedPoints($active_id, $pass);
1058 $max_points = $this->getMaximumPoints();
1059
1060 $result->setReachedPercentage(($points/$max_points) * 100);
1061
1062 return $result;
1063 }
1064
1073 public function getAvailableAnswerOptions($index = null)
1074 {
1075 return array();
1076 }
1077}
$result
$filename
Definition: buildRTE.php:89
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="")
reworkWorkingData($active_id, $pass, $obligationsAnswered)
Reworks the allready saved working data if neccessary.
setJavaCode($java_code="")
Sets the java applet code parameter.
calculateReachedPoints($active_id, $pass=NULL, $authorizedSolution=true, $returndetails=FALSE)
Returns the points, a learner has reached answering 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.
saveWorkingData($active_id, $pass=NULL, $authorized=true)
Saves the learners input of the question to the database.
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.
setExportDetailsXLS(&$worksheet, $startrow, $active_id, $pass, &$format_title, &$format_bold)
Creates an Excel worksheet for the detailed cumulated results of this question.
getJavaAppletFilename()
Gets the java applet file name.
duplicate($for_test=true, $title="", $author="", $owner="", $testObjId=null)
Duplicates an assJavaApplet.
getReachedInformation($active_id, $pass=NULL)
Returns the evaluation data, a learner has entered to answer the question.
getExpressionTypes()
Get all available expression types for a specific question.
buildParams()
Returns a string containing the applet parameters.
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)
Reworks the allready saved working data if neccessary.
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)
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.
getSolutionValuesRegardlessOfAuthorization($active_id, $pass=NULL)
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.
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.
setAuthor($author="")
Sets the authors name of the assQuestion object.
getPoints()
Returns the maximum available points for the question.
getTitle()
Gets the title string of the assQuestion object.
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.
_convert_text($a_text, $a_target="has been removed")
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.
$data
$params
Definition: example_049.php:96
if(! $in) print
Class iQuestionCondition.
Interface ilObjQuestionScoringAdjustable.
global $ilDB