Class for Java Applet Questions. More...
Inheritance diagram for assJavaApplet:
Collaboration diagram for assJavaApplet:Public Member Functions | |
| assJavaApplet ($title="", $comment="", $author="", $owner=-1, $question="", $javaapplet_filename="") | |
| assJavaApplet constructor | |
| splitParams ($params="") | |
| Sets the applet parameters from a parameter string containing all parameters in a list. | |
| buildParams () | |
| Returns a string containing the applet parameters. | |
| buildParamsOnly () | |
| Returns a string containing the additional applet parameters. | |
| isComplete () | |
| Returns true, if a imagemap question is complete for use. | |
| saveToDb ($original_id="") | |
| Saves a assJavaApplet object to a database. | |
| loadFromDb ($question_id) | |
| Loads a assJavaApplet object from a database. | |
| duplicate ($for_test=true, $title="", $author="", $owner="") | |
| Duplicates an assJavaApplet. | |
| copyObject ($target_questionpool, $title="") | |
| Copies an assJavaApplet object. | |
| duplicateApplet ($question_id) | |
| copyApplet ($question_id, $source_questionpool) | |
| getMaximumPoints () | |
| Returns the maximum points, a learner can reach answering the question. | |
| getJavaCode () | |
| Returns the java applet code parameter. | |
| getJavaCodebase () | |
| Returns the java applet codebase parameter. | |
| getJavaArchive () | |
| Returns the java applet archive parameter. | |
| setJavaCode ($java_code="") | |
| Sets the java applet code parameter. | |
| setJavaCodebase ($java_codebase="") | |
| Sets the java applet codebase parameter. | |
| setJavaArchive ($java_archive="") | |
| Sets the java applet archive parameter. | |
| getJavaWidth () | |
| Returns the java applet width parameter. | |
| setJavaWidth ($java_width="") | |
| Sets the java applet width parameter. | |
| getJavaHeight () | |
| Returns the java applet height parameter. | |
| setJavaHeight ($java_height="") | |
| Sets the java applet height parameter. | |
| calculateReachedPoints ($active_id, $pass=NULL) | |
| Returns the points, a learner has reached answering the question. | |
| getReachedInformation ($active_id, $pass=NULL) | |
| Returns the evaluation data, a learner has entered to answer the question. | |
| addParameter ($name="", $value="") | |
| Adds a new parameter value to the parameter list. | |
| addParameterAtIndex ($index=0, $name="", $value="") | |
| Adds a new parameter value to the parameter list at a given index. | |
| removeParameter ($name) | |
| Removes a parameter value from the parameter list. | |
| getParameter ($index) | |
| Returns the paramter at a given index. | |
| getParameterIndex ($name) | |
| Returns the index of an applet parameter. | |
| getParameterCount () | |
| Returns the number of additional applet parameters. | |
| flushParams () | |
| Removes all applet parameters. | |
| saveWorkingData ($active_id, $pass=NULL) | |
| Saves the learners input of the question to the database. | |
| getJavaAppletFilename () | |
| Gets the java applet file name. | |
| setJavaAppletFilename ($javaapplet_filename, $javaapplet_tempfilename="") | |
| Sets the java applet file name. | |
| deleteJavaAppletFilename () | |
| getQuestionType () | |
| Returns the question type of the question. | |
| getAdditionalTableName () | |
| Returns the name of the additional question data table in the database. | |
| getRTETextWithMediaObjects () | |
| Collects all text in the question which could contain media objects which were created with the Rich Text Editor. | |
Data Fields | |
| $javaapplet_filename | |
| $java_code | |
| $java_codebase | |
| $java_archive | |
| $java_width | |
| $java_height | |
| $parameters | |
Class for Java Applet Questions.
assJavaApplet is a class for Java Applet Questions.
Definition at line 35 of file class.assJavaApplet.php.
| assJavaApplet::addParameter | ( | $ | name = "", |
|
| $ | value = "" | |||
| ) |
Adds a new parameter value to the parameter list.
Adds a new parameter value to the parameter list
| string | $name The name of the parameter value | |
| string | $value The value of the parameter value public |
Definition at line 760 of file class.assJavaApplet.php.
References getParameterIndex().
{
$index = $this->getParameterIndex($name);
if ($index > -1)
{
$this->parameters[$index] = array("name" => $name, "value" => $value);
}
else
{
array_push($this->parameters, array("name" => $name, "value" => $value));
}
}
Here is the call graph for this function:| assJavaApplet::addParameterAtIndex | ( | $ | index = 0, |
|
| $ | name = "", |
|||
| $ | value = "" | |||
| ) |
Adds a new parameter value to the parameter list at a given index.
Adds a new parameter value to the parameter list at a given index
| integer | $index The index at which the parameter should be inserted | |
| string | $name The name of the parameter value | |
| string | $value The value of the parameter value public |
Definition at line 784 of file class.assJavaApplet.php.
{
$this->parameters[$index] = array("name" => $name, "value" => $value);
}
| assJavaApplet::assJavaApplet | ( | $ | title = "", |
|
| $ | comment = "", |
|||
| $ | author = "", |
|||
| $ | owner = -1, |
|||
| $ | question = "", |
|||
| $ | javaapplet_filename = "" | |||
| ) |
assJavaApplet constructor
The constructor takes possible arguments an creates an instance of the assJavaApplet object.
| string | $title A title string to describe the question | |
| string | $comment A comment string to describe the question | |
| string | $author A string containing the name of the questions author | |
| integer | $owner A numerical ID to identify the owner/creator | |
| string | $question The question string of the multiple choice question | |
| integer | $response Indicates the response type of the multiple choice question | |
| integer | $output_type The output order of the multiple choice answers public |
Definition at line 115 of file class.assJavaApplet.php.
References assQuestion::$author, assQuestion::$comment, $javaapplet_filename, assQuestion::$owner, assQuestion::$question, assQuestion::$title, and assQuestion::assQuestion().
{
$this->assQuestion($title, $comment, $author, $owner, $question);
$this->javaapplet_filename = $javaapplet_filename;
$this->parameters = array();
}
Here is the call graph for this function:| assJavaApplet::buildParams | ( | ) |
Returns a string containing the applet parameters.
Returns a string containing the applet parameters. This is used for saving the applet data to database
Definition at line 182 of file class.assJavaApplet.php.
Referenced by saveToDb().
{
$params_array = array();
if ($this->java_code)
{
array_push($params_array, "java_code=$this->java_code");
}
if ($this->java_codebase)
{
array_push($params_array, "java_codebase=$this->java_codebase");
}
if ($this->java_archive)
{
array_push($params_array, "java_archive=$this->java_archive");
}
if ($this->java_width)
{
array_push($params_array, "java_width=$this->java_width");
}
if ($this->java_height)
{
array_push($params_array, "java_height=$this->java_height");
}
foreach ($this->parameters as $key => $value)
{
array_push($params_array, "param_name_$key=" . $value["name"]);
array_push($params_array, "param_value_$key=" . $value["value"]);
}
return join($params_array, "<separator>");
}
Here is the caller graph for this function:| assJavaApplet::buildParamsOnly | ( | ) |
Returns a string containing the additional applet parameters.
Returns a string containing the additional applet parameters
Definition at line 221 of file class.assJavaApplet.php.
{
$params_array = array();
if ($this->java_code)
{
array_push($params_array, "java_code=$this->java_code");
array_push($params_array, "java_codebase=$this->java_codebase");
array_push($params_array, "java_archive=$this->java_archive");
}
foreach ($this->parameters as $key => $value)
{
array_push($params_array, "param_name_$key=" . $value["name"]);
array_push($params_array, "param_value_$key=" . $value["value"]);
}
return join($params_array, "<separator>");
}
| assJavaApplet::calculateReachedPoints | ( | $ | active_id, | |
| $ | pass = NULL | |||
| ) |
Returns the points, a learner has reached answering the question.
Returns the points, a learner has reached answering the question The points are calculated from the given answers including checks for all special scoring options in the test container.
| integer | $user_id The database ID of the learner | |
| integer | $test_id The database Id of the test containing the question public |
Definition at line 679 of file class.assJavaApplet.php.
References $data, assQuestion::$points, assQuestion::getId(), and assQuestion::getSolutionMaxPass().
{
global $ilDB;
$found_values = array();
if (is_null($pass))
{
$pass = $this->getSolutionMaxPass($active_id);
}
$query = sprintf("SELECT * FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
$ilDB->quote($active_id . ""),
$ilDB->quote($this->getId() . ""),
$ilDB->quote($pass . "")
);
$result = $ilDB->query($query);
$points = 0;
while ($data = $result->fetchRow(DB_FETCHMODE_OBJECT))
{
$points += $data->points;
}
$points = parent::calculateReachedPoints($active_id, $pass = NULL, $points);
return $points;
}
Here is the call graph for this function:| assJavaApplet::copyApplet | ( | $ | question_id, | |
| $ | source_questionpool | |||
| ) |
Definition at line 510 of file class.assJavaApplet.php.
References $filename, getJavaAppletFilename(), assQuestion::getJavaPath(), and ilUtil::makeDirParents().
{
$javapath = $this->getJavaPath();
$javapath_original = preg_replace("/([^\d])$this->id([^\d])/", "\${1}$question_id\${2}", $javapath);
$javapath_original = str_replace("/$this->obj_id/", "/$source_questionpool/", $javapath_original);
if (!file_exists($javapath))
{
ilUtil::makeDirParents($javapath);
}
$filename = $this->getJavaAppletFilename();
if (!copy($javapath_original . $filename, $javapath . $filename)) {
print "java applet could not be copied!!!! ";
}
}
Here is the call graph for this function:| assJavaApplet::copyObject | ( | $ | target_questionpool, | |
| $ | title = "" | |||
| ) |
Copies an assJavaApplet object.
Copies an assJavaApplet object
public
Definition at line 464 of file class.assJavaApplet.php.
References assQuestion::$title, assQuestion::_getOriginalId(), and assQuestion::getObjId().
{
if ($this->id <= 0)
{
// The question has not been saved. It cannot be duplicated
return;
}
// duplicate the question in database
$clone = $this;
include_once ("./Modules/TestQuestionPool/classes/class.assQuestion.php");
$original_id = assQuestion::_getOriginalId($this->id);
$clone->id = -1;
$source_questionpool = $this->getObjId();
$clone->setObjId($target_questionpool);
if ($title)
{
$clone->setTitle($title);
}
$clone->saveToDb();
// copy question page content
$clone->copyPageOfQuestion($original_id);
// copy XHTML media objects
$clone->copyXHTMLMediaObjectsOfQuestion($original_id);
// duplicate the generic feedback
$clone->duplicateFeedbackGeneric($original_id);
// duplicate the image
$clone->copyApplet($original_id, $source_questionpool);
return $clone->id;
}
Here is the call graph for this function:| assJavaApplet::deleteJavaAppletFilename | ( | ) |
Definition at line 944 of file class.assJavaApplet.php.
References getJavaAppletFilename(), and assQuestion::getJavaPath().
{
unlink($this->getJavaPath() . $this->getJavaAppletFilename());
$this->javaapplet_filename = "";
}
Here is the call graph for this function:| assJavaApplet::duplicate | ( | $ | for_test = true, |
|
| $ | title = "", |
|||
| $ | author = "", |
|||
| $ | owner = "" | |||
| ) |
Duplicates an assJavaApplet.
Duplicates an assJavaApplet
public
Definition at line 411 of file class.assJavaApplet.php.
References assQuestion::$author, assQuestion::$owner, assQuestion::$title, assQuestion::_getOriginalId(), and assQuestion::getId().
{
if ($this->id <= 0)
{
// The question has not been saved. It cannot be duplicated
return;
}
// duplicate the question in database
$this_id = $this->getId();
$clone = $this;
include_once ("./Modules/TestQuestionPool/classes/class.assQuestion.php");
$original_id = assQuestion::_getOriginalId($this->id);
$clone->id = -1;
if ($title)
{
$clone->setTitle($title);
}
if ($author)
{
$clone->setAuthor($author);
}
if ($owner)
{
$clone->setOwner($owner);
}
if ($for_test)
{
$clone->saveToDb($original_id);
}
else
{
$clone->saveToDb();
}
// copy question page content
$clone->copyPageOfQuestion($this_id);
// copy XHTML media objects
$clone->copyXHTMLMediaObjectsOfQuestion($this_id);
// duplicate the generic feedback
$clone->duplicateFeedbackGeneric($this_id);
// duplicate the image
$clone->duplicateApplet($this_id);
return $clone->id;
}
Here is the call graph for this function:| assJavaApplet::duplicateApplet | ( | $ | question_id | ) |
Definition at line 496 of file class.assJavaApplet.php.
References $filename, getJavaAppletFilename(), assQuestion::getJavaPath(), and ilUtil::makeDirParents().
{
$javapath = $this->getJavaPath();
$javapath_original = preg_replace("/([^\d])$this->id([^\d])/", "\${1}$question_id\${2}", $javapath);
if (!file_exists($javapath))
{
ilUtil::makeDirParents($javapath);
}
$filename = $this->getJavaAppletFilename();
if (!copy($javapath_original . $filename, $javapath . $filename)) {
print "java applet could not be duplicated!!!! ";
}
}
Here is the call graph for this function:| assJavaApplet::flushParams | ( | ) |
Removes all applet parameters.
Removes all applet parameters
public
Definition at line 873 of file class.assJavaApplet.php.
{
$this->parameters = array();
}
| assJavaApplet::getAdditionalTableName | ( | ) |
Returns the name of the additional question data table in the database.
Returns the name of the additional question data table in the database
Reimplemented from assQuestion.
Definition at line 971 of file class.assJavaApplet.php.
{
return "qpl_question_javaapplet";
}
| assJavaApplet::getJavaAppletFilename | ( | ) |
Gets the java applet file name.
Gets the java applet file name
Definition at line 903 of file class.assJavaApplet.php.
Referenced by copyApplet(), deleteJavaAppletFilename(), and duplicateApplet().
{
return $this->javaapplet_filename;
}
Here is the caller graph for this function:| assJavaApplet::getJavaArchive | ( | ) |
Returns the java applet archive parameter.
Returns the java applet archive parameter
Definition at line 572 of file class.assJavaApplet.php.
Referenced by isComplete().
{
return $this->java_archive;
}
Here is the caller graph for this function:| assJavaApplet::getJavaCode | ( | ) |
Returns the java applet code parameter.
Returns the java applet code parameter
Definition at line 546 of file class.assJavaApplet.php.
{
return $this->java_code;
}
| assJavaApplet::getJavaCodebase | ( | ) |
Returns the java applet codebase parameter.
Returns the java applet codebase parameter
Definition at line 559 of file class.assJavaApplet.php.
Referenced by isComplete().
{
return $this->java_codebase;
}
Here is the caller graph for this function:| assJavaApplet::getJavaHeight | ( | ) |
Returns the java applet height parameter.
Returns the java applet height parameter
Definition at line 650 of file class.assJavaApplet.php.
{
return $this->java_height;
}
| assJavaApplet::getJavaWidth | ( | ) |
Returns the java applet width parameter.
Returns the java applet width parameter
Definition at line 624 of file class.assJavaApplet.php.
{
return $this->java_width;
}
| assJavaApplet::getMaximumPoints | ( | ) |
Returns the maximum points, a learner can reach answering the question.
Returns the maximum points, a learner can reach answering the question
public
Reimplemented from assQuestion.
Definition at line 533 of file class.assJavaApplet.php.
Referenced by isComplete().
{
return $this->points;
}
Here is the caller graph for this function:| assJavaApplet::getParameter | ( | $ | index | ) |
Returns the paramter at a given index.
Returns the paramter at a given index
| intege | $index The index value of the parameter |
Definition at line 820 of file class.assJavaApplet.php.
{
if (($index < 0) or ($index >= count($this->parameters)))
{
return undef;
}
return $this->parameters[$index];
}
| assJavaApplet::getParameterCount | ( | ) |
Returns the number of additional applet parameters.
Returns the number of additional applet parameters
Definition at line 860 of file class.assJavaApplet.php.
{
return count($this->parameters);
}
| assJavaApplet::getParameterIndex | ( | $ | name | ) |
Returns the index of an applet parameter.
Returns the index of an applet parameter
| string | $name The name of the parameter value |
Definition at line 839 of file class.assJavaApplet.php.
Referenced by addParameter().
{
foreach ($this->parameters as $key => $value)
{
if (array_key_exists($name, $value))
{
return $key;
}
}
return -1;
}
Here is the caller graph for this function:| assJavaApplet::getQuestionType | ( | ) |
Returns the question type of the question.
Returns the question type of the question
Reimplemented from assQuestion.
Definition at line 958 of file class.assJavaApplet.php.
{
return "assJavaApplet";
}
| assJavaApplet::getReachedInformation | ( | $ | active_id, | |
| $ | pass = NULL | |||
| ) |
Returns the evaluation data, a learner has entered to answer the question.
Returns the evaluation data, a learner has entered to answer the question
| integer | $user_id The database ID of the learner | |
| integer | $test_id The database Id of the test containing the question public |
Definition at line 713 of file class.assJavaApplet.php.
References $data, assQuestion::getId(), and assQuestion::getSolutionMaxPass().
{
global $ilDB;
$found_values = array();
if (is_null($pass))
{
$pass = $this->getSolutionMaxPass($active_id);
}
$query = sprintf("SELECT * FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
$ilDB->quote($active_id . ""),
$ilDB->quote($this->getId() . ""),
$ilDB->quote($pass . "")
);
$result = $ilDB->query($query);
$counter = 1;
$user_result = array();
while ($data = $result->fetchRow(DB_FETCHMODE_OBJECT))
{
$true = 0;
if ($data->points > 0)
{
$true = 1;
}
$solution = array(
"order" => "$counter",
"points" => "$data->points",
"true" => "$true",
"value1" => "$data->value1",
"value2" => "$data->value2",
);
$counter++;
array_push($user_result, $solution);
}
return $user_result;
}
Here is the call graph for this function:| assJavaApplet::getRTETextWithMediaObjects | ( | ) |
Collects all text in the question which could contain media objects which were created with the Rich Text Editor.
Reimplemented from assQuestion.
Definition at line 980 of file class.assJavaApplet.php.
{
return parent::getRTETextWithMediaObjects();
}
| assJavaApplet::isComplete | ( | ) |
Returns true, if a imagemap question is complete for use.
Returns true, if a imagemap question is complete for use
Reimplemented from assQuestion.
Definition at line 246 of file class.assJavaApplet.php.
References getJavaArchive(), getJavaCodebase(), and getMaximumPoints().
Referenced by saveToDb().
{
if (($this->title) and ($this->author) and ($this->question) and ($this->javaapplet_filename) and ($this->java_width) and ($this->java_height) and ($this->getMaximumPoints() > 0))
{
return true;
}
else if (($this->title) and ($this->author) and ($this->question) and ($this->getJavaArchive()) and ($this->getJavaCodebase()) and ($this->java_width) and ($this->java_height) and ($this->getMaximumPoints() > 0))
{
return true;
}
else
{
return false;
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| assJavaApplet::loadFromDb | ( | $ | question_id | ) |
Loads a assJavaApplet object from a database.
Loads a assJavaApplet object from a database (experimental)
| object | $db A pear DB object | |
| integer | $question_id A unique key which defines the multiple choice test in the database public |
Reimplemented from assQuestion.
Definition at line 371 of file class.assJavaApplet.php.
References $data, ilRTE::_replaceMediaObjectImageSrc(), assQuestion::setEstimatedWorkingTime(), and splitParams().
{
global $ilDB;
$query = sprintf("SELECT qpl_questions.*, qpl_question_javaapplet.* FROM qpl_questions, qpl_question_javaapplet WHERE question_id = %s AND qpl_questions.question_id = qpl_question_javaapplet.question_fi",
$ilDB->quote($question_id)
);
$result = $ilDB->query($query);
if (strcmp(strtolower(get_class($result)), db_result) == 0)
{
if ($result->numRows() == 1)
{
$data = $result->fetchRow(DB_FETCHMODE_OBJECT);
$this->id = $question_id;
$this->title = $data->title;
$this->comment = $data->comment;
$this->obj_id = $data->obj_fi;
$this->author = $data->author;
$this->points = $data->points;
$this->owner = $data->owner;
$this->original_id = $data->original_id;
$this->javaapplet_filename = $data->image_file;
include_once("./Services/RTE/classes/class.ilRTE.php");
$this->question = ilRTE::_replaceMediaObjectImageSrc($data->question_text, 1);
$this->solution_hint = $data->solution_hint;
$this->splitParams($data->params);
$this->setEstimatedWorkingTime(substr($data->working_time, 0, 2), substr($data->working_time, 3, 2), substr($data->working_time, 6, 2));
}
}
parent::loadFromDb($question_id);
}
Here is the call graph for this function:| assJavaApplet::removeParameter | ( | $ | name | ) |
Removes a parameter value from the parameter list.
Removes a parameter value from the parameter list
| string | $name The name of the parameter value public |
Definition at line 798 of file class.assJavaApplet.php.
{
foreach ($this->parameters as $key => $value)
{
if (strcmp($name, $value["name"]) == 0)
{
array_splice($this->parameters, $key, 1);
return;
}
}
}
| assJavaApplet::saveToDb | ( | $ | original_id = "" |
) |
Saves a assJavaApplet object to a database.
Saves a assJavaApplet object to a database (experimental)
| object | $db A pear DB object public |
Reimplemented from assQuestion.
Definition at line 271 of file class.assJavaApplet.php.
References ilRTE::_replaceMediaObjectImageSrc(), buildParams(), assQuestion::createPageObject(), assQuestion::getEstimatedWorkingTime(), assQuestion::getQuestionTypeID(), assQuestion::getTestId(), assQuestion::insertIntoTest(), and isComplete().
{
global $ilDB;
$complete = 0;
if ($this->isComplete())
{
$complete = 1;
}
$params = $this->buildParams();
$estw_time = $this->getEstimatedWorkingTime();
$estw_time = sprintf("%02d:%02d:%02d", $estw_time['h'], $estw_time['m'], $estw_time['s']);
if ($original_id)
{
$original_id = $ilDB->quote($original_id);
}
else
{
$original_id = "NULL";
}
// cleanup RTE images which are not inserted into the question text
include_once("./Services/RTE/classes/class.ilRTE.php");
if ($this->id == -1)
{
// Neuen Datensatz schreiben
$now = getdate();
$question_type = $this->getQuestionTypeID();
$created = sprintf("%04d%02d%02d%02d%02d%02d", $now['year'], $now['mon'], $now['mday'], $now['hours'], $now['minutes'], $now['seconds']);
$query = sprintf("INSERT INTO qpl_questions (question_id, question_type_fi, obj_fi, title, comment, author, owner, question_text, points, working_time, complete, created, original_id, TIMESTAMP) VALUES (NULL, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, NULL)",
$ilDB->quote($question_type . ""),
$ilDB->quote($this->obj_id . ""),
$ilDB->quote($this->title . ""),
$ilDB->quote($this->comment . ""),
$ilDB->quote($this->author . ""),
$ilDB->quote($this->owner . ""),
$ilDB->quote(ilRTE::_replaceMediaObjectImageSrc($this->question, 0)),
$ilDB->quote($this->points . ""),
$ilDB->quote($estw_time . ""),
$ilDB->quote($complete . ""),
$ilDB->quote($created . ""),
$original_id
);
$result = $ilDB->query($query);
if ($result == DB_OK)
{
$this->id = $ilDB->getLastInsertId();
$query = sprintf("INSERT INTO qpl_question_javaapplet (question_fi, image_file, params) VALUES (%s, %s, %s)",
$ilDB->quote($this->id . ""),
$ilDB->quote($this->javaapplet_filename . ""),
$ilDB->quote($params . "")
);
$ilDB->query($query);
// create page object of question
$this->createPageObject();
if ($this->getTestId() > 0)
{
$this->insertIntoTest($this->getTestId());
}
}
}
else
{
// Vorhandenen Datensatz aktualisieren
$query = sprintf("UPDATE qpl_questions SET obj_fi = %s, title = %s, comment = %s, author = %s, question_text = %s, points = %s, working_time=%s, complete = %s WHERE question_id = %s",
$ilDB->quote($this->obj_id. ""),
$ilDB->quote($this->title . ""),
$ilDB->quote($this->comment . ""),
$ilDB->quote($this->author . ""),
$ilDB->quote(ilRTE::_replaceMediaObjectImageSrc($this->question, 0)),
$ilDB->quote($this->points . ""),
$ilDB->quote($estw_time . ""),
$ilDB->quote($complete . ""),
$ilDB->quote($this->id . "")
);
$result = $ilDB->query($query);
$query = sprintf("UPDATE qpl_question_javaapplet SET image_file = %s, params = %s WHERE question_fi = %s",
$ilDB->quote($this->javaapplet_filename . ""),
$ilDB->quote($params . ""),
$ilDB->quote($this->id . "")
);
$result = $ilDB->query($query);
}
parent::saveToDb($original_id);
}
Here is the call graph for this function:| assJavaApplet::saveWorkingData | ( | $ | active_id, | |
| $ | pass = NULL | |||
| ) |
Saves the learners input of the question to the database.
Saves the learners input of the question to the database
| integer | $test_id The database id of the test containing this question |
Reimplemented from assQuestion.
Definition at line 888 of file class.assJavaApplet.php.
{
parent::saveWorkingData($active_id, $pass);
return true;
}
| assJavaApplet::setJavaAppletFilename | ( | $ | javaapplet_filename, | |
| $ | javaapplet_tempfilename = "" | |||
| ) |
Sets the java applet file name.
Sets the java applet file name
| string | $javaapplet_file. public |
Definition at line 917 of file class.assJavaApplet.php.
References $javaapplet_filename, assQuestion::getJavaPath(), ilUtil::makeDirParents(), ilUtil::moveUploadedFile(), setJavaArchive(), and setJavaCodebase().
{
if (!empty($javaapplet_filename))
{
$this->javaapplet_filename = $javaapplet_filename;
}
if (!empty($javaapplet_tempfilename))
{
$javapath = $this->getJavaPath();
if (!file_exists($javapath))
{
ilUtil::makeDirParents($javapath);
}
//if (!move_uploaded_file($javaapplet_tempfilename, $javapath . $javaapplet_filename))
if (!ilUtil::moveUploadedFile($javaapplet_tempfilename, $javaapplet_filename, $javapath.$javaapplet_filename))
{
print "java applet not uploaded!!!! ";
}
else
{
$this->setJavaCodebase();
$this->setJavaArchive();
}
}
}
Here is the call graph for this function:| assJavaApplet::setJavaArchive | ( | $ | java_archive = "" |
) |
Sets the java applet archive parameter.
Sets the java applet archive parameter
| string | java applet archive parameter public |
Definition at line 611 of file class.assJavaApplet.php.
References $java_archive.
Referenced by setJavaAppletFilename().
{
$this->java_archive = $java_archive;
}
Here is the caller graph for this function:| assJavaApplet::setJavaCode | ( | $ | java_code = "" |
) |
Sets the java applet code parameter.
Sets the java applet code parameter
| string | java applet code parameter public |
Definition at line 585 of file class.assJavaApplet.php.
References $java_code.
{
$this->java_code = $java_code;
}
| assJavaApplet::setJavaCodebase | ( | $ | java_codebase = "" |
) |
Sets the java applet codebase parameter.
Sets the java applet codebase parameter
| string | java applet codebase parameter public |
Definition at line 598 of file class.assJavaApplet.php.
References $java_codebase.
Referenced by setJavaAppletFilename().
{
$this->java_codebase = $java_codebase;
}
Here is the caller graph for this function:| assJavaApplet::setJavaHeight | ( | $ | java_height = "" |
) |
Sets the java applet height parameter.
Sets the java applet height parameter
| integer | java applet height parameter public |
Definition at line 663 of file class.assJavaApplet.php.
References $java_height.
{
$this->java_height = $java_height;
}
| assJavaApplet::setJavaWidth | ( | $ | java_width = "" |
) |
Sets the java applet width parameter.
Sets the java applet width parameter
| integer | java applet width parameter public |
Definition at line 637 of file class.assJavaApplet.php.
References $java_width.
{
$this->java_width = $java_width;
}
| assJavaApplet::splitParams | ( | $ | params = "" |
) |
Sets the applet parameters from a parameter string containing all parameters in a list.
Sets the applet parameters from a parameter string containing all parameters in a list
| string | $params All applet parameters in a list public |
Definition at line 137 of file class.assJavaApplet.php.
Referenced by loadFromDb().
{
$params_array = split("<separator>", $params);
foreach ($params_array as $pair)
{
if (preg_match("/(.*?)\=(.*)/", $pair, $matches))
{
switch ($matches[1])
{
case "java_code" :
$this->java_code = $matches[2];
break;
case "java_codebase" :
$this->java_codebase = $matches[2];
break;
case "java_archive" :
$this->java_archive = $matches[2];
break;
case "java_width" :
$this->java_width = $matches[2];
break;
case "java_height" :
$this->java_height = $matches[2];
break;
}
if (preg_match("/param_name_(\d+)/", $matches[1], $found_key))
{
$this->parameters[$found_key[1]]["name"] = $matches[2];
}
if (preg_match("/param_value_(\d+)/", $matches[1], $found_key))
{
$this->parameters[$found_key[1]]["value"] = $matches[2];
}
}
}
}
Here is the caller graph for this function:| assJavaApplet::$java_archive |
Definition at line 71 of file class.assJavaApplet.php.
Referenced by setJavaArchive().
| assJavaApplet::$java_code |
Definition at line 53 of file class.assJavaApplet.php.
Referenced by setJavaCode().
| assJavaApplet::$java_codebase |
Definition at line 62 of file class.assJavaApplet.php.
Referenced by setJavaCodebase().
| assJavaApplet::$java_height |
Definition at line 89 of file class.assJavaApplet.php.
Referenced by setJavaHeight().
| assJavaApplet::$java_width |
Definition at line 80 of file class.assJavaApplet.php.
Referenced by setJavaWidth().
| assJavaApplet::$javaapplet_filename |
Definition at line 44 of file class.assJavaApplet.php.
Referenced by assJavaApplet(), and setJavaAppletFilename().
| assJavaApplet::$parameters |
Definition at line 98 of file class.assJavaApplet.php.
1.7.1