5 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
6 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
48 $this->parameters = array();
62 if (strlen($this->title) and ($this->author) and ($this->question) and ($this->
getMaximumPoints() > 0) and (strlen($this->
getApplet())))
84 $affectedRows = $ilDB->manipulateF(
"DELETE FROM " . $this->
getAdditionalTableName() .
" WHERE question_fi = %s",
88 $affectedRows = $ilDB->manipulateF(
"INSERT INTO " . $this->
getAdditionalTableName() .
" (question_fi, width, height, applet, params) VALUES (%s, %s, %s, %s, %s)",
89 array(
"integer",
"integer",
"integer",
"text",
"text"),
103 unset(
$_SESSION[
"flash_upload_filename"]);
126 $this->
setId($question_id);
137 include_once(
"./Services/RTE/classes/class.ilRTE.php");
151 $this->parameters = unserialize(
$data[
"params"]);
153 unset(
$_SESSION[
"flash_upload_filename"]);
174 $this_id = $this->
getId();
176 if( (
int)$testObjId > 0 )
182 include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
186 if( (
int)$testObjId > 0 )
188 $clone->setObjId($testObjId);
215 $clone->copyPageOfQuestion($this_id);
217 $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
219 $clone->duplicateGenericFeedback($this_id);
221 $clone->duplicateApplet($this_id, $thisObjId);
223 $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
244 include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
247 $source_questionpool = $this->
getObjId();
248 $clone->setObjId($target_questionpool);
278 $flashpath_original = preg_replace(
"/([^\d])$this->id([^\d])/",
"\${1}$question_id\${2}", $flashpath);
280 if( (
int)$objectId > 0 )
282 $flashpath_original = str_replace(
"/$this->obj_id/",
"/$objectId/", $flashpath_original);
285 if (!file_exists($flashpath))
290 if (!copy($flashpath_original .
$filename, $flashpath . $filename)) {
291 print
"flash applet could not be duplicated!!!! ";
301 protected function copyApplet($question_id, $source_questionpool)
304 $flashpath_original = preg_replace(
"/([^\d])$this->id([^\d])/",
"\${1}$question_id\${2}", $flashpath);
305 $flashpath_original = str_replace(
"/$this->obj_id/",
"/$source_questionpool/", $flashpath_original);
306 if (!file_exists($flashpath))
311 if (!copy($flashpath_original .
$filename, $flashpath . $filename))
313 print
"flash applet could not be copied!!!! ";
342 throw new ilTestException(
'return details not implemented for '.__METHOD__);
347 $found_values = array();
352 $result = $ilDB->queryF(
"SELECT * FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
353 array(
"integer",
"integer",
"integer"),
368 $params = array(
'http' => array(
372 if ($optional_headers !== null)
374 $params[
'http'][
'header'] = $optional_headers;
376 $ctx = stream_context_create($params);
377 $fp = @fopen($url,
'rb',
false, $ctx);
380 throw new Exception(
"Problem with $url, $php_errormsg");
382 $response = @stream_get_contents($fp);
383 if ($response ===
false)
385 throw new Exception(
"Problem reading data from $url, $php_errormsg");
401 if (!empty($tmpfile))
403 $flashfile = str_replace(
" ",
"_", $flashfile);
405 if (!file_exists($flashpath))
461 return "assFlashQuestion";
474 return "qpl_qst_flash";
524 include_once (
"./Services/Excel/classes/class.ilExcelUtils.php");
527 return $startrow + 1;
543 function fromXML(&$item, &$questionpool_id, &$tst_id, &$tst_object, &$question_counter, &$import_mapping)
545 include_once
"./Modules/TestQuestionPool/classes/import/qti12/class.assFlashQuestionImport.php";
547 $import->fromXML($item, $questionpool_id, $tst_id, $tst_object, $question_counter, $import_mapping);
557 function toXML($a_include_header =
true, $a_include_binary =
true, $a_shuffle =
false, $test_output =
false, $force_image_references =
false)
559 include_once
"./Modules/TestQuestionPool/classes/export/qti12/class.assFlashQuestionExport.php";
561 return $export->toXML($a_include_header, $a_include_binary, $a_shuffle, $test_output, $force_image_references);
572 $user_solution = array();
573 return $user_solution;
578 if (!$a_height) $a_height = 400;
579 $this->height = $a_height;
589 if (!$a_width) $a_width = 550;
590 $this->width = $a_width;
600 $this->applet = $a_applet;
610 $this->parameters[$name] = $value;
615 if (is_array($params))
617 $this->parameters = $params;
621 $this->parameters = array();
627 unset($this->parameters[$name]);
632 $this->parameters = array();