ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
assOrderingHorizontal Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for assOrderingHorizontal:
+ Collaboration diagram for assOrderingHorizontal:

Public Member Functions

 __construct ( $title="", $comment="", $author="", $owner=-1, $question="")
 assOrderingHorizontal constructor More...
 
 isComplete ()
 Returns true, if a single choice question is complete for use. More...
 
 saveToDb ($original_id="")
 Saves a assOrderingHorizontal object to a database. More...
 
 getAnswerSeparator ()
 
 loadFromDb ($question_id)
 Loads a assOrderingHorizontal object from a database. More...
 
 duplicate (bool $for_test=true, string $title="", string $author="", int $owner=-1, $testObjId=null)
 Duplicates an assOrderingHorizontal. More...
 
 copyObject ($target_questionpool_id, $title="")
 Copies an assOrderingHorizontal object. More...
 
 createNewOriginalFromThisDuplicate ($targetParentId, $targetQuestionTitle="")
 
 getMaximumPoints ()
 Returns the maximum points, a learner can reach answering the question. More...
 
 calculateReachedPoints ($active_id, $pass=null, $authorizedSolution=true, $returndetails=false)
 Returns the points, a learner has reached answering the question. More...
 
 splitAndTrimOrderElementText (string $in_string, string $separator)
 Splits the answer string either by space(s) or the separator (eg. More...
 
 getSolutionSubmit ()
 
 saveWorkingData ($active_id, $pass=null, $authorized=true)
 Saves the learners input of the question to the database. More...
 
 saveAdditionalQuestionDataToDb ()
 Saves a record to the question types additional data table. More...
 
 getQuestionType ()
 Returns the question type of the question. More...
 
 getAdditionalTableName ()
 Returns the name of the additional question data table in the database. More...
 
 getAnswerTableName ()
 Returns the name of the answer table in the database. More...
 
 deleteAnswers ($question_id)
 Deletes datasets from answers tables. More...
 
 getRTETextWithMediaObjects ()
 Collects all text in the question which could contain media objects which were created with the Rich Text Editor. More...
 
 setExportDetailsXLSX (ilAssExcelFormatHelper $worksheet, int $startrow, int $col, int $active_id, int $pass)
 {} More...
 
 fromXML ($item, int $questionpool_id, ?int $tst_id, &$tst_object, int &$question_counter, array $import_mapping, array &$solutionhints=[])
 Creates a question from a QTI file. More...
 
 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 and sets the internal domxml variable with the DOM XML representation of the QTI xml representation. More...
 
 getBestSolution ($active_id, $pass)
 Returns the best solution for a given pass of a participant. More...
 
 getOrderingElements ()
 Get ordering elements from order text. More...
 
 getRandomOrderingElements ()
 Get ordering elements from order text in random sequence. More...
 
 getOrderText ()
 Get order text. More...
 
 setOrderText ($a_value)
 Set order text. More...
 
 getTextSize ()
 Get text size. More...
 
 setTextSize (?float $textsize)
 Set text size. More...
 
 getSeparator ()
 Get order text separator. More...
 
 setSeparator ($a_value)
 Set order text separator. More...
 
 toJSON ()
 Returns a JSON representation of the question. More...
 
 getOperators ($expression)
 Get all available operations for a specific question. More...
 
 getExpressionTypes ()
 Get all available expression types for a specific question. More...
 
 getAvailableAnswerOptions ($index=null)
 If index is null, the function returns an array with all anwser options Else it returns the specific answer option. More...
 
 buildTestPresentationConfig ()
 Get the test question configuration. More...
 
- Public Member Functions inherited from assQuestion
 __construct (string $title="", string $comment="", string $author="", int $owner=-1, string $question="")
 assQuestion constructor More...
 
 getShuffler ()
 
 setShuffler (Transformation $shuffler)
 
 setProcessLocker (ilAssQuestionProcessLocker $processLocker)
 
 getProcessLocker ()
 
 fromXML ($item, int $questionpool_id, ?int $tst_id, &$tst_object, int &$question_counter, array $import_mapping, array &$solutionhints=[])
 Receives parameters from a QTI parser and creates a valid ILIAS question object. More...
 
 toXML (bool $a_include_header=true, bool $a_include_binary=true, bool $a_shuffle=false, bool $test_output=false, bool $force_image_references=false)
 Returns a QTI xml representation of the question. More...
 
 isComplete ()
 Returns true, if a question is complete for use. More...
 
 setTitle (string $title="")
 
 setId (int $id=-1)
 
 setTestId (int $id=-1)
 
 setComment (string $comment="")
 
 setShuffle (?bool $shuffle=true)
 
 setAuthor (string $author="")
 
 setOwner (int $owner=-1)
 
 getTitle ()
 
 getTitleForHTMLOutput ()
 
 getTitleFilenameCompliant ()
 
 getId ()
 
 getShuffle ()
 
 getTestId ()
 
 getComment ()
 
 getDescriptionForHTMLOutput ()
 
 getThumbSize ()
 
 setThumbSize (int $a_size)
 
 getMinimumThumbSize ()
 
 getMaximumThumbSize ()
 
 getAuthor ()
 
 getAuthorForHTMLOutput ()
 
 getOwner ()
 
 getObjId ()
 
 setObjId (int $obj_id=0)
 
 getLifecycle ()
 
 setLifecycle (ilAssQuestionLifecycle $lifecycle)
 
 setExternalId (?string $external_id)
 
 getExternalId ()
 
 getSuggestedSolutionOutput ()
 
 getSuggestedSolutions ()
 
 getReachedPoints (int $active_id, int $pass)
 
 getMaximumPoints ()
 
 getAdjustedReachedPoints (int $active_id, int $pass, bool $authorizedSolution=true)
 returns the reached points ... More...
 
 calculateResultsFromSolution (int $active_id, int $pass, bool $obligationsEnabled=false)
 Calculates the question results from a previously saved question solution. More...
 
 persistWorkingState (int $active_id, $pass, bool $obligationsEnabled=false, bool $authorized=true)
 persists the working state for current testactive and testpass More...
 
 persistPreviewState (ilAssQuestionPreviewSession $previewSession)
 persists the preview state for current user and question More...
 
 validateSolutionSubmit ()
 
 saveWorkingData (int $active_id, int $pass, bool $authorized=true)
 Saves the learners input of the question to the database. More...
 
 getSuggestedSolutionPath ()
 
 getImagePath ($question_id=null, $object_id=null)
 Returns the image path for web accessable images of a question. More...
 
 getSuggestedSolutionPathWeb ()
 
 getImagePathWeb ()
 Returns the web image path for web accessable images of a question. More...
 
 getTestOutputSolutions (int $activeId, int $pass)
 
 getUserSolutionPreferingIntermediate (int $active_id, $pass=null)
 
 getSolutionValues ($active_id, $pass=null, bool $authorized=true)
 Loads solutions of a given user from the database an returns it. More...
 
 getAdditionalTableName ()
 
 getAnswerTableName ()
 
 deleteAnswers (int $question_id)
 
 deleteAdditionalTableData (int $question_id)
 
 delete (int $question_id)
 
 getTotalAnswers ()
 
 copyXHTMLMediaObjectsOfQuestion (int $a_q_id)
 
 syncXHTMLMediaObjectsOfQuestion ()
 
 createPageObject ()
 
 copyPageOfQuestion (int $a_q_id)
 
 getPageOfQuestion ()
 
 setOriginalId (?int $original_id)
 
 getOriginalId ()
 
 fixSvgToPng (string $imageFilenameContainingString)
 
 fixUnavailableSkinImageSources (string $html)
 
 loadFromDb (int $question_id)
 
 createNewQuestion (bool $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. More...
 
 saveQuestionDataToDb (int $original_id=-1)
 
 saveToDb ()
 
 deleteSuggestedSolutions ()
 
 getSuggestedSolution (int $subquestion_index=0)
 
 resolveInternalLink (string $internal_link)
 
 resolveSuggestedSolutionLinks ()
 
 syncWithOriginal ()
 
 getPoints ()
 
 setPoints (float $points)
 
 getSolutionMaxPass (int $active_id)
 
 calculateReachedPoints ($active_id, $pass=null, $authorizedSolution=true, $returndetails=false)
 Returns the points, a learner has reached answering the question. More...
 
 deductHintPointsFromReachedPoints (ilAssQuestionPreviewSession $previewSession, $reachedPoints)
 
 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. More...
 
 buildHashedImageFilename (string $plain_image_filename, bool $unique=false)
 
 getQuestion ()
 
 getQuestionForHTMLOutput ()
 
 setQuestion (string $question="")
 
 getQuestionType ()
 Returns the question type of the question. More...
 
 getQuestionTypeID ()
 
 syncHints ()
 
 cleanupMediaObjectUsage ()
 
 getInstances ()
 
 getActiveUserData (int $active_id)
 Returns the user id and the test id for a given active id. More...
 
 hasSpecificFeedback ()
 
 setExportDetailsXLSX (ilAssExcelFormatHelper $worksheet, int $startrow, int $col, int $active_id, int $pass)
 
 getNrOfTries ()
 
 setNrOfTries (int $a_nr_of_tries)
 
 setExportImagePath (string $path)
 
 formatSAQuestion ($a_q)
 
 setPreventRteUsage (bool $prevent_rte_usage)
 
 getPreventRteUsage ()
 
 migrateContentForLearningModule (ilAssSelfAssessmentMigrator $migrator)
 
 setSelfAssessmentEditingMode (bool $selfassessmenteditingmode)
 
 getSelfAssessmentEditingMode ()
 
 setDefaultNrOfTries (int $defaultnroftries)
 
 getDefaultNrOfTries ()
 
 syncSkillAssignments (int $srcParentId, int $srcQuestionId, int $trgParentId, int $trgQuestionId)
 
 ensureHintPageObjectExists ($pageObjectId)
 
 isAnswered (int $active_id, int $pass)
 
 getAdditionalContentEditingMode ()
 
 setAdditionalContentEditingMode (?string $additionalContentEditingMode)
 
 isAdditionalContentEditingModePageObject ()
 
 isValidAdditionalContentEditingMode (string $additionalContentEditingMode)
 
 getValidAdditionalContentEditingModes ()
 
 getHtmlUserSolutionPurifier ()
 
 getHtmlQuestionContentPurifier ()
 
 setLastChange ($lastChange)
 
 getLastChange ()
 
 removeIntermediateSolution (int $active_id, int $pass)
 
 removeCurrentSolution (int $active_id, int $pass, bool $authorized=true)
 
 saveCurrentSolution (int $active_id, int $pass, $value1, $value2, bool $authorized=true, $tstamp=0)
 
 updateCurrentSolution (int $solutionId, $value1, $value2, bool $authorized=true)
 
 updateCurrentSolutionsAuthorization (int $activeId, int $pass, bool $authorized, bool $keepTime=false)
 
 setStep ($step)
 
 getStep ()
 
 toJSON ()
 
 duplicate (bool $for_test=true, string $title="", string $author="", int $owner=-1, $testObjId=null)
 
 intermediateSolutionExists (int $active_id, int $pass)
 
 authorizedSolutionExists (int $active_id, ?int $pass)
 
 authorizedOrIntermediateSolutionExists (int $active_id, int $pass)
 
 lookupForExistingSolutions (int $activeId, int $pass)
 Lookup if an authorized or intermediate solution exists. More...
 
 isAddableAnswerOptionValue (int $qIndex, string $answerOptionValue)
 
 addAnswerOptionValue (int $qIndex, string $answerOptionValue, float $points)
 
 removeAllExistingSolutions ()
 
 removeExistingSolutions (int $activeId, int $pass)
 
 resetUsersAnswer (int $activeId, int $pass)
 
 removeResultRecord (int $activeId, int $pass)
 
 fetchValuePairsFromIndexedValues (array $indexedValues)
 
 fetchIndexedValuesFromValuePairs (array $valuePairs)
 
 areObligationsToBeConsidered ()
 
 setObligationsToBeConsidered (bool $obligationsToBeConsidered)
 
 updateTimestamp ()
 
 getTestPresentationConfig ()
 
- Public Member Functions inherited from iQuestionCondition
 getUserQuestionResult ($active_id, $pass)
 Get the user solution for a question by active_id and the test pass. More...
 
- Public Member Functions inherited from assQuestionInterface
 validateSolutionSubmit ()
 

Protected Member Functions

 calculateReachedPointsForSolution ($value)
 
- Protected Member Functions inherited from assQuestion
 getQuestionAction ()
 
 isNonEmptyItemListPostSubmission (string $postSubmissionFieldname)
 
 log (int $active_id, string $langVar)
 
 savePreviewData (ilAssQuestionPreviewSession $previewSession)
 
 deletePageOfQuestion (int $question_id)
 
 onDuplicate (int $originalParentId, int $originalQuestionId, int $duplicateParentId, int $duplicateQuestionId)
 
 beforeSyncWithOriginal (int $origQuestionId, int $dupQuestionId, int $origParentObjId, int $dupParentObjId)
 
 afterSyncWithOriginal (int $origQuestionId, int $dupQuestionId, int $origParentObjId, int $dupParentObjId)
 
 onCopy (int $sourceParentId, int $sourceQuestionId, int $targetParentId, int $targetQuestionId)
 
 duplicateComments (int $parent_source_id, int $source_id, int $parent_target_id, int $target_id)
 
 deleteComments ()
 
 getNotesManager ()
 
 getNotesDataService ()
 
 getNotesRepo ()
 
 syncSuggestedSolutions (int $target_question_id, int $target_obj_id)
 
 duplicateSuggestedSolutionFiles (int $parent_id, int $question_id)
 Duplicates the files of a suggested solution if the question is duplicated. More...
 
 syncSuggestedSolutionFiles (int $target_question_id, int $target_obj_id)
 
 copySuggestedSolutionFiles (int $source_questionpool_id, int $source_question_id)
 
 copySuggestedSolutions (int $target_question_id)
 
 ensureNonNegativePoints ($points)
 
 purifyAndPrepareTextAreaOutput (string $content)
 
 getRTETextWithMediaObjects ()
 
 getSelfAssessmentFormatter ()
 
 lmMigrateQuestionTypeGenericContent (ilAssSelfAssessmentMigrator $migrator)
 
 lmMigrateQuestionTypeSpecificContent (ilAssSelfAssessmentMigrator $migrator)
 
 duplicateQuestionHints (int $originalQuestionId, int $duplicateQuestionId)
 
 duplicateSkillAssignments (int $srcParentId, int $srcQuestionId, int $trgParentId, int $trgQuestionId)
 
 buildQuestionDataQuery ()
 
 getCurrentSolutionResultSet (int $active_id, int $pass, bool $authorized=true)
 
 removeSolutionRecordById (int $solutionId)
 
 getSolutionRecordById (int $solutionId)
 
 deleteDummySolutionRecord (int $activeId, int $passIndex)
 
 isDummySolutionRecord (array $solutionRecord)
 
 deleteSolutionRecordByValues (int $activeId, int $passIndex, bool $authorized, array $matchValues)
 
 duplicateIntermediateSolutionAuthorized (int $activeId, int $passIndex)
 
 forceExistingIntermediateSolution (int $activeId, int $passIndex, bool $considerDummyRecordCreation)
 
 lookupMaxStep (int $active_id, int $pass)
 
 buildTestPresentationConfig ()
 build basic test question configuration instance More...
 
 getSuggestedSolutionsRepo ()
 
 loadSuggestedSolutions ()
 

Protected Attributes

const HAS_SPECIFIC_FEEDBACK = false
 
const DEFAULT_TEXT_SIZE = 100
 
 $ordertext
 
 $textsize
 
 $separator = "::"
 
 $answer_separator = '{::}'
 
- Protected Attributes inherited from assQuestion
const HAS_SPECIFIC_FEEDBACK = true
 
ILIAS TestQuestionPool QuestionInfoService $questioninfo
 
ILIAS Test TestParticipantInfoService $testParticipantInfo
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 
ILIAS TestQuestionPool QuestionFilesService $questionFilesService
 
ILIAS DI LoggingServices $ilLog
 
int $id
 
string $title
 
string $comment
 
string $owner
 
string $author
 
int $thumb_size
 
string $question
 The question text. More...
 
float $points
 The maximum available points for the question. More...
 
bool $shuffle
 Indicates whether the answers will be shuffled or not. More...
 
int $test_id
 The database id of a test in which the question is contained. More...
 
int $obj_id = 0
 Object id of the container object. More...
 
 $ilias
 
ilGlobalPageTemplate $tpl
 
ilLanguage $lng
 
ilDBInterface $db
 
Container $dic
 
array $suggested_solutions
 
int $original_id = null
 
 $page
 
string $external_id = null
 
ilAssQuestionProcessLocker $processLocker
 
 $step
 
 $lastChange
 
Transformation $shuffler
 
ilTestQuestionConfig $testQuestionConfig
 
ilAssQuestionLifecycle $lifecycle
 
ilObjUser $current_user
 
SkillUsageService $skillUsageService
 
assQuestionSuggestedSolutionsDatabaseRepository $suggestedsolution_repo = null
 

Additional Inherited Members

- Static Public Member Functions inherited from assQuestion
static setForcePassResultUpdateEnabled (bool $forcePassResultsUpdateEnabled)
 
static isForcePassResultUpdateEnabled ()
 
static _getSuggestedSolutionOutput (int $question_id)
 
static _getReachedPoints (int $active_id, int $question_id, int $pass)
 
static logAction (string $logtext, int $active_id, int $question_id)
 
static isFileAvailable (string $file)
 
static saveOriginalId (int $questionId, int $originalId)
 
static resetOriginalId (int $questionId)
 
static _getInternalLinkHref (string $target="")
 
static instantiateQuestion (int $question_id)
 
static _getSolutionMaxPass (int $question_id, int $active_id)
 Returns the maximum pass a users question solution. More...
 
static _isWriteable (int $question_id, int $user_id)
 
static _setReachedPoints (int $active_id, int $question_id, float $points, float $maxpoints, int $pass, bool $manualscoring, bool $obligationsEnabled, ?int $test_id=null)
 Sets the points, a learner has reached answering the question Additionally objective results are updated. More...
 
static _needsManualScoring (int $question_id)
 
static getFeedbackClassNameByQuestionType (string $questionType)
 
static instantiateQuestionGUI (int $a_question_id)
 
static _questionExistsInTest (int $question_id, int $test_id)
 
static lookupParentObjId (int $questionId)
 
static isObligationPossible (int $questionId)
 
static implodeKeyValues (array $keyValues)
 
static explodeKeyValues (string $keyValues)
 
static convertISO8601FormatH_i_s_ExtendedToSeconds (string $time)
 
static extendedTrim (string $value)
 Trim non-printable characters from the beginning and end of a string. More...
 
- Data Fields inherited from assQuestion
const TRIM_PATTERN = '/^[\p{C}\p{Z}]+|[\p{C}\p{Z}]+$/u'
 
const ADDITIONAL_CONTENT_EDITING_MODE_RTE = 'default'
 
const ADDITIONAL_CONTENT_EDITING_MODE_IPE = 'pageobject'
 
ilAssQuestionFeedback $feedbackOBJ
 
bool $prevent_rte_usage = false
 
bool $selfassessmenteditingmode = false
 
int $defaultnroftries = 0
 
string $questionActionCmd = 'handleQuestionAction'
 
const KEY_VALUES_IMPLOSION_SEPARATOR = ':'
 
- Data Fields inherited from iQuestionCondition
const StringResultExpression = '~TEXT~'
 
const PercentageResultExpression = '%n%'
 
const NumericResultExpression = '#n#'
 
const MatchingResultExpression = ';n:m;'
 
const OrderingResultExpression = '$n,m,o,p$'
 
const NumberOfResultExpression = '+n+'
 
const ExclusiveResultExpression = '*n,m,o,p*'
 
const EmptyAnswerExpression = "?"
 
- Static Protected Member Functions inherited from assQuestion
static getNumExistingSolutionRecords (int $activeId, int $pass, int $questionId)
 
- Static Protected Attributes inherited from assQuestion
static $forcePassResultsUpdateEnabled = false
 
static $imageSourceFixReplaceMap
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class for horizontal ordering questions

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
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 32 of file class.assOrderingHorizontal.php.

Constructor & Destructor Documentation

◆ __construct()

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

assOrderingHorizontal constructor

The constructor takes possible arguments an creates an instance of the assOrderingHorizontal object.

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$questionThe question string of the single choice question
See also
assQuestion:__construct()

Definition at line 54 of file class.assOrderingHorizontal.php.

References assQuestion\$author, assQuestion\$comment, assQuestion\$owner, assQuestion\$question, assQuestion\$title, and ILIAS\MetaData\Repository\Validation\Data\__construct().

60  {
62  $this->ordertext = "";
63  }
__construct(VocabulariesInterface $vocabularies)
string $question
The question text.
+ Here is the call graph for this function:

Member Function Documentation

◆ buildTestPresentationConfig()

assOrderingHorizontal::buildTestPresentationConfig ( )

Get the test question configuration.

Returns
ilTestQuestionConfig

Definition at line 772 of file class.assOrderingHorizontal.php.

References ILIAS\Repository\lng(), and ilTestQuestionConfig\setIsUnchangedAnswerPossible().

773  // hey.
774  {
775  // hey: refactored identifiers
776  return parent::buildTestPresentationConfig()
777  // hey.
779  ->setUseUnchangedAnswerLabel($this->lng->txt('tst_unchanged_order_is_correct'));
780  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setIsUnchangedAnswerPossible($isUnchangedAnswerPossible)
Set if the saving of an unchanged answer is supported with an additional checkbox.
+ Here is the call graph for this function:

◆ calculateReachedPoints()

assOrderingHorizontal::calculateReachedPoints (   $active_id,
  $pass = null,
  $authorizedSolution = true,
  $returndetails = false 
)

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 !!)

Definition at line 278 of file class.assOrderingHorizontal.php.

References $data, $DIC, $ilDB, assQuestion\$points, calculateReachedPointsForSolution(), assQuestion\getCurrentSolutionResultSet(), and assQuestion\getSolutionMaxPass().

Referenced by getExpressionTypes().

278  : float
279  {
280  if ($returndetails) {
281  throw new ilTestException('return details not implemented for ' . __METHOD__);
282  }
283 
284  global $DIC;
285  $ilDB = $DIC['ilDB'];
286 
287  $found_values = [];
288  if (is_null($pass)) {
289  $pass = $this->getSolutionMaxPass($active_id);
290  }
291  $result = $this->getCurrentSolutionResultSet($active_id, $pass, $authorizedSolution);
292  $points = 0;
293 
294  if ($ilDB->numRows($result) > 0) {
295  $data = $ilDB->fetchAssoc($result);
296  $points = $this->calculateReachedPointsForSolution($data['value1']);
297  }
298 
299  return $points;
300  }
float $points
The maximum available points for the question.
Base Exception for all Exceptions relating to Modules/Test.
global $DIC
Definition: feed.php:28
getSolutionMaxPass(int $active_id)
getCurrentSolutionResultSet(int $active_id, int $pass, bool $authorized=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculateReachedPointsForSolution()

assOrderingHorizontal::calculateReachedPointsForSolution (   $value)
protected
Parameters
$value
Returns
float

Definition at line 755 of file class.assOrderingHorizontal.php.

References assQuestion\$points, getOrderingElements(), assQuestion\getPoints(), and splitAndTrimOrderElementText().

Referenced by calculateReachedPoints().

755  : float
756  {
757  $value = $this->splitAndTrimOrderElementText($value ?? "", $this->answer_separator);
758  $value = join($this->answer_separator, $value);
759  if (strcmp($value, join($this->answer_separator, $this->getOrderingElements())) == 0) {
760  $points = $this->getPoints();
761  return $points;
762  }
763  return 0;
764  }
float $points
The maximum available points for the question.
splitAndTrimOrderElementText(string $in_string, string $separator)
Splits the answer string either by space(s) or the separator (eg.
getOrderingElements()
Get ordering elements from order text.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyObject()

assOrderingHorizontal::copyObject (   $target_questionpool_id,
  $title = "" 
)

Copies an assOrderingHorizontal object.

Definition at line 202 of file class.assOrderingHorizontal.php.

References assQuestion\$original_id, assQuestion\$title, assQuestion\getId(), and assQuestion\getObjId().

202  : int
203  {
204  if ($this->getId() <= 0) {
205  throw new RuntimeException('The question has not been saved. It cannot be duplicated');
206  }
207  // duplicate the question in database
208  $clone = $this;
209 
210  $original_id = $this->questioninfo->getOriginalId($this->id);
211  $clone->id = -1;
212  $source_questionpool_id = $this->getObjId();
213  $clone->setObjId($target_questionpool_id);
214  if ($title) {
215  $clone->setTitle($title);
216  }
217  $clone->saveToDb();
218  // copy question page content
219  $clone->copyPageOfQuestion($original_id);
220  // copy XHTML media objects
221  $clone->copyXHTMLMediaObjectsOfQuestion($original_id);
222 
223  $clone->onCopy($source_questionpool_id, $original_id, $clone->getObjId(), $clone->getId());
224 
225  return $clone->id;
226  }
+ Here is the call graph for this function:

◆ createNewOriginalFromThisDuplicate()

assOrderingHorizontal::createNewOriginalFromThisDuplicate (   $targetParentId,
  $targetQuestionTitle = "" 
)

Definition at line 228 of file class.assOrderingHorizontal.php.

References assQuestion\$id, assQuestion\getId(), and assQuestion\getObjId().

228  : int
229  {
230  if ($this->getId() <= 0) {
231  throw new RuntimeException('The question has not been saved. It cannot be duplicated');
232  }
233 
234  $sourceQuestionId = $this->id;
235  $sourceParentId = $this->getObjId();
236 
237  // duplicate the question in database
238  $clone = $this;
239  $clone->id = -1;
240 
241  $clone->setObjId($targetParentId);
242 
243  if ($targetQuestionTitle) {
244  $clone->setTitle($targetQuestionTitle);
245  }
246 
247  $clone->saveToDb();
248  // copy question page content
249  $clone->copyPageOfQuestion($sourceQuestionId);
250  // copy XHTML media objects
251  $clone->copyXHTMLMediaObjectsOfQuestion($sourceQuestionId);
252 
253  $clone->onCopy($sourceParentId, $sourceQuestionId, $clone->getObjId(), $clone->getId());
254 
255  return $clone->id;
256  }
+ Here is the call graph for this function:

◆ deleteAnswers()

assOrderingHorizontal::deleteAnswers (   $question_id)

Deletes datasets from answers tables.

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

Definition at line 450 of file class.assOrderingHorizontal.php.

450  : void
451  {
452  }

◆ duplicate()

assOrderingHorizontal::duplicate ( bool  $for_test = true,
string  $title = "",
string  $author = "",
int  $owner = -1,
  $testObjId = null 
)

Duplicates an assOrderingHorizontal.

Definition at line 153 of file class.assOrderingHorizontal.php.

References assQuestion\$author, assQuestion\$original_id, assQuestion\$owner, assQuestion\$title, assQuestion\getId(), and assQuestion\getObjId().

153  : int
154  {
155  if ($this->id <= 0) {
156  // The question has not been saved. It cannot be duplicated
157  return -1;
158  }
159  // duplicate the question in database
160  $this_id = $this->getId();
161  $thisObjId = $this->getObjId();
162 
163  $clone = $this;
164 
165  $original_id = $this->questioninfo->getOriginalId($this->id);
166  $clone->id = -1;
167 
168  if ((int) $testObjId > 0) {
169  $clone->setObjId($testObjId);
170  }
171 
172  if ($title) {
173  $clone->setTitle($title);
174  }
175 
176  if ($author) {
177  $clone->setAuthor($author);
178  }
179  if ($owner) {
180  $clone->setOwner($owner);
181  }
182 
183  if ($for_test) {
184  $clone->saveToDb($original_id);
185  } else {
186  $clone->saveToDb();
187  }
188 
189  // copy question page content
190  $clone->copyPageOfQuestion($this_id);
191  // copy XHTML media objects
192  $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
193 
194  $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
195 
196  return $clone->id;
197  }
+ Here is the call graph for this function:

◆ fromXML()

assOrderingHorizontal::fromXML (   $item,
int  $questionpool_id,
?int  $tst_id,
$tst_object,
int &  $question_counter,
array  $import_mapping,
array &  $solutionhints = [] 
)

Creates a question from a QTI file.

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

Parameters
ilQTIItem$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

Definition at line 495 of file class.assOrderingHorizontal.php.

495  : array
496  {
497  $import = new assOrderingHorizontalImport($this);
498  return $import->fromXML($item, $questionpool_id, $tst_id, $tst_object, $question_counter, $import_mapping);
499  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getAdditionalTableName()

assOrderingHorizontal::getAdditionalTableName ( )

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

Returns
string The additional table name

Definition at line 430 of file class.assOrderingHorizontal.php.

Referenced by loadFromDb(), and saveAdditionalQuestionDataToDb().

430  : string
431  {
432  return "qpl_qst_horder";
433  }
+ Here is the caller graph for this function:

◆ getAnswerSeparator()

assOrderingHorizontal::getAnswerSeparator ( )
Returns
string

Definition at line 98 of file class.assOrderingHorizontal.php.

References $answer_separator.

98  : string
99  {
101  }

◆ getAnswerTableName()

assOrderingHorizontal::getAnswerTableName ( )

Returns the name of the answer table in the database.

Returns
string The answer table name

Definition at line 440 of file class.assOrderingHorizontal.php.

440  : string
441  {
442  return "";
443  }

◆ getAvailableAnswerOptions()

assOrderingHorizontal::getAvailableAnswerOptions (   $index = null)

If index is null, the function returns an array with all anwser options Else it returns the specific answer option.

Parameters
null | int$index
Returns
array|ASS_AnswerSimple

Implements iQuestionCondition.

Definition at line 738 of file class.assOrderingHorizontal.php.

References getOrderingElements().

739  {
740  $elements = $this->getOrderingElements();
741  if ($index !== null) {
742  if (array_key_exists($index, $elements)) {
743  return $elements[$index];
744  }
745  return null;
746  } else {
747  return $elements;
748  }
749  }
getOrderingElements()
Get ordering elements from order text.
+ Here is the call graph for this function:

◆ getBestSolution()

assOrderingHorizontal::getBestSolution (   $active_id,
  $pass 
)

Returns the best solution for a given pass of a participant.

Returns
array An associated array containing the best solution

Definition at line 518 of file class.assOrderingHorizontal.php.

518  : array
519  {
520  $user_solution = [];
521  return $user_solution;
522  }

◆ getExpressionTypes()

◆ getMaximumPoints()

assOrderingHorizontal::getMaximumPoints ( )

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

See also
$points

Definition at line 263 of file class.assOrderingHorizontal.php.

References assQuestion\getPoints().

Referenced by getExpressionTypes(), and isComplete().

263  : float
264  {
265  return $this->getPoints();
266  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOperators()

assOrderingHorizontal::getOperators (   $expression)

Get all available operations for a specific question.

Parameters
$expression

Implements iQuestionCondition.

Definition at line 653 of file class.assOrderingHorizontal.php.

References ilOperatorsExpressionMapping\getOperatorsByExpression().

653  : array
654  {
656  }
+ Here is the call graph for this function:

◆ getOrderingElements()

assOrderingHorizontal::getOrderingElements ( )

Get ordering elements from order text.

Returns
array Ordering elements

Definition at line 529 of file class.assOrderingHorizontal.php.

References getOrderText(), and splitAndTrimOrderElementText().

Referenced by calculateReachedPointsForSolution(), getAvailableAnswerOptions(), getExpressionTypes(), getRandomOrderingElements(), and toJSON().

529  : array
530  {
531  return $this->splitAndTrimOrderElementText($this->getOrderText() ?? "", $this->separator);
532  }
splitAndTrimOrderElementText(string $in_string, string $separator)
Splits the answer string either by space(s) or the separator (eg.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOrderText()

assOrderingHorizontal::getOrderText ( )

Get order text.

Returns
string Order text

Definition at line 551 of file class.assOrderingHorizontal.php.

References $ordertext.

Referenced by getOrderingElements(), and saveAdditionalQuestionDataToDb().

+ Here is the caller graph for this function:

◆ getQuestionType()

assOrderingHorizontal::getQuestionType ( )

Returns the question type of the question.

Returns
integer The question type of the question

Definition at line 420 of file class.assOrderingHorizontal.php.

Referenced by toJSON().

420  : string
421  {
422  return "assOrderingHorizontal";
423  }
+ Here is the caller graph for this function:

◆ getRandomOrderingElements()

assOrderingHorizontal::getRandomOrderingElements ( )

Get ordering elements from order text in random sequence.

Returns
array Ordering elements

Definition at line 539 of file class.assOrderingHorizontal.php.

References getOrderingElements(), and assQuestion\getShuffler().

539  : array
540  {
541  $elements = $this->getOrderingElements();
542  $elements = $this->getShuffler()->transform($elements);
543  return $elements;
544  }
getOrderingElements()
Get ordering elements from order text.
+ Here is the call graph for this function:

◆ getRTETextWithMediaObjects()

assOrderingHorizontal::getRTETextWithMediaObjects ( )

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

Definition at line 458 of file class.assOrderingHorizontal.php.

458  : string
459  {
460  $text = parent::getRTETextWithMediaObjects();
461  return $text;
462  }

◆ getSeparator()

assOrderingHorizontal::getSeparator ( )

Get order text separator.

Returns
string Separator

Definition at line 594 of file class.assOrderingHorizontal.php.

References $separator.

594  : string
595  {
596  return $this->separator;
597  }

◆ getSolutionSubmit()

assOrderingHorizontal::getSolutionSubmit ( )

Definition at line 328 of file class.assOrderingHorizontal.php.

Referenced by saveWorkingData().

329  {
330  return $_POST["orderresult"];
331  }
+ Here is the caller graph for this function:

◆ getTextSize()

assOrderingHorizontal::getTextSize ( )

Get text size.

Returns
double Text size in percent maybe

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

References $textsize.

Referenced by saveAdditionalQuestionDataToDb(), and toJSON().

+ Here is the caller graph for this function:

◆ isComplete()

assOrderingHorizontal::isComplete ( )

Returns true, if a single choice question is complete for use.

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

Definition at line 70 of file class.assOrderingHorizontal.php.

References getMaximumPoints().

70  : bool
71  {
72  if (strlen($this->title) and ($this->author) and ($this->question) and ($this->getMaximumPoints() > 0)) {
73  return true;
74  } else {
75  return false;
76  }
77  }
getMaximumPoints()
Returns the maximum points, a learner can reach answering the question.
+ Here is the call graph for this function:

◆ loadFromDb()

assOrderingHorizontal::loadFromDb (   $question_id)

Loads a assOrderingHorizontal object from a database.

Parameters
object$dbA pear DB object
integer$question_idA unique key which defines the multiple choice test in the database

Definition at line 110 of file class.assOrderingHorizontal.php.

References $data, $DIC, Vendor\Package\$e, $ilDB, ilRTE\_replaceMediaObjectImageSrc(), getAdditionalTableName(), ilAssQuestionLifecycle\getDraftInstance(), ilAssQuestionLifecycle\getInstance(), assQuestion\setAdditionalContentEditingMode(), assQuestion\setAuthor(), assQuestion\setComment(), assQuestion\setId(), assQuestion\setLifecycle(), assQuestion\setNrOfTries(), assQuestion\setObjId(), setOrderText(), assQuestion\setOriginalId(), assQuestion\setOwner(), assQuestion\setPoints(), assQuestion\setQuestion(), setTextSize(), and assQuestion\setTitle().

110  : void
111  {
112  global $DIC;
113  $ilDB = $DIC['ilDB'];
114 
115  $result = $ilDB->queryF(
116  "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",
117  array("integer"),
118  array($question_id)
119  );
120  if ($result->numRows() == 1) {
121  $data = $ilDB->fetchAssoc($result);
122  $this->setId($question_id);
123  $this->setObjId($data["obj_fi"]);
124  $this->setTitle((string) $data["title"]);
125  $this->setComment((string) $data["description"]);
126  $this->setOriginalId($data["original_id"]);
127  $this->setNrOfTries($data['nr_of_tries']);
128  $this->setAuthor($data["author"]);
129  $this->setPoints($data["points"]);
130  $this->setOwner($data["owner"]);
131  $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc((string) $data["question_text"], 1));
132  $this->setOrderText($data["ordertext"]);
133  $this->setTextSize($data["textsize"]);
134 
135  try {
139  }
140 
141  try {
142  $this->setAdditionalContentEditingMode($data['add_cont_edit_mode']);
143  } catch (ilTestQuestionPoolException $e) {
144  }
145  }
146 
147  parent::loadFromDb($question_id);
148  }
static _replaceMediaObjectImageSrc(string $a_text, int $a_direction=0, string $nic='')
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
setNrOfTries(int $a_nr_of_tries)
setOwner(int $owner=-1)
setOrderText($a_value)
Set order text.
setComment(string $comment="")
global $DIC
Definition: feed.php:28
getAdditionalTableName()
Returns the name of the additional question data table in the database.
setTextSize(?float $textsize)
Set text size.
setPoints(float $points)
setObjId(int $obj_id=0)
setId(int $id=-1)
setOriginalId(?int $original_id)
setTitle(string $title="")
setLifecycle(ilAssQuestionLifecycle $lifecycle)
setAuthor(string $author="")
setAdditionalContentEditingMode(?string $additionalContentEditingMode)
setQuestion(string $question="")
+ Here is the call graph for this function:

◆ saveAdditionalQuestionDataToDb()

assOrderingHorizontal::saveAdditionalQuestionDataToDb ( )

Saves a record to the question types additional data table.

Returns
mixed

Implements ilObjQuestionScoringAdjustable.

Definition at line 390 of file class.assOrderingHorizontal.php.

References $DIC, $ilDB, getAdditionalTableName(), assQuestion\getId(), getOrderText(), and getTextSize().

Referenced by saveToDb().

391  {
392  global $DIC;
393  $ilDB = $DIC['ilDB'];
394 
395  // save additional data
396  $ilDB->manipulateF(
397  "DELETE FROM " . $this->getAdditionalTableName()
398  . " WHERE question_fi = %s",
399  array( "integer" ),
400  array( $this->getId() )
401  );
402 
403  $ilDB->manipulateF(
404  "INSERT INTO " . $this->getAdditionalTableName()
405  . " (question_fi, ordertext, textsize) VALUES (%s, %s, %s)",
406  array( "integer", "text", "float" ),
407  array(
408  $this->getId(),
409  $this->getOrderText(),
410  ($this->getTextSize() < 10) ? null : (float) $this->getTextSize()
411  )
412  );
413  }
global $DIC
Definition: feed.php:28
getAdditionalTableName()
Returns the name of the additional question data table in the database.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveToDb()

assOrderingHorizontal::saveToDb (   $original_id = "")

Saves a assOrderingHorizontal object to a database.

Definition at line 83 of file class.assOrderingHorizontal.php.

References assQuestion\$original_id, saveAdditionalQuestionDataToDb(), and assQuestion\saveQuestionDataToDb().

83  : void
84  {
85  if ($original_id == "") {
86  $this->saveQuestionDataToDb();
87  } else {
89  }
90 
92  parent::saveToDb();
93  }
saveQuestionDataToDb(int $original_id=-1)
saveAdditionalQuestionDataToDb()
Saves a record to the question types additional data table.
+ Here is the call graph for this function:

◆ saveWorkingData()

assOrderingHorizontal::saveWorkingData (   $active_id,
  $pass = null,
  $authorized = true 
)

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

Definition at line 341 of file class.assOrderingHorizontal.php.

References $DIC, $ilDB, ilObjAssessmentFolder\_enabledAssessmentLogging(), ilObjAssessmentFolder\_getLogLanguage(), ilObjTest\_getPass(), assQuestion\getId(), assQuestion\getProcessLocker(), getSolutionSubmit(), ILIAS\Repository\lng(), assQuestion\logAction(), assQuestion\removeCurrentSolution(), and assQuestion\saveCurrentSolution().

341  : bool
342  {
343  if ($this->dic->testQuestionPool()->internal()->request()->raw('test_answer_changed') === null) {
344  return true;
345  }
346 
347  global $DIC;
348  $ilDB = $DIC['ilDB'];
349  $ilUser = $DIC['ilUser'];
350 
351  if (is_null($pass)) {
352  $pass = ilObjTest::_getPass($active_id);
353  }
354 
355  $entered_values = false;
356 
357  $this->getProcessLocker()->executeUserSolutionUpdateLockOperation(function () use (&$entered_values, $active_id, $pass, $authorized) {
358  $this->removeCurrentSolution($active_id, $pass, $authorized);
359 
360  $solutionSubmit = $this->getSolutionSubmit();
361 
362  $entered_values = false;
363  if (strlen($solutionSubmit)) {
364  $this->saveCurrentSolution($active_id, $pass, $_POST['orderresult'], null, $authorized);
365  $entered_values = true;
366  }
367  });
368 
369  if ($entered_values) {
371  assQuestion::logAction($this->lng->txtlng(
372  "assessment",
373  "log_user_entered_values",
375  ), $active_id, $this->getId());
376  }
377  } else {
379  assQuestion::logAction($this->lng->txtlng(
380  "assessment",
381  "log_user_not_entered_values",
383  ), $active_id, $this->getId());
384  }
385  }
386 
387  return true;
388  }
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
global $DIC
Definition: feed.php:28
saveCurrentSolution(int $active_id, int $pass, $value1, $value2, bool $authorized=true, $tstamp=0)
static logAction(string $logtext, int $active_id, int $question_id)
removeCurrentSolution(int $active_id, int $pass, bool $authorized=true)
+ Here is the call graph for this function:

◆ setExportDetailsXLSX()

assOrderingHorizontal::setExportDetailsXLSX ( ilAssExcelFormatHelper  $worksheet,
int  $startrow,
int  $col,
int  $active_id,
int  $pass 
)

{}

Definition at line 467 of file class.assOrderingHorizontal.php.

References assQuestion\getSolutionValues(), and ilAssExcelFormatHelper\setCell().

467  : int
468  {
469  parent::setExportDetailsXLSX($worksheet, $startrow, $col, $active_id, $pass);
470 
471  $solutionvalue = "";
472  $solutions = $this->getSolutionValues($active_id, $pass);
473  if (array_key_exists(0, $solutions)) {
474  $solutionvalue = str_replace("{::}", " ", $solutions[0]["value1"]);
475  }
476  $i = 1;
477  $worksheet->setCell($startrow + $i, $col + 2, $solutionvalue);
478  $i++;
479 
480  return $startrow + $i + 1;
481  }
getSolutionValues($active_id, $pass=null, bool $authorized=true)
Loads solutions of a given user from the database an returns it.
setCell($a_row, $a_col, $a_value, $datatype=null)
+ Here is the call graph for this function:

◆ setOrderText()

assOrderingHorizontal::setOrderText (   $a_value)

Set order text.

Parameters
string$a_valueOrder text

Definition at line 561 of file class.assOrderingHorizontal.php.

Referenced by loadFromDb().

561  : void
562  {
563  $this->ordertext = $a_value;
564  }
+ Here is the caller graph for this function:

◆ setSeparator()

assOrderingHorizontal::setSeparator (   $a_value)

Set order text separator.

Parameters
string$a_valueSeparator

Definition at line 604 of file class.assOrderingHorizontal.php.

604  : void
605  {
606  $this->separator = $a_value;
607  }

◆ setTextSize()

assOrderingHorizontal::setTextSize ( ?float  $textsize)

Set text size.

Parameters
double$a_valueText size in percent

Definition at line 581 of file class.assOrderingHorizontal.php.

References $textsize.

Referenced by loadFromDb().

581  : void
582  {
583  if ($textsize === null || $textsize === 0.0) {
584  $textsize = self::DEFAULT_TEXT_SIZE;
585  }
586  $this->textsize = $textsize;
587  }
+ Here is the caller graph for this function:

◆ splitAndTrimOrderElementText()

assOrderingHorizontal::splitAndTrimOrderElementText ( string  $in_string,
string  $separator 
)

Splits the answer string either by space(s) or the separator (eg.

::) and trims the resulting array elements.

Parameters
string$in_stringOrderElements
string$separatorto be used for splitting.
Returns
array

Definition at line 311 of file class.assOrderingHorizontal.php.

References ILIAS\LTI\ToolProvider\$key, and ilStr\strPos().

Referenced by calculateReachedPointsForSolution(), getExpressionTypes(), and getOrderingElements().

311  : array
312  {
313  $result = [];
314 
315  if (ilStr::strPos($in_string, $separator, 0) === false) {
316  $result = preg_split("/\\s+/", $in_string);
317  } else {
318  $result = explode($separator, $in_string);
319  }
320 
321  foreach ($result as $key => $value) {
322  $result[$key] = trim($value);
323  }
324 
325  return $result;
326  }
static strPos(string $a_haystack, string $a_needle, int $a_offset=0)
Definition: class.ilStr.php:42
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toJSON()

assOrderingHorizontal::toJSON ( )

Returns a JSON representation of the question.

Implements ilAssQuestionLMExportable.

Definition at line 612 of file class.assOrderingHorizontal.php.

References ilObjMediaObject\_getMobsOfObject(), assQuestion\formatSAQuestion(), assQuestion\getId(), assQuestion\getNrOfTries(), getOrderingElements(), assQuestion\getPoints(), assQuestion\getQuestion(), getQuestionType(), getTextSize(), assQuestion\getTitleForHTMLOutput(), and ILIAS\Repository\int().

612  : string
613  {
614  $result = [];
615  $result['id'] = $this->getId();
616  $result['type'] = (string) $this->getQuestionType();
617  $result['title'] = $this->getTitleForHTMLOutput();
618  $result['question'] = $this->formatSAQuestion($this->getQuestion());
619  $result['nr_of_tries'] = $this->getNrOfTries();
620  $result['shuffle'] = true;
621  $result['points'] = (bool) $this->getPoints();
622  $result['textsize'] = ((int) $this->getTextSize()) // #10923
623  ? (int) $this->getTextSize()
624  : self::DEFAULT_TEXT_SIZE;
625  $result['feedback'] = array(
626  'onenotcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), false)),
627  'allcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), true))
628  );
629 
630  $arr = [];
631  foreach ($this->getOrderingElements() as $order => $answer) {
632  array_push($arr, array(
633  "answertext" => (string) $answer,
634  "order" => (int) $order + 1
635  ));
636  }
637  $result['answers'] = $arr;
638 
639  $mobs = ilObjMediaObject::_getMobsOfObject("qpl:html", $this->getId());
640  $result['mobs'] = $mobs;
641 
642  return json_encode($result);
643  }
static _getMobsOfObject(string $a_type, int $a_id, int $a_usage_hist_nr=0, string $a_lang="-")
getQuestionType()
Returns the question type of the question.
getOrderingElements()
Get ordering elements from order text.
+ Here is the call graph for this function:

◆ toXML()

assOrderingHorizontal::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 and sets the internal domxml variable with the DOM XML representation of the QTI xml representation.

Returns
string The QTI xml representation of the question

Definition at line 507 of file class.assOrderingHorizontal.php.

507  : string
508  {
509  $export = new assOrderingHorizontalExport($this);
510  return $export->toXML($a_include_header, $a_include_binary, $a_shuffle, $test_output, $force_image_references);
511  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Field Documentation

◆ $answer_separator

assOrderingHorizontal::$answer_separator = '{::}'
protected

Definition at line 40 of file class.assOrderingHorizontal.php.

Referenced by getAnswerSeparator().

◆ $ordertext

assOrderingHorizontal::$ordertext
protected

Definition at line 37 of file class.assOrderingHorizontal.php.

Referenced by getOrderText().

◆ $separator

assOrderingHorizontal::$separator = "::"
protected

Definition at line 39 of file class.assOrderingHorizontal.php.

Referenced by getSeparator().

◆ $textsize

assOrderingHorizontal::$textsize
protected

Definition at line 38 of file class.assOrderingHorizontal.php.

Referenced by getTextSize(), and setTextSize().

◆ DEFAULT_TEXT_SIZE

const assOrderingHorizontal::DEFAULT_TEXT_SIZE = 100
protected

Definition at line 35 of file class.assOrderingHorizontal.php.

◆ HAS_SPECIFIC_FEEDBACK

const assOrderingHorizontal::HAS_SPECIFIC_FEEDBACK = false
protected

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


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