23 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
24 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
62 $this->parameters = array();
76 if (strlen($this->title) and ($this->author) and ($this->question) and ($this->
getMaximumPoints() > 0) and (strlen($this->
getApplet())))
98 $affectedRows = $ilDB->manipulateF(
"DELETE FROM " . $this->
getAdditionalTableName() .
" WHERE question_fi = %s",
100 array($this->
getId())
102 $affectedRows = $ilDB->manipulateF(
"INSERT INTO " . $this->
getAdditionalTableName() .
" (question_fi, width, height, applet, params) VALUES (%s, %s, %s, %s, %s)",
103 array(
"integer",
"integer",
"integer",
"text",
"text"),
117 unset(
$_SESSION[
"flash_upload_filename"]);
140 $this->
setId($question_id);
151 include_once(
"./Services/RTE/classes/class.ilRTE.php");
165 $this->parameters = unserialize(
$data[
"params"]);
167 unset(
$_SESSION[
"flash_upload_filename"]);
188 $this_id = $this->
getId();
190 if( (
int)$testObjId > 0 )
196 include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
200 if( (
int)$testObjId > 0 )
202 $clone->setObjId($testObjId);
229 $clone->copyPageOfQuestion($this_id);
231 $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
233 $clone->duplicateFeedbackGeneric($this_id);
235 $clone->duplicateApplet($this_id, $thisObjId);
237 $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
258 include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
261 $source_questionpool = $this->
getObjId();
262 $clone->setObjId($target_questionpool);
292 $flashpath_original = preg_replace(
"/([^\d])$this->id([^\d])/",
"\${1}$question_id\${2}", $flashpath);
294 if( (
int)$objectId > 0 )
296 $flashpath_original = str_replace(
"/$this->obj_id/",
"/$objectId/", $flashpath_original);
299 if (!file_exists($flashpath))
304 if (!copy($flashpath_original .
$filename, $flashpath . $filename)) {
305 print
"flash applet could not be duplicated!!!! ";
315 protected function copyApplet($question_id, $source_questionpool)
318 $flashpath_original = preg_replace(
"/([^\d])$this->id([^\d])/",
"\${1}$question_id\${2}", $flashpath);
319 $flashpath_original = str_replace(
"/$this->obj_id/",
"/$source_questionpool/", $flashpath_original);
320 if (!file_exists($flashpath))
325 if (!copy($flashpath_original .
$filename, $flashpath . $filename))
327 print
"flash applet could not be copied!!!! ";
355 $found_values = array();
360 $result = $ilDB->queryF(
"SELECT * FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
361 array(
"integer",
"integer",
"integer"),
377 $params = array(
'http' => array(
381 if ($optional_headers !== null)
383 $params[
'http'][
'header'] = $optional_headers;
385 $ctx = stream_context_create($params);
386 $fp = @fopen($url,
'rb',
false, $ctx);
389 throw new Exception(
"Problem with $url, $php_errormsg");
391 $response = @stream_get_contents($fp);
392 if ($response ===
false)
394 throw new Exception(
"Problem reading data from $url, $php_errormsg");
410 if (!empty($tmpfile))
412 $flashfile = str_replace(
" ",
"_", $flashfile);
414 if (!file_exists($flashpath))
456 return "assFlashQuestion";
469 return "qpl_qst_flash";
519 include_once (
"./Services/Excel/classes/class.ilExcelUtils.php");
522 return $startrow + 1;
538 function fromXML(&$item, &$questionpool_id, &$tst_id, &$tst_object, &$question_counter, &$import_mapping)
540 include_once
"./Modules/TestQuestionPool/classes/import/qti12/class.assFlashQuestionImport.php";
542 $import->fromXML($item, $questionpool_id, $tst_id, $tst_object, $question_counter, $import_mapping);
552 function toXML($a_include_header =
true, $a_include_binary =
true, $a_shuffle =
false, $test_output =
false, $force_image_references =
false)
554 include_once
"./Modules/TestQuestionPool/classes/export/qti12/class.assFlashQuestionExport.php";
556 return $export->toXML($a_include_header, $a_include_binary, $a_shuffle, $test_output, $force_image_references);
567 $user_solution = array();
568 return $user_solution;
573 if (!$a_height) $a_height = 400;
574 $this->height = $a_height;
584 if (!$a_width) $a_width = 550;
585 $this->width = $a_width;
595 $this->applet = $a_applet;
605 $this->parameters[$name] = $value;
610 if (is_array($params))
612 $this->parameters = $params;
616 $this->parameters = array();
622 unset($this->parameters[$name]);
627 $this->parameters = array();