ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
assQuestion Class Reference

Abstract basic class which is to be extended by the concrete assessment question type classes. More...

+ Inheritance diagram for assQuestion:
+ Collaboration diagram for assQuestion:

Public Member Functions

 __construct ($title="", $comment="", $author="", $owner=-1, $question="")
 assQuestion constructor
 setProcessLocker ($processLocker)
 getProcessLocker ()
 fromXML (&$item, &$questionpool_id, &$tst_id, &$tst_object, &$question_counter, &$import_mapping)
 Receives parameters from a QTI parser and creates a valid ILIAS question object.
 toXML ($a_include_header=true, $a_include_binary=true, $a_shuffle=false, $test_output=false, $force_image_references=false)
 Returns a QTI xml representation of the question.
 isComplete ()
 Returns true, if a question is complete for use.
 questionTitleExists ($questionpool_id, $title)
 Returns TRUE if the question title exists in the database.
 setTitle ($title="")
 Sets the title string of the assQuestion object.
 setId ($id=-1)
 Sets the id of the assQuestion object.
 setTestId ($id=-1)
 Sets the test id of the assQuestion object.
 setComment ($comment="")
 Sets the comment string of the assQuestion object.
 setOutputType ($outputType=OUTPUT_HTML)
 Sets the output type.
 setShuffle ($shuffle=true)
 Sets the shuffle flag.
 setEstimatedWorkingTime ($hour=0, $min=0, $sec=0)
 Sets the estimated working time of a question from given hour, minute and second.
 setEstimatedWorkingTimeFromDurationString ($durationString)
 Sets the estimated working time of a question from a given datetime string.
 keyInArray ($searchkey, $array)
 returns TRUE if the key occurs in an array
 setAuthor ($author="")
 Sets the authors name of the assQuestion object.
 setOwner ($owner="")
 Sets the creator/owner ID of the assQuestion object.
 getTitle ()
 Gets the title string of the assQuestion object.
 getId ()
 Gets the id of the assQuestion object.
 getShuffle ()
 Gets the shuffle flag.
 getTestId ()
 Gets the test id of the assQuestion object.
 getComment ()
 Gets the comment string of the assQuestion object.
 getOutputType ()
 Gets the output type.
 supportsJavascriptOutput ()
 Returns true if the question type supports JavaScript output.
 supportsNonJsOutput ()
 requiresJsSwitch ()
 getEstimatedWorkingTime ()
 Gets the estimated working time of a question.
 getAuthor ()
 Gets the authors name of the assQuestion object.
 getOwner ()
 Gets the creator/owner ID of the assQuestion object.
 getObjId ()
 Get the object id of the container object.
 setObjId ($obj_id=0)
 Set the object id of the container object.
 setExternalId ($external_id)
 getExternalId ()
 _getMaximumPoints ($question_id)
 Returns the maximum points, a learner can reach answering the question.
_getQuestionInfo ($question_id)
 Returns question information from the database.
 getSuggestedSolutionOutput ()
_getSuggestedSolution ($question_id, $subquestion_index=0)
 Returns a suggested solution for a given subquestion index.
 getSuggestedSolutions ()
 Return the suggested solutions.
 _getReachedPoints ($active_id, $question_id, $pass=NULL)
 Returns the points, a learner has reached answering the question.
 getReachedPoints ($active_id, $pass=NULL)
 Returns the points, a learner has reached answering the question This is the fast way to get the points directly from the database.
 getMaximumPoints ()
 Returns the maximum points, a learner can reach answering the question.
 getAdjustedReachedPoints ($active_id, $pass=NULL)
 returns the reached points ...
 calculateResultsFromSolution ($active_id, $pass=NULL, $obligationsEnabled=false)
 Calculates the question results from a previously saved question solution.
 persistWorkingState ($active_id, $pass=NULL, $obligationsEnabled=false)
 persists the working state for current testactive and testpass
 persistPreviewState (ilAssQuestionPreviewSession $previewSession)
 persists the preview state for current user and question
 saveWorkingData ($active_id, $pass=NULL)
 Saves the learners input of the question to the database.
 _updateTestResultCache ($active_id, ilAssQuestionProcessLocker $processLocker=null)
 Move this to a proper place.
 logAction ($logtext="", $active_id="", $question_id="")
 Logs an action into the Test&Assessment log.
 _logAction ($logtext="", $active_id="", $question_id="")
 Logs an action into the Test&Assessment log.
 moveUploadedMediaFile ($file, $name)
 Move an uploaded media file to an public accessible temp dir to present it.
 getSuggestedSolutionPath ()
 Returns the path for a suggested solution.
 getJavaPath ()
 Returns the image path for web accessable images of a question.
 getImagePath ($question_id=null, $object_id=null)
 Returns the image path for web accessable images of a question.
 buildImagePath ($questionId, $parentObjectId)
 getFlashPath ()
 Returns the image path for web accessable flash files of a question.
 getJavaPathWeb ()
 Returns the web image path for web accessable java applets of a question.
 getSuggestedSolutionPathWeb ()
 Returns the web path for a suggested solution.
 getImagePathWeb ()
 Returns the web image path for web accessable images of a question.
 getFlashPathWeb ()
 Returns the web image path for web accessable flash applications of a question.
getSolutionValues ($active_id, $pass=NULL)
 Loads solutions of a given user from the database an returns it.
 isInUse ($question_id="")
 Checks whether the question is in use or not.
 isClone ($question_id="")
 Checks whether the question is a clone of another question or not.
 pcArrayShuffle ($array)
 Shuffles the values of a given array.
 getQuestionTypeFromDb ($question_id)
 get question type for question id
 getAdditionalTableName ()
 Returns the name of the additional question data table in the database.
 getAnswerTableName ()
 Returns the name of the answer table in the database.
 deleteAnswers ($question_id)
 Deletes datasets from answers tables.
 deleteAdditionalTableData ($question_id)
 Deletes datasets from the additional question table in the database.
 delete ($question_id)
 Deletes a question and all materials from the database.
 getTotalAnswers ()
 get total number of answers
 _getTotalAnswers ($a_q_id)
 get number of answers for question id (static) note: do not use $this inside this method
 _getTitle ($a_q_id)
 Returns the title of a question.
 _getQuestionText ($a_q_id)
 Returns question text.
 copyXHTMLMediaObjectsOfQuestion ($a_q_id)
 syncXHTMLMediaObjectsOfQuestion ()
 createPageObject ()
 create page object of question
 copyPageOfQuestion ($a_q_id)
 getPageOfQuestion ()
 _getQuestionType ($question_id)
 Returns the question type of a question with a given id.
 _getQuestionTitle ($question_id)
 Returns the question title of a question with a given id.
 setOriginalId ($original_id)
 getOriginalId ()
 loadFromDb ($question_id)
 Loads the question from the database.
 createNewQuestion ($a_create_page=true)
 Creates a new question without an owner when a new question is created This assures that an ID is given to the question if a file upload or something else occurs.
 saveQuestionDataToDb ($original_id="")
 saveToDb ($original_id="")
 Saves the question to the database.
 setNewOriginalId ($newId)
 deleteSuggestedSolutions ()
 Deletes all suggestes solutions in the database.
 getSuggestedSolution ($subquestion_index=0)
 Returns a suggested solution for a given subquestion index.
 getSuggestedSolutionTitle ($subquestion_index=0)
 Returns the title of a suggested solution at a given subquestion_index.
 setSuggestedSolution ($solution_id="", $subquestion_index=0, $is_import=false)
 Sets a suggested solution for the question.
 _resolveInternalLink ($internal_link)
 _resolveIntLinks ($question_id)
 _getInternalLinkHref ($target="")
 syncWithOriginal ()
 createRandomSolution ($test_id, $user_id)
 _questionExists ($question_id)
 Returns true if the question already exists in the database.
 _questionExistsInPool ($question_id)
 Returns true if the question already exists in the database and is assigned to a question pool.
 getPoints ()
 Returns the maximum available points for the question.
 setPoints ($a_points)
 Sets the maximum available points for the question.
 getSolutionMaxPass ($active_id)
 Returns the maximum pass a users question solution.
 _getSolutionMaxPass ($question_id, $active_id)
 Returns the maximum pass a users question solution.
 _isWriteable ($question_id, $user_id)
 Returns true if the question is writeable by a certain user.
 _isUsedInRandomTest ($question_id="")
 Checks whether the question is used in a random test or not.
 calculateReachedPoints ($active_id, $pass=NULL, $returndetails=FALSE)
 Returns the points, a learner has reached answering the question.
 calculateReachedPointsFromPreviewSession (ilAssQuestionPreviewSession $previewSession)
 isPreviewSolutionCorrect (ilAssQuestionPreviewSession $previewSession)
 adjustReachedPointsByScoringOptions ($points, $active_id, $pass=NULL)
 Adjust the given reached points by checks for all special scoring options in the test container.
 isHTML ($a_text)
 Checks if a given string contains HTML or not.
 prepareTextareaOutput ($txt_output, $prepare_for_latex_output=FALSE)
 Prepares a string for a text area output in tests.
 QTIMaterialToString ($a_material)
 Reads an QTI material tag an creates a text string.
 addQTIMaterial (&$a_xml_writer, $a_material, $close_material_tag=TRUE, $add_mobs=TRUE)
 Creates a QTI material tag from a plain text or xhtml text.
 createNewImageFileName ($image_filename, $unique=false)
 _setReachedPoints ($active_id, $question_id, $points, $maxpoints, $pass, $manualscoring, $obligationsEnabled)
 Sets the points, a learner has reached answering the question Additionally objective results are updated.
 getQuestion ()
 Gets the question string of the question object.
 setQuestion ($question="")
 Sets the question string of the question object.
 getQuestionType ()
 Returns the question type of the question.
 getQuestionTypeID ()
 Returns the question type of the question.
 cleanupMediaObjectUsage ()
 synchronises appearances of media objects in the question with media object usage table
getInstances ()
 Gets all instances of the question.
 _needsManualScoring ($question_id)
 getActiveUserData ($active_id)
 Returns the user id and the test id for a given active id.
 setExportDetailsXLS (&$worksheet, $startrow, $active_id, $pass, &$format_title, &$format_bold)
 Creates an Excel worksheet for the detailed cumulated results of this question.
 __get ($value)
 Object getter.
 __set ($key, $value)
 Object setter.
 getNrOfTries ()
 setNrOfTries ($a_nr_of_tries)
 setExportImagePath ($a_path)
 _questionExistsInTest ($question_id, $test_id)
 formatSAQuestion ($a_q)
 Format self assessment question.
 setPreventRteUsage ($a_val)
 Set prevent rte usage.
 getPreventRteUsage ()
 Get prevent rte usage.
 setSelfAssessmentEditingMode ($a_selfassessmenteditingmode)
 Set Self-Assessment Editing Mode.
 getSelfAssessmentEditingMode ()
 Get Self-Assessment Editing Mode.
 setDefaultNrOfTries ($a_defaultnroftries)
 Set Default Nr of Tries.
 getDefaultNrOfTries ()
 Get Default Nr of Tries.
 isAnswered ($active_id, $pass=null)
 returns boolean wether the question is answered during test pass or not
 setObligationsToBeConsidered ($obligationsToBeConsidered=true)
 sets the flag wether obligations are to be considered or not
 areObligationsToBeConsidered ()
 gets the flag wether obligations are to be considered or not
 isAutosaveable ()
 getAdditionalContentEditingMode ()
 getter for additional content editing mode for this question
 setAdditionalContentEditingMode ($additinalContentEditingMode)
 setter for additional content editing mode for this question
 isAdditionalContentEditingModePageObject ()
 isser for additional "pageobject" content editing mode
 isValidAdditionalContentEditingMode ($additionalContentEditingMode)
 returns the fact wether the passed additional content mode is valid or not
 getValidAdditionalContentEditingModes ()
 getter for valid additional content editing modes
 addQuestionChangeListener (ilQuestionChangeListener $listener)
 getQuestionChangeListeners ()
 getHtmlUserSolutionPurifier ()
 getHtmlQuestionContentPurifier ()
 setLastChange ($lastChange)
 getLastChange ()
 setStep ($step)
 getStep ()
 toJSON ()
 duplicate ($for_test=true, $title="", $author="", $owner="", $testObjId=null)

Static Public Member Functions

static _getSuggestedSolutionCount ($question_id)
 Returns the number of suggested solutions associated with a question.
static _getSuggestedSolutionOutput ($question_id)
 Returns the output of the suggested solution.
static _getTotalRightAnswers ($a_q_id)
 get number of answers for question id (static) note: do not use $this inside this method
static _getOriginalId ($question_id)
 Returns the original id of a question.
static originalQuestionExists ($questionId)
static _instanciateQuestion ($question_id)
 Creates an instance of a question with a given question id.
static _instantiateQuestion ($question_id)
static _isWorkedThrough ($active_id, $question_id, $pass=NULL)
 Returns true if the question was worked through in the given pass Worked through means that the user entered at least one value.
static _areAnswered ($a_user_id, $a_question_ids)
 Checks if an array of question ids is answered by an user or not.
static _includeClass ($question_type, $gui=0)
 Include the php class file for a given question type.
static getGuiClassNameByQuestionType ($questionType)
static getObjectClassNameByQuestionType ($questionType)
static getFeedbackClassNameByQuestionType ($questionType)
static isCoreQuestionType ($questionType)
static includeCoreClass ($questionType, $withGuiClass)
static includePluginClass ($questionType, $withGuiClass)
static _getQuestionTypeName ($type_tag)
 Return the translation for a given question type tag.
static & _instanciateQuestionGUI ($question_id)
 Creates an instance of a question gui with a given question id.
static instantiateQuestionGUI ($a_question_id)
 Creates an instance of a question gui with a given question id.
static lookupParentObjId ($questionId)
 ilDB $ilDB
static lookupOriginalParentObjId ($originalQuestionId)
 returns the parent object id for given original question id (should be a qpl id, but theoretically it can be a tst id, too)
static isObligationPossible ($questionId)
 returns boolean wether it is possible to set this question type as obligatory or not considering the current question configuration
static setResultGateway ($resultGateway)
static getResultGateway ()
static sumTimesInISO8601FormatH_i_s_Extended ($time1, $time2)
static convertISO8601FormatH_i_s_ExtendedToSeconds ($time)

Data Fields

const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT = 'default'
 constant for additional content editing mode "default"
const ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT = 'pageobject'
 constant for additional content editing mode "pageobject"
 $feedbackOBJ = null
 $prevent_rte_usage = false
 $selfassessmenteditingmode = false
 $defaultnroftries = 0
 $questionActionCmd = 'handleQuestionAction'

Protected Member Functions

 reworkWorkingData ($active_id, $pass, $obligationsAnswered)
 Reworks the allready saved working data if neccessary.
 savePreviewData (ilAssQuestionPreviewSession $previewSession)
 deletePageOfQuestion ($question_id)
 Deletes the page object of a question with a given ID.
 onDuplicate ($originalParentId, $originalQuestionId, $duplicateParentId, $duplicateQuestionId)
 Will be called when a question is duplicated (inside a question pool or for insertion in a test)
 beforeSyncWithOriginal ($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId)
 afterSyncWithOriginal ($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId)
 onCopy ($sourceParentId, $sourceQuestionId, $targetParentId, $targetQuestionId)
 Will be called when a question is copied (into another question pool)
 duplicateSuggestedSolutionFiles ($parent_id, $question_id)
 Duplicates the files of a suggested solution if the question is duplicated.
 syncSuggestedSolutionFiles ($original_id)
 Syncs the files of a suggested solution if the question is synced.
 copySuggestedSolutionFiles ($source_questionpool_id, $source_question_id)
 getRTETextWithMediaObjects ()
 Collects all text in the question which could contain media objects which were created with the Rich Text Editor.
 duplicateQuestionHints ($originalQuestionId, $duplicateQuestionId)
 buildQuestionDataQuery ()

Static Protected Member Functions

static getNumExistingSolutionRecords ($activeId, $pass, $questionId)
 returns the number of existing solution records for the given test active / pass and given question id

Protected Attributes

 $id
 $title
 $comment
 $owner
 $author
 $question
 $points
 $est_working_time
 $shuffle
 $test_id
 $obj_id
 $ilias
 $tpl
 $lng
 $db
 $outputType
 $suggested_solutions
 $original_id
 $page
 $external_id = ''
 $questionChangeListeners = array()
 $processLocker
 $step = null
 $lastChange

Private Member Functions

 deleteTaxonomyAssignments ()
 notifyQuestionCreated ()
 notifyQuestionEdited ()
 notifyQuestionDeleted ()

Private Attributes

 $nr_of_tries
 Number of tries.
 $arrData
 Associative array to store properties.
 $export_image_path
 (Web) Path to images
 $obligationsToBeConsidered = false
 $additinalContentEditingMode = null

Static Private Attributes

static $resultGateway = null

Detailed Description

Abstract basic class which is to be extended by the concrete assessment question type classes.

The assQuestion class defines and encapsulates basic/common methods and attributes as well as it provides abstract methods that are to be implemented by concrete question type classes.

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Björn Heyser bheys.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
Id:
class.assQuestion.php 61462 2015-12-14 13:36:36Z gitmgr

Definition at line 20 of file class.assQuestion.php.

Constructor & Destructor Documentation

assQuestion::__construct (   $title = "",
  $comment = "",
  $author = "",
  $owner = -1,
  $question = "" 
)

assQuestion constructor

Parameters
string$titleA title string to describe the question
string$commentA comment string to describe the question
string$authorA string containing the name of the questions author
integer$ownerA numerical ID to identify the owner/creator
string$questionQuestion text public

Reimplemented in assClozeTest, assTextQuestion, assTextSubset, assNumeric, assKprimChoice, assFileUpload, assErrorText, assFormulaQuestion, assFlashQuestion, and assOrderingHorizontal.

Definition at line 257 of file class.assQuestion.php.

References $author, $comment, $ilDB, $ilias, $lng, $owner, $question, $title, $tpl, OUTPUT_JAVASCRIPT, setEstimatedWorkingTime(), setExternalId(), and setQuestion().

{
global $ilias, $lng, $tpl, $ilDB;
$this->ilias = $ilias;
$this->lng = $lng;
$this->tpl = $tpl;
$this->db = $ilDB;
$this->original_id = null;
$this->title = $title;
$this->comment = $comment;
$this->page = null;
$this->author = $author;
if (!$this->author)
{
$this->author = $this->ilias->account->fullname;
}
$this->owner = $owner;
if ($this->owner <= 0)
{
$this->owner = $this->ilias->account->id;
}
$this->id = -1;
$this->test_id = -1;
$this->suggested_solutions = array();
$this->shuffle = 1;
$this->nr_of_tries = 0;
$this->setEstimatedWorkingTime(0,1,0);
$this->outputType = OUTPUT_JAVASCRIPT;
$this->arrData = array();
$this->setExternalId('');
$this->questionActionCmd = 'handleQuestionAction';
$this->lastChange = null;
}

+ Here is the call graph for this function:

Member Function Documentation

assQuestion::__get (   $value)

Object getter.

Reimplemented in assFormulaQuestion, assErrorText, assFileUpload, and assOrderingHorizontal.

Definition at line 3837 of file class.assQuestion.php.

References $ilias, $page, $tpl, getAuthor(), getComment(), getEstimatedWorkingTime(), getId(), getObjId(), getOriginalId(), getOutputType(), getOwner(), getPoints(), getQuestion(), getShuffle(), getSuggestedSolutions(), getTestId(), and getTitle().

{
switch ($value)
{
case "id":
return $this->getId();
break;
case "title":
return $this->getTitle();
break;
case "comment":
return $this->getComment();
break;
case "owner":
return $this->getOwner();
break;
case "author":
return $this->getAuthor();
break;
case "question":
return $this->getQuestion();
break;
case "points":
return $this->getPoints();
break;
case "est_working_time":
return $this->getEstimatedWorkingTime();
break;
case "shuffle":
return $this->getShuffle();
break;
case "test_id":
return $this->getTestId();
break;
case "obj_id":
return $this->getObjId();
break;
case "ilias":
return $this->ilias;
break;
case "tpl":
return $this->tpl;
break;
case "page":
return $this->page;
break;
case "outputType":
return $this->getOutputType();
break;
case "suggested_solutions":
return $this->getSuggestedSolutions();
break;
case "original_id":
return $this->getOriginalId();
break;
default:
if (array_key_exists($value, $this->arrData))
{
return $this->arrData[$value];
}
else
{
return null;
}
break;
}
}

+ Here is the call graph for this function:

assQuestion::__set (   $key,
  $value 
)

Object setter.

Reimplemented in assErrorText, assFileUpload, and assOrderingHorizontal.

Definition at line 3908 of file class.assQuestion.php.

References setAuthor(), setComment(), setEstimatedWorkingTime(), setId(), setObjId(), setOriginalId(), setOutputType(), setOwner(), setPoints(), setQuestion(), setShuffle(), setTestId(), and setTitle().

{
switch ($key)
{
case "id":
$this->setId($value);
break;
case "title":
$this->setTitle($value);
break;
case "comment":
$this->setComment($value);
break;
case "owner":
$this->setOwner($value);
break;
case "author":
$this->setAuthor($value);
break;
case "question":
$this->setQuestion($value);
break;
case "points":
$this->setPoints($value);
break;
case "est_working_time":
if (is_array($value))
{
$this->setEstimatedWorkingTime($value["h"], $value["m"], $value["s"]);
}
break;
case "shuffle":
$this->setShuffle($value);
break;
case "test_id":
$this->setTestId($value);
break;
case "obj_id":
$this->setObjId($value);
break;
case "outputType":
$this->setOutputType($value);
break;
case "original_id":
$this->setOriginalId($value);
break;
case "page":
$this->page =& $value;
break;
default:
$this->arrData[$key] = $value;
break;
}
}

