ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
4 require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
5 require_once './Modules/Test/classes/inc.AssessmentConstants.php';
6 require_once './Modules/TestQuestionPool/interfaces/interface.ilObjQuestionScoringAdjustable.php';
7 require_once './Modules/TestQuestionPool/interfaces/interface.iQuestionCondition.php';
8 require_once './Modules/TestQuestionPool/classes/class.ilUserQuestionResult.php';
9 
24 {
33 
41  public $java_code;
42 
51 
59  public $java_archive;
60 
68  public $java_width;
69 
77  public $java_height;
78 
86  public $parameters;
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($params_array, "<separator>");
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($params_array, "<separator>");
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 $ilDB;
255  $params = $this->buildParams();
256  // save additional data
257  $ilDB->manipulateF(
258  "DELETE FROM " . $this->getAdditionalTableName() . " WHERE question_fi = %s",
259  array( "integer" ),
260  array( $this->getId() )
261  );
262  $ilDB->manipulateF(
263  "INSERT INTO " . $this->getAdditionalTableName(
264  ) . " (question_fi, image_file, params) VALUES (%s, %s, %s)",
265  array( "integer", "text", "text" ),
266  array(
267  $this->getId(),
268  $this->javaapplet_filename,
269  $params
270  )
271  );
272  }
273 
280  public function loadFromDb($question_id)
281  {
282  global $ilDB;
283 
284  $result = $ilDB->queryF(
285  "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",
286  array("integer"),
287  array($question_id)
288  );
289  if ($result->numRows() == 1) {
290  $data = $ilDB->fetchAssoc($result);
291  $this->setId($question_id);
292  $this->setObjId($data["obj_fi"]);
293  $this->setNrOfTries($data['nr_of_tries']);
294  $this->setTitle($data["title"]);
295  $this->setComment($data["description"]);
296  $this->setOriginalId($data["original_id"]);
297  $this->setAuthor($data["author"]);
298  $this->setPoints($data["points"]);
299  $this->setOwner($data["owner"]);
300  include_once("./Services/RTE/classes/class.ilRTE.php");
301  $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc($data["question_text"], 1));
302  $this->setJavaAppletFilename($data["image_file"]);
303  $this->splitParams($data["params"]);
304  $this->setEstimatedWorkingTime(substr($data["working_time"], 0, 2), substr($data["working_time"], 3, 2), substr($data["working_time"], 6, 2));
305 
306  try {
307  $this->setAdditionalContentEditingMode($data['add_cont_edit_mode']);
308  } catch (ilTestQuestionPoolException $e) {
309  }
310  }
311  parent::loadFromDb($question_id);
312  }
313 
319  public function duplicate($for_test = true, $title = "", $author = "", $owner = "", $testObjId = null)
320  {
321  if ($this->id <= 0) {
322  // The question has not been saved. It cannot be duplicated
323  return;
324  }
325  // duplicate the question in database
326  $this_id = $this->getId();
327  $thisObjId = $this->getObjId();
328 
329  $clone = $this;
330  include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
332  $clone->id = -1;
333 
334  if ((int) $testObjId > 0) {
335  $clone->setObjId($testObjId);
336  }
337 
338  if ($title) {
339  $clone->setTitle($title);
340  }
341  if ($author) {
342  $clone->setAuthor($author);
343  }
344  if ($owner) {
345  $clone->setOwner($owner);
346  }
347  if ($for_test) {
348  $clone->saveToDb($original_id);
349  } else {
350  $clone->saveToDb();
351  }
352 
353  // copy question page content
354  $clone->copyPageOfQuestion($this_id);
355  // copy XHTML media objects
356  $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
357  // duplicate the image
358  $clone->duplicateApplet($this_id, $thisObjId);
359 
360  $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
361 
362  return $clone->id;
363  }
364 
372  public function copyObject($target_questionpool_id, $title = "")
373  {
374  if ($this->id <= 0) {
375  // The question has not been saved. It cannot be duplicated
376  return;
377  }
378  // duplicate the question in database
379  $clone = $this;
380  include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
382  $clone->id = -1;
383  $source_questionpool_id = $this->getObjId();
384  $clone->setObjId($target_questionpool_id);
385  if ($title) {
386  $clone->setTitle($title);
387  }
388  $clone->saveToDb();
389 
390  // copy question page content
391  $clone->copyPageOfQuestion($original_id);
392  // copy XHTML media objects
393  $clone->copyXHTMLMediaObjectsOfQuestion($original_id);
394  // duplicate the image
395  $clone->copyApplet($original_id, $source_questionpool_id);
396 
397  $clone->onCopy($source_questionpool_id, $original_id, $clone->getObjId(), $clone->getId());
398 
399  return $clone->id;
400  }
401 
402  public function createNewOriginalFromThisDuplicate($targetParentId, $targetQuestionTitle = "")
403  {
404  if ($this->id <= 0) {
405  // The question has not been saved. It cannot be duplicated
406  return;
407  }
408 
409  include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
410 
411  $sourceQuestionId = $this->id;
412  $sourceParentId = $this->getObjId();
413 
414  // duplicate the question in database
415  $clone = $this;
416  $clone->id = -1;
417 
418  $clone->setObjId($targetParentId);
419 
420  if ($targetQuestionTitle) {
421  $clone->setTitle($targetQuestionTitle);
422  }
423 
424  $clone->saveToDb();
425  // copy question page content
426  $clone->copyPageOfQuestion($sourceQuestionId);
427  // copy XHTML media objects
428  $clone->copyXHTMLMediaObjectsOfQuestion($sourceQuestionId);
429  // duplicate the image
430  $clone->copyApplet($sourceQuestionId, $sourceParentId);
431 
432  $clone->onCopy($sourceParentId, $sourceQuestionId, $clone->getObjId(), $clone->getId());
433 
434  return $clone->id;
435  }
436 
437  public function duplicateApplet($question_id, $objectId = null)
438  {
439  $javapath = $this->getJavaPath();
440  $javapath_original = preg_replace("/([^\d])$this->id([^\d])/", "\${1}$question_id\${2}", $javapath);
441 
442  if ((int) $objectId > 0) {
443  $javapath_original = str_replace("/$this->obj_id/", "/$objectId/", $javapath_original);
444  }
445 
446  if (!file_exists($javapath)) {
447  ilUtil::makeDirParents($javapath);
448  }
449  $filename = $this->getJavaAppletFilename();
450  if (!copy($javapath_original . $filename, $javapath . $filename)) {
451  print "java applet could not be duplicated!!!! ";
452  }
453  }
454 
455  public function copyApplet($question_id, $source_questionpool)
456  {
457  $javapath = $this->getJavaPath();
458  $javapath_original = preg_replace("/([^\d])$this->id([^\d])/", "\${1}$question_id\${2}", $javapath);
459  $javapath_original = str_replace("/$this->obj_id/", "/$source_questionpool/", $javapath_original);
460  if (!file_exists($javapath)) {
461  ilUtil::makeDirParents($javapath);
462  }
463  $filename = $this->getJavaAppletFilename();
464  if (!copy($javapath_original . $filename, $javapath . $filename)) {
465  print "java applet could not be copied!!!! ";
466  }
467  }
468 
477  public function getJavaCode()
478  {
479  return $this->java_code;
480  }
481 
490  public function getJavaCodebase()
491  {
492  return $this->java_codebase;
493  }
494 
503  public function getJavaArchive()
504  {
505  return $this->java_archive;
506  }
507 
516  public function setJavaCode($java_code = "")
517  {
518  $this->java_code = $java_code;
519  }
520 
529  public function setJavaCodebase($java_codebase = "")
530  {
531  $this->java_codebase = $java_codebase;
532  }
533 
542  public function setJavaArchive($java_archive = "")
543  {
544  $this->java_archive = $java_archive;
545  }
546 
555  public function getJavaWidth()
556  {
557  return $this->java_width;
558  }
559 
567  public function setJavaWidth($java_width = "")
568  {
569  $this->java_width = $java_width;
570  }
571 
580  public function getJavaHeight()
581  {
582  return $this->java_height;
583  }
584 
593  public function setJavaHeight($java_height = "")
594  {
595  $this->java_height = $java_height;
596  }
597 
609  public function calculateReachedPoints($active_id, $pass = null, $authorizedSolution = true, $returndetails = false)
610  {
611  if ($returndetails) {
612  throw new ilTestException('return details not implemented for ' . __METHOD__);
613  }
614 
615  global $ilDB;
616 
617  $found_values = array();
618  if (is_null($pass)) {
619  $pass = $this->getSolutionMaxPass($active_id);
620  }
621 
622  $result = $this->getCurrentSolutionResultSet($active_id, $pass, $authorizedSolution);
623 
624  $points = 0;
625  while ($data = $ilDB->fetchAssoc($result)) {
626  $points += $data["points"];
627  }
628 
629  return $points;
630  }
631 
633  {
634  $points = 0;
635  foreach ($previewSession->getParticipantsSolution() as $solution) {
636  if (isset($solution['points'])) {
637  $points += $solution['points'];
638  }
639  }
640 
641  $reachedPoints = $this->deductHintPointsFromReachedPoints($previewSession, $points);
642 
643  return $this->ensureNonNegativePoints($reachedPoints);
644  }
645 
646  // hey: prevPassSolutions - bypass intermediate solution requests and deligate
647  // to own implementation for requests to authorized solutions
648  public function getSolutionValues($active_id, $pass = null, $authorized = true)
649  {
650  if (!$authorized) {
651  return array();
652  }
653 
654  return $this->getSolutionValuesRegardlessOfAuthorization($active_id, $pass);
655  }
656 
657  public function getSolutionValuesRegardlessOfAuthorization($active_id, $pass = null)
658  {
659  // - similar to getSolutionValues in general
660  // - does not consider "step" in any kind
661  // - returns a customized associative array
662  // - is the original implementation for qtype
663  return $this->getReachedInformation($active_id, $pass);
664  }
665  // hey.
666 
675  public function getReachedInformation($active_id, $pass = null)
676  {
677  global $ilDB;
678 
679  $found_values = array();
680  if (is_null($pass)) {
681  $pass = $this->getSolutionMaxPass($active_id);
682  }
683  $result = $ilDB->queryF(
684  "SELECT * FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
685  array('integer','integer','integer'),
686  array($active_id, $this->getId(), $pass)
687  );
688  $counter = 1;
689  $user_result = array();
690  while ($data = $ilDB->fetchAssoc($result)) {
691  $true = 0;
692  if ($data["points"] > 0) {
693  $true = 1;
694  }
695  $solution = array(
696  "order" => $counter,
697  "points" => $data["points"],
698  "true" => $true,
699  "value1" => $data["value1"],
700  "value2" => $data["value2"],
701  );
702  $counter++;
703  array_push($user_result, $solution);
704  }
705  return $user_result;
706  }
707 
716  public function addParameter($name = "", $value = "")
717  {
718  $index = $this->getParameterIndex($name);
719  if ($index > -1) {
720  $this->parameters[$index] = array("name" => $name, "value" => $value);
721  } else {
722  array_push($this->parameters, array("name" => $name, "value" => $value));
723  }
724  }
725 
726  public function addParameterAtIndex($index = 0, $name = "", $value = "")
727  {
728  if (array_key_exists($index, $this->parameters)) {
729  // insert parameter
730  $newparams = array();
731  for ($i = 0; $i < $index; $i++) {
732  array_push($newparams, $this->parameters[$i]);
733  }
734  array_push($newparams, array($name, $value));
735  for ($i = $index; $i < count($this->parameters); $i++) {
736  array_push($newparams, $this->parameters[$i]);
737  }
738  $this->parameters = $newparams;
739  } else {
740  array_push($this->parameters, array($name, $value));
741  }
742  }
743 
751  public function removeParameter($index)
752  {
753  if ($index < 0) {
754  return;
755  }
756  if (count($this->parameters) < 1) {
757  return;
758  }
759  if ($index >= count($this->parameters)) {
760  return;
761  }
762  unset($this->parameters[$index]);
763  $this->parameters = array_values($this->parameters);
764  }
765 
774  public function getParameter($index)
775  {
776  if (($index < 0) or ($index >= count($this->parameters))) {
777  return undef;
778  }
779  return $this->parameters[$index];
780  }
781 
790  public function getParameterIndex($name)
791  {
792  foreach ($this->parameters as $key => $value) {
793  if (array_key_exists($name, $value)) {
794  return $key;
795  }
796  }
797  return -1;
798  }
799 
807  public function getParameterCount()
808  {
809  return count($this->parameters);
810  }
811 
818  public function flushParams()
819  {
820  $this->parameters = array();
821  }
822 
831  public function saveWorkingData($active_id, $pass = null, $authorized = true)
832  {
833  // nothing to save!
834 
835  //$this->getProcessLocker()->requestUserSolutionUpdateLock();
836  // store in tst_solutions
837  //$this->getProcessLocker()->releaseUserSolutionUpdateLock();
838 
839  return true;
840  }
841 
842  protected function savePreviewData(ilAssQuestionPreviewSession $previewSession)
843  {
844  // nothing to save!
845 
846  return true;
847  }
848 
852  protected function reworkWorkingData($active_id, $pass, $obligationsAnswered, $authorized)
853  {
854  // nothing to rework!
855  }
856 
864  public function getJavaAppletFilename()
865  {
867  }
868 
877  public function setJavaAppletFilename($javaapplet_filename, $javaapplet_tempfilename = "")
878  {
879  if (!empty($javaapplet_filename)) {
880  $this->javaapplet_filename = $javaapplet_filename;
881  }
882  if (!empty($javaapplet_tempfilename)) {
883  $javapath = $this->getJavaPath();
884  if (!file_exists($javapath)) {
885  ilUtil::makeDirParents($javapath);
886  }
887 
888  if (!ilUtil::moveUploadedFile($javaapplet_tempfilename, $javaapplet_filename, $javapath . $javaapplet_filename)) {
889  $ilLog->write("ERROR: java applet question: java applet not uploaded: $javaapplet_filename");
890  } else {
891  $this->setJavaCodebase();
892  $this->setJavaArchive();
893  }
894  }
895  }
896 
897  public function deleteJavaAppletFilename()
898  {
899  @unlink($this->getJavaPath() . $this->getJavaAppletFilename());
900  $this->javaapplet_filename = "";
901  }
902 
908  public function getQuestionType()
909  {
910  return "assJavaApplet";
911  }
912 
918  public function getAdditionalTableName()
919  {
920  return "qpl_qst_javaapplet";
921  }
922 
927  public function getRTETextWithMediaObjects()
928  {
929  return parent::getRTETextWithMediaObjects();
930  }
931 
935  public function setExportDetailsXLS($worksheet, $startrow, $active_id, $pass)
936  {
937  parent::setExportDetailsXLS($worksheet, $startrow, $active_id, $pass);
938 
939  $solutions = $this->getSolutionValues($active_id, $pass);
940 
941  $i = 1;
942  foreach ($solutions as $solution) {
943  $worksheet->setCell($startrow + $i, 1, $this->lng->txt("result") . " $i");
944  if (strlen($solution["value1"])) {
945  $worksheet->setCell($startrow + $i, 1, $solution["value1"]);
946  }
947  if (strlen($solution["value2"])) {
948  $worksheet->setCell($startrow + $i, 2, $solution["value2"]);
949  }
950  $i++;
951  }
952 
953  return $startrow + $i + 1;
954  }
955 
956  public function isAutosaveable()
957  {
958  return false;
959  }
960 
969  public function getOperators($expression)
970  {
971  require_once "./Modules/TestQuestionPool/classes/class.ilOperatorsExpressionMapping.php";
973  }
974 
979  public function getExpressionTypes()
980  {
981  return array(
984  );
985  }
986 
995  public function getUserQuestionResult($active_id, $pass)
996  {
997  $result = new ilUserQuestionResult($this, $active_id, $pass);
998 
999  $points = $this->calculateReachedPoints($active_id, $pass);
1000  $max_points = $this->getMaximumPoints();
1001 
1002  $result->setReachedPercentage(($points/$max_points) * 100);
1003 
1004  return $result;
1005  }
1006 
1015  public function getAvailableAnswerOptions($index = null)
1016  {
1017  return array();
1018  }
1019 
1020  // fau: testNav - new function getTestQuestionConfig()
1025  // hey: refactored identifiers
1027  // hey.
1028  {
1029  // hey: refactored identifiers
1030  return parent::buildTestPresentationConfig()
1031  // hey.
1032  ->setFormChangeDetectionEnabled(false)
1033  ->setBackgroundChangeDetectionEnabled(true);
1034  }
1035  // fau.
1036 }
duplicateApplet($question_id, $objectId=null)
$params
Definition: disable.php:11
getParameterIndex($name)
Returns the index of an applet parameter.
static makeDirParents($a_dir)
Create a new directory and all parent directories.
addParameter($name="", $value="")
Adds a new parameter value to the parameter list.
getId()
Gets the id of the assQuestion object.
getAvailableAnswerOptions($index=null)
If index is null, the function returns an array with all anwser options Else it returns the specific ...
static _getOriginalId($question_id)
Returns the original id of a question.
$worksheet
Class iQuestionCondition.
setExportDetailsXLS($worksheet, $startrow, $active_id, $pass)
{}
getQuestionType()
Returns the question type of the question.
flushParams()
Removes all applet parameters.
$result
getJavaWidth()
Returns the java applet width parameter.
calculateReachedPointsFromPreviewSession(ilAssQuestionPreviewSession $previewSession)
getPoints()
Returns the maximum available points for the question.
duplicate($for_test=true, $title="", $author="", $owner="", $testObjId=null)
Duplicates an assJavaApplet.
Abstract basic class which is to be extended by the concrete assessment question type classes...
getSolutionValuesRegardlessOfAuthorization($active_id, $pass=null)
getAdditionalTableName()
Returns the name of the additional question data table in the database.
saveAdditionalQuestionDataToDb()
Saves a record to the question types additional data table.
saveWorkingData($active_id, $pass=null, $authorized=true)
Saves the learners input of the question to the database.
setJavaHeight($java_height="")
Sets the java applet height parameter.
ensureNonNegativePoints($points)
createNewOriginalFromThisDuplicate($targetParentId, $targetQuestionTitle="")
setId($id=-1)
Sets the id of the assQuestion object.
setJavaArchive($java_archive="")
Sets the java applet archive parameter.
getSolutionMaxPass($active_id)
Returns the maximum pass a users question solution.
splitParams($params="")
Sets the applet parameters from a parameter string containing all parameters in a list...
setEstimatedWorkingTime($hour=0, $min=0, $sec=0)
Sets the estimated working time of a question from given hour, minute and second. ...
getSolutionValues($active_id, $pass=null, $authorized=true)
addParameterAtIndex($index=0, $name="", $value="")
$index
Definition: metadata.php:60
getJavaPath()
Returns the image path for web accessable images of a question.
Class for Java Applet Questions.
copyApplet($question_id, $source_questionpool)
getMaximumPoints()
Returns the maximum points, a learner can reach answering the question.
loadFromDb($question_id)
Loads a assJavaApplet object from a database.
buildParamsOnly()
Returns a string containing the additional applet parameters.
setNrOfTries($a_nr_of_tries)
getParameterCount()
Returns the number of additional applet parameters.
setAdditionalContentEditingMode($additinalContentEditingMode)
setter for additional content editing mode for this question
setJavaWidth($java_width="")
Sets the java applet width parameter.
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...
getObjId()
Get the object id of the container object.
Base Exception for all Exceptions relating to Modules/Test.
$counter
saveToDb($original_id="")
Saves a assJavaApplet object to a database.
if($format !==null) $name
Definition: metadata.php:146
setAuthor($author="")
Sets the authors name of the assQuestion object.
getRTETextWithMediaObjects()
Collects all text in the question which could contain media objects which were created with the Rich ...
getJavaHeight()
Returns the java applet height parameter.
getJavaAppletFilename()
Gets the java applet file name.
getParameter($index)
Returns the paramter at a given index.
Class ilUserQuestionResult.
reworkWorkingData($active_id, $pass, $obligationsAnswered, $authorized)
{}
removeParameter($index)
Removes a parameter value from the parameter list.
getOperators($expression)
Get all available operations for a specific question.
getJavaCodebase()
Returns the java applet codebase parameter.
savePreviewData(ilAssQuestionPreviewSession $previewSession)
calculateReachedPoints($active_id, $pass=null, $authorizedSolution=true, $returndetails=false)
Returns the points, a learner has reached answering the question.
Create styles array
The data for the language used.
buildTestPresentationConfig()
Get the test question configuration.
deductHintPointsFromReachedPoints(ilAssQuestionPreviewSession $previewSession, $reachedPoints)
setPoints($a_points)
Sets the maximum available points for the question.
saveQuestionDataToDb($original_id="")
__construct( $title="", $comment="", $author="", $owner=-1, $question="", $javaapplet_filename="")
assJavaApplet constructor
setJavaAppletFilename($javaapplet_filename, $javaapplet_tempfilename="")
Sets the java applet file name.
setJavaCodebase($java_codebase="")
Sets the java applet codebase parameter.
getJavaArchive()
Returns the java applet archive parameter.
setQuestion($question="")
Sets the question string of the question object.
Interface ilObjQuestionScoringAdjustable.
global $ilDB
setOriginalId($original_id)
buildParams()
Returns a string containing the applet parameters.
getCurrentSolutionResultSet($active_id, $pass, $authorized=true)
Get a restulset for the current user solution for a this question by active_id and pass...
$i
Definition: disco.tpl.php:19
isComplete()
Returns true, if a imagemap question is complete for use.
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.
getUserQuestionResult($active_id, $pass)
Get the user solution for a question by active_id and the test pass.
getJavaCode()
Returns the java applet code parameter.
setTitle($title="")
Sets the title string of the assQuestion object.
setObjId($obj_id=0)
Set the object id of the container object.
copyObject($target_questionpool_id, $title="")
Copies an assJavaApplet object.
$key
Definition: croninfo.php:18
setComment($comment="")
Sets the comment string of the assQuestion object.
setJavaCode($java_code="")
Sets the java applet code parameter.
setOwner($owner="")
Sets the creator/owner ID of the assQuestion object.