ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 = explode("<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
679 $reachedPoints = $this->deductHintPointsFromReachedPoints($previewSession, $points);
680
681 return $this->ensureNonNegativePoints($reachedPoints);
682 }
683
684 // hey: prevPassSolutions - bypass intermediate solution requests and deligate
685 // to own implementation for requests to authorized solutions
686 public function getSolutionValues($active_id, $pass = NULL, $authorized = true)
687 {
688 if( !$authorized )
689 {
690 return array();
691 }
692
693 return $this->getSolutionValuesRegardlessOfAuthorization($active_id, $pass);
694 }
695
696 public function getSolutionValuesRegardlessOfAuthorization($active_id, $pass = NULL)
697 {
698 // - similar to getSolutionValues in general
699 // - does not consider "step" in any kind
700 // - returns a customized associative array
701 // - is the original implementation for qtype
702 return $this->getReachedInformation($active_id, $pass);
703 }
704 // hey.
705
714 public function getReachedInformation($active_id, $pass = NULL)
715 {
716 global $ilDB;
717
718 $found_values = array();
719 if (is_null($pass))
720 {
721 $pass = $this->getSolutionMaxPass($active_id);
722 }
723 $result = $ilDB->queryF("SELECT * FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
724 array('integer','integer','integer'),
725 array($active_id, $this->getId(), $pass)
726 );
727 $counter = 1;
728 $user_result = array();
729 while ($data = $ilDB->fetchAssoc($result))
730 {
731 $true = 0;
732 if ($data["points"] > 0)
733 {
734 $true = 1;
735 }
736 $solution = array(
737 "order" => $counter,
738 "points" => $data["points"],
739 "true" => $true,
740 "value1" => $data["value1"],
741 "value2" => $data["value2"],
742 );
743 $counter++;
744 array_push($user_result, $solution);
745 }
746 return $user_result;
747 }
748
757 function addParameter($name = "", $value = "")
758 {
759 $index = $this->getParameterIndex($name);
760 if ($index > -1)
761 {
762 $this->parameters[$index] = array("name" => $name, "value" => $value);
763 }
764 else
765 {
766 array_push($this->parameters, array("name" => $name, "value" => $value));
767 }
768 }
769
770 public function addParameterAtIndex($index = 0, $name = "", $value = "")
771 {
772 if (array_key_exists($index, $this->parameters))
773 {
774 // insert parameter
775 $newparams = array();
776 for ($i = 0; $i < $index; $i++)
777 {
778 array_push($newparams, $this->parameters[$i]);
779 }
780 array_push($newparams, array($name, $value));
781 for ($i = $index; $i < count($this->parameters); $i++)
782 {
783 array_push($newparams, $this->parameters[$i]);
784 }
785 $this->parameters = $newparams;
786 }
787 else
788 {
789 array_push($this->parameters, array($name, $value));
790 }
791 }
792
800 public function removeParameter($index)
801 {
802 if ($index < 0) return;
803 if (count($this->parameters) < 1) return;
804 if ($index >= count($this->parameters)) return;
805 unset($this->parameters[$index]);
806 $this->parameters = array_values($this->parameters);
807 }
808
817 function getParameter($index)
818 {
819 if (($index < 0) or ($index >= count($this->parameters)))
820 {
821 return undef;
822 }
823 return $this->parameters[$index];
824 }
825
834 function getParameterIndex($name)
835 {
836 foreach ($this->parameters as $key => $value)
837 {
838 if (array_key_exists($name, $value))
839 {
840 return $key;
841 }
842 }
843 return -1;
844 }
845
854 {
855 return count($this->parameters);
856 }
857
864 function flushParams()
865 {
866 $this->parameters = array();
867 }
868
877 public function saveWorkingData($active_id, $pass = NULL, $authorized = true)
878 {
879 // nothing to save!
880
881 //$this->getProcessLocker()->requestUserSolutionUpdateLock();
882 // store in tst_solutions
883 //$this->getProcessLocker()->releaseUserSolutionUpdateLock();
884
885 return true;
886 }
887
888 protected function savePreviewData(ilAssQuestionPreviewSession $previewSession)
889 {
890 // nothing to save!
891
892 return true;
893 }
894
898 protected function reworkWorkingData($active_id, $pass, $obligationsAnswered, $authorized)
899 {
900 // nothing to rework!
901 }
902
911 {
913 }
914
923 public function setJavaAppletFilename($javaapplet_filename, $javaapplet_tempfilename = "")
924 {
925 if (!empty($javaapplet_filename))
926 {
927 $this->javaapplet_filename = $javaapplet_filename;
928 }
929 if (!empty($javaapplet_tempfilename))
930 {
931 $javapath = $this->getJavaPath();
932 if (!file_exists($javapath))
933 {
934 ilUtil::makeDirParents($javapath);
935 }
936
937 if (!ilUtil::moveUploadedFile($javaapplet_tempfilename, $javaapplet_filename, $javapath.$javaapplet_filename))
938 {
939 $ilLog->write("ERROR: java applet question: java applet not uploaded: $javaapplet_filename");
940 }
941 else
942 {
943 $this->setJavaCodebase();
944 $this->setJavaArchive();
945 }
946 }
947 }
948
950 {
951 @unlink($this->getJavaPath() . $this->getJavaAppletFilename());
952 $this->javaapplet_filename = "";
953 }
954
960 public function getQuestionType()
961 {
962 return "assJavaApplet";
963 }
964
970 public function getAdditionalTableName()
971 {
972 return "qpl_qst_javaapplet";
973 }
974
980 {
981 return parent::getRTETextWithMediaObjects();
982 }
983
987 public function setExportDetailsXLS($worksheet, $startrow, $active_id, $pass)
988 {
989 parent::setExportDetailsXLS($worksheet, $startrow, $active_id, $pass);
990
991 $solutions = $this->getSolutionValues($active_id, $pass);
992
993 $i = 1;
994 foreach ($solutions as $solution)
995 {
996 $worksheet->setCell($startrow + $i, 1, $this->lng->txt("result") . " $i");
997 if (strlen($solution["value1"])) $worksheet->setCell($startrow + $i, 1, $solution["value1"]);
998 if (strlen($solution["value2"])) $worksheet->setCell($startrow + $i, 2, $solution["value2"]);
999 $i++;
1000 }
1001
1002 return $startrow + $i + 1;
1003 }
1004
1005 public function isAutosaveable()
1006 {
1007 return FALSE;
1008 }
1009
1018 public function getOperators($expression)
1019 {
1020 require_once "./Modules/TestQuestionPool/classes/class.ilOperatorsExpressionMapping.php";
1022 }
1023
1028 public function getExpressionTypes()
1029 {
1030 return array(
1033 );
1034 }
1035
1044 public function getUserQuestionResult($active_id, $pass)
1045 {
1046 $result = new ilUserQuestionResult($this, $active_id, $pass);
1047
1048 $points = $this->calculateReachedPoints($active_id, $pass);
1049 $max_points = $this->getMaximumPoints();
1050
1051 $result->setReachedPercentage(($points/$max_points) * 100);
1052
1053 return $result;
1054 }
1055
1064 public function getAvailableAnswerOptions($index = null)
1065 {
1066 return array();
1067 }
1068
1069// fau: testNav - new function getTestQuestionConfig()
1074 // hey: refactored identifiers
1076 // hey.
1077 {
1078 // hey: refactored identifiers
1079 return parent::buildTestPresentationConfig()
1080 // hey.
1081 ->setFormChangeDetectionEnabled(false)
1082 ->setBackgroundChangeDetectionEnabled(true);
1083 }
1084// fau.
1085}
$worksheet
$result
if(! $in) print
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.
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.
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)
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.
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)
reworkWorkingData($active_id, $pass, $obligationsAnswered, $authorized)
{Reworks the allready saved working data if neccessary.}
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 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.
$counter
$params
Definition: example_049.php:96
Class iQuestionCondition.
Interface ilObjQuestionScoringAdjustable.
global $ilDB