+ Here is the call graph for this function:

static assQuestion::_areAnswered (   $a_user_id,
  $a_question_ids 
)
static

Checks if an array of question ids is answered by an user or not.

Parameters
intuser_id
array$question_idsuser id array
Returns
boolean

Definition at line 3215 of file class.assQuestion.php.

References $ilDB, and $res.

Referenced by ilCourseObjectiveResult\getStatus().

{
global $ilDB;
$res = $ilDB->queryF("SELECT DISTINCT(question_fi) FROM tst_test_result JOIN tst_active ".
"ON (active_id = active_fi) ".
"WHERE " . $ilDB->in('question_fi', $a_question_ids, false, 'integer') .
" AND user_fi = %s",
array('integer'),
array($a_user_id)
);
return ($res->numRows() == count($a_question_ids)) ? true : false;
}

+ Here is the caller graph for this function:

assQuestion::_getInternalLinkHref (   $target = "")

Definition at line 2767 of file class.assQuestion.php.

References $ilDB, and $target_id.

Referenced by getSuggestedSolutionOutput(), and assQuestionGUI\suggestedsolution().

{
global $ilDB;
$linktypes = array(
"lm" => "LearningModule",
"pg" => "PageObject",
"st" => "StructureObject",
"git" => "GlossaryItem",
"mob" => "MediaObject"
);
$href = "";
if (preg_match("/il__(\w+)_(\d+)/", $target, $matches))
{
$type = $matches[1];
$target_id = $matches[2];
include_once "./Services/Utilities/classes/class.ilUtil.php";
switch($linktypes[$matches[1]])
{
case "LearningModule":
$href = "./goto.php?target=" . $type . "_" . $target_id;
break;
case "PageObject":
case "StructureObject":
$href = "./goto.php?target=" . $type . "_" . $target_id;
break;
case "GlossaryItem":
$href = "./goto.php?target=" . $type . "_" . $target_id;
break;
case "MediaObject":
$href = "./ilias.php?baseClass=ilLMPresentationGUI&obj_type=" . $linktypes[$type] . "&cmd=media&ref_id=".$_GET["ref_id"]."&mob_id=".$target_id;
break;
}
}
return $href;
}

+ Here is the caller graph for this function:

assQuestion::_getMaximumPoints (   $question_id)

Returns the maximum points, a learner can reach answering the question.

Parameters
integer$question_idThe database Id of the question
See Also
$points

Definition at line 733 of file class.assQuestion.php.

References $ilDB, $points, $result, and $row.

Referenced by _getTotalRightAnswers(), ilCourseObjectiveQuestion\_lookupMaximumPointsOfQuestion(), ilTestScoringGUI\buildManScoringParticipantForm(), assFileUpload\handleSubmission(), ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI\initFilter(), and ilTestScoringGUI\saveManScoringParticipantScreen().

{
global $ilDB;
$points = 0;
$result = $ilDB->queryF("SELECT points FROM qpl_questions WHERE question_id = %s",
array('integer'),
array($question_id)
);
if ($result->numRows() == 1)
{
$row = $ilDB->fetchAssoc($result);
$points = $row["points"];
}
return $points;
}

+ Here is the caller graph for this function:

static assQuestion::_getOriginalId (   $question_id)
static

Returns the original id of a question.

Parameters
integer$question_idThe database id of the question
Returns
integer The database id of the original question public

Definition at line 2810 of file class.assQuestion.php.

References $ilDB, and $result.

Referenced by _logAction(), ilTestFixedQuestionSetConfig\cloneQuestionSetRelatedData(), ilObjTestGUI\copyAndLinkToQuestionpoolObject(), assOrderingHorizontal\copyObject(), assFileUpload\copyObject(), assNumeric\copyObject(), assTextQuestion\copyObject(), assImagemapQuestion\copyObject(), assFlashQuestion\copyObject(), assOrderingQuestion\copyObject(), assErrorText\copyObject(), assTextSubset\copyObject(), assMultipleChoice\copyObject(), assSingleChoice\copyObject(), assMatchingQuestion\copyObject(), assJavaApplet\copyObject(), assFormulaQuestion\copyObject(), assKprimChoice\copyObject(), assClozeTest\copyObject(), assOrderingHorizontal\duplicate(), assFileUpload\duplicate(), assNumeric\duplicate(), assTextQuestion\duplicate(), assImagemapQuestion\duplicate(), assFlashQuestion\duplicate(), assOrderingQuestion\duplicate(), assErrorText\duplicate(), assTextSubset\duplicate(), assSingleChoice\duplicate(), assMultipleChoice\duplicate(), assMatchingQuestion\duplicate(), assJavaApplet\duplicate(), assKprimChoice\duplicate(), assFormulaQuestion\duplicate(), assClozeTest\duplicate(), logAction(), and ilObjTest\logAction().

{
global $ilDB;
$result = $ilDB->queryF("SELECT * FROM qpl_questions WHERE question_id = %s",
array('integer'),
array($question_id)
);
if ($result->numRows() > 0)
{
$row = $ilDB->fetchAssoc($result);
if ($row["original_id"] > 0)
{
return $row["original_id"];
}
else
{
return $row["question_id"];
}
}
else
{
return "";
}
}

+ Here is the caller graph for this function:

& assQuestion::_getQuestionInfo (   $question_id)

Returns question information from the database.

Parameters
integer$question_idThe database Id of the question
Returns
array The database row containing the question data

Definition at line 756 of file class.assQuestion.php.

References $ilDB, and $result.

Referenced by ilObjMediaObject\getParentObjectIdForUsage(), and ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI\initFilter().

{
global $ilDB;
$result = $ilDB->queryF("SELECT qpl_questions.*, qpl_qst_type.type_tag FROM qpl_qst_type, qpl_questions WHERE qpl_questions.question_id = %s AND qpl_questions.question_type_fi = qpl_qst_type.question_type_id",
array('integer'),
array($question_id)
);
if ($result->numRows())
{
return $ilDB->fetchAssoc($result);
}
else return array();
}

+ Here is the caller graph for this function:

assQuestion::_getQuestionText (   $a_q_id)

Returns question text.

Parameters
int$a_q_idquestion id

Definition at line 2036 of file class.assQuestion.php.

References $ilDB, and $result.

Referenced by ilLMQuestionListTableGUI\fillRow().

{
global $ilDB;
$result = $ilDB->queryF("SELECT question_text FROM qpl_questions WHERE question_id = %s",
array('integer'),
array($a_q_id)
);
if ($result->numRows() == 1)
{
$row = $ilDB->fetchAssoc($result);
return $row["question_text"];
}
else
{
return "";
}
}

+ Here is the caller graph for this function:

assQuestion::_getQuestionTitle (   $question_id)

Returns the question title of a question with a given id.

Parameters
integer$question_idThe database id of the question
Returns
string The question title private

Definition at line 2146 of file class.assQuestion.php.

References $ilDB, and $result.

Referenced by ilObjAssessmentFolderGUI\exportLogObject(), ilAssessmentFolderLogTableGUI\fillRow(), and ilObjectivesAlignmentTableGUI\fillRow().

{
global $ilDB;
if ($question_id < 1) return "";
$result = $ilDB->queryF("SELECT title FROM qpl_questions WHERE qpl_questions.question_id = %s",
array('integer'),
array($question_id)
);
if ($result->numRows() == 1)
{
$data = $ilDB->fetchAssoc($result);
return $data["title"];
}
else
{
return "";
}
}

+ Here is the caller graph for this function:

assQuestion::_getQuestionType (   $question_id)

Returns the question type of a question with a given id.

Parameters
integer$question_idThe database id of the question
Returns
string The question type string private

Definition at line 2119 of file class.assQuestion.php.

References $ilDB, and $result.

Referenced by _instantiateQuestion(), _needsManualScoring(), ilPageObjectGUI\executeCommand(), ilObjectivesAlignmentTableGUI\fillRow(), instantiateQuestionGUI(), ilObjTest\isQuestionObligationPossible(), and ilPCQuestionGUI\setTabs().

{
global $ilDB;
if ($question_id < 1) return "";
$result = $ilDB->queryF("SELECT type_tag FROM qpl_questions, qpl_qst_type WHERE qpl_questions.question_id = %s AND qpl_questions.question_type_fi = qpl_qst_type.question_type_id",
array('integer'),
array($question_id)
);
if ($result->numRows() == 1)
{
$data = $ilDB->fetchAssoc($result);
return $data["type_tag"];
}
else
{
return "";
}
}

+ Here is the caller graph for this function:

static assQuestion::_getQuestionTypeName (   $type_tag)
static

Return the translation for a given question type tag.

Parameters
string$type_tagThe type tag of the question type public

Definition at line 3738 of file class.assQuestion.php.

References $lng, ilPlugin\getPluginObject(), and IL_COMP_MODULE.

Referenced by ilObjQuestionPoolGUI\addLocatorItems(), ilObjTestGUI\createRandomSelectionObject(), ilCopySelfAssQuestionTableGUI\fillRow(), ilTestQuestionBrowserTableGUI\fillRow(), ilTestQuestionsTableGUI\fillRow(), ilQuestionBrowserTableGUI\fillRow(), assQuestionGUI\outQuestionType(), ilObjTestGUI\removeQuestionsForm(), and ilObjQuestionPoolGUI\setTitleAndDescription().

{
if (file_exists("./Modules/TestQuestionPool/classes/class.".$type_tag.".php"))
{
global $lng;
return $lng->txt($type_tag);
}
else
{
global $ilPluginAdmin;
$pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, "TestQuestionPool", "qst");
foreach ($pl_names as $pl_name)
{
$pl = ilPlugin::getPluginObject(IL_COMP_MODULE, "TestQuestionPool", "qst", $pl_name);
if (strcmp($pl->getQuestionType(), $type_tag) == 0)
{
return $pl->getQuestionTypeTranslation();
}
}
}
return "";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::_getReachedPoints (   $active_id,
  $question_id,
  $pass = NULL 
)

Returns the points, a learner has reached answering the question.

Parameters
integer$user_idThe database ID of the learner
integer$test_idThe database Id of the test containing the question
integer$question_idThe database Id of the question

Definition at line 877 of file class.assQuestion.php.

References $ilDB, $pass, $points, $result, $row, and _getSolutionMaxPass().

Referenced by ilTestScoringGUI\buildManScoringParticipantForm(), ilTestServiceGUI\getPassListOfAnswersWithScoring(), getReachedPoints(), and ilTestPlayerDynamicQuestionSetGUI\isQuestionAnsweredCorrect().

{
global $ilDB;
$points = 0;
if (is_null($pass))
{
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$pass = assQuestion::_getSolutionMaxPass($question_id, $active_id);
}
$result = $ilDB->queryF("SELECT * FROM tst_test_result WHERE active_fi = %s AND question_fi = %s AND pass = %s",
array('integer','integer','integer'),
array($active_id, $question_id, $pass)
);
if ($result->numRows() == 1)
{
$row = $ilDB->fetchAssoc($result);
$points = $row["points"];
}
return $points;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::_getSolutionMaxPass (   $question_id,
  $active_id 
)

Returns the maximum pass a users question solution.

Parameters
returninteger The maximum pass of the users solution public

Definition at line 3035 of file class.assQuestion.php.

References $ilDB, and $result.

Referenced by _getReachedPoints(), _isWorkedThrough(), _setReachedPoints(), getSolutionMaxPass(), and ilObjTest\getTextAnswer().

{
/* include_once "./Modules/Test/classes/class.ilObjTest.php";
$pass = ilObjTest::_getPass($active_id);
return $pass;*/
// the following code was the old solution which added the non answered
// questions of a pass from the answered questions of the previous pass
// with the above solution, only the answered questions of the last pass are counted
global $ilDB;
$result = $ilDB->queryF("SELECT MAX(pass) maxpass FROM tst_test_result WHERE active_fi = %s AND question_fi = %s",
array('integer','integer'),
array($active_id, $question_id)
);
if ($result->numRows() == 1)
{
$row = $ilDB->fetchAssoc($result);
return $row["maxpass"];
}
else
{
return 0;
}
}

+ Here is the caller graph for this function:

& assQuestion::_getSuggestedSolution (   $question_id,
  $subquestion_index = 0 
)

Returns a suggested solution for a given subquestion index.

Parameters
integer$question_idThe database Id of the question
integer$subquestion_indexThe index of a subquestion (i.e. a close test gap). Usually 0
Returns
array A suggested solution array containing the internal link public

Definition at line 838 of file class.assQuestion.php.

References $ilDB, $result, and $row.

{
global $ilDB;
$result = $ilDB->queryF("SELECT * FROM qpl_sol_sug WHERE question_fi = %s AND subquestion_index = %s",
array('integer','integer'),
array($question_id, $subquestion_index)
);
if ($result->numRows() == 1)
{
$row = $ilDB->fetchAssoc($result);
return array(
"internal_link" => $row["internal_link"],
"import_id" => $row["import_id"]
);
}
else
{
return array();
}
}
static assQuestion::_getSuggestedSolutionCount (   $question_id)
static

Returns the number of suggested solutions associated with a question.

Parameters
integer$question_idThe database Id of the question
Returns
integer The number of suggested solutions

Definition at line 777 of file class.assQuestion.php.

References $ilDB, and $result.

{
global $ilDB;
$result = $ilDB->queryF("SELECT suggested_solution_id FROM qpl_sol_sug WHERE question_fi = %s",
array('integer'),
array($question_id)
);
return $result->numRows();
}
static assQuestion::_getSuggestedSolutionOutput (   $question_id)
static

Returns the output of the suggested solution.

Parameters
integer$question_idThe database Id of the question
Returns
string Suggested solution

Definition at line 794 of file class.assQuestion.php.

References $question, and _instanciateQuestion().

Referenced by ilObjTest\getTestResult().

{
if (!is_object($question)) return "";
return $question->getSuggestedSolutionOutput();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::_getTitle (   $a_q_id)

Returns the title of a question.

Parameters
int$a_q_idquestion id

Definition at line 2013 of file class.assQuestion.php.

References $ilDB, and $result.

Referenced by ilSCORM2004ScoGUI\sahs_questions(), and ilLMMailNotification\send().

{
global $ilDB;
$result = $ilDB->queryF("SELECT title FROM qpl_questions WHERE question_id = %s",
array('integer'),
array($a_q_id)
);
if ($result->numRows() == 1)
{
$row = $ilDB->fetchAssoc($result);
return $row["title"];
}
else
{
return "";
}
}

+ Here is the caller graph for this function:

assQuestion::_getTotalAnswers (   $a_q_id)

get number of answers for question id (static) note: do not use $this inside this method

Parameters
int$a_q_idquestion id

Definition at line 1935 of file class.assQuestion.php.

References $ilDB, and $result.

Referenced by getTotalAnswers().

{
global $ilDB;
// get all question references to the question id
$result = $ilDB->queryF("SELECT question_id FROM qpl_questions WHERE original_id = %s OR question_id = %s",
array('integer','integer'),
array($a_q_id, $a_q_id)
);
if ($result->numRows() == 0)
{
return 0;
}
$found_id = array();
while ($row = $ilDB->fetchAssoc($result))
{
array_push($found_id, $row["question_id"]);
}
$result = $ilDB->query("SELECT * FROM tst_test_result WHERE " . $ilDB->in('question_fi', $found_id, false, 'integer'));
return $result->numRows();
}

+ Here is the caller graph for this function:

static assQuestion::_getTotalRightAnswers (   $a_q_id)
static

get number of answers for question id (static) note: do not use $this inside this method

Parameters
int$a_q_idquestion id

Definition at line 1966 of file class.assQuestion.php.

References $ilDB, $result, and _getMaximumPoints().

Referenced by ilQuestionCumulatedStatisticsTableGUI\initData().

{
global $ilDB;
$result = $ilDB->queryF("SELECT question_id FROM qpl_questions WHERE original_id = %s OR question_id = %s",
array('integer','integer'),
array($a_q_id, $a_q_id)
);
if ($result->numRows() == 0)
{
return 0;
}
$found_id = array();
while ($row = $ilDB->fetchAssoc($result))
{
array_push($found_id, $row["question_id"]);
}
$result = $ilDB->query("SELECT * FROM tst_test_result WHERE " . $ilDB->in('question_fi', $found_id, false, 'integer'));
$answers = array();
while ($row = $ilDB->fetchAssoc($result))
{
$reached = $row["points"];
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$max = assQuestion::_getMaximumPoints($row["question_fi"]);
array_push($answers, array("reached" => $reached, "max" => $max));
}
$max = 0.0;
$reached = 0.0;
foreach ($answers as $key => $value)
{
$max += $value["max"];
$reached += $value["reached"];
}
if ($max > 0)
{
return $reached / $max;
}
else
{
return 0;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static assQuestion::_includeClass (   $question_type,
  $gui = 0 
)
static

Include the php class file for a given question type.

Parameters
string$question_typeThe type tag of the question type
Returns
integer 0 if the class should be included, 1 if the GUI class should be included public

Definition at line 3650 of file class.assQuestion.php.

References includeCoreClass(), and includePluginClass().

Referenced by assQuestionGUI\_getQuestionGUI(), _instantiateQuestion(), ilObjQuestionPool\createQuestion(), ilObjTest\createQuestionGUI(), ilQTIParser\handlerParseEndTag(), instantiateQuestionGUI(), and ilObjTest\isQuestionObligationPossible().

{
if( self::isCoreQuestionType($question_type) )
{
self::includeCoreClass($question_type, $gui);
}
else
{
self::includePluginClass($question_type, $gui);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static& assQuestion::_instanciateQuestionGUI (   $question_id)
static

Creates an instance of a question gui with a given question id.

Parameters
integer$question_idThe question id
Returns
The question gui instance
Deprecated:
Use instantiateQuestionGUI (without legacy underscore & typos) instead. public

Definition at line 3770 of file class.assQuestion.php.

References instantiateQuestionGUI().

Referenced by ilObjTestGUI\copyQuestionObject(), ilObjQuestionPool\createQuestion(), and ilQuestionPoolPrintViewTableGUI\fillRow().

{
return self::instantiateQuestionGUI($question_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static assQuestion::_instantiateQuestion (   $question_id)
static

Definition at line 2968 of file class.assQuestion.php.

References $ilCtrl, $ilDB, $lng, $question, _getQuestionType(), _includeClass(), getFeedbackClassNameByQuestionType(), and getObjectClassNameByQuestionType().

Referenced by _instanciateQuestion(), ilSCORM2004Asset\exportXMLPageObjects(), ilPageObject\newQuestionCopies(), and ilAssIncompleteQuestionPurger\purgeQuestionIds().

{
global $ilCtrl, $ilDB, $lng;
if (strcmp($question_id, "") != 0)
{
$question_type = assQuestion::_getQuestionType($question_id);
if (!strlen($question_type)) return null;
assQuestion::_includeClass($question_type);
$objectClassname = self::getObjectClassNameByQuestionType($question_type);
$question = new $objectClassname();
$question->loadFromDb($question_id);
$feedbackObjectClassname = self::getFeedbackClassNameByQuestionType($question_type);
$question->feedbackOBJ = new $feedbackObjectClassname($question, $ilCtrl, $ilDB, $lng);
return $question;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::_isUsedInRandomTest (   $question_id = "")

Checks whether the question is used in a random test or not.

Returns
boolean The number how often the question is used in a random test public

Definition at line 3101 of file class.assQuestion.php.

References $ilDB, and $result.

Referenced by ilObjQuestionPool\getDeleteableQuestionDetails().

{
global $ilDB;
if ($question_id < 1) return 0;
$result = $ilDB->queryF("SELECT test_random_question_id FROM tst_test_rnd_qst WHERE question_fi = %s",
array('integer'),
array($question_id)
);
return $result->numRows();
}

+ Here is the caller graph for this function:

static assQuestion::_isWorkedThrough (   $active_id,
  $question_id,
  $pass = NULL 
)
static

Returns true if the question was worked through in the given pass Worked through means that the user entered at least one value.

Parameters
integer$user_idThe database ID of the learner
integer$test_idThe database Id of the test containing the question
integer$question_idThe database Id of the question

Definition at line 3184 of file class.assQuestion.php.

References $ilDB, $points, $result, and _getSolutionMaxPass().

Referenced by ilObjTest\getAnsweredQuestionCount().

{
global $ilDB;
$points = 0;
if (is_null($pass))
{
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$pass = assQuestion::_getSolutionMaxPass($question_id, $active_id);
}
$result = $ilDB->queryF("SELECT solution_id FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
array('integer','integer','integer'),
array($active_id, $question_id, $pass)
);
if ($result->numRows())
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::_isWriteable (   $question_id,
  $user_id 
)

Returns true if the question is writeable by a certain user.

Parameters
integer$question_idThe database id of the question
integer$user_idThe database id of the user
Returns
boolean True, if the question exists, otherwise False public

Definition at line 3069 of file class.assQuestion.php.

References $ilDB, and $result.

Referenced by ilAssQuestionFeedbackEditingGUI\isSyncAfterSaveRequired(), ilAssQuestionHintsGUI\performDeleteCmd(), assQuestionGUI\save(), assQuestionGUI\saveEdit(), ilAssQuestionHintGUI\saveFormCmd(), ilAssQuestionHintsGUI\saveListOrderCmd(), assQuestionGUI\saveReturn(), assFormulaQuestionGUI\saveReturnFQ(), and assQuestionGUI\suggestedsolution().

{
global $ilDB;
if (($question_id < 1) || ($user_id < 1))
{
return false;
}
$result = $ilDB->queryF("SELECT obj_fi FROM qpl_questions WHERE question_id = %s",
array('integer'),
array($question_id)
);
if ($result->numRows() == 1)
{
$row = $ilDB->fetchAssoc($result);
$qpl_object_id = $row["obj_fi"];
include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
return ilObjQuestionPool::_isWriteable($qpl_object_id, $user_id);
}
else
{
return false;
}
}

+ Here is the caller graph for this function:

assQuestion::_logAction (   $logtext = "",
  $active_id = "",
  $question_id = "" 
)

Logs an action into the Test&Assessment log.

Parameters
string$logtextThe log text
integer$question_idIf given, saves the question id to the database public

Definition at line 1393 of file class.assQuestion.php.

References $ilUser, $original_id, ilObjAssessmentFolder\_addLog(), ilObjTest\_getObjectIDFromActiveID(), and _getOriginalId().

Referenced by _setReachedPoints().

{
global $ilUser;
if (strcmp($question_id, "") != 0)
{
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
}
include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
include_once "./Modules/Test/classes/class.ilObjTest.php";
ilObjAssessmentFolder::_addLog($ilUser->id, ilObjTest::_getObjectIDFromActiveID($active_id), $logtext, $question_id, $original_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::_needsManualScoring (   $question_id)

Definition at line 3603 of file class.assQuestion.php.

References ilObjAssessmentFolder\_getManualScoringTypes(), and _getQuestionType().

Referenced by ilTestExpressPageObjectGUI\insertQuestions(), and ilObjTestGUI\insertQuestionsObject().

{
include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
$questiontype = assQuestion::_getQuestionType($question_id);
if (in_array($questiontype, $scoring))
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::_questionExists (   $question_id)

Returns true if the question already exists in the database.

Parameters
integer$question_idThe database id of the question
Returns
boolean True, if the question exists, otherwise False public

Definition at line 2903 of file class.assQuestion.php.

References $ilDB, and $result.

{
global $ilDB;
if ($question_id < 1)
{
return false;
}
$result = $ilDB->queryF("SELECT question_id FROM qpl_questions WHERE question_id = %s",
array('integer'),
array($question_id)
);
if ($result->numRows() == 1)
{
return true;
}
else
{
return false;
}
}
assQuestion::_questionExistsInPool (   $question_id)

Returns true if the question already exists in the database and is assigned to a question pool.

Parameters
integer$question_idThe database id of the question
Returns
boolean True, if the question exists, otherwise False public

Definition at line 2933 of file class.assQuestion.php.

References $ilDB, and $result.

Referenced by assQuestionGUI\outQuestionType().

{
global $ilDB;
if ($question_id < 1)
{
return false;
}
$result = $ilDB->queryF("SELECT question_id FROM qpl_questions INNER JOIN object_data ON obj_fi = obj_id WHERE question_id = %s AND type = 'qpl'",
array('integer'),
array($question_id)
);
if ($result->numRows() == 1)
{
return true;
}
else
{
return false;
}
}

+ Here is the caller graph for this function:

assQuestion::_questionExistsInTest (   $question_id,
  $test_id 
)

Definition at line 3978 of file class.assQuestion.php.

References $ilDB, $result, and $test_id.

Referenced by assQuestionGUI\save(), assQuestionGUI\saveReturn(), and assFormulaQuestionGUI\saveReturnFQ().

{
global $ilDB;
if ($question_id < 1)
{
return false;
}
$result = $ilDB->queryF("SELECT question_fi FROM tst_test_question WHERE question_fi = %s AND test_fi = %s",
array('integer', 'integer'),
array($question_id, $test_id)
);
if ($result->numRows() == 1)
{
return true;
}
else
{
return false;
}
}

+ Here is the caller graph for this function:

assQuestion::_resolveInternalLink (   $internal_link)

Definition at line 2679 of file class.assQuestion.php.

References ilInternalLink\_getIdForImportId(), and ilLMObject\_getIdForImportId().

Referenced by _resolveIntLinks(), and setSuggestedSolution().

{
if (preg_match("/il_(\d+)_(\w+)_(\d+)/", $internal_link, $matches))
{
include_once "./Services/Link/classes/class.ilInternalLink.php";
include_once "./Modules/LearningModule/classes/class.ilLMObject.php";
include_once "./Modules/Glossary/classes/class.ilGlossaryTerm.php";
switch ($matches[2])
{
case "lm":
$resolved_link = ilLMObject::_getIdForImportId($internal_link);
break;
case "pg":
$resolved_link = ilInternalLink::_getIdForImportId("PageObject", $internal_link);
break;
case "st":
$resolved_link = ilInternalLink::_getIdForImportId("StructureObject", $internal_link);
break;
case "git":
$resolved_link = ilInternalLink::_getIdForImportId("GlossaryItem", $internal_link);
break;
case "mob":
$resolved_link = ilInternalLink::_getIdForImportId("MediaObject", $internal_link);
break;
}
if (strcmp($resolved_link, "") == 0)
{
$resolved_link = $internal_link;
}
}
else
{
$resolved_link = $internal_link;
}
return $resolved_link;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::_resolveIntLinks (   $question_id)

Definition at line 2716 of file class.assQuestion.php.

References $ilDB, $result, ilInternalLink\_deleteAllLinksOfSource(), _resolveInternalLink(), and ilInternalLink\_saveLink().

Referenced by ilContObjParser\processPagesToParse().

{
global $ilDB;
$resolvedlinks = 0;
$result = $ilDB->queryF("SELECT * FROM qpl_sol_sug WHERE question_fi = %s",
array('integer'),
array($question_id)
);
if ($result->numRows())
{
while ($row = $ilDB->fetchAssoc($result))
{
$internal_link = $row["internal_link"];
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$resolved_link = assQuestion::_resolveInternalLink($internal_link);
if (strcmp($internal_link, $resolved_link) != 0)
{
// internal link was resolved successfully
$affectedRows = $ilDB->manipulateF("UPDATE qpl_sol_sug SET internal_link = %s WHERE suggested_solution_id = %s",
array('text','integer'),
array($resolved_link, $row["suggested_solution_id"])
);
$resolvedlinks++;
}
}
}
if ($resolvedlinks)
{
// there are resolved links -> reenter theses links to the database
// delete all internal links from the database
include_once "./Services/Link/classes/class.ilInternalLink.php";
$result = $ilDB->queryF("SELECT * FROM qpl_sol_sug WHERE question_fi = %s",
array('integer'),
array($question_id)
);
if ($result->numRows())
{
while ($row = $ilDB->fetchAssoc($result))
{
if (preg_match("/il_(\d*?)_(\w+)_(\d+)/", $row["internal_link"], $matches))
{
ilInternalLink::_saveLink("qst", $question_id, $matches[2], $matches[3], $matches[1]);
}
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::_setReachedPoints (   $active_id,
  $question_id,
  $points,
  $maxpoints,
  $pass,
  $manualscoring,
  $obligationsEnabled 
)

Sets the points, a learner has reached answering the question Additionally objective results are updated.

Parameters
integer$user_idThe database ID of the learner
integer$test_idThe database Id of the test containing the question
integer$pointsThe points the user has reached answering the question
Returns
boolean true on success, otherwise false public

Definition at line 3366 of file class.assQuestion.php.

References $ilDB, $ilUser, $lng, $points, $result, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), ilObjTestAccess\_getParticipantData(), _getSolutionMaxPass(), ilObjTest\_getUserIdFromActiveId(), _logAction(), and ilCourseObjectiveResult\_updateObjectiveResult().

Referenced by assFileUpload\handleSubmission(), and ilTestScoringGUI\saveManScoringParticipantScreen().

{
global $ilDB;
if ($points <= $maxpoints)
{
if (is_null($pass))
{
$pass = assQuestion::_getSolutionMaxPass($question_id, $active_id);
}
// retrieve the already given points
$old_points = 0;
$result = $ilDB->queryF("SELECT points FROM tst_test_result WHERE active_fi = %s AND question_fi = %s AND pass = %s",
array('integer','integer','integer'),
array($active_id, $question_id, $pass)
);
$manual = ($manualscoring) ? 1 : 0;
$rowsnum = $result->numRows();
if($rowsnum)
{
$row = $ilDB->fetchAssoc($result);
$old_points = $row["points"];
if($old_points != $points)
{
$affectedRows = $ilDB->manipulateF("UPDATE tst_test_result SET points = %s, manual = %s, tstamp = %s WHERE active_fi = %s AND question_fi = %s AND pass = %s",
array('float', 'integer', 'integer', 'integer', 'integer', 'integer'),
array($points, $manual, time(), $active_id, $question_id, $pass)
);
}
}
else
{
$next_id = $ilDB->nextId('tst_test_result');
$affectedRows = $ilDB->manipulateF("INSERT INTO tst_test_result (test_result_id, active_fi, question_fi, points, pass, manual, tstamp) VALUES (%s, %s, %s, %s, %s, %s, %s)",
array('integer', 'integer','integer', 'float', 'integer', 'integer','integer'),
array($next_id, $active_id, $question_id, $points, $pass, $manual, time())
);
}
if($old_points != $points || !$rowsnum)
{
assQuestion::_updateTestPassResults($active_id, $pass, $obligationsEnabled);
// finally update objective result
include_once "./Modules/Test/classes/class.ilObjTest.php";
include_once './Modules/Course/classes/class.ilCourseObjectiveResult.php';
include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
{
global $lng, $ilUser;
include_once "./Modules/Test/classes/class.ilObjTestAccess.php";
$username = ilObjTestAccess::_getParticipantData($active_id);
assQuestion::_logAction(sprintf($lng->txtlng("assessment", "log_answer_changed_points", ilObjAssessmentFolder::_getLogLanguage()), $username, $old_points, $points, $ilUser->getFullname() . " (" . $ilUser->getLogin() . ")"), $active_id, $question_id);
}
}
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::_updateTestResultCache (   $active_id,
ilAssQuestionProcessLocker  $processLocker = null 
)

Move this to a proper place.

Definition at line 1138 of file class.assQuestion.php.

References $ilDB, $pass, $processLocker, $query, $result, $row, and ilObjTest\_getResultPass().

Referenced by ilObjTestAccess\_getPassedUsers(), ilObjTestAccess\_isPassed(), ilObjTest\getResultsForActiveId(), ilTestScoring\recalculateSolutions(), and ilObjTestAccess\updateTestResultCache().

{
global $ilDB;
include_once "./Modules/Test/classes/class.ilObjTest.php";
include_once "./Modules/Test/classes/class.assMarkSchema.php";
$query = "
SELECT tst_pass_result.*
FROM tst_pass_result
WHERE active_fi = %s
AND pass = %s
";
$result = $ilDB->queryF(
$query, array('integer','integer'), array($active_id, $pass)
);
$row = $ilDB->fetchAssoc($result);
$max = $row['maxpoints'];
$reached = $row['points'];
$obligationsAnswered = (int)$row['obligations_answered'];
include_once "./Modules/Test/classes/class.assMarkSchema.php";
$percentage = (!$max) ? 0 : ($reached / $max) * 100.0;
$mark = ASS_MarkSchema::_getMatchingMarkFromActiveId($active_id, $percentage);
$isPassed = ( $mark["passed"] ? 1 : 0 );
$isFailed = ( !$mark["passed"] ? 1 : 0 );
if( is_object($processLocker) )
{
}
$query = "
DELETE FROM tst_result_cache
WHERE active_fi = %s
";
$affectedRows = $ilDB->manipulateF(
$query, array('integer'), array($active_id)
);
$ilDB->insert('tst_result_cache', array(
'active_fi'=> array('integer', $active_id),
'pass'=> array('integer', strlen($pass) ? $pass : 0),
'max_points'=> array('float', strlen($max) ? $max : 0),
'reached_points'=> array('float', strlen($reached) ? $reached : 0),
'mark_short'=> array('text', strlen($mark["short_name"]) ? $mark["short_name"] : " "),
'mark_official'=> array('text', strlen($mark["official_name"]) ? $mark["official_name"] : " "),
'passed'=> array('integer', $isPassed),
'failed'=> array('integer', $isFailed),
'tstamp'=> array('integer', time()),
'hint_count'=> array('integer', $row['hint_count']),
'hint_points'=> array('float', $row['hint_points']),
'obligations_answered' => array('integer', $obligationsAnswered)
));
if( is_object($processLocker) )
{
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::addQTIMaterial ( $a_xml_writer,
  $a_material,
  $close_material_tag = TRUE,
  $add_mobs = TRUE 
)

Creates a QTI material tag from a plain text or xhtml text.

Parameters
object$a_xml_writerReference to the ILIAS XML writer
string$a_materialplain text or html text containing the material
Returns
string QTI material tag public

Definition at line 3300 of file class.assQuestion.php.

References $mobs, ilObjMediaObject\_exists(), ilObjMediaObject\_getMobsOfObject(), ilRTE\_replaceMediaObjectImageSrc(), getId(), and isHTML().

{
include_once "./Services/RTE/classes/class.ilRTE.php";
include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
$a_xml_writer->xmlStartTag("material");
$attrs = array(
"texttype" => "text/plain"
);
if ($this->isHTML($a_material))
{
$attrs["texttype"] = "text/xhtml";
}
$a_xml_writer->xmlElement("mattext", $attrs, ilRTE::_replaceMediaObjectImageSrc($a_material, 0));
if ($add_mobs)
{
foreach ($mobs as $mob)
{
$moblabel = "il_" . IL_INST_ID . "_mob_" . $mob;
if (strpos($a_material, "mm_$mob") !== FALSE)
{
{
$mob_obj =& new ilObjMediaObject($mob);
$imgattrs = array(
"label" => $moblabel,
"uri" => "objects/" . "il_" . IL_INST_ID . "_mob_" . $mob . "/" . $mob_obj->getTitle()
);
}
$a_xml_writer->xmlElement("matimage", $imgattrs, NULL);
}
}
}
if ($close_material_tag) $a_xml_writer->xmlEndTag("material");
}

+ Here is the call graph for this function:

assQuestion::addQuestionChangeListener ( ilQuestionChangeListener  $listener)
Parameters
ilQuestionChangeListener$listener

Definition at line 4310 of file class.assQuestion.php.

Referenced by ilObjQuestionPool\addQuestionChangeListeners().

{
$this->questionChangeListeners[] = $listener;
}

+ Here is the caller graph for this function:

assQuestion::adjustReachedPointsByScoringOptions (   $points,
  $active_id,
  $pass = NULL 
)
final

Adjust the given reached points by checks for all special scoring options in the test container.

public

Parameters
integer$points
integer$active_id
integer$pass

Definition at line 3154 of file class.assQuestion.php.

References $points, ilObjTest\_getCountSystem(), ilObjTest\_getScoreCutting(), and getMaximumPoints().

Referenced by calculateResultsFromSolution(), and getAdjustedReachedPoints().

{
include_once "./Modules/Test/classes/class.ilObjTest.php";
$count_system = ilObjTest::_getCountSystem($active_id);
if ($count_system == 1)
{
if (abs($this->getMaximumPoints() - $points) > 0.0000000001)
{
$points = 0;
}
}
$score_cutting = ilObjTest::_getScoreCutting($active_id);
if ($score_cutting == 0)
{
if ($points < 0)
{
$points = 0;
}
}
return $points;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::afterSyncWithOriginal (   $origQuestionId,
  $dupQuestionId,
  $origParentObjId,
  $dupParentObjId 
)
protected

Reimplemented in assKprimChoice.

Definition at line 2396 of file class.assQuestion.php.

Referenced by syncWithOriginal().

{
// sync question feeback
$this->feedbackOBJ->syncFeedback($origQuestionId, $dupQuestionId);
}

+ Here is the caller graph for this function:

assQuestion::areObligationsToBeConsidered ( )

gets the flag wether obligations are to be considered or not

Returns
bool $obligationsToBeConsidered

Definition at line 4191 of file class.assQuestion.php.

References $obligationsToBeConsidered.

assQuestion::beforeSyncWithOriginal (   $origQuestionId,
  $dupQuestionId,
  $origParentObjId,
  $dupParentObjId 
)
protected

Reimplemented in assKprimChoice.

Definition at line 2391 of file class.assQuestion.php.

Referenced by syncWithOriginal().

{
}

+ Here is the caller graph for this function:

assQuestion::buildImagePath (   $questionId,
  $parentObjectId 
)

Definition at line 1472 of file class.assQuestion.php.

Referenced by assKprimChoice\cloneAnswerImages(), and getImagePath().

{
return CLIENT_WEB_DIR . "/assessment/{$parentObjectId}/{$questionId}/images/";
}

+ Here is the caller graph for this function:

assQuestion::buildQuestionDataQuery ( )
protected

Definition at line 4365 of file class.assQuestion.php.

Referenced by assKprimChoice\loadFromDb().

{
return "
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
";
}

+ Here is the caller graph for this function:

assQuestion::calculateReachedPoints (   $active_id,
  $pass = NULL,
  $returndetails = FALSE 
)
abstract

Returns the points, a learner has reached answering the question.

The points are calculated from the given answers.

public

Parameters
integer$active_id
integer$pass
boolean$returndetails(deprecated !!)
Returns
integer/array $points/$details (array $details is deprecated !!)

Reimplemented in assClozeTest, assFormulaQuestion, assMatchingQuestion, assImagemapQuestion, assJavaApplet, assOrderingQuestion, assTextQuestion, assMultipleChoice, assSingleChoice, assTextSubset, assKprimChoice, assFlashQuestion, assErrorText, assFileUpload, and assOrderingHorizontal.

Referenced by calculateResultsFromSolution(), and getAdjustedReachedPoints().

+ Here is the caller graph for this function:

assQuestion::calculateReachedPointsFromPreviewSession ( ilAssQuestionPreviewSession  $previewSession)

Reimplemented in assClozeTest, assFormulaQuestion, assImagemapQuestion, assJavaApplet, assOrderingQuestion, assSingleChoice, assFlashQuestion, assErrorText, and assNumeric.

Definition at line 3126 of file class.assQuestion.php.

References ilAssQuestionPreviewSession\getParticipantsSolution().

Referenced by isPreviewSolutionCorrect().

{
return $this->calculateReachedPointsForSolution($previewSession->getParticipantsSolution());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::calculateResultsFromSolution (   $active_id,
  $pass = NULL,
  $obligationsEnabled = false 
)
final

Calculates the question results from a previously saved question solution.

ilDB $ilDB ilObjUser $ilUser

Parameters
integer$active_idActive id of the user
integer$passTest pass

Definition at line 968 of file class.assQuestion.php.

References $ilDB, $ilUser, $pass, $query, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), ilObjTest\_getPass(), ilCourseObjectiveResult\_updateObjectiveResult(), adjustReachedPointsByScoringOptions(), calculateReachedPoints(), getId(), getProcessLocker(), getStep(), isAnswered(), ilObjTest\isQuestionObligatory(), and logAction().

Referenced by persistWorkingState().

{
global $ilDB, $ilUser;
if( is_null($pass) )
{
include_once "./Modules/Test/classes/class.ilObjTest.php";
$pass = ilObjTest::_getPass($active_id);
}
// determine reached points for submitted solution
$reached_points = $this->calculateReachedPoints($active_id, $pass);
// deduct points for requested hints from reached points
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
$questionHintTracking = new ilAssQuestionHintTracking($this->getId(), $active_id, $pass);
$requestsStatisticData = $questionHintTracking->getRequestStatisticDataByQuestionAndTestpass();
$reached_points = $reached_points - $requestsStatisticData->getRequestsPoints();
// adjust reached points regarding to tests scoring options
$reached_points = $this->adjustReachedPointsByScoringOptions($reached_points, $active_id, $pass);
if( $obligationsEnabled && ilObjTest::isQuestionObligatory($this->getId()) )
{
$isAnswered = $this->isAnswered($active_id, $pass);
}
else
{
$isAnswered = true;
}
if( is_null($reached_points) ) $reached_points = 0;
$this->getProcessLocker()->requestUserQuestionResultUpdateLock();
$query = "
DELETE FROM tst_test_result
WHERE active_fi = %s
AND question_fi = %s
AND pass = %s
";
$types = array('integer', 'integer', 'integer');
$values = array($active_id, $this->getId(), $pass);
if( $this->getStep() !== NULL )
{
$query .= "
AND step = %s
";
$types[] = 'integer';
$values[] = $this->getStep();
}
$affectedRows = $ilDB->manipulateF($query, $types, $values);
$next_id = $ilDB->nextId("tst_test_result");
$fieldData = array(
'test_result_id' => array('integer', $next_id),
'active_fi' => array('integer', $active_id),
'question_fi' => array('integer', $this->getId()),
'pass' => array('integer', $pass),
'points' => array('float', $reached_points),
'tstamp' => array('integer', time()),
'hint_count' => array('integer', $requestsStatisticData->getRequestsCount()),
'hint_points' => array('float', $requestsStatisticData->getRequestsPoints()),
'answered' => array('integer', $isAnswered)
);
if( $this->getStep() !== NULL )
{
$fieldData['step'] = array('integer', $this->getStep());
}
$ilDB->insert('tst_test_result', $fieldData);
$this->getProcessLocker()->releaseUserQuestionResultUpdateLock();
include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
{
$this->logAction(
sprintf(
$this->lng->txtlng(
"assessment", "log_user_answered_question", ilObjAssessmentFolder::_getLogLanguage()
),
$reached_points
),
$active_id,
$this->getId()
);
}
// update test pass results
$this->_updateTestPassResults($active_id, $pass, $obligationsEnabled, $this->getProcessLocker());
// Update objective status
include_once 'Modules/Course/classes/class.ilCourseObjectiveResult.php';
ilCourseObjectiveResult::_updateObjectiveResult($ilUser->getId(),$active_id,$this->getId());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::cleanupMediaObjectUsage ( )

synchronises appearances of media objects in the question with media object usage table

Definition at line 3548 of file class.assQuestion.php.

References ilRTE\_cleanupMediaObjectUsage(), getId(), and getRTETextWithMediaObjects().

Referenced by saveToDb().

{
$combinedtext = $this->getRTETextWithMediaObjects();
include_once("./Services/RTE/classes/class.ilRTE.php");
ilRTE::_cleanupMediaObjectUsage($combinedtext, "qpl:html", $this->getId());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static assQuestion::convertISO8601FormatH_i_s_ExtendedToSeconds (   $time)
static
Parameters
$time
Returns
int

Definition at line 4531 of file class.assQuestion.php.

Referenced by sumTimesInISO8601FormatH_i_s_Extended().

{
$sec = 0;
$time_array = explode(':',$time);
if( sizeof($time_array) == 3)
{
$sec += $time_array[0] * 3600;
$sec += $time_array[1] * 60;
$sec += $time_array[2];
}
return $sec;
}

+ Here is the caller graph for this function:

assQuestion::copyPageOfQuestion (   $a_q_id)

Definition at line 2092 of file class.assQuestion.php.

References $page.

Referenced by syncWithOriginal().

{
if ($a_q_id > 0)
{
include_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php";
$page = new ilAssQuestionPage($a_q_id);
$xml = str_replace("il__qst_".$a_q_id, "il__qst_".$this->id, $page->getXMLContent());
$this->page->setXMLContent($xml);
$this->page->updateFromXML();
}
}

+ Here is the caller graph for this function:

assQuestion::copySuggestedSolutionFiles (   $source_questionpool_id,
  $source_question_id 
)
protected

Definition at line 2566 of file class.assQuestion.php.

References $filename, $ilLog, getSuggestedSolutionPath(), and ilUtil\makeDirParents().

Referenced by onCopy().

{
global $ilLog;
foreach ($this->suggested_solutions as $index => $solution)
{
if (strcmp($solution["type"], "file") == 0)
{
$filepath = $this->getSuggestedSolutionPath();
$filepath_original = str_replace("/$this->obj_id/$this->id/solution", "/$source_questionpool_id/$source_question_id/solution", $filepath);
if (!file_exists($filepath))
{
}
$filename = $solution["value"]["name"];
if (strlen($filename))
{
if (!copy($filepath_original . $filename, $filepath . $filename))
{
$ilLog->write("File could not be copied!!!!", $ilLog->ERROR);
$ilLog->write("object: " . print_r($this, TRUE), $ilLog->ERROR);
}
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::copyXHTMLMediaObjectsOfQuestion (   $a_q_id)

Definition at line 2055 of file class.assQuestion.php.

References $mobs, ilObjMediaObject\_getMobsOfObject(), ilObjMediaObject\_saveUsage(), and getId().

{
include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
$mobs = ilObjMediaObject::_getMobsOfObject("qpl:html", $a_q_id);
foreach ($mobs as $mob)
{
ilObjMediaObject::_saveUsage($mob, "qpl:html", $this->getId());
}
}

+ Here is the call graph for this function:

assQuestion::createNewImageFileName (   $image_filename,
  $unique = false 
)

Definition at line 3337 of file class.assQuestion.php.

Referenced by assKprimChoice\handleFileUpload().

{
$extension = "";
if (preg_match("/.*\.(png|jpg|gif|jpeg)$/i", $image_filename, $matches))
{
$extension = "." . $matches[1];
}
if($unique)
{
$image_filename = uniqid($image_filename.microtime(true));
}
$image_filename = md5($image_filename) . $extension;
return $image_filename;
}

+ Here is the caller graph for this function:

assQuestion::createNewQuestion (   $a_create_page = true)

Creates a new question without an owner when a new question is created This assures that an ID is given to the question if a file upload or something else occurs.

Returns
integer ID of the new question

Definition at line 2225 of file class.assQuestion.php.

References $_GET, $_POST, $ilDB, $ilUser, $obj_id, ilObject\_lookupObjId(), createPageObject(), getAdditionalContentEditingMode(), getAuthor(), getDefaultNrOfTries(), getEstimatedWorkingTime(), getExternalId(), getId(), getObjId(), getQuestionTypeID(), notifyQuestionCreated(), and setId().

{
global $ilDB, $ilUser;
$complete = "0";
$estw_time = $this->getEstimatedWorkingTime();
$estw_time = sprintf("%02d:%02d:%02d", $estw_time['h'], $estw_time['m'], $estw_time['s']);
$obj_id = ($this->getObjId() <= 0) ? (ilObject::_lookupObjId((strlen($_GET["ref_id"])) ? $_GET["ref_id"] : $_POST["sel_qpl"])) : $this->getObjId();
if ($obj_id > 0)
{
if($a_create_page)
{
$tstamp = 0;
}
else
{
// question pool must not try to purge
$tstamp = time();
}
$next_id = $ilDB->nextId('qpl_questions');
$affectedRows = $ilDB->insert("qpl_questions", array(
"question_id" => array("integer", $next_id),
"question_type_fi" => array("integer", $this->getQuestionTypeID()),
"obj_fi" => array("integer", $obj_id),
"title" => array("text", NULL),
"description" => array("text", NULL),
"author" => array("text", $this->getAuthor()),
"owner" => array("integer", $ilUser->getId()),
"question_text" => array("clob", NULL),
"points" => array("float", 0),
"nr_of_tries" => array("integer", $this->getDefaultNrOfTries()), // #10771
"working_time" => array("text", $estw_time),
"complete" => array("text", $complete),
"created" => array("integer", time()),
"original_id" => array("integer", NULL),
"tstamp" => array("integer", $tstamp),
"external_id" => array("text", $this->getExternalId()),
'add_cont_edit_mode' => array('text', $this->getAdditionalContentEditingMode())
));
$this->setId($next_id);
if($a_create_page)
{
// create page object of question
$this->createPageObject();
}
}
return $this->getId();
}

+ Here is the call graph for this function:

assQuestion::createPageObject ( )

create page object of question

Definition at line 2078 of file class.assQuestion.php.

References getId(), and getObjId().

Referenced by createNewQuestion(), saveQuestionDataToDb(), and syncWithOriginal().

{
$qpl_id = $this->getObjId();
include_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php";
$this->page = new ilAssQuestionPage(0);
$this->page->setId($this->getId());
$this->page->setParentId($qpl_id);
$this->page->setXMLContent("<PageObject><PageContent>".
"<Question QRef=\"il__qst_".$this->getId()."\"/>".
"</PageContent></PageObject>");
$this->page->create();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::createRandomSolution (   $test_id,
  $user_id 
)

Reimplemented in assSingleChoice, and assTextQuestion.

Definition at line 2892 of file class.assQuestion.php.

{
}
assQuestion::delete (   $question_id)

Deletes a question and all materials from the database.

Parameters
integer$question_idThe database id of the question private

Definition at line 1768 of file class.assQuestion.php.

References $ilDB, $ilLog, $mobs, $obj_id, $result, ilObjMediaObject\_exists(), ilObjMediaObject\_getMobsOfObject(), ilObjMediaObject\_removeUsage(), ilObjQuestionPool\_updateQuestionCount(), ilUtil\delDir(), deleteAdditionalTableData(), deleteAnswers(), ilAssQuestionHintList\deleteHintsByQuestionIds(), deletePageOfQuestion(), ilAssQuestionHintTracking\deleteRequestsByQuestionIds(), deleteTaxonomyAssignments(), getObjId(), isAdditionalContentEditingModePageObject(), and notifyQuestionDeleted().

{
global $ilDB, $ilLog;
if ($question_id < 1) return true; // nothing to do
$result = $ilDB->queryF("SELECT obj_fi FROM qpl_questions WHERE question_id = %s",
array('integer'),
array($question_id)
);
if ($result->numRows() == 1)
{
$row = $ilDB->fetchAssoc($result);
$obj_id = $row["obj_fi"];
}
else
{
return true; // nothing to do
}
try
{
$this->deletePageOfQuestion($question_id);
}
catch (Exception $e)
{
$ilLog->write("EXCEPTION: Could not delete page of question $question_id: $e");
return false;
}
$affectedRows = $ilDB->manipulateF("DELETE FROM qpl_questions WHERE question_id = %s",
array('integer'),
array($question_id)
);
if ($affectedRows == 0) return false;
try
{
$this->deleteAdditionalTableData($question_id);
$this->deleteAnswers($question_id);
$this->feedbackOBJ->deleteGenericFeedbacks($question_id, $this->isAdditionalContentEditingModePageObject());
$this->feedbackOBJ->deleteSpecificAnswerFeedbacks($question_id, $this->isAdditionalContentEditingModePageObject());
}
catch (Exception $e)
{
$ilLog->write("EXCEPTION: Could not delete additional table data of question $question_id: $e");
return false;
}
try
{
// delete the question in the tst_test_question table (list of test questions)
$affectedRows = $ilDB->manipulateF("DELETE FROM tst_test_question WHERE question_fi = %s",
array('integer'),
array($question_id)
);
}
catch (Exception $e)
{
$ilLog->write("EXCEPTION: Could not delete delete question $question_id from a test: $e");
return false;
}
try
{
// delete suggested solutions contained in the question
$affectedRows = $ilDB->manipulateF("DELETE FROM qpl_sol_sug WHERE question_fi = %s",
array('integer'),
array($question_id)
);
}
catch (Exception $e)
{
$ilLog->write("EXCEPTION: Could not delete suggested solutions of question $question_id: $e");
return false;
}
try
{
$directory = CLIENT_WEB_DIR . "/assessment/" . $obj_id . "/$question_id";
if (preg_match("/\d+/", $obj_id) and preg_match("/\d+/", $question_id) and is_dir($directory))
{
include_once "./Services/Utilities/classes/class.ilUtil.php";
ilUtil::delDir($directory);
}
}
catch (Exception $e)
{
$ilLog->write("EXCEPTION: Could not delete question file directory $directory of question $question_id: $e");
return false;
}
try
{
include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
$mobs = ilObjMediaObject::_getMobsOfObject("qpl:html", $question_id);
// remaining usages are not in text anymore -> delete them
// and media objects (note: delete method of ilObjMediaObject
// checks whether object is used in another context; if yes,
// the object is not deleted!)
foreach($mobs as $mob)
{
ilObjMediaObject::_removeUsage($mob, "qpl:html", $question_id);
{
$mob_obj =& new ilObjMediaObject($mob);
$mob_obj->delete();
}
}
}
catch (Exception $e)
{
$ilLog->write("EXCEPTION: Error deleting the media objects of question $question_id: $e");
return false;
}
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintList.php';
try
{
// update question count of question pool
include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
}
catch (Exception $e)
{
$ilLog->write("EXCEPTION: Error updating the question pool question count of question pool " . $this->getObjId() . " when deleting question $question_id: $e");
return false;
}
$this->notifyQuestionDeleted($this);
return true;
}

+ Here is the call graph for this function:

assQuestion::deleteAdditionalTableData (   $question_id)

Deletes datasets from the additional question table in the database.

Parameters
integer$question_idThe question id which should be deleted in the additional question table public

Definition at line 1725 of file class.assQuestion.php.

References $ilDB, and getAdditionalTableName().

Referenced by delete().

{
global $ilDB;
$additional_table_name = $this->getAdditionalTableName();
if( !is_array($additional_table_name) )
{
$additional_table_name = array($additional_table_name);
}
foreach ($additional_table_name as $table)
{
if (strlen($table))
{
$affectedRows = $ilDB->manipulateF("DELETE FROM $table WHERE question_fi = %s",
array('integer'),
array($question_id)
);
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::deleteAnswers (   $question_id)

Deletes datasets from answers tables.

Parameters
integer$question_idThe question id which should be deleted in the answers table public

Reimplemented in assFormulaQuestion, assFileUpload, assFlashQuestion, and assOrderingHorizontal.

Definition at line 1697 of file class.assQuestion.php.

References $ilDB, and getAnswerTableName().

Referenced by delete().

{
global $ilDB;
$answer_table_name = $this->getAnswerTableName();
if( !is_array($answer_table_name) )
{
$answer_table_name = array($answer_table_name);
}
foreach ($answer_table_name as $table)
{
if (strlen($table))
{
$affectedRows = $ilDB->manipulateF("DELETE FROM $table WHERE question_fi = %s",
array('integer'),
array($question_id)
);
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::deletePageOfQuestion (   $question_id)
protected

Deletes the page object of a question with a given ID.

Parameters
integer$question_idThe database id of the question protected

Definition at line 1754 of file class.assQuestion.php.

References $page.

Referenced by delete(), and syncWithOriginal().

{
include_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php";
$page = new ilAssQuestionPage($question_id);
$page->delete();
return true;
}

+ Here is the caller graph for this function:

assQuestion::deleteSuggestedSolutions ( )

Deletes all suggestes solutions in the database.

Definition at line 2419 of file class.assQuestion.php.

References $ilDB, ilInternalLink\_deleteAllLinksOfSource(), ilUtil\delDir(), getId(), and getSuggestedSolutionPath().

{
global $ilDB;
// delete the links in the qpl_sol_sug table
$affectedRows = $ilDB->manipulateF("DELETE FROM qpl_sol_sug WHERE question_fi = %s",
array('integer'),
array($this->getId())
);
// delete the links in the int_link table
include_once "./Services/Link/classes/class.ilInternalLink.php";
$this->suggested_solutions = array();
}

+ Here is the call graph for this function:

assQuestion::deleteTaxonomyAssignments ( )
private

Definition at line 1908 of file class.assQuestion.php.

References getId(), getObjId(), and ilObjTaxonomy\getUsageOfObject().

Referenced by delete().

{
require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
require_once 'Services/Taxonomy/classes/class.ilTaxNodeAssignment.php';
foreach($taxIds as $taxId)
{
$taxNodeAssignment = new ilTaxNodeAssignment('qpl', $this->getObjId(), 'quest', $taxId);
$taxNodeAssignment->deleteAssignmentsOfItem($this->getId());
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::duplicate (   $for_test = true,
  $title = "",
  $author = "",
  $owner = "",
  $testObjId = null 
)
abstract
assQuestion::duplicateQuestionHints (   $originalQuestionId,
  $duplicateQuestionId 
)
protected

Definition at line 4119 of file class.assQuestion.php.

References ilAssQuestionHintList\duplicateListForQuestion(), getId(), and isAdditionalContentEditingModePageObject().

Referenced by onCopy(), and onDuplicate().

{
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintList.php';
$hintIds = ilAssQuestionHintList::duplicateListForQuestion($originalQuestionId, $duplicateQuestionId);
{
require_once 'Modules/TestQuestionPool/classes/class.ilAssHintPage.php';
foreach($hintIds as $originalHintId => $duplicateHintId)
{
$originalPageObject = new ilAssHintPage($originalHintId);
$originalXML = $originalPageObject->getXMLContent();
$duplicatePageObject = new ilAssHintPage();
$duplicatePageObject->setId($duplicateHintId);
$duplicatePageObject->setParentId($this->getId());
$duplicatePageObject->setXMLContent($originalXML);
$duplicatePageObject->createFromXML();
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::duplicateSuggestedSolutionFiles (   $parent_id,
  $question_id 
)
protected

Duplicates the files of a suggested solution if the question is duplicated.

Definition at line 2504 of file class.assQuestion.php.

References $filename, $ilLog, getSuggestedSolutionPath(), and ilUtil\makeDirParents().

Referenced by onDuplicate().

{
global $ilLog;
foreach ($this->suggested_solutions as $index => $solution)
{
if (strcmp($solution["type"], "file") == 0)
{
$filepath = $this->getSuggestedSolutionPath();
$filepath_original = str_replace(
"/{$this->obj_id}/{$this->id}/solution",
"/$parent_id/$question_id/solution",
$filepath
);
if (!file_exists($filepath))
{
}
$filename = $solution["value"]["name"];
if (strlen($filename))
{
if (!copy($filepath_original . $filename, $filepath . $filename))
{
$ilLog->write("File could not be duplicated!!!!", $ilLog->ERROR);
$ilLog->write("object: " . print_r($this, TRUE), $ilLog->ERROR);
}
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::formatSAQuestion (   $a_q)

Format self assessment question.

Parameters
@return

Definition at line 4007 of file class.assQuestion.php.

References ilRTE\_replaceMediaObjectImageSrc(), and ilUtil\insertLatexImages().

Referenced by assOrderingHorizontal\toJSON(), assTextSubset\toJSON(), assTextQuestion\toJSON(), assImagemapQuestion\toJSON(), assKprimChoice\toJSON(), assMultipleChoice\toJSON(), assSingleChoice\toJSON(), assOrderingQuestion\toJSON(), assErrorText\toJSON(), assMatchingQuestion\toJSON(), and assClozeTest\toJSON().

{
include_once("./Services/RTE/classes/class.ilRTE.php");
$a_q = nl2br((string) ilRTE::_replaceMediaObjectImageSrc($a_q, 0));
$a_q = str_replace("</li><br />", "</li>", $a_q);
$a_q = str_replace("</li><br>", "</li>", $a_q);
$a_q = ilUtil::insertLatexImages($a_q, "\[tex\]", "\[\/tex\]");
$a_q = ilUtil::insertLatexImages($a_q, "<span class\=\"latex\">", "<\/span>");
$a_q = str_replace('{', '&#123;', $a_q);
$a_q = str_replace('}', '&#125;', $a_q);
return $a_q;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::fromXML ( $item,
$questionpool_id,
$tst_id,
$tst_object,
$question_counter,
$import_mapping 
)

Receives parameters from a QTI parser and creates a valid ILIAS question object.

Parameters
object$itemThe QTI item object
integer$questionpool_idThe id of the parent questionpool
integer$tst_idThe id of the parent test if the question is part of a test
object$tst_objectA reference to the parent test object
integer$question_counterA reference to a question counter to count the questions of an imported question pool
array$import_mappingAn array containing references to included ILIAS objects public

Reimplemented in assFileUpload, assFlashQuestion, assErrorText, and assOrderingHorizontal.

Definition at line 329 of file class.assQuestion.php.

References getQuestionType().

{
include_once "./Modules/TestQuestionPool/classes/import/qti12/class." . $this->getQuestionType() . "Import.php";
$classname = $this->getQuestionType() . "Import";
$import = new $classname($this);
$import->fromXML($item, $questionpool_id, $tst_id, $tst_object, $question_counter, $import_mapping);
}

+ Here is the call graph for this function:

assQuestion::getActiveUserData (   $active_id)

Returns the user id and the test id for a given active id.

Parameters
integer$active_idActive id for a test/user
Returns
array Result array containing the user_id and test_id public

Definition at line 3625 of file class.assQuestion.php.

References $ilDB, and $result.

{
global $ilDB;
$result = $ilDB->queryF("SELECT * FROM tst_active WHERE active_id = %s",
array('integer'),
array($active_id)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
return array("user_id" => $row["user_fi"], "test_id" => $row["test_fi"]);
}
else
{
return array();
}
}
assQuestion::getAdditionalContentEditingMode ( )

getter for additional content editing mode for this question

public

Returns
string

Definition at line 4243 of file class.assQuestion.php.

References $additinalContentEditingMode.

Referenced by createNewQuestion(), isAdditionalContentEditingModePageObject(), and saveQuestionDataToDb().

+ Here is the caller graph for this function:

assQuestion::getAdditionalTableName ( )

Returns the name of the additional question data table in the database.

Returns
string The additional table name public

Reimplemented in assClozeTest, assMatchingQuestion, assFormulaQuestion, assOrderingQuestion, assJavaApplet, assImagemapQuestion, assTextQuestion, assFileUpload, assSingleChoice, assMultipleChoice, assTextSubset, assNumeric, assFlashQuestion, assErrorText, assOrderingHorizontal, and assKprimChoice.

Definition at line 1675 of file class.assQuestion.php.

Referenced by deleteAdditionalTableData().

{
return "";
}

+ Here is the caller graph for this function:

assQuestion::getAdjustedReachedPoints (   $active_id,
  $pass = NULL 
)
final

returns the reached points ...

  • calculated by concrete question type class
  • adjusted by hint point deduction
  • adjusted by scoring options ... for given testactive and testpass
Parameters
integer$active_id
integer$pass
Returns
integer $reached_points

Definition at line 934 of file class.assQuestion.php.

References $pass, ilObjTest\_getPass(), adjustReachedPointsByScoringOptions(), calculateReachedPoints(), and getId().

{
if (is_null($pass))
{
include_once "./Modules/Test/classes/class.ilObjTest.php";
$pass = ilObjTest::_getPass($active_id);
}
// determine reached points for submitted solution
$reached_points = $this->calculateReachedPoints($active_id, $pass);
// deduct points for requested hints from reached points
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
$hintTracking = new ilAssQuestionHintTracking($this->getId(), $active_id, $pass);
$requestsStatisticData = $hintTracking->getRequestStatisticDataByQuestionAndTestpass();
$reached_points = $reached_points - $requestsStatisticData->getRequestsPoints();
// adjust reached points regarding to tests scoring options
$reached_points = $this->adjustReachedPointsByScoringOptions($reached_points, $active_id, $pass);
return $reached_points;
}

+ Here is the call graph for this function:

assQuestion::getAnswerTableName ( )

Returns the name of the answer table in the database.

Returns
string The answer table name public

Reimplemented in assClozeTest, assMatchingQuestion, assFormulaQuestion, assOrderingQuestion, assTextQuestion, assImagemapQuestion, assFileUpload, assSingleChoice, assMultipleChoice, assTextSubset, assFlashQuestion, assErrorText, assOrderingHorizontal, and assKprimChoice.

Definition at line 1686 of file class.assQuestion.php.

Referenced by deleteAnswers().

{
return "";
}

+ Here is the caller graph for this function:

assQuestion::getAuthor ( )

Gets the authors name of the assQuestion object.

Returns
string The string containing the name of the questions author public
See Also
$author

Definition at line 656 of file class.assQuestion.php.

References $author.

Referenced by __get(), createNewQuestion(), assClozeTest\isComplete(), and saveQuestionDataToDb().

{
return $this->author;
}

+ Here is the caller graph for this function:

assQuestion::getComment ( )

Gets the comment string of the assQuestion object.

Returns
string The comment string to describe the question public
See Also
$comment

Definition at line 595 of file class.assQuestion.php.

References $comment.

Referenced by __get(), and saveQuestionDataToDb().

{
}

+ Here is the caller graph for this function:

assQuestion::getDefaultNrOfTries ( )

Get Default Nr of Tries.

Returns
int Default Nr of Tries

Definition at line 4080 of file class.assQuestion.php.

References $defaultnroftries.

Referenced by createNewQuestion().

{
}

+ Here is the caller graph for this function:

assQuestion::getEstimatedWorkingTime ( )

Gets the estimated working time of a question.

Returns
array Estimated Working Time of a question public
See Also
$est_working_time

Definition at line 640 of file class.assQuestion.php.

References $est_working_time.

Referenced by __get(), createNewQuestion(), and saveQuestionDataToDb().

{
if (!$this->est_working_time)
{
$this->est_working_time = array("h" => 0, "m" => 0, "s" => 0);
}
}

+ Here is the caller graph for this function:

assQuestion::getExternalId ( )
Returns
string

Definition at line 708 of file class.assQuestion.php.

References $external_id, and getId().

Referenced by createNewQuestion(), and saveQuestionDataToDb().

{
if(!strlen($this->external_id))
{
if($this->getId() > 0)
{
return 'il_' . IL_INST_ID . '_qst_' . $this->getId();
}
else
{
return uniqid('', true);
}
}
else
{
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static assQuestion::getFeedbackClassNameByQuestionType (   $questionType)
static

Definition at line 3672 of file class.assQuestion.php.

Referenced by assQuestionGUI\_getQuestionGUI(), _instantiateQuestion(), ilObjTest\createQuestionGUI(), includeCoreClass(), and instantiateQuestionGUI().

{
return str_replace('ass', 'ilAss', $questionType).'Feedback';
}

+ Here is the caller graph for this function:

assQuestion::getFlashPath ( )

Returns the image path for web accessable flash files of a question.

The image path is under the CLIENT_WEB_DIR in assessment/REFERENCE_ID_OF_QUESTION_POOL/ID_OF_QUESTION/flash

public

Definition at line 1483 of file class.assQuestion.php.

Referenced by assFlashQuestion\copyApplet(), assFlashQuestion\deleteApplet(), assFlashQuestion\duplicateApplet(), assFlashQuestion\moveUploadedFile(), and assFlashQuestion\saveAdditionalQuestionDataToDb().

{
return CLIENT_WEB_DIR . "/assessment/$this->obj_id/$this->id/flash/";
}

+ Here is the caller graph for this function:

assQuestion::getFlashPathWeb ( )

Returns the web image path for web accessable flash applications of a question.

The image path is under the web accessable data dir in assessment/REFERENCE_ID_OF_QUESTION_POOL/ID_OF_QUESTION/flash

public

Definition at line 1539 of file class.assQuestion.php.

References ILIAS_ABSOLUTE_PATH, and ilUtil\removeTrailingPathSeparators().

{
include_once "./Services/Utilities/classes/class.ilUtil.php";
$webdir = ilUtil::removeTrailingPathSeparators(CLIENT_WEB_DIR) . "/assessment/$this->obj_id/$this->id/flash/";
}

+ Here is the call graph for this function:

static assQuestion::getGuiClassNameByQuestionType (   $questionType)
static

Definition at line 3662 of file class.assQuestion.php.

Referenced by assQuestionGUI\_getQuestionGUI(), ilObjTest\createQuestionGUI(), includeCoreClass(), includePluginClass(), instantiateQuestionGUI(), and isCoreQuestionType().

{
return $questionType.'GUI';
}

+ Here is the caller graph for this function:

assQuestion::getHtmlQuestionContentPurifier ( )
Returns
ilAssHtmlUserSolutionPurifier

Definition at line 4359 of file class.assQuestion.php.

References ilHtmlPurifierFactory\_getInstanceByType().

{
require_once 'Services/Html/classes/class.ilHtmlPurifierFactory.php';
return ilHtmlPurifierFactory::_getInstanceByType('qpl_usersolution');
}

+ Here is the call graph for this function:

assQuestion::getHtmlUserSolutionPurifier ( )
Returns
ilAssHtmlUserSolutionPurifier

Definition at line 4350 of file class.assQuestion.php.

References ilHtmlPurifierFactory\_getInstanceByType().

Referenced by assTextSubset\getSolutionSubmit().

{
require_once 'Services/Html/classes/class.ilHtmlPurifierFactory.php';
return ilHtmlPurifierFactory::_getInstanceByType('qpl_usersolution');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::getId ( )

Gets the id of the assQuestion object.

Returns
integer The id of the assQuestion object public
See Also
$id

Definition at line 559 of file class.assQuestion.php.

References $id.

Referenced by ilQuestionCumulatedStatisticsTableGUI\__construct(), ilQuestionUsagesTableGUI\__construct(), ilAssQuestionHintsOrderingClipboard\__construct(), __get(), addQTIMaterial(), assClozeTest\calculateCombinationResult(), assFlashQuestion\calculateReachedPoints(), assKprimChoice\calculateReachedPoints(), assTextQuestion\calculateReachedPoints(), assJavaApplet\calculateReachedPoints(), calculateResultsFromSolution(), cleanupMediaObjectUsage(), assErrorText\copyObject(), assClozeTest\copyObject(), copyXHTMLMediaObjectsOfQuestion(), createNewQuestion(), createPageObject(), deleteSuggestedSolutions(), deleteTaxonomyAssignments(), ilDynamicTestQuestionChangeListener\deleteTestsParticipantsQuestionData(), assOrderingHorizontal\duplicate(), assFileUpload\duplicate(), assNumeric\duplicate(), assImagemapQuestion\duplicate(), assTextQuestion\duplicate(), assFlashQuestion\duplicate(), assOrderingQuestion\duplicate(), assErrorText\duplicate(), assTextSubset\duplicate(), assSingleChoice\duplicate(), assMultipleChoice\duplicate(), assMatchingQuestion\duplicate(), assJavaApplet\duplicate(), assKprimChoice\duplicate(), assFormulaQuestion\duplicate(), assClozeTest\duplicate(), assTextQuestion\duplicateAnswers(), duplicateQuestionHints(), assMatchingQuestion\fetchSubmittedMatchingsFromPost(), getAdjustedReachedPoints(), getExternalId(), assFileUpload\getFileUploadPath(), assFileUpload\getFileUploadPathWeb(), getInstances(), assClozeTest\getMaximumPoints(), assOrderingQuestion\getOldLeveledOrdering(), assJavaApplet\getReachedInformation(), getReachedPoints(), assImagemapQuestion\getRTETextWithMediaObjects(), assMultipleChoice\getRTETextWithMediaObjects(), assSingleChoice\getRTETextWithMediaObjects(), getRTETextWithMediaObjects(), getSolutionMaxPass(), getSolutionValues(), assFileUpload\getUploadedFiles(), assFileUpload\handleSubmission(), assFileUpload\hasFileUploads(), assKprimChoice\isAnswered(), assTextQuestion\isAnswered(), assMultipleChoice\isAnswered(), assFileUpload\isAnswered(), assSingleChoice\isAnswered(), isInUse(), assTextQuestion\loadFromDb(), loadFromDb(), assFileUpload\saveAdditionalQuestionDataToDb(), assFlashQuestion\saveAdditionalQuestionDataToDb(), assErrorText\saveAdditionalQuestionDataToDb(), assImagemapQuestion\saveAdditionalQuestionDataToDb(), assMatchingQuestion\saveAdditionalQuestionDataToDb(), assJavaApplet\saveAdditionalQuestionDataToDb(), assKprimChoice\saveAdditionalQuestionDataToDb(), assClozeTest\saveAdditionalQuestionDataToDb(), assOrderingHorizontal\saveAdditionalQuestionDataToDb(), assErrorText\saveAnswerSpecificDataToDb(), assImagemapQuestion\saveAnswerSpecificDataToDb(), assMatchingQuestion\saveAnswerSpecificDataToDb(), assClozeTest\saveAnswerSpecificDataToDb(), assKprimChoice\saveAnswerSpecificDataToDb(), assClozeTest\saveClozeNumericGapRecordToDb(), assClozeTest\saveClozeSelectGapRecordToDb(), assClozeTest\saveClozeTextGapRecordToDb(), assErrorText\savePreviewData(), assSingleChoice\savePreviewData(), saveQuestionDataToDb(), assMultipleChoice\saveToDb(), assFormulaQuestion\saveToDb(), saveToDb(), assOrderingHorizontal\saveWorkingData(), assErrorText\saveWorkingData(), assTextSubset\saveWorkingData(), assFileUpload\saveWorkingData(), assTextQuestion\saveWorkingData(), assSingleChoice\saveWorkingData(), assImagemapQuestion\saveWorkingData(), assOrderingQuestion\saveWorkingData(), assFormulaQuestion\saveWorkingData(), assMatchingQuestion\saveWorkingData(), assClozeTest\saveWorkingData(), assFormulaQuestion\setId(), setNewOriginalId(), assTextQuestion\setReachedPoints(), assFormulaQuestion\substituteVariables(), syncWithOriginal(), syncXHTMLMediaObjectsOfQuestion(), assOrderingHorizontal\toJSON(), assTextSubset\toJSON(), assTextQuestion\toJSON(), assImagemapQuestion\toJSON(), assKprimChoice\toJSON(), assMultipleChoice\toJSON(), assSingleChoice\toJSON(), assOrderingQuestion\toJSON(), assErrorText\toJSON(), assMatchingQuestion\toJSON(), assClozeTest\toJSON(), and ilLOTestQuestionAdapter\updateQuestionResult().

{
return $this->id;
}

+ Here is the caller graph for this function:

assQuestion::getImagePath (   $question_id = null,
  $object_id = null 
)

Returns the image path for web accessable images of a question.

The image path is under the CLIENT_WEB_DIR in assessment/REFERENCE_ID_OF_QUESTION_POOL/ID_OF_QUESTION/images

public

Definition at line 1457 of file class.assQuestion.php.

References $id, $obj_id, and buildImagePath().

Referenced by assOrderingQuestion\cleanImagefiles(), assImagemapQuestion\copyImage(), assOrderingQuestion\copyImages(), assMatchingQuestion\copyImages(), assMultipleChoice\copyImages(), assSingleChoice\copyImages(), assErrorText\createErrorTextOutput(), assMultipleChoice\deleteImage(), assSingleChoice\deleteImage(), assImagemapQuestion\deleteImage(), assOrderingQuestion\deleteImagefile(), assMatchingQuestion\deleteImagefile(), assImagemapQuestion\duplicateImage(), assOrderingQuestion\duplicateImages(), assMatchingQuestion\duplicateImages(), assMultipleChoice\duplicateImages(), assSingleChoice\duplicateImages(), assKprimChoice\handleFileUpload(), assKprimChoice\loadAnswerData(), assSingleChoice\loadFromDb(), assMultipleChoice\loadFromDb(), assMultipleChoice\rebuildThumbnails(), assSingleChoice\rebuildThumbnails(), assOrderingQuestion\rebuildThumbnails(), assMatchingQuestion\rebuildThumbnails(), assMatchingQuestion\setExportDetailsXLS(), assOrderingQuestion\setImageFile(), assMultipleChoice\setImageFile(), assSingleChoice\setImageFile(), assMatchingQuestion\setImageFile(), assImagemapQuestion\setImageFilename(), assMultipleChoice\syncImages(), and assSingleChoice\syncImages().

{
if( $question_id === null)
{
$question_id = $this->id;
}
if( $object_id === null)
{
$object_id = $this->obj_id;
}
return $this->buildImagePath($question_id, $object_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::getImagePathWeb ( )

Returns the web image path for web accessable images of a question.

The image path is under the web accessable data dir in assessment/REFERENCE_ID_OF_QUESTION_POOL/ID_OF_QUESTION/images

public

Definition at line 1519 of file class.assQuestion.php.

References $export_image_path, ILIAS_ABSOLUTE_PATH, and ilUtil\removeTrailingPathSeparators().

Referenced by assKprimChoice\loadAnswerData(), assImagemapQuestion\toJSON(), assKprimChoice\toJSON(), assMultipleChoice\toJSON(), assSingleChoice\toJSON(), and assOrderingQuestion\toJSON().

{
if(!$this->export_image_path)
{
include_once "./Services/Utilities/classes/class.ilUtil.php";
$webdir = ilUtil::removeTrailingPathSeparators(CLIENT_WEB_DIR) . "/assessment/$this->obj_id/$this->id/images/";
}
else
{
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& assQuestion::getInstances ( )

Gets all instances of the question.

Returns
array All instances of question and its copies

Definition at line 3560 of file class.assQuestion.php.

References $ilDB, $result, ilObject\_getAllReferences(), ilObjTest\_lookupAuthor(), ilObject\_lookupTitle(), and getId().

{
global $ilDB;
$result = $ilDB->queryF("SELECT question_id FROM qpl_questions WHERE original_id = %s",
array("integer"),
array($this->getId())
);
$instances = array();
$ids = array();
while ($row = $ilDB->fetchAssoc($result))
{
array_push($ids, $row["question_id"]);
}
foreach ($ids as $question_id)
{
// check non random tests
$result = $ilDB->queryF("SELECT tst_tests.obj_fi FROM tst_tests, tst_test_question WHERE tst_test_question.question_fi = %s AND tst_test_question.test_fi = tst_tests.test_id",
array("integer"),
array($question_id)
);
while ($row = $ilDB->fetchAssoc($result))
{
$instances[$row['obj_fi']] = ilObject::_lookupTitle($row['obj_fi']);
}
// check random tests
$result = $ilDB->queryF("SELECT tst_tests.obj_fi FROM tst_tests, tst_test_rnd_qst, tst_active WHERE tst_test_rnd_qst.active_fi = tst_active.active_id AND tst_test_rnd_qst.question_fi = %s AND tst_tests.test_id = tst_active.test_fi",
array("integer"),
array($question_id)
);
while ($row = $ilDB->fetchAssoc($result))
{
$instances[$row['obj_fi']] = ilObject::_lookupTitle($row['obj_fi']);
}
}
include_once "./Modules/Test/classes/class.ilObjTest.php";
foreach ($instances as $key => $value)
{
$instances[$key] = array("obj_id" => $key, "title" => $value, "author" => ilObjTest::_lookupAuthor($key), "refs" => ilObject::_getAllReferences($key));
}
return $instances;
}

+ Here is the call graph for this function:

assQuestion::getJavaPath ( )

Returns the image path for web accessable images of a question.

The image path is under the CLIENT_WEB_DIR in assessment/REFERENCE_ID_OF_QUESTION_POOL/ID_OF_QUESTION/images

public

Definition at line 1447 of file class.assQuestion.php.

Referenced by assJavaApplet\copyApplet(), assJavaApplet\deleteJavaAppletFilename(), assJavaApplet\duplicateApplet(), and assJavaApplet\setJavaAppletFilename().

{
return CLIENT_WEB_DIR . "/assessment/$this->obj_id/$this->id/java/";
}

+ Here is the caller graph for this function:

assQuestion::getJavaPathWeb ( )

Returns the web image path for web accessable java applets of a question.

The image path is under the web accessable data dir in assessment/REFERENCE_ID_OF_QUESTION_POOL/ID_OF_QUESTION/java

public

Definition at line 1494 of file class.assQuestion.php.

References ILIAS_ABSOLUTE_PATH, and ilUtil\removeTrailingPathSeparators().

{
include_once "./Services/Utilities/classes/class.ilUtil.php";
$webdir = ilUtil::removeTrailingPathSeparators(CLIENT_WEB_DIR) . "/assessment/$this->obj_id/$this->id/java/";
}

+ Here is the call graph for this function:

assQuestion::getLastChange ( )

Reimplemented in assMultipleChoice.

Definition at line 4382 of file class.assQuestion.php.

References $lastChange.

{
}
assQuestion::getMaximumPoints ( )
static assQuestion::getNumExistingSolutionRecords (   $activeId,
  $pass,
  $questionId 
)
staticprotected

returns the number of existing solution records for the given test active / pass and given question id

protected ilDB $ilDB

Parameters
integer$activeId
integer$pass
integer$questionId
Returns
integer $numberOfExistingSolutionRecords

Definition at line 4213 of file class.assQuestion.php.

References $ilDB, $query, and $res.

Referenced by assKprimChoice\isAnswered(), assTextQuestion\isAnswered(), assMultipleChoice\isAnswered(), assFileUpload\isAnswered(), and assSingleChoice\isAnswered().

{
global $ilDB;
$query = "
SELECT count(active_fi) cnt
FROM tst_solutions
WHERE active_fi = %s
AND question_fi = %s
AND pass = %s
";
$res = $ilDB->queryF(
$query, array('integer','integer','integer'),
array($activeId, $questionId, $pass)
);
$row = $ilDB->fetchAssoc($res);
return (int)$row['cnt'];
}

+ Here is the caller graph for this function:

static assQuestion::getObjectClassNameByQuestionType (   $questionType)
static

Definition at line 3667 of file class.assQuestion.php.

Referenced by _instantiateQuestion(), and includeCoreClass().

{
return $questionType;
}

+ Here is the caller graph for this function:

assQuestion::getObjId ( )

Get the object id of the container object.

Returns
integer The object id of the container object public
See Also
$obj_id

Definition at line 680 of file class.assQuestion.php.

References $obj_id.

Referenced by __get(), assOrderingHorizontal\copyObject(), assFileUpload\copyObject(), assNumeric\copyObject(), assTextQuestion\copyObject(), assImagemapQuestion\copyObject(), assFlashQuestion\copyObject(), assOrderingQuestion\copyObject(), assErrorText\copyObject(), assTextSubset\copyObject(), assMultipleChoice\copyObject(), assSingleChoice\copyObject(), assMatchingQuestion\copyObject(), assJavaApplet\copyObject(), assFormulaQuestion\copyObject(), assKprimChoice\copyObject(), assClozeTest\copyObject(), assOrderingHorizontal\createNewOriginalFromThisDuplicate(), assFileUpload\createNewOriginalFromThisDuplicate(), assNumeric\createNewOriginalFromThisDuplicate(), assTextQuestion\createNewOriginalFromThisDuplicate(), assImagemapQuestion\createNewOriginalFromThisDuplicate(), assFlashQuestion\createNewOriginalFromThisDuplicate(), assOrderingQuestion\createNewOriginalFromThisDuplicate(), assErrorText\createNewOriginalFromThisDuplicate(), assTextSubset\createNewOriginalFromThisDuplicate(), assMultipleChoice\createNewOriginalFromThisDuplicate(), assSingleChoice\createNewOriginalFromThisDuplicate(), assMatchingQuestion\createNewOriginalFromThisDuplicate(), assJavaApplet\createNewOriginalFromThisDuplicate(), assKprimChoice\createNewOriginalFromThisDuplicate(), assFormulaQuestion\createNewOriginalFromThisDuplicate(), assClozeTest\createNewOriginalFromThisDuplicate(), createNewQuestion(), createPageObject(), delete(), deleteTaxonomyAssignments(), assOrderingHorizontal\duplicate(), assFileUpload\duplicate(), assNumeric\duplicate(), assTextQuestion\duplicate(), assImagemapQuestion\duplicate(), assFlashQuestion\duplicate(), assOrderingQuestion\duplicate(), assErrorText\duplicate(), assTextSubset\duplicate(), assSingleChoice\duplicate(), assMultipleChoice\duplicate(), assMatchingQuestion\duplicate(), assJavaApplet\duplicate(), assKprimChoice\duplicate(), assFormulaQuestion\duplicate(), assClozeTest\duplicate(), saveQuestionDataToDb(), and syncWithOriginal().

{
return $this->obj_id;
}

+ Here is the caller graph for this function:

assQuestion::getOriginalId ( )
assQuestion::getOutputType ( )

Gets the output type.

Returns
integer The output type of the question public
See Also
$outputType

Reimplemented in assSingleChoice, and assMultipleChoice.

Definition at line 607 of file class.assQuestion.php.

References $outputType.

Referenced by __get(), and assOrderingQuestion\checkSaveData().

{
}

+ Here is the caller graph for this function:

assQuestion::getOwner ( )

Gets the creator/owner ID of the assQuestion object.

Returns
integer The numerical ID to identify the owner/creator public
See Also
$owner

Definition at line 668 of file class.assQuestion.php.

References $owner.

Referenced by __get(), saveQuestionDataToDb(), and saveToDb().

{
return $this->owner;
}

+ Here is the caller graph for this function:

assQuestion::getPageOfQuestion ( )

Definition at line 2105 of file class.assQuestion.php.

References $page.

{
include_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php";
$page = new ilAssQuestionPage($this->id);
return $page->getXMLContent();
}
assQuestion::getPreventRteUsage ( )

Get prevent rte usage.

Returns
boolean prevent rte usage

Definition at line 4040 of file class.assQuestion.php.

References $prevent_rte_usage.

assQuestion::getQuestionChangeListeners ( )
Returns
array[ilQuestionChangeListener]

Definition at line 4318 of file class.assQuestion.php.

References $questionChangeListeners.

Referenced by notifyQuestionCreated(), notifyQuestionDeleted(), and notifyQuestionEdited().

+ Here is the caller graph for this function:

assQuestion::getQuestionType ( )
abstract

Returns the question type of the question.

Returns
string The question type of the question

Reimplemented in assClozeTest, assMatchingQuestion, assFormulaQuestion, assOrderingQuestion, assJavaApplet, assImagemapQuestion, assFileUpload, assSingleChoice, assTextQuestion, assMultipleChoice, assTextSubset, assNumeric, assFlashQuestion, assErrorText, assOrderingHorizontal, and assKprimChoice.

Referenced by fromXML(), getQuestionTypeID(), and toXML().

+ Here is the caller graph for this function:

assQuestion::getQuestionTypeFromDb (   $question_id)

get question type for question id

note: please don't use $this in this class to allow static calls

Definition at line 1657 of file class.assQuestion.php.

References $ilDB, and $result.

Referenced by assQuestionGUI\_getGUIClassNameForId(), assQuestionGUI\_getQuestionGUI(), and ilObjTestGUI\executeCommand().

{
global $ilDB;
$result = $ilDB->queryF("SELECT qpl_qst_type.type_tag FROM qpl_qst_type, qpl_questions WHERE qpl_questions.question_id = %s AND qpl_questions.question_type_fi = qpl_qst_type.question_type_id",
array('integer'),
array($question_id)
);
$data = $ilDB->fetchAssoc($result);
return $data["type_tag"];
}

+ Here is the caller graph for this function:

assQuestion::getQuestionTypeID ( )

Returns the question type of the question.

Returns the question type of the question

Returns
integer The question type of the question public

Definition at line 3471 of file class.assQuestion.php.

References $ilDB, $result, and getQuestionType().

Referenced by createNewQuestion(), and saveQuestionDataToDb().

{
global $ilDB;
$result = $ilDB->queryF("SELECT question_type_id FROM qpl_qst_type WHERE type_tag = %s",
array('text'),
array($this->getQuestionType())
);
if ($result->numRows() == 1)
{
$row = $ilDB->fetchAssoc($result);
return $row["question_type_id"];
}
return 0;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::getReachedPoints (   $active_id,
  $pass = NULL 
)

Returns the points, a learner has reached answering the question This is the fast way to get the points directly from the database.

Parameters
integer$user_idThe database ID of the learner
integer$test_idThe database Id of the test containing the question public

Definition at line 907 of file class.assQuestion.php.

References $pass, _getReachedPoints(), and getId().

Referenced by ilLOTestQuestionAdapter\updateQuestionResult().

{
return round($this->_getReachedPoints($active_id, $this->getId(), $pass), 2);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static assQuestion::getResultGateway ( )
static
Returns

Definition at line 4494 of file class.assQuestion.php.

References $resultGateway.

{
}
assQuestion::getRTETextWithMediaObjects ( )
protected

Collects all text in the question which could contain media objects which were created with the Rich Text Editor.

Reimplemented in assClozeTest, assMatchingQuestion, assFormulaQuestion, assSingleChoice, assOrderingQuestion, assJavaApplet, assMultipleChoice, assKprimChoice, assImagemapQuestion, assFileUpload, assTextQuestion, assTextSubset, assNumeric, assFlashQuestion, assErrorText, and assOrderingHorizontal.

Definition at line 3526 of file class.assQuestion.php.

References getId(), getQuestion(), and getTotalAnswers().

Referenced by cleanupMediaObjectUsage().

{
// must be called in parent classes. add additional RTE text in the parent
// classes and call this method to add the standard RTE text
$collected = $this->getQuestion();
$collected .= $this->feedbackOBJ->getGenericFeedbackContent($this->getId(), false);
$collected .= $this->feedbackOBJ->getGenericFeedbackContent($this->getId(), true);
for( $i = 0; $i <= $this->getTotalAnswers(); $i++ )
{
$collected .= $this->feedbackOBJ->getSpecificAnswerFeedbackContent($this->getId(), $i);
}
foreach ($this->suggested_solutions as $solution_array)
{
$collected .= $solution_array["value"];
}
return $collected;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::getSelfAssessmentEditingMode ( )

Get Self-Assessment Editing Mode.

Returns
boolean Self-Assessment Editing Mode

Definition at line 4060 of file class.assQuestion.php.

References $selfassessmenteditingmode.

assQuestion::getShuffle ( )

Gets the shuffle flag.

Returns
boolean The shuffle flag public
See Also
$shuffle

Definition at line 571 of file class.assQuestion.php.

References $shuffle.

Referenced by __get(), assTextQuestion\toJSON(), assImagemapQuestion\toJSON(), assMultipleChoice\toJSON(), assSingleChoice\toJSON(), assErrorText\toJSON(), and assClozeTest\toJSON().

{
}

+ Here is the caller graph for this function:

& assQuestion::getSolutionValues (   $active_id,
  $pass = NULL 
)

Loads solutions of a given user from the database an returns it.

Parameters
integer$test_idThe database id of the test containing this question public
See Also
$answers

Definition at line 1553 of file class.assQuestion.php.

References $ilDB, $result, getId(), getSolutionMaxPass(), and getStep().

Referenced by assFormulaQuestion\calculateReachedPoints(), assOrderingHorizontal\setExportDetailsXLS(), assErrorText\setExportDetailsXLS(), assNumeric\setExportDetailsXLS(), assTextSubset\setExportDetailsXLS(), assTextQuestion\setExportDetailsXLS(), assFileUpload\setExportDetailsXLS(), assImagemapQuestion\setExportDetailsXLS(), assJavaApplet\setExportDetailsXLS(), assMultipleChoice\setExportDetailsXLS(), assSingleChoice\setExportDetailsXLS(), assOrderingQuestion\setExportDetailsXLS(), assKprimChoice\setExportDetailsXLS(), assFormulaQuestion\setExportDetailsXLS(), assMatchingQuestion\setExportDetailsXLS(), and assClozeTest\setExportDetailsXLS().

{
global $ilDB;
$values = array();
if (is_null($pass))
{
$pass = $this->getSolutionMaxPass($active_id);
}
$result = null;
if( $this->getStep() !== NULL )
{
$result = $ilDB->queryF("SELECT * FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s AND step = %s ORDER BY solution_id",
array('integer','integer','integer', 'integer'),
array($active_id, $this->getId(), $pass, $this->getStep())
);
}
else
{
$result = $ilDB->queryF("SELECT * FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s ORDER BY solution_id",
array('integer','integer','integer'),
array($active_id, $this->getId(), $pass)
);
}
while ($row = $ilDB->fetchAssoc($result))
{
array_push($values, $row);
}
return $values;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::getStep ( )
Returns
int|null

Definition at line 4510 of file class.assQuestion.php.

References $step.

Referenced by calculateResultsFromSolution(), getSolutionValues(), and assImagemapQuestion\saveWorkingData().

{
return $this->step;
}

+ Here is the caller graph for this function:

assQuestion::getSuggestedSolution (   $subquestion_index = 0)

Returns a suggested solution for a given subquestion index.

Parameters
integer$subquestion_indexThe index of a subquestion (i.e. a close test gap). Usually 0
Returns
array A suggested solution array containing the internal link public

Definition at line 2441 of file class.assQuestion.php.

{
if (array_key_exists($subquestion_index, $this->suggested_solutions))
{
return $this->suggested_solutions[$subquestion_index];
}
else
{
return array();
}
}
assQuestion::getSuggestedSolutionOutput ( )

Definition at line 801 of file class.assQuestion.php.

References _getInternalLinkHref(), getSuggestedSolutionPathWeb(), ilUtil\prepareFormOutput(), and prepareTextareaOutput().

{
$output = array();
foreach ($this->suggested_solutions as $solution)
{
switch ($solution["type"])
{
case "lm":
case "st":
case "pg":
case "git":
array_push($output, '<a href="' . assQuestion::_getInternalLinkHref($solution["internal_link"]) . '">' . $this->lng->txt("solution_hint") . '</a>');
break;
case "file":
$possible_texts = array_values(array_filter(array(
ilUtil::prepareFormOutput($solution['value']['filename']),
ilUtil::prepareFormOutput($solution['value']['name']),
$this->lng->txt('tst_show_solution_suggested')
)));
array_push($output, '<a href="' . $this->getSuggestedSolutionPathWeb() . $solution["value"]["name"] . '">' . $possible_texts[0] . '</a>');
break;
case "text":
array_push($output, $this->prepareTextareaOutput($solution["value"], true));
break;
}
}
return join($output, "<br />");
}

+ Here is the call graph for this function:

assQuestion::getSuggestedSolutionPath ( )

Returns the path for a suggested solution.

public

Definition at line 1437 of file class.assQuestion.php.

Referenced by copySuggestedSolutionFiles(), deleteSuggestedSolutions(), duplicateSuggestedSolutionFiles(), and syncSuggestedSolutionFiles().

{
return CLIENT_WEB_DIR . "/assessment/$this->obj_id/$this->id/solution/";
}

+ Here is the caller graph for this function:

assQuestion::getSuggestedSolutionPathWeb ( )

Returns the web path for a suggested solution.

public

Definition at line 1506 of file class.assQuestion.php.

References ILIAS_ABSOLUTE_PATH, and ilUtil\removeTrailingPathSeparators().

Referenced by getSuggestedSolutionOutput().

{
include_once "./Services/Utilities/classes/class.ilUtil.php";
$webdir = ilUtil::removeTrailingPathSeparators(CLIENT_WEB_DIR) . "/assessment/$this->obj_id/$this->id/solution/";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::getSuggestedSolutions ( )

Return the suggested solutions.

Returns
array Suggested solutions

Definition at line 865 of file class.assQuestion.php.

References $suggested_solutions.

Referenced by __get().

+ Here is the caller graph for this function:

assQuestion::getSuggestedSolutionTitle (   $subquestion_index = 0)

Returns the title of a suggested solution at a given subquestion_index.

This can be usable for displaying suggested solutions

Parameters
integer$subquestion_indexThe index of a subquestion (i.e. a close test gap). Usually 0
Returns
string A string containing the type and title of the internal link public

Definition at line 2461 of file class.assQuestion.php.

References $title.

{
if (array_key_exists($subquestion_index, $this->suggested_solutions))
{
$title = $this->suggested_solutions[$subquestion_index]["internal_link"];
// TO DO: resolve internal link an get link type and title
}
else
{
$title = "";
}
return $title;
}
assQuestion::getTestId ( )

Gets the test id of the assQuestion object.

Returns
integer The test id of the assQuestion object public
See Also
$test_id

Definition at line 583 of file class.assQuestion.php.

References $test_id.

Referenced by __get().

{
}

+ Here is the caller graph for this function:

assQuestion::getTotalAnswers ( )

get total number of answers

Definition at line 1924 of file class.assQuestion.php.

References _getTotalAnswers().

Referenced by getRTETextWithMediaObjects().

{
return $this->_getTotalAnswers($this->id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::getValidAdditionalContentEditingModes ( )

getter for valid additional content editing modes

public

Returns
array

Definition at line 4299 of file class.assQuestion.php.

Referenced by isValidAdditionalContentEditingMode(), and setAdditionalContentEditingMode().

{
return array(
self::ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT,
self::ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT
);
}

+ Here is the caller graph for this function:

static assQuestion::includeCoreClass (   $questionType,
  $withGuiClass 
)
static

Definition at line 3683 of file class.assQuestion.php.

References getFeedbackClassNameByQuestionType(), getGuiClassNameByQuestionType(), and getObjectClassNameByQuestionType().

Referenced by _includeClass().

{
if( $withGuiClass )
{
$guiClassName = self::getGuiClassNameByQuestionType($questionType);
require_once "Modules/TestQuestionPool/classes/class.{$guiClassName}.php";
// object class is included by gui classes constructor
}
else
{
$objectClassName = self::getObjectClassNameByQuestionType($questionType);
require_once "Modules/TestQuestionPool/classes/class.{$objectClassName}.php";
}
$feedbackClassName = self::getFeedbackClassNameByQuestionType($questionType);
require_once "Modules/TestQuestionPool/classes/feedback/class.{$feedbackClassName}.php";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static assQuestion::includePluginClass (   $questionType,
  $withGuiClass 
)
static

Definition at line 3702 of file class.assQuestion.php.

References getGuiClassNameByQuestionType(), ilPlugin\getPluginObject(), and IL_COMP_MODULE.

Referenced by _includeClass().

{
global $ilPluginAdmin;
$classes = array(
self::getObjectClassNameByQuestionType($questionType),
self::getFeedbackClassNameByQuestionType($questionType)
);
if( $withGuiClass )
{
$classes[] = self::getGuiClassNameByQuestionType($questionType);
}
$pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, "TestQuestionPool", "qst");
foreach ($pl_names as $pl_name)
{
$pl = ilPlugin::getPluginObject(IL_COMP_MODULE, "TestQuestionPool", "qst", $pl_name);
if (strcmp($pl->getQuestionType(), $questionType) == 0)
{
foreach($classes as $class)
{
$pl->includeClass("class.{$class}.php");
}
break;
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static assQuestion::instantiateQuestionGUI (   $a_question_id)
static

Creates an instance of a question gui with a given question id.

Parameters
integer$a_question_id
Returns
The question gui instance

Definition at line 3782 of file class.assQuestion.php.

References $ilCtrl, $ilDB, $ilLog, $ilUser, $lng, ilObjAssessmentFolder\_enabledAssessmentLogging(), _getQuestionType(), _includeClass(), getFeedbackClassNameByQuestionType(), and getGuiClassNameByQuestionType().

Referenced by _instanciateQuestionGUI(), ilObjTestGUI\copyQuestionToPool(), and ilAssQuestionPreviewGUI\initQuestion().

{
if (strcmp($a_question_id, "") != 0)
{
$question_type = assQuestion::_getQuestionType($a_question_id);
assQuestion::_includeClass($question_type, 1);
$question_type_gui = self::getGuiClassNameByQuestionType($question_type);
$question_gui = new $question_type_gui();
$question_gui->object->loadFromDb($a_question_id);
$feedbackObjectClassname = self::getFeedbackClassNameByQuestionType($question_type);
$question_gui->object->feedbackOBJ = new $feedbackObjectClassname($question_gui->object, $ilCtrl, $ilDB, $lng);
$assSettings = new ilSetting('assessment');
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLockerFactory.php';
$processLockerFactory = new ilAssQuestionProcessLockerFactory($assSettings, $ilDB);
$processLockerFactory->setQuestionId($question_gui->object->getId());
$processLockerFactory->setUserId($ilUser->getId());
include_once ("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
$processLockerFactory->setAssessmentLogEnabled(ilObjAssessmentFolder::_enabledAssessmentLogging());
$question_gui->object->setProcessLocker($processLockerFactory->getLocker());
}
else
{
global $ilLog;
$ilLog->write('Instantiate question called without question id. (instantiateQuestionGUI@assQuestion)', $ilLog->WARNING);
return null;
}
return $question_gui;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::isAdditionalContentEditingModePageObject ( )

isser for additional "pageobject" content editing mode

public

Returns
boolean

Definition at line 4271 of file class.assQuestion.php.

References ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT, and getAdditionalContentEditingMode().

Referenced by delete(), and duplicateQuestionHints().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::isAnswered (   $active_id,
  $pass = null 
)

returns boolean wether the question is answered during test pass or not

method can be overwritten in derived classes, but be aware of also overwrite the method assQuestion::isObligationPossible()

Parameters
integer$active_id
integer$pass
Returns
boolean $answered

Reimplemented in assSingleChoice, assFileUpload, assMultipleChoice, assTextQuestion, and assKprimChoice.

Definition at line 4154 of file class.assQuestion.php.

Referenced by calculateResultsFromSolution().

{
return true;
}

+ Here is the caller graph for this function:

assQuestion::isAutosaveable ( )

Reimplemented in assFileUpload, assJavaApplet, assFlashQuestion, and assImagemapQuestion.

Definition at line 4196 of file class.assQuestion.php.

{
return TRUE;
}
assQuestion::isClone (   $question_id = "")

Checks whether the question is a clone of another question or not.

Returns
boolean TRUE if the question is a clone, otherwise FALSE public

Definition at line 1621 of file class.assQuestion.php.

References $id, $ilDB, and $result.

{
global $ilDB;
if ($question_id < 1) $question_id = $this->id;
$result = $ilDB->queryF("SELECT original_id FROM qpl_questions WHERE question_id = %s",
array('integer'),
array($question_id)
);
$row = $ilDB->fetchAssoc($result);
return ($row["original_id"] > 0) ? TRUE : FALSE;
}
assQuestion::isComplete ( )

Returns true, if a question is complete for use.

Returns
boolean True, if the question is complete for use, otherwise false public

Reimplemented in assFormulaQuestion, assKprimChoice, assJavaApplet, assClozeTest, assMultipleChoice, assMatchingQuestion, assImagemapQuestion, assSingleChoice, assOrderingQuestion, assTextQuestion, assTextSubset, assNumeric, assFlashQuestion, assErrorText, assFileUpload, and assOrderingHorizontal.

Definition at line 357 of file class.assQuestion.php.

Referenced by saveQuestionDataToDb(), and saveToDb().

{
return false;
}

+ Here is the caller graph for this function:

static assQuestion::isCoreQuestionType (   $questionType)
static

Definition at line 3677 of file class.assQuestion.php.

References getGuiClassNameByQuestionType().

{
$guiClassName = self::getGuiClassNameByQuestionType($questionType);
return file_exists("Modules/TestQuestionPool/classes/class.{$guiClassName}.php");
}

+ Here is the call graph for this function:

assQuestion::isHTML (   $a_text)

Checks if a given string contains HTML or not.

Parameters
string$a_textText which should be checked
Returns
boolean public
Deprecated:
use ilUtil::isHTML() instead

Definition at line 3237 of file class.assQuestion.php.

Referenced by addQTIMaterial(), and assTextQuestion\getSolutionSubmit().

{
if (preg_match("/<[^>]*?>/", $a_text))
{
return TRUE;
}
else
{
return FALSE;
}
}

+ Here is the caller graph for this function:

assQuestion::isInUse (   $question_id = "")

Checks whether the question is in use or not.

Returns
boolean The number of datasets which are affected by the use of the query. public

Definition at line 1594 of file class.assQuestion.php.

References $ilDB, $result, and getId().

{
global $ilDB;
if ($question_id < 1) $question_id = $this->getId();
$result = $ilDB->queryF("SELECT COUNT(qpl_questions.question_id) question_count FROM qpl_questions, tst_test_question WHERE qpl_questions.original_id = %s AND qpl_questions.question_id = tst_test_question.question_fi",
array('integer'),
array($question_id)
);
$row = $ilDB->fetchAssoc($result);
$count = $row["question_count"];
$result = $ilDB->queryF("SELECT DISTINCT tst_active.test_fi, qpl_questions.question_id FROM qpl_questions, tst_test_rnd_qst, tst_active WHERE qpl_questions.original_id = %s AND qpl_questions.question_id = tst_test_rnd_qst.question_fi AND tst_test_rnd_qst.active_fi = tst_active.active_id",
array('integer'),
array($question_id)
);
$count += $result->numRows();
return $count;
}

+ Here is the call graph for this function:

static assQuestion::isObligationPossible (   $questionId)
static

returns boolean wether it is possible to set this question type as obligatory or not considering the current question configuration

method can be overwritten in derived classes, but be aware of also overwrite the method assQuestion::isAnswered()

Parameters
integer$questionId
Returns
boolean $obligationPossible

Reimplemented in assSingleChoice, assFileUpload, assTextQuestion, and assKprimChoice.

Definition at line 4171 of file class.assQuestion.php.

{
return false;
}
assQuestion::isPreviewSolutionCorrect ( ilAssQuestionPreviewSession  $previewSession)

Definition at line 3131 of file class.assQuestion.php.

References calculateReachedPointsFromPreviewSession(), and getMaximumPoints().

{
$reachedPoints = $this->calculateReachedPointsFromPreviewSession($previewSession);
if( $reachedPoints < $this->getMaximumPoints() )
{
return false;
}
return true;
}

+ Here is the call graph for this function:

assQuestion::isValidAdditionalContentEditingMode (   $additionalContentEditingMode)

returns the fact wether the passed additional content mode is valid or not

public

Parameters
string$additionalContentEditingMode
Returns
boolean $isValidAdditionalContentEditingMode

Definition at line 4283 of file class.assQuestion.php.

References getValidAdditionalContentEditingModes().

{
if( in_array($additionalContentEditingMode, $this->getValidAdditionalContentEditingModes()) )
{
return true;
}
return false;
}

+ Here is the call graph for this function:

assQuestion::keyInArray (   $searchkey,
  $array 
)

returns TRUE if the key occurs in an array

Parameters
string$arraykeyA key to an element in array
array$arrayAn array to be searched public

Definition at line 497 of file class.assQuestion.php.

{
if ($searchkey)
{
foreach ($array as $key => $value)
{
if (strcmp($key, $searchkey)==0)
{
return true;
}
}
}
return false;
}
assQuestion::loadFromDb (   $question_id)

Loads the question from the database.

Parameters
integer$question_idA unique key which defines the question in the database public

Reimplemented in assFormulaQuestion, assImagemapQuestion, assJavaApplet, assMatchingQuestion, assMultipleChoice, assSingleChoice, assKprimChoice, assClozeTest, assErrorText, assOrderingQuestion, assTextSubset, assTextQuestion, assFlashQuestion, assFileUpload, and assOrderingHorizontal.

Definition at line 2183 of file class.assQuestion.php.

References $ilDB, $result, ilRTE\_replaceMediaObjectImageSrc(), and getId().

{
global $ilDB;
$result = $ilDB->queryF(
"SELECT external_id FROM qpl_questions WHERE question_id = %s",
array("integer"),
array($question_id)
);
if($result->numRows() == 1)
{
$data = $ilDB->fetchAssoc($result);
$this->external_id = $data['external_id'];
}
$result = $ilDB->queryF("SELECT * FROM qpl_sol_sug WHERE question_fi = %s",
array('integer'),
array($this->getId())
);
$this->suggested_solutions = array();
if ($result->numRows())
{
include_once("./Services/RTE/classes/class.ilRTE.php");
while ($row = $ilDB->fetchAssoc($result))
{
$value = (is_array(unserialize($row["value"]))) ? unserialize($row["value"]) : ilRTE::_replaceMediaObjectImageSrc($row["value"], 1);
$this->suggested_solutions[$row["subquestion_index"]] = array(
"type" => $row["type"],
"value" => $value,
"internal_link" => $row["internal_link"],
"import_id" => $row["import_id"]
);
}
}
}

+ Here is the call graph for this function:

assQuestion::logAction (   $logtext = "",
  $active_id = "",
  $question_id = "" 
)

Logs an action into the Test&Assessment log.

Parameters
string$logtextThe log text
integer$question_idIf given, saves the question id to the database public

Definition at line 1371 of file class.assQuestion.php.

References $ilUser, $original_id, ilObjAssessmentFolder\_addLog(), ilObjTest\_getObjectIDFromActiveID(), and _getOriginalId().

Referenced by calculateResultsFromSolution(), assOrderingHorizontal\saveWorkingData(), assErrorText\saveWorkingData(), assTextSubset\saveWorkingData(), assFileUpload\saveWorkingData(), assTextQuestion\saveWorkingData(), assSingleChoice\saveWorkingData(), assImagemapQuestion\saveWorkingData(), assOrderingQuestion\saveWorkingData(), assFormulaQuestion\saveWorkingData(), assMatchingQuestion\saveWorkingData(), and assClozeTest\saveWorkingData().

{
global $ilUser;
if (strcmp($question_id, "") != 0)
{
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
}
include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
include_once "./Modules/Test/classes/class.ilObjTest.php";
ilObjAssessmentFolder::_addLog($ilUser->id, ilObjTest::_getObjectIDFromActiveID($active_id), $logtext, $question_id, $original_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static assQuestion::lookupOriginalParentObjId (   $originalQuestionId)
static

returns the parent object id for given original question id (should be a qpl id, but theoretically it can be a tst id, too)

ilDB $ilDB

Parameters
integer$originalQuestionId
Returns
integer $originalQuestionParentObjectId
Deprecated:
: use assQuestion::lookupParentObjId() instead

Definition at line 4114 of file class.assQuestion.php.

References lookupParentObjId().

Referenced by syncWithOriginal().

{
return self::lookupParentObjId($originalQuestionId);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static assQuestion::lookupParentObjId (   $questionId)
static

ilDB $ilDB

Parameters
integer$questionId
Returns
integer $parentObjectId

Definition at line 4092 of file class.assQuestion.php.

References $ilDB, $query, and $res.

Referenced by ilObjTestGUI\copyAndLinkToQuestionpoolObject(), lookupOriginalParentObjId(), and assMultipleChoice\syncImages().

{
global $ilDB;
$query = "SELECT obj_fi FROM qpl_questions WHERE question_id = %s";
$res = $ilDB->queryF($query, array('integer'), array((int)$questionId));
$row = $ilDB->fetchAssoc($res);
return $row['obj_fi'];
}

+ Here is the caller graph for this function:

assQuestion::moveUploadedMediaFile (   $file,
  $name 
)

Move an uploaded media file to an public accessible temp dir to present it.

Parameters
string$fileFile path
string$nameName of the file public

Definition at line 1415 of file class.assQuestion.php.

References $file, ilUtil\createDirectory(), and ilUtil\moveUploadedFile().

{
$mediatempdir = CLIENT_WEB_DIR . "/assessment/temp";
if (!@is_dir($mediatempdir)) ilUtil::createDirectory($mediatempdir);
$temp_name = tempnam($mediatempdir, $name . "_____");
$temp_name = str_replace("\\", "/", $temp_name);
@unlink($temp_name);
if (!ilUtil::moveUploadedFile($file, $name, $temp_name))
{
return FALSE;
}
else
{
return $temp_name;
}
}

+ Here is the call graph for this function:

assQuestion::notifyQuestionCreated ( )
private

Definition at line 4323 of file class.assQuestion.php.

References getQuestionChangeListeners().

Referenced by createNewQuestion().

{
foreach($this->getQuestionChangeListeners() as $listener)
{
$listener->notifyQuestionCreated($this);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::notifyQuestionDeleted ( )
private

Definition at line 4339 of file class.assQuestion.php.

References getQuestionChangeListeners().

Referenced by delete().

{
foreach($this->getQuestionChangeListeners() as $listener)
{
$listener->notifyQuestionDeleted($this);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::notifyQuestionEdited ( )
private

Definition at line 4331 of file class.assQuestion.php.

References getQuestionChangeListeners().

Referenced by saveToDb().

{
foreach($this->getQuestionChangeListeners() as $listener)
{
$listener->notifyQuestionEdited($this);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::onCopy (   $sourceParentId,
  $sourceQuestionId,
  $targetParentId,
  $targetQuestionId 
)
protected

Will be called when a question is copied (into another question pool)

Definition at line 2405 of file class.assQuestion.php.

References copySuggestedSolutionFiles(), and duplicateQuestionHints().

{
$this->copySuggestedSolutionFiles($sourceParentId, $sourceQuestionId);
// duplicate question feeback
$this->feedbackOBJ->duplicateFeedback($sourceQuestionId, $targetQuestionId);
// duplicate question hints
$this->duplicateQuestionHints($sourceQuestionId, $targetQuestionId);
}

+ Here is the call graph for this function:

assQuestion::onDuplicate (   $originalParentId,
  $originalQuestionId,
  $duplicateParentId,
  $duplicateQuestionId 
)
protected

Will be called when a question is duplicated (inside a question pool or for insertion in a test)

Definition at line 2380 of file class.assQuestion.php.

References duplicateQuestionHints(), and duplicateSuggestedSolutionFiles().

{
$this->duplicateSuggestedSolutionFiles($originalParentId, $originalQuestionId);
// duplicate question feeback
$this->feedbackOBJ->duplicateFeedback($originalQuestionId, $duplicateQuestionId);
// duplicate question hints
$this->duplicateQuestionHints($originalQuestionId, $duplicateQuestionId);
}

+ Here is the call graph for this function:

static assQuestion::originalQuestionExists (   $questionId)
static

Definition at line 2835 of file class.assQuestion.php.

References $ilDB, $query, and $res.

Referenced by ilObjTestGUI\copyAndLinkQuestionsToPoolObject(), and ilObjTestGUI\copyAndLinkToQuestionpoolObject().

{
global $ilDB;
$query = "
SELECT COUNT(dupl.question_id) cnt
FROM qpl_questions dupl
INNER JOIN qpl_questions orig
ON orig.question_id = dupl.original_id
WHERE dupl.question_id = %s
";
$res = $ilDB->queryF($query, array('integer'), array($questionId));
$row = $ilDB->fetchAssoc($res);
return $row['cnt'] > 0;
}

+ Here is the caller graph for this function:

assQuestion::pcArrayShuffle (   $array)

Shuffles the values of a given array.

Parameters
array$arrayAn array which should be shuffled public

Definition at line 1640 of file class.assQuestion.php.

References $result.

Referenced by assOrderingQuestion\toJSON().

{
$keys = array_keys($array);
shuffle($keys);
$result = array();
foreach ($keys as $key)
{
$result[$key] = $array[$key];
}
return $result;
}

+ Here is the caller graph for this function:

assQuestion::persistPreviewState ( ilAssQuestionPreviewSession  $previewSession)
final

persists the preview state for current user and question

Definition at line 1105 of file class.assQuestion.php.

References savePreviewData().

{
$this->savePreviewData($previewSession);
}

+ Here is the call graph for this function:

assQuestion::persistWorkingState (   $active_id,
  $pass = NULL,
  $obligationsEnabled = false 
)
final

persists the working state for current testactive and testpass

public

Parameters
integer$active_idActive id of the user
integer$passTest pass

Definition at line 1081 of file class.assQuestion.php.

References $pass, ilObjTest\_getPass(), calculateResultsFromSolution(), getProcessLocker(), reworkWorkingData(), and saveWorkingData().

{
if( $pass === null )
{
require_once 'Modules/Test/classes/class.ilObjTest.php';
$pass = ilObjTest::_getPass($active_id);
}
$this->getProcessLocker()->requestPersistWorkingStateLock();
$saveStatus = $this->saveWorkingData($active_id, $pass);
$this->calculateResultsFromSolution($active_id, $pass, $obligationsEnabled);
$this->reworkWorkingData($active_id, $pass, $obligationsEnabled);
$this->getProcessLocker()->releasePersistWorkingStateLock();
return $saveStatus;
}

+ Here is the call graph for this function:

assQuestion::prepareTextareaOutput (   $txt_output,
  $prepare_for_latex_output = FALSE 
)

Prepares a string for a text area output in tests.

Parameters
string$txt_outputString which should be prepared for output public

Definition at line 3255 of file class.assQuestion.php.

Referenced by getSuggestedSolutionOutput(), and assClozeTest\updateClozeTextFromGaps().

{
include_once "./Services/Utilities/classes/class.ilUtil.php";
return ilUtil::prepareTextareaOutput($txt_output, $prepare_for_latex_output);
}

+ Here is the caller graph for this function:

assQuestion::QTIMaterialToString (   $a_material)

Reads an QTI material tag an creates a text string.

Parameters
string$a_materialQTI material tag
Returns
string text or xhtml string public

Definition at line 3268 of file class.assQuestion.php.

References $_SESSION, and $result.

{
$result = "";
for ($i = 0; $i < $a_material->getMaterialCount(); $i++)
{
$material = $a_material->getMaterial($i);
if (strcmp($material["type"], "mattext") == 0)
{
$result .= $material["material"]->getContent();
}
if (strcmp($material["type"], "matimage") == 0)
{
$matimage = $material["material"];
if (preg_match("/(il_([0-9]+)_mob_([0-9]+))/", $matimage->getLabel(), $matches))
{
// import an mediaobject which was inserted using tiny mce
if (!is_array($_SESSION["import_mob_xhtml"])) $_SESSION["import_mob_xhtml"] = array();
array_push($_SESSION["import_mob_xhtml"], array("mob" => $matimage->getLabel(), "uri" => $matimage->getUri()));
}
}
}
return $result;
}
assQuestion::questionTitleExists (   $questionpool_id,
  $title 
)

Returns TRUE if the question title exists in the database.

Parameters
string$titleThe title of the question
Returns
boolean The result of the title check public

Definition at line 369 of file class.assQuestion.php.

References $ilDB, $result, and $title.

{
global $ilDB;
$result = $ilDB->queryF("SELECT * FROM qpl_questions WHERE obj_fi = %s AND title = %s",
array('integer','text'),
array($questionpool_id, $title)
);
return ($result->numRows() > 0) ? TRUE : FALSE;
}
assQuestion::requiresJsSwitch ( )

Definition at line 628 of file class.assQuestion.php.

References supportsJavascriptOutput(), and supportsNonJsOutput().

{
return $this->supportsJavascriptOutput() && $this->supportsNonJsOutput();
}

+ Here is the call graph for this function:

assQuestion::reworkWorkingData (   $active_id,
  $pass,
  $obligationsAnswered 
)
abstractprotected

Reworks the allready saved working data if neccessary.

protected

Parameters
integer$active_id
integer$pass
boolean$obligationsAnswered

Reimplemented in assClozeTest, assMatchingQuestion, assFormulaQuestion, assOrderingQuestion, assJavaApplet, assImagemapQuestion, assSingleChoice, assTextQuestion, assFileUpload, assMultipleChoice, assTextSubset, assNumeric, assFlashQuestion, assKprimChoice, assErrorText, and assOrderingHorizontal.

Referenced by persistWorkingState().

+ Here is the caller graph for this function:

assQuestion::savePreviewData ( ilAssQuestionPreviewSession  $previewSession)
protected

Reimplemented in assMatchingQuestion, assFormulaQuestion, assOrderingQuestion, assJavaApplet, assImagemapQuestion, assFileUpload, assSingleChoice, assNumeric, assFlashQuestion, and assErrorText.

Definition at line 1132 of file class.assQuestion.php.

References ilAssQuestionPreviewSession\setParticipantsSolution().

Referenced by persistPreviewState().

{
$previewSession->setParticipantsSolution($this->getSolutionSubmit());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::saveQuestionDataToDb (   $original_id = "")

Definition at line 2279 of file class.assQuestion.php.

References $ilDB, $original_id, ilRTE\_replaceMediaObjectImageSrc(), createPageObject(), getAdditionalContentEditingMode(), getAuthor(), getComment(), getEstimatedWorkingTime(), getExternalId(), getId(), getMaximumPoints(), getNrOfTries(), getObjId(), getOwner(), getQuestion(), getQuestionTypeID(), getTitle(), isComplete(), and setId().

Referenced by assOrderingHorizontal\saveToDb(), assFileUpload\saveToDb(), assErrorText\saveToDb(), assFlashQuestion\saveToDb(), assNumeric\saveToDb(), assTextSubset\saveToDb(), assTextQuestion\saveToDb(), assOrderingQuestion\saveToDb(), assImagemapQuestion\saveToDb(), assMatchingQuestion\saveToDb(), assMultipleChoice\saveToDb(), assJavaApplet\saveToDb(), assClozeTest\saveToDb(), assKprimChoice\saveToDb(), and assFormulaQuestion\saveToDb().

{
global $ilDB;
$estw_time = $this->getEstimatedWorkingTime();
$estw_time = sprintf("%02d:%02d:%02d", $estw_time['h'], $estw_time['m'], $estw_time['s']);
// cleanup RTE images which are not inserted into the question text
include_once("./Services/RTE/classes/class.ilRTE.php");
if ($this->getId() == -1)
{
// Neuen Datensatz schreiben
$next_id = $ilDB->nextId('qpl_questions');
$affectedRows = $ilDB->insert("qpl_questions", array(
"question_id" => array("integer", $next_id),
"question_type_fi" => array("integer", $this->getQuestionTypeID()),
"obj_fi" => array("integer", $this->getObjId()),
"title" => array("text", $this->getTitle()),
"description" => array("text", $this->getComment()),
"author" => array("text", $this->getAuthor()),
"owner" => array("integer", $this->getOwner()),
"question_text" => array("clob", ilRTE::_replaceMediaObjectImageSrc($this->getQuestion(), 0)),
"points" => array("float", $this->getMaximumPoints()),
"working_time" => array("text", $estw_time),
"nr_of_tries" => array("integer", $this->getNrOfTries()),
"created" => array("integer", time()),
"original_id" => array("integer", ($original_id) ? $original_id : NULL),
"tstamp" => array("integer", time()),
"external_id" => array("text", $this->getExternalId()),
'add_cont_edit_mode' => array('text', $this->getAdditionalContentEditingMode())
));
$this->setId($next_id);
// create page object of question
$this->createPageObject();
}
else
{
// Vorhandenen Datensatz aktualisieren
$affectedRows = $ilDB->update("qpl_questions", array(
"obj_fi" => array("integer", $this->getObjId()),
"title" => array("text", $this->getTitle()),
"description" => array("text", $this->getComment()),
"author" => array("text", $this->getAuthor()),
"question_text" => array("clob", ilRTE::_replaceMediaObjectImageSrc($this->getQuestion(), 0)),
"points" => array("float", $this->getMaximumPoints()),
"nr_of_tries" => array("integer", $this->getNrOfTries()),
"working_time" => array("text", $estw_time),
"tstamp" => array("integer", time()),
'complete' => array('integer', $this->isComplete()),
"external_id" => array("text", $this->getExternalId())
), array(
"question_id" => array("integer", $this->getId())
));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::saveToDb (   $original_id = "")

Saves the question to the database.

Parameters
integer$original_idpublic

Reimplemented in assFormulaQuestion, assKprimChoice, assClozeTest, assJavaApplet, assMultipleChoice, assMatchingQuestion, assImagemapQuestion, assOrderingQuestion, assTextQuestion, assTextSubset, assNumeric, assFlashQuestion, assErrorText, assFileUpload, and assOrderingHorizontal.

Definition at line 2341 of file class.assQuestion.php.

References $ilDB, ilObjQuestionPool\_updateQuestionCount(), cleanupMediaObjectUsage(), getId(), getOwner(), isComplete(), and notifyQuestionEdited().

Referenced by syncWithOriginal().

{
global $ilDB;
$this->updateSuggestedSolutions();
// remove unused media objects from ILIAS
$complete = "0";
if ($this->isComplete())
{
$complete = "1";
}
// update the question time stamp and completion status
$affectedRows = $ilDB->manipulateF("UPDATE qpl_questions SET tstamp = %s, owner = %s, complete = %s WHERE question_id = %s",
array('integer','integer', 'integer','text'),
array(time(), ($this->getOwner() <= 0) ? $this->ilias->account->id : $this->getOwner(), $complete, $this->getId())
);
// update question count of question pool
include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
$this->notifyQuestionEdited($this);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::saveWorkingData (   $active_id,
  $pass = NULL 
)
abstract

Saves the learners input of the question to the database.

public

Parameters
integer$active_idActive id of the user
integer$passTest pass
Returns
boolean $status

Reimplemented in assClozeTest, assMatchingQuestion, assFormulaQuestion, assJavaApplet, assOrderingQuestion, assImagemapQuestion, assSingleChoice, assTextQuestion, assFileUpload, assTextSubset, assFlashQuestion, assErrorText, and assOrderingHorizontal.

Referenced by persistWorkingState().

+ Here is the caller graph for this function:

assQuestion::setAdditionalContentEditingMode (   $additinalContentEditingMode)

setter for additional content editing mode for this question

public

Returns
string

Definition at line 4254 of file class.assQuestion.php.

References $additinalContentEditingMode, and getValidAdditionalContentEditingModes().

Referenced by assOrderingHorizontal\loadFromDb(), assFileUpload\loadFromDb(), assFlashQuestion\loadFromDb(), assTextQuestion\loadFromDb(), assTextSubset\loadFromDb(), assOrderingQuestion\loadFromDb(), assErrorText\loadFromDb(), assClozeTest\loadFromDb(), assKprimChoice\loadFromDb(), assSingleChoice\loadFromDb(), assMultipleChoice\loadFromDb(), assMatchingQuestion\loadFromDb(), assJavaApplet\loadFromDb(), assImagemapQuestion\loadFromDb(), and assFormulaQuestion\loadFromDb().

{
{
require_once 'Modules/TestQuestionPool/exceptions/class.ilTestQuestionPoolException.php';
throw new ilTestQuestionPoolException('invalid additional content editing mode given: '.$additinalContentEditingMode);
}
$this->additinalContentEditingMode = $additinalContentEditingMode;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::setAuthor (   $author = "")
assQuestion::setDefaultNrOfTries (   $a_defaultnroftries)

Set Default Nr of Tries.

Parameters
int$a_defaultnroftriesDefault Nr. of Tries

Definition at line 4070 of file class.assQuestion.php.

{
$this->defaultnroftries = $a_defaultnroftries;
}
assQuestion::setEstimatedWorkingTime (   $hour = 0,
  $min = 0,
  $sec = 0 
)

Sets the estimated working time of a question from given hour, minute and second.

Parameters
integer$hourHour
integer$minMinutes
integer$secSeconds public
See Also
$comment

Definition at line 470 of file class.assQuestion.php.

Referenced by __construct(), __set(), assOrderingHorizontal\loadFromDb(), assFileUpload\loadFromDb(), assFlashQuestion\loadFromDb(), assTextQuestion\loadFromDb(), assTextSubset\loadFromDb(), assOrderingQuestion\loadFromDb(), assErrorText\loadFromDb(), assClozeTest\loadFromDb(), assSingleChoice\loadFromDb(), assMultipleChoice\loadFromDb(), assMatchingQuestion\loadFromDb(), assJavaApplet\loadFromDb(), assImagemapQuestion\loadFromDb(), and assFormulaQuestion\loadFromDb().

{
$this->est_working_time = array("h" => (int)$hour, "m" => (int)$min, "s" => (int)$sec);
}

+ Here is the caller graph for this function:

assQuestion::setEstimatedWorkingTimeFromDurationString (   $durationString)

Sets the estimated working time of a question from a given datetime string.

Parameters
string$datetime

Definition at line 481 of file class.assQuestion.php.

Referenced by assKprimChoice\loadFromDb().

{
$this->est_working_time = array(
'h' => (int)substr($durationString, 0, 2),
'm' => (int)substr($durationString, 3, 2),
's' => (int)substr($durationString, 6, 2)
);
}

+ Here is the caller graph for this function:

assQuestion::setExportDetailsXLS ( $worksheet,
  $startrow,
  $active_id,
  $pass,
$format_title,
$format_bold 
)

Creates an Excel worksheet for the detailed cumulated results of this question.

Parameters
object$worksheetReference to the parent excel worksheet
object$startrowStartrow of the output in the excel worksheet
object$active_idActive id of the participant
object$passTest pass
object$format_titleExcel title format
object$format_boldExcel bold format
array$eval_dataCumulated evaluation data public

Reimplemented in assClozeTest, assMatchingQuestion, assFormulaQuestion, assKprimChoice, assOrderingQuestion, assSingleChoice, assMultipleChoice, assJavaApplet, assImagemapQuestion, assFileUpload, assTextQuestion, assTextSubset, assNumeric, assFlashQuestion, assErrorText, and assOrderingHorizontal.

Definition at line 3829 of file class.assQuestion.php.

{
return $startrow;
}
assQuestion::setExportImagePath (   $a_path)

Definition at line 3973 of file class.assQuestion.php.

{
$this->export_image_path = (string)$a_path;
}
assQuestion::setExternalId (   $external_id)
Parameters
string$external_id

Definition at line 700 of file class.assQuestion.php.

References $external_id.

Referenced by __construct().

{
$this->external_id = $external_id;
}

+ Here is the caller graph for this function:

assQuestion::setLastChange (   $lastChange)

Reimplemented in assMultipleChoice.

Definition at line 4377 of file class.assQuestion.php.

References $lastChange.

Referenced by assKprimChoice\loadFromDb().

{
$this->lastChange = $lastChange;
}

+ Here is the caller graph for this function:

assQuestion::setNewOriginalId (   $newId)

Definition at line 2369 of file class.assQuestion.php.

References $ilDB, and getId().

{
global $ilDB;
$ilDB->manipulateF("UPDATE qpl_questions SET tstamp = %s, original_id = %s WHERE question_id = %s",
array('integer','integer', 'text'),
array(time(), $newId, $this->getId())
);
}

+ Here is the call graph for this function:

assQuestion::setObligationsToBeConsidered (   $obligationsToBeConsidered = true)

sets the flag wether obligations are to be considered or not

Parameters
bool$obligationsToBeConsidered

Definition at line 4181 of file class.assQuestion.php.

References $obligationsToBeConsidered.

{
$this->obligationsToBeConsidered = (bool)$obligationsToBeConsidered;
}
assQuestion::setOutputType (   $outputType = OUTPUT_HTML)

Sets the output type.

Parameters
integer$outputTypeThe output type of the question public
See Also
$outputType

Reimplemented in assSingleChoice, and assMultipleChoice.

Definition at line 435 of file class.assQuestion.php.

References $outputType.

Referenced by __set().

{
$this->outputType = $outputType;
}

+ Here is the caller graph for this function:

assQuestion::setPreventRteUsage (   $a_val)

Set prevent rte usage.

Parameters
booleanprevent rte usage

Definition at line 4030 of file class.assQuestion.php.

{
$this->prevent_rte_usage = $a_val;
}
assQuestion::setProcessLocker (   $processLocker)
Parameters
\ilAssQuestionProcessLocker$processLocker

Definition at line 305 of file class.assQuestion.php.

References $processLocker.

{
$this->processLocker = $processLocker;
}
static assQuestion::setResultGateway (   $resultGateway)
static
Parameters
\ilObjTestGateway$resultGateway

Definition at line 4486 of file class.assQuestion.php.

References $resultGateway.

{
self::$resultGateway = $resultGateway;
}
assQuestion::setSelfAssessmentEditingMode (   $a_selfassessmenteditingmode)

Set Self-Assessment Editing Mode.

Parameters
boolean$a_selfassessmenteditingmodeSelf-Assessment Editing Mode

Definition at line 4050 of file class.assQuestion.php.

{
$this->selfassessmenteditingmode = $a_selfassessmenteditingmode;
}
assQuestion::setShuffle (   $shuffle = true)

Sets the shuffle flag.

Parameters
boolean$shuffleA flag indicating whether the answers are shuffled or not public
See Also
$shuffle

Reimplemented in assMatchingQuestion.

Definition at line 448 of file class.assQuestion.php.

References $shuffle.

Referenced by __set(), assTextQuestion\loadFromDb(), assSingleChoice\loadFromDb(), and assMultipleChoice\loadFromDb().

{
if ($shuffle)
{
$this->shuffle = 1;
}
else
{
$this->shuffle = 0;
}
}

+ Here is the caller graph for this function:

assQuestion::setStep (   $step)
Parameters
int | null$step

Definition at line 4502 of file class.assQuestion.php.

References $step.

{
$this->step = $step;
}
assQuestion::setSuggestedSolution (   $solution_id = "",
  $subquestion_index = 0,
  $is_import = false 
)

Sets a suggested solution for the question.

If there is more than one subquestion (i.e. close questions) may enter a subquestion index.

Parameters
string$solution_idAn internal link pointing to the suggested solution
integer$subquestion_indexThe index of a subquestion (i.e. a close test gap). Usually 0
boolean$is_importA boolean indication that the internal link was imported from another ILIAS installation public

Definition at line 2484 of file class.assQuestion.php.

References _resolveInternalLink().

Referenced by assFileUpload\loadFromDb(), assFlashQuestion\loadFromDb(), and assFormulaQuestion\loadFromDb().

{
if (strcmp($solution_id, "") != 0)
{
$import_id = "";
if ($is_import)
{
$import_id = $solution_id;
$solution_id = $this->_resolveInternalLink($import_id);
}
$this->suggested_solutions[$subquestion_index] = array(
"internal_link" => $solution_id,
"import_id" => $import_id
);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::setTestId (   $id = -1)

Sets the test id of the assQuestion object.

Parameters
integer$idA unique integer value public
See Also
$test_id

Definition at line 411 of file class.assQuestion.php.

References $id.

Referenced by __set().

{
$this->test_id = $id;
}

+ Here is the caller graph for this function:

static assQuestion::sumTimesInISO8601FormatH_i_s_Extended (   $time1,
  $time2 
)
static
Parameters
$time1
$time2
Returns
string

Definition at line 4520 of file class.assQuestion.php.

References convertISO8601FormatH_i_s_ExtendedToSeconds().

Referenced by ilTestQuestionsTableGUI\fillRow(), and ilQuestionBrowserTableGUI\fillRow().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::supportsJavascriptOutput ( )

Returns true if the question type supports JavaScript output.

Returns
boolean TRUE if the question type supports JavaScript output, FALSE otherwise public

Reimplemented in assMatchingQuestion, assOrderingQuestion, and assOrderingHorizontal.

Definition at line 618 of file class.assQuestion.php.

Referenced by requiresJsSwitch().

{
return FALSE;
}

+ Here is the caller graph for this function:

assQuestion::supportsNonJsOutput ( )

Reimplemented in assMatchingQuestion, assOrderingQuestion, and assOrderingHorizontal.

Definition at line 623 of file class.assQuestion.php.

Referenced by requiresJsSwitch().

{
return true;
}

+ Here is the caller graph for this function:

assQuestion::syncSuggestedSolutionFiles (   $original_id)
protected

Syncs the files of a suggested solution if the question is synced.

Definition at line 2538 of file class.assQuestion.php.

References $filename, $ilLog, ilUtil\delDir(), getSuggestedSolutionPath(), and ilUtil\makeDirParents().

{
global $ilLog;
$filepath = $this->getSuggestedSolutionPath();
$filepath_original = str_replace("/$this->id/solution", "/$original_id/solution", $filepath);
ilUtil::delDir($filepath_original);
foreach ($this->suggested_solutions as $index => $solution)
{
if (strcmp($solution["type"], "file") == 0)
{
if (!file_exists($filepath_original))
{
ilUtil::makeDirParents($filepath_original);
}
$filename = $solution["value"]["name"];
if (strlen($filename))
{
if (!@copy($filepath . $filename, $filepath_original . $filename))
{
$ilLog->write("File could not be duplicated!!!!", $ilLog->ERROR);
$ilLog->write("object: " . print_r($this, TRUE), $ilLog->ERROR);
}
}
}
}
}

+ Here is the call graph for this function:

assQuestion::syncWithOriginal ( )

Reimplemented in assImagemapQuestion, assSingleChoice, and assMultipleChoice.

Definition at line 2853 of file class.assQuestion.php.

References $id, $ilDB, afterSyncWithOriginal(), beforeSyncWithOriginal(), copyPageOfQuestion(), createPageObject(), deletePageOfQuestion(), getId(), getObjId(), getOriginalId(), lookupOriginalParentObjId(), saveToDb(), setId(), setObjId(), setOriginalId(), and syncXHTMLMediaObjectsOfQuestion().

{
global $ilDB;
if( !$this->getOriginalId() )
{
return;
}
$originalObjId = self::lookupOriginalParentObjId($this->getOriginalId());
if ( !$originalObjId )
{
return;
}
$id = $this->getId();
$objId = $this->getObjId();
$original = $this->getOriginalId();
$this->beforeSyncWithOriginal($original, $id, $originalObjId, $objId);
$this->setId($this->getOriginalId());
$this->setOriginalId(NULL);
$this->setObjId($originalObjId);
$this->saveToDb();
$this->deletePageOfQuestion($original);
$this->createPageObject();
$this->setId($id);
$this->setOriginalId($original);
$this->updateSuggestedSolutions($original);
$this->afterSyncWithOriginal($original, $id, $originalObjId, $objId);
$this->syncHints();
}

+ Here is the call graph for this function:

assQuestion::syncXHTMLMediaObjectsOfQuestion ( )

Definition at line 2065 of file class.assQuestion.php.

References $mobs, ilObjMediaObject\_getMobsOfObject(), ilObjMediaObject\_saveUsage(), and getId().

Referenced by syncWithOriginal().

{
include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
foreach ($mobs as $mob)
{
ilObjMediaObject::_saveUsage($mob, "qpl:html", $this->original_id);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

assQuestion::toXML (   $a_include_header = true,
  $a_include_binary = true,
  $a_shuffle = false,
  $test_output = false,
  $force_image_references = false 
)

Returns a QTI xml representation of the question.

Returns
string The QTI xml representation of the question public

Reimplemented in assFileUpload, assFlashQuestion, assErrorText, and assOrderingHorizontal.

Definition at line 343 of file class.assQuestion.php.

References getQuestionType().

{
include_once "./Modules/TestQuestionPool/classes/export/qti12/class." . $this->getQuestionType() . "Export.php";
$classname = $this->getQuestionType() . "Export";
$export = new $classname($this);
return $export->toXML($a_include_header, $a_include_binary, $a_shuffle, $test_output, $force_image_references);
}

+ Here is the call graph for this function:

Field Documentation

assQuestion::$additinalContentEditingMode = null
private
assQuestion::$arrData
private

Associative array to store properties.

Definition at line 157 of file class.assQuestion.php.

assQuestion::$db
protected

Definition at line 119 of file class.assQuestion.php.

assQuestion::$defaultnroftries = 0

Definition at line 221 of file class.assQuestion.php.

Referenced by getDefaultNrOfTries().

assQuestion::$est_working_time
protected

Definition at line 76 of file class.assQuestion.php.

Referenced by getEstimatedWorkingTime().

assQuestion::$export_image_path
private

(Web) Path to images

Definition at line 162 of file class.assQuestion.php.

Referenced by getImagePathWeb().

assQuestion::$external_id = ''
protected

Definition at line 176 of file class.assQuestion.php.

Referenced by getExternalId(), and setExternalId().

assQuestion::$feedbackOBJ = null

Definition at line 200 of file class.assQuestion.php.

assQuestion::$ilias
protected

Definition at line 104 of file class.assQuestion.php.

Referenced by __construct(), and __get().

assQuestion::$lastChange
protected

Definition at line 245 of file class.assQuestion.php.

Referenced by getLastChange(), and setLastChange().

assQuestion::$nr_of_tries
private

Number of tries.

Definition at line 152 of file class.assQuestion.php.

Referenced by getNrOfTries().

assQuestion::$obj_id
protected

Definition at line 97 of file class.assQuestion.php.

Referenced by createNewQuestion(), delete(), getImagePath(), getObjId(), and setObjId().

assQuestion::$obligationsToBeConsidered = false
private
assQuestion::$original_id
protected

Definition at line 140 of file class.assQuestion.php.

Referenced by _logAction(), assOrderingHorizontal\copyObject(), assFileUpload\copyObject(), assNumeric\copyObject(), assTextQuestion\copyObject(), assImagemapQuestion\copyObject(), assFlashQuestion\copyObject(), assOrderingQuestion\copyObject(), assErrorText\copyObject(), assTextSubset\copyObject(), assMultipleChoice\copyObject(), assSingleChoice\copyObject(), assMatchingQuestion\copyObject(), assJavaApplet\copyObject(), assFormulaQuestion\copyObject(), assKprimChoice\copyObject(), assClozeTest\copyObject(), assOrderingHorizontal\duplicate(), assFileUpload\duplicate(), assNumeric\duplicate(), assImagemapQuestion\duplicate(), assTextQuestion\duplicate(), assFlashQuestion\duplicate(), assOrderingQuestion\duplicate(), assErrorText\duplicate(), assTextSubset\duplicate(), assSingleChoice\duplicate(), assMultipleChoice\duplicate(), assMatchingQuestion\duplicate(), assJavaApplet\duplicate(), assKprimChoice\duplicate(), assFormulaQuestion\duplicate(), assClozeTest\duplicate(), assTextQuestion\duplicateAnswers(), getOriginalId(), logAction(), saveQuestionDataToDb(), assOrderingHorizontal\saveToDb(), assFileUpload\saveToDb(), assErrorText\saveToDb(), assFlashQuestion\saveToDb(), assNumeric\saveToDb(), assTextSubset\saveToDb(), assTextQuestion\saveToDb(), assOrderingQuestion\saveToDb(), assImagemapQuestion\saveToDb(), assMatchingQuestion\saveToDb(), assMultipleChoice\saveToDb(), assJavaApplet\saveToDb(), assClozeTest\saveToDb(), assFormulaQuestion\saveToDb(), and setOriginalId().

assQuestion::$outputType
protected

Definition at line 126 of file class.assQuestion.php.

Referenced by getOutputType(), and setOutputType().

assQuestion::$page
protected
assQuestion::$points
protected

Definition at line 69 of file class.assQuestion.php.

Referenced by _getMaximumPoints(), _getReachedPoints(), _isWorkedThrough(), _setReachedPoints(), assTextSubset\addAnswer(), assMultipleChoice\addAnswer(), assSingleChoice\addAnswer(), assImagemapQuestion\addAnswer(), assTextQuestion\addAnswer(), assErrorText\addErrorData(), assMatchingQuestion\addMatchingPair(), adjustReachedPointsByScoringOptions(), assClozeTest\calculateCombinationResult(), assOrderingHorizontal\calculateReachedPoints(), assFileUpload\calculateReachedPoints(), assErrorText\calculateReachedPoints(), assFlashQuestion\calculateReachedPoints(), assKprimChoice\calculateReachedPoints(), assTextSubset\calculateReachedPoints(), assMultipleChoice\calculateReachedPoints(), assSingleChoice\calculateReachedPoints(), assTextQuestion\calculateReachedPoints(), assOrderingQuestion\calculateReachedPoints(), assJavaApplet\calculateReachedPoints(), assImagemapQuestion\calculateReachedPoints(), assMatchingQuestion\calculateReachedPoints(), assFormulaQuestion\calculateReachedPoints(), assFileUpload\calculateReachedPointsForSolution(), assTextQuestion\calculateReachedPointsForSolution(), assKprimChoice\calculateReachedPointsForSolution(), assOrderingHorizontal\calculateReachedPointsForSolution(), assTextSubset\calculateReachedPointsForSolution(), assImagemapQuestion\calculateReachedPointsForSolution(), assMultipleChoice\calculateReachedPointsForSolution(), assOrderingQuestion\calculateReachedPointsForSolution(), assMatchingQuestion\calculateReachedPointsForSolution(), assClozeTest\calculateReachedPointsForSolution(), assNumeric\calculateReachedPointsFromPreviewSession(), assFlashQuestion\calculateReachedPointsFromPreviewSession(), assJavaApplet\calculateReachedPointsFromPreviewSession(), assFormulaQuestion\calculateReachedPointsFromPreviewSession(), assErrorText\getBestSelection(), assClozeTest\getMaximumGapPoints(), assTextQuestion\getMaximumPoints(), assFlashQuestion\getMaximumPoints(), assTextSubset\getMaximumPoints(), assMultipleChoice\getMaximumPoints(), assSingleChoice\getMaximumPoints(), assImagemapQuestion\getMaximumPoints(), assClozeTest\getMaximumPoints(), assFormulaQuestion\getMaximumPoints(), getMaximumPoints(), assMatchingQuestion\getMaximumPoints(), assTextQuestion\getMinimumPoints(), getPoints(), assErrorText\getPointsForSelectedPositions(), assJavaApplet\getUserQuestionResult(), assFileUpload\handleSubmission(), assMatchingQuestion\insertMatchingPair(), assErrorText\setErrorData(), assClozeTest\setGapAnswerPoints(), and assTextQuestion\setReachedPoints().

assQuestion::$prevent_rte_usage = false

Definition at line 207 of file class.assQuestion.php.

Referenced by getPreventRteUsage().

assQuestion::$processLocker
protected
assQuestion::$questionActionCmd = 'handleQuestionAction'

Definition at line 233 of file class.assQuestion.php.

assQuestion::$questionChangeListeners = array()
protected

Definition at line 226 of file class.assQuestion.php.

Referenced by getQuestionChangeListeners().

assQuestion::$resultGateway = null
staticprivate

Definition at line 238 of file class.assQuestion.php.

Referenced by getResultGateway(), and setResultGateway().

assQuestion::$selfassessmenteditingmode = false

Definition at line 214 of file class.assQuestion.php.

Referenced by getSelfAssessmentEditingMode().

assQuestion::$step = null
protected

Definition at line 243 of file class.assQuestion.php.

Referenced by getStep(), and setStep().

assQuestion::$suggested_solutions
protected

Definition at line 133 of file class.assQuestion.php.

Referenced by getSuggestedSolutions().

assQuestion::$title
protected

Definition at line 34 of file class.assQuestion.php.

Referenced by assFlashQuestion\__construct(), assOrderingHorizontal\__construct(), assErrorText\__construct(), assFormulaQuestion\__construct(), assFileUpload\__construct(), assKprimChoice\__construct(), assNumeric\__construct(), assImagemapQuestion\__construct(), assTextSubset\__construct(), assTextQuestion\__construct(), assOrderingQuestion\__construct(), assSingleChoice\__construct(), assMatchingQuestion\__construct(), assMultipleChoice\__construct(), assJavaApplet\__construct(), assClozeTest\__construct(), __construct(), assOrderingHorizontal\copyObject(), assFileUpload\copyObject(), assNumeric\copyObject(), assTextQuestion\copyObject(), assImagemapQuestion\copyObject(), assFlashQuestion\copyObject(), assOrderingQuestion\copyObject(), assErrorText\copyObject(), assTextSubset\copyObject(), assMultipleChoice\copyObject(), assSingleChoice\copyObject(), assMatchingQuestion\copyObject(), assJavaApplet\copyObject(), assFormulaQuestion\copyObject(), assKprimChoice\copyObject(), assClozeTest\copyObject(), assOrderingHorizontal\duplicate(), assFileUpload\duplicate(), assNumeric\duplicate(), assTextQuestion\duplicate(), assImagemapQuestion\duplicate(), assFlashQuestion\duplicate(), assOrderingQuestion\duplicate(), assErrorText\duplicate(), assTextSubset\duplicate(), assSingleChoice\duplicate(), assMultipleChoice\duplicate(), assMatchingQuestion\duplicate(), assJavaApplet\duplicate(), assKprimChoice\duplicate(), assFormulaQuestion\duplicate(), assClozeTest\duplicate(), getSuggestedSolutionTitle(), getTitle(), questionTitleExists(), and setTitle().

assQuestion::$tpl
protected

Definition at line 109 of file class.assQuestion.php.

Referenced by __construct(), and __get().

const assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT = 'pageobject'

The documentation for this class was generated from the following file: