ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
assOrderingQuestion 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 assOrderingQuestion:
+ Collaboration diagram for assOrderingQuestion:

Public Member Functions

 __construct ( $title="", $comment="", $author="", $owner=-1, $question="", $ordering_type=self::OQ_TERMS)
 assOrderingQuestion constructor More...
 
 isComplete ()
 Returns true, if a ordering question is complete for use. More...
 
 saveToDb ($original_id="")
 Saves a assOrderingQuestion object to a database. More...
 
 loadFromDb ($question_id)
 Loads a assOrderingQuestion object from a database. More...
 
 duplicate (bool $for_test=true, ?string $title="", ?string $author="", ?int $owner=-1, $testObjId=null)
 
 copyObject ($target_questionpool_id, $title="")
 Copies an assOrderingQuestion object. More...
 
 createNewOriginalFromThisDuplicate ($targetParentId, $targetQuestionTitle="")
 
 duplicateImages ($src_question_id, $src_object_id, $dest_question_id, $dest_object_id)
 
 copyImages ($question_id, $source_questionpool)
 
 setOrderingType ($ordering_type=self::OQ_TERMS)
 
 getOrderingType ()
 
 isOrderingTypeNested ()
 
 isImageOrderingType ()
 
 setContentType ($ct)
 
 setNestingType (bool $nesting)
 
 hasOrderingTypeUploadSupport ()
 
 getOrderingElementListForSolutionOutput ($forceCorrectSolution, $activeId, $passIndex)
 
 getSolutionOrderingElementListForTestOutput (ilAssNestedOrderingElementsInputGUI $inputGUI, $lastPost, $activeId, $pass)
 
 getSolutionOrderingElementList ($indexedSolutionValues)
 
 getShuffledOrderingElementList ()
 
 getOrderingElementList ()
 
 setOrderingElementList (ilAssOrderingElementList $list)
 
 getAnswer ($index=0)
 Returns the ordering element from the given position. More...
 
 deleteAnswer ($randomIdentifier)
 Deletes an answer with a given index. More...
 
 getAnswerCount ()
 Returns the number of answers. More...
 
 calculateReachedPoints ($active_id, $pass=null, $authorizedSolution=true, $returndetails=false)
 Returns the points, a learner has reached answering the question. More...
 
 calculateReachedPointsFromPreviewSession (ilAssQuestionPreviewSession $previewSession)
 
 getMaximumPoints ()
 Returns the maximum points, a learner can reach answering the question. More...
 
 getEncryptedFilename ($filename)
 
 dropImageFile ($imageFilename)
 
 isImageFileStored ($imageFilename)
 
 isImageReplaced (ilAssOrderingElement $newElement, ilAssOrderingElement $oldElement)
 
 storeImageFile (string $upload_file, string $upload_name)
 
 updateImageFile (string $existing_image_name)
 
 validateSolutionSubmit ()
 
 saveWorkingData ($active_id, $pass=null, $authorized=true)
 Saves the learners input of the question to the database. More...
 
 saveAnswerSpecificDataToDb ()
 Saves the answer specific records into a question types answer 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...
 
 getRTETextWithMediaObjects ()
 Collects all text in the question which could contain media objects which were created with the Rich Text Editor. More...
 
 getOrderElements ()
 Returns the answers array. More...
 
 setExportDetailsXLSX (ilAssExcelFormatHelper $worksheet, int $startrow, int $col, int $active_id, int $pass)
 {} More...
 
 getElementHeight ()
 
 setElementHeight (?int $a_height)
 
 rebuildThumbnails ()
 
 getThumbPrefix ()
 
 toJSON ()
 Returns a JSON representation of the question. More...
 
 buildOrderingElementInputGui ()
 
 initOrderingElementAuthoringProperties (ilFormPropertyGUI $formField)
 
 initOrderingElementFormFieldLabels (ilFormPropertyGUI $formField)
 
 buildOrderingTextsInputGui ()
 
 buildOrderingImagesInputGui ()
 
 buildNestedOrderingElementInputGui ()
 
 fetchSolutionListFromFormSubmissionData ($userSolutionPost)
 
 getSolutionListFromPostSubmit ()
 
 getSolutionPostSubmit ()
 
 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...
 
 fetchSolutionSubmit ($formSubmissionDataStructure)
 
- 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 ilObjQuestionScoringAdjustable
 saveAdditionalQuestionDataToDb ()
 Saves a record to the question types additional data table. More...
 
- 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...
 

Data Fields

const ORDERING_ELEMENT_FORM_FIELD_POSTVAR = 'order_elems'
 
const ORDERING_ELEMENT_FORM_CMD_UPLOAD_IMG = 'uploadElementImage'
 
const ORDERING_ELEMENT_FORM_CMD_REMOVE_IMG = 'removeElementImage'
 
const OQ_PICTURES = 0
 
const OQ_TERMS = 1
 
const OQ_NESTED_PICTURES = 2
 
const OQ_NESTED_TERMS = 3
 
const OQ_CT_PICTURES = 'pics'
 
const OQ_CT_TERMS = 'terms'
 
const VALID_UPLOAD_SUFFIXES = ["jpg", "jpeg", "png", "gif"]
 
int $element_height = null
 
 $old_ordering_depth = array()
 
 $leveled_ordering = array()
 
- 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 = "?"
 

Protected Member Functions

 getRepository ()
 
 getValidOrderingTypes ()
 
 getSolutionValuePairBrandedOrderingElementByRandomIdentifier ($value1, $value2)
 
 getSolutionValuePairBrandedOrderingElementBySolutionIdentifier ($value1, $value2)
 
 cleanImagefiles ()
 
 savePreviewData (ilAssQuestionPreviewSession $previewSession)
 
 getQuestionRepository ()
 
 generateThumbForFile ($path, $file)
 
 calculateReachedPointsForSolution (ilAssOrderingElementList $solutionOrderingElementList)
 
 afterSyncWithOriginal ($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId)
 {} More...
 
 ensureImagePathExists ()
 
 buildOrderingElementFormDataConverter ()
 
 buildOrderingImagesFormDataConverter ()
 
 buildOrderingTextsFormDataConverter ()
 
 buildNestedOrderingFormDataConverter ()
 
- 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
 
 $orderingElementList
 
 $ordering_type
 
 $oq_repository = null
 
- 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
 

Private Attributes

 $postSolutionOrderingElementList = 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...
 
- 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 ordering questions

assOrderingQuestion is a class for 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
Nils Haagen nils..nosp@m.haag.nosp@m.en@co.nosp@m.ncep.nosp@m.ts-an.nosp@m.d-tr.nosp@m.ainin.nosp@m.g.de
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

assOrderingQuestion::__construct (   $title = "",
  $comment = "",
  $author = "",
  $owner = -1,
  $question = "",
  $ordering_type = self::OQ_TERMS 
)

assOrderingQuestion constructor

The constructor takes possible arguments an creates an instance of the assOrderingQuestion 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 ordering test
int$ordering_type

Definition at line 90 of file class.assOrderingQuestion.php.

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

97  {
99  $this->orderingElementList = new ilAssOrderingElementList();
100  $this->ordering_type = $ordering_type;
101  }
__construct(VocabulariesInterface $vocabularies)
string $question
The question text.
+ Here is the call graph for this function:

Member Function Documentation

◆ afterSyncWithOriginal()

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

{}

Definition at line 1458 of file class.assOrderingQuestion.php.

References duplicateImages().

1458  : void
1459  {
1460  parent::afterSyncWithOriginal($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId);
1461  $this->duplicateImages($dupQuestionId, $dupParentObjId, $origQuestionId, $origParentObjId);
1462  }
duplicateImages($src_question_id, $src_object_id, $dest_question_id, $dest_object_id)
+ Here is the call graph for this function:

◆ buildNestedOrderingElementInputGui()

assOrderingQuestion::buildNestedOrderingElementInputGui ( )
Returns
ilAssNestedOrderingElementsInputGUI

Definition at line 1238 of file class.assOrderingQuestion.php.

References buildNestedOrderingFormDataConverter(), assQuestion\getId(), assQuestion\getImagePathWeb(), getOrderingType(), getThumbPrefix(), and initOrderingElementFormFieldLabels().

Referenced by fetchSolutionListFromFormSubmissionData().

1239  {
1240  $formDataConverter = $this->buildNestedOrderingFormDataConverter();
1241 
1242  $orderingElementInput = new ilAssNestedOrderingElementsInputGUI(
1243  $formDataConverter,
1244  self::ORDERING_ELEMENT_FORM_FIELD_POSTVAR
1245  );
1246 
1247  $orderingElementInput->setUniquePrefix($this->getId());
1248  $orderingElementInput->setOrderingType($this->getOrderingType());
1249  $orderingElementInput->setElementImagePath($this->getImagePathWeb());
1250  $orderingElementInput->setThumbPrefix($this->getThumbPrefix());
1251 
1252  $this->initOrderingElementFormFieldLabels($orderingElementInput);
1253 
1254  return $orderingElementInput;
1255  }
initOrderingElementFormFieldLabels(ilFormPropertyGUI $formField)
getImagePathWeb()
Returns the web image path for web accessable images of a question.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildNestedOrderingFormDataConverter()

assOrderingQuestion::buildNestedOrderingFormDataConverter ( )
protected
Returns
ilAssOrderingFormValuesObjectsConverter

Definition at line 1586 of file class.assOrderingQuestion.php.

References buildOrderingElementFormDataConverter(), ilAssOrderingFormValuesObjectsConverter\CONTEXT_MAINTAIN_HIERARCHY, assQuestion\getImagePathWeb(), getOrderingType(), getThumbPrefix(), and OQ_NESTED_PICTURES.

Referenced by buildNestedOrderingElementInputGui().

1587  {
1588  $formDataConverter = $this->buildOrderingElementFormDataConverter();
1590 
1591  if ($this->getOrderingType() == OQ_NESTED_PICTURES) {
1592  $formDataConverter->setImageRemovalCommand(self::ORDERING_ELEMENT_FORM_CMD_REMOVE_IMG);
1593  $formDataConverter->setImageUrlPath($this->getImagePathWeb());
1594  $formDataConverter->setThumbnailPrefix($this->getThumbPrefix());
1595  }
1596 
1597  return $formDataConverter;
1598  }
getImagePathWeb()
Returns the web image path for web accessable images of a question.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildOrderingElementFormDataConverter()

assOrderingQuestion::buildOrderingElementFormDataConverter ( )
protected
Returns
ilAssOrderingFormValuesObjectsConverter

Definition at line 1547 of file class.assOrderingQuestion.php.

Referenced by buildNestedOrderingFormDataConverter(), buildOrderingImagesFormDataConverter(), and buildOrderingTextsFormDataConverter().

1548  {
1549  $converter = new ilAssOrderingFormValuesObjectsConverter();
1550  $converter->setPostVar(self::ORDERING_ELEMENT_FORM_FIELD_POSTVAR);
1551 
1552  return $converter;
1553  }
+ Here is the caller graph for this function:

◆ buildOrderingElementInputGui()

assOrderingQuestion::buildOrderingElementInputGui ( )
Returns
ilAssNestedOrderingElementsInputGUI|ilAssOrderingImagesInputGUI|ilAssOrderingTextsInputGUI
Exceptions
ilTestQuestionPoolException

Definition at line 1160 of file class.assOrderingQuestion.php.

References buildOrderingImagesInputGui(), buildOrderingTextsInputGui(), and isImageOrderingType().

Referenced by ilAssOrderingQuestionAuthoringFormGUI\renewOrderingElementInput().

1161  {
1162  if ($this->isImageOrderingType()) {
1163  return $this->buildOrderingImagesInputGui();
1164  }
1165  return $this->buildOrderingTextsInputGui();
1166  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildOrderingImagesFormDataConverter()

assOrderingQuestion::buildOrderingImagesFormDataConverter ( )
protected
Returns
ilAssOrderingFormValuesObjectsConverter

Definition at line 1558 of file class.assOrderingQuestion.php.

References buildOrderingElementFormDataConverter(), ilAssOrderingFormValuesObjectsConverter\CONTEXT_MAINTAIN_ELEMENT_IMAGE, assQuestion\getImagePath(), assQuestion\getImagePathWeb(), and getThumbPrefix().

Referenced by buildOrderingImagesInputGui().

1559  {
1560  $formDataConverter = $this->buildOrderingElementFormDataConverter();
1562 
1563  $formDataConverter->setImageRemovalCommand(self::ORDERING_ELEMENT_FORM_CMD_REMOVE_IMG);
1564  $formDataConverter->setImageUrlPath($this->getImagePathWeb());
1565  $formDataConverter->setImageFsPath($this->getImagePath());
1566 
1567  if ($this->getThumbPrefix()) {
1568  $formDataConverter->setThumbnailPrefix($this->getThumbPrefix());
1569  }
1570  return $formDataConverter;
1571  }
getImagePathWeb()
Returns the web 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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildOrderingImagesInputGui()

assOrderingQuestion::buildOrderingImagesInputGui ( )
Returns
ilAssOrderingImagesInputGUI

Definition at line 1218 of file class.assOrderingQuestion.php.

References buildOrderingImagesFormDataConverter(), and initOrderingElementFormFieldLabels().

Referenced by buildOrderingElementInputGui().

1219  {
1220  $formDataConverter = $this->buildOrderingImagesFormDataConverter();
1221 
1222  $orderingElementInput = new ilAssOrderingImagesInputGUI(
1223  $formDataConverter,
1224  self::ORDERING_ELEMENT_FORM_FIELD_POSTVAR
1225  );
1226 
1227  $orderingElementInput->setImageUploadCommand(self::ORDERING_ELEMENT_FORM_CMD_UPLOAD_IMG);
1228  $orderingElementInput->setImageRemovalCommand(self::ORDERING_ELEMENT_FORM_CMD_REMOVE_IMG);
1229 
1230  $this->initOrderingElementFormFieldLabels($orderingElementInput);
1231 
1232  return $orderingElementInput;
1233  }
initOrderingElementFormFieldLabels(ilFormPropertyGUI $formField)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildOrderingTextsFormDataConverter()

assOrderingQuestion::buildOrderingTextsFormDataConverter ( )
protected

◆ buildOrderingTextsInputGui()

assOrderingQuestion::buildOrderingTextsInputGui ( )
Returns
ilAssOrderingTextsInputGUI

Definition at line 1201 of file class.assOrderingQuestion.php.

References buildOrderingTextsFormDataConverter(), and initOrderingElementFormFieldLabels().

Referenced by buildOrderingElementInputGui().

1202  {
1203  $formDataConverter = $this->buildOrderingTextsFormDataConverter();
1204 
1205  $orderingElementInput = new ilAssOrderingTextsInputGUI(
1206  $formDataConverter,
1207  self::ORDERING_ELEMENT_FORM_FIELD_POSTVAR
1208  );
1209 
1210  $this->initOrderingElementFormFieldLabels($orderingElementInput);
1211 
1212  return $orderingElementInput;
1213  }
initOrderingElementFormFieldLabels(ilFormPropertyGUI $formField)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildTestPresentationConfig()

assOrderingQuestion::buildTestPresentationConfig ( )

Get the test question configuration.

Returns
ilTestQuestionConfig

Definition at line 1470 of file class.assOrderingQuestion.php.

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

1471  // hey.
1472  {
1473  // hey: refactored identifiers
1474  return parent::buildTestPresentationConfig()
1475  // hey.
1477  ->setUseUnchangedAnswerLabel($this->lng->txt('tst_unchanged_order_is_correct'));
1478  }
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()

assOrderingQuestion::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 694 of file class.assOrderingQuestion.php.

References calculateReachedPointsForSolution(), assQuestion\fetchIndexedValuesFromValuePairs(), assQuestion\getSolutionMaxPass(), getSolutionOrderingElementList(), and assQuestion\getSolutionValues().

Referenced by getExpressionTypes().

694  : float
695  {
696  if ($returndetails) {
697  throw new ilTestException('return details not implemented for ' . __METHOD__);
698  }
699 
700  if (is_null($pass)) {
701  $pass = $this->getSolutionMaxPass($active_id);
702  }
703 
704  $solutionValuePairs = $this->getSolutionValues($active_id, $pass, $authorizedSolution);
705 
706  if (!count($solutionValuePairs)) {
707  return (float) 0;
708  }
709 
710  $indexedSolutionValues = $this->fetchIndexedValuesFromValuePairs($solutionValuePairs);
711  $solutionOrderingElementList = $this->getSolutionOrderingElementList($indexedSolutionValues);
712 
713  return $this->calculateReachedPointsForSolution($solutionOrderingElementList);
714  }
getSolutionValues($active_id, $pass=null, bool $authorized=true)
Loads solutions of a given user from the database an returns it.
calculateReachedPointsForSolution(ilAssOrderingElementList $solutionOrderingElementList)
getSolutionOrderingElementList($indexedSolutionValues)
Base Exception for all Exceptions relating to Modules/Test.
fetchIndexedValuesFromValuePairs(array $valuePairs)
getSolutionMaxPass(int $active_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculateReachedPointsForSolution()

assOrderingQuestion::calculateReachedPointsForSolution ( ilAssOrderingElementList  $solutionOrderingElementList)
protected
Parameters
$user_order
$nested_solution
Returns
int

Definition at line 1331 of file class.assOrderingQuestion.php.

References ilAssOrderingElementList\getElementByPosition(), getOrderingElementList(), and assQuestion\getPoints().

Referenced by calculateReachedPoints(), and calculateReachedPointsFromPreviewSession().

1331  : float
1332  {
1333  $reachedPoints = $this->getPoints();
1334 
1335  foreach ($this->getOrderingElementList() as $correctElement) {
1336  $userElement = $solutionOrderingElementList->getElementByPosition($correctElement->getPosition());
1337 
1338  if (!$correctElement->isSameElement($userElement)) {
1339  $reachedPoints = 0;
1340  break;
1341  }
1342  }
1343 
1344  return $reachedPoints;
1345  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculateReachedPointsFromPreviewSession()

assOrderingQuestion::calculateReachedPointsFromPreviewSession ( ilAssQuestionPreviewSession  $previewSession)

Definition at line 716 of file class.assOrderingQuestion.php.

References calculateReachedPointsForSolution(), assQuestion\deductHintPointsFromReachedPoints(), assQuestion\ensureNonNegativePoints(), ilAssQuestionPreviewSession\getParticipantsSolution(), and ilAssQuestionPreviewSession\hasParticipantSolution().

717  {
718  if (!$previewSession->hasParticipantSolution()) {
719  return 0;
720  }
721 
722  $solutionOrderingElementList = unserialize(
723  $previewSession->getParticipantsSolution(),
724  ["allowed_classes" => true]
725  );
726 
727  $reachedPoints = $this->calculateReachedPointsForSolution($solutionOrderingElementList);
728  $reachedPoints = $this->deductHintPointsFromReachedPoints($previewSession, $reachedPoints);
729 
730  return $this->ensureNonNegativePoints($reachedPoints);
731  }
calculateReachedPointsForSolution(ilAssOrderingElementList $solutionOrderingElementList)
ensureNonNegativePoints($points)
deductHintPointsFromReachedPoints(ilAssQuestionPreviewSession $previewSession, $reachedPoints)
+ Here is the call graph for this function:

◆ cleanImagefiles()

assOrderingQuestion::cleanImagefiles ( )
protected

Definition at line 761 of file class.assOrderingQuestion.php.

References Vendor\Package\$f, ilFileUtils\delDir(), ilFileUtils\getDir(), assQuestion\getImagePath(), getOrderingElementList(), getOrderingType(), getThumbPrefix(), and OQ_PICTURES.

761  : void
762  {
763  if ($this->getOrderingType() == self::OQ_PICTURES) {
764  if (@file_exists($this->getImagePath())) {
765  $contents = ilFileUtils::getDir($this->getImagePath());
766  foreach ($contents as $f) {
767  if (strcmp($f['type'], 'file') == 0) {
768  $found = false;
769  foreach ($this->getOrderingElementList() as $orderElement) {
770  if (strcmp($f['entry'], $orderElement->getContent()) == 0) {
771  $found = true;
772  }
773  if (strcmp($f['entry'], $this->getThumbPrefix() . $orderElement->getContent()) == 0) {
774  $found = true;
775  }
776  }
777  if (!$found) {
778  if (@file_exists($this->getImagePath() . $f['entry'])) {
779  @unlink($this->getImagePath() . $f['entry']);
780  }
781  }
782  }
783  }
784  }
785  } else {
786  if (@file_exists($this->getImagePath())) {
788  }
789  }
790  }
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
const OQ_PICTURES
Ordering question constants.
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static getDir(string $a_dir, bool $a_rec=false, ?string $a_sub_dir="")
get directory
+ Here is the call graph for this function:

◆ copyImages()

assOrderingQuestion::copyImages (   $question_id,
  $source_questionpool 
)
Deprecated:
(!) simply use the working method duplicateImages(), we do not search the difference here and we will delete this soon (!) currently no usage found, remove for il5.3

Definition at line 372 of file class.assOrderingQuestion.php.

References $DIC, $filename, assQuestion\$ilLog, assQuestion\getImagePath(), getOrderingElementList(), getOrderingType(), getThumbPrefix(), ilFileUtils\makeDirParents(), and OQ_PICTURES.

372  : void
373  {
374  global $DIC;
375  $ilLog = $DIC['ilLog'];
376  if ($this->getOrderingType() == OQ_PICTURES) {
377  $imagepath = $this->getImagePath();
378  $imagepath_original = str_replace("/$this->id/images", "/$question_id/images", $imagepath);
379  $imagepath_original = str_replace("/$this->obj_id/", "/$source_questionpool/", $imagepath_original);
380  if (!file_exists($imagepath)) {
381  ilFileUtils::makeDirParents($imagepath);
382  }
383  foreach ($this->getOrderingElementList() as $element) {
384  $filename = $element->getContent();
385  if (!@copy($imagepath_original . $filename, $imagepath . $filename)) {
386  $ilLog->write('Ordering Question image could not be copied: ' . $imagepath_original . ${filename});
387  }
388  if (@file_exists($imagepath_original . $this->getThumbPrefix() . $filename)) {
389  if (!@copy($imagepath_original . $this->getThumbPrefix() . $filename, $imagepath . $this->getThumbPrefix() . $filename)) {
390  $ilLog->write('Ordering Question image thumbnail could not be copied: ' . $imagepath_original . $this->getThumbPrefix() . $filename);
391  }
392  }
393  }
394  }
395  }
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
global $DIC
Definition: feed.php:28
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
$filename
Definition: buildRTE.php:78
ILIAS DI LoggingServices $ilLog
+ Here is the call graph for this function:

◆ copyObject()

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

Copies an assOrderingQuestion object.

public

Definition at line 264 of file class.assOrderingQuestion.php.

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

264  : int
265  {
266  if ($this->getId() <= 0) {
267  throw new RuntimeException('The question has not been saved. It cannot be duplicated');
268  }
269  // duplicate the question in database
270  $clone = clone $this;
271  $this_id = $this->getId();
272  $original_id = $this->questioninfo->getOriginalId($this_id);
273  $clone->id = -1;
274  $source_questionpool_id = $this->getObjId();
275  $clone->setObjId($target_questionpool_id);
276  if ($title) {
277  $clone->setTitle($title);
278  }
279  $clone->saveToDb();
280 
281  $list = $this->getRepository()->getOrderingList($this_id)
282  ->withQuestionId($clone->getId());
283  $list->distributeNewRandomIdentifiers();
284  $clone->setOrderingElementList($list);
285  $clone->saveToDb();
286 
287  $clone->copyPageOfQuestion($original_id);
288  $clone->copyXHTMLMediaObjectsOfQuestion($original_id);
289  $clone->duplicateImages($original_id, $source_questionpool_id, $clone->getId(), $target_questionpool_id);
290 
291  $clone->onCopy($source_questionpool_id, $original_id, $clone->getObjId(), $clone->getId());
292 
293  return $clone->getId();
294  }
+ Here is the call graph for this function:

◆ createNewOriginalFromThisDuplicate()

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

Definition at line 296 of file class.assOrderingQuestion.php.

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

296  : int
297  {
298  if ($this->getId() <= 0) {
299  throw new RuntimeException('The question has not been saved. It cannot be duplicated');
300  }
301 
302  $sourceQuestionId = $this->id;
303  $sourceParentId = $this->getObjId();
304 
305  // duplicate the question in database
306  $clone = clone $this;
307  $clone->id = -1;
308 
309  $clone->setObjId($targetParentId);
310 
311  if ($targetQuestionTitle) {
312  $clone->setTitle($targetQuestionTitle);
313  }
314 
315  $clone->saveToDb();
316 
317  $list = $this->getRepository()->getOrderingList($this->getId())
318  ->withQuestionId($clone->getId());
319  $list->distributeNewRandomIdentifiers();
320  $clone->setOrderingElementList($list);
321  $clone->saveToDb();
322 
323  // copy question page content
324  $clone->copyPageOfQuestion($sourceQuestionId);
325  // copy XHTML media objects
326  $clone->copyXHTMLMediaObjectsOfQuestion($sourceQuestionId);
327  // duplicate the image
328  $clone->duplicateImages($sourceQuestionId, $sourceParentId, $clone->getId(), $clone->getObjId());
329 
330  $clone->onCopy($sourceParentId, $sourceQuestionId, $clone->getObjId(), $clone->getId());
331 
332  return $clone->id;
333  }
+ Here is the call graph for this function:

◆ deleteAnswer()

assOrderingQuestion::deleteAnswer (   $randomIdentifier)

Deletes an answer with a given index.

The index of the first answer is 0, the index of the second answer is 1 and so on.

Parameters
integer$indexA nonnegative index of the n-th answer public
See also
$answers

Definition at line 664 of file class.assOrderingQuestion.php.

References getOrderingElementList().

664  : void
665  {
666  $this->getOrderingElementList()->removeElement(
667  $this->getOrderingElementList()->getElementByRandomIdentifier($randomIdentifier)
668  );
669  $this->getOrderingElementList()->saveToDb();
670  }
+ Here is the call graph for this function:

◆ dropImageFile()

assOrderingQuestion::dropImageFile (   $imageFilename)

Definition at line 798 of file class.assOrderingQuestion.php.

References assQuestion\getImagePath(), and getThumbPrefix().

799  {
800  if (!strlen($imageFilename)) {
801  return false;
802  }
803 
804  $result = @unlink($this->getImagePath() . $imageFilename);
805  $result = $result && @unlink($this->getImagePath() . $this->getThumbPrefix() . $imageFilename);
806 
807  return $result;
808  }
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
+ Here is the call graph for this function:

◆ duplicate()

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

Definition at line 206 of file class.assOrderingQuestion.php.

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

212  : int {
213  if ($this->id <= 0) {
214  // The question has not been saved. It cannot be duplicated
215  return -1;
216  }
217  // duplicate the question in database
218  $this_id = $this->getId();
219  $thisObjId = $this->getObjId();
220 
221  $clone = clone $this;
222  $original_id = $this->questioninfo->getOriginalId($this->id);
223  $clone->id = -1;
224 
225  if ((int) $testObjId > 0) {
226  $clone->setObjId($testObjId);
227  }
228 
229  if ($title) {
230  $clone->setTitle($title);
231  }
232  if ($author) {
233  $clone->setAuthor($author);
234  }
235  if ($owner) {
236  $clone->setOwner($owner);
237  }
238  if ($for_test) {
239  $clone->saveToDb($original_id);
240  } else {
241  $clone->saveToDb();
242  }
243 
244  //$list = $this->getRepository()->getOrderingList($original_id)
245  $list = $this->getRepository()->getOrderingList($this_id)
246  ->withQuestionId($clone->getId());
247  $list->distributeNewRandomIdentifiers();
248  $clone->setOrderingElementList($list);
249  $clone->saveToDb();
250 
251  $clone->copyPageOfQuestion($this_id);
252  $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
253  $clone->duplicateImages($this_id, $thisObjId, $clone->getId(), $testObjId);
254 
255  $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
256  return $clone->getId();
257  }
+ Here is the call graph for this function:

◆ duplicateImages()

assOrderingQuestion::duplicateImages (   $src_question_id,
  $src_object_id,
  $dest_question_id,
  $dest_object_id 
)

Definition at line 335 of file class.assOrderingQuestion.php.

References $DIC, $filename, assQuestion\$ilLog, assQuestion\getImagePath(), getOrderingElementList(), getThumbPrefix(), isImageOrderingType(), and ilFileUtils\makeDirParents().

Referenced by afterSyncWithOriginal().

335  : void
336  {
337  global $DIC;
338  $ilLog = $DIC['ilLog'];
339  if ($this->isImageOrderingType()) {
340  $imagepath_original = $this->getImagePath($src_question_id, $src_object_id);
341  $imagepath = $this->getImagePath($dest_question_id, $dest_object_id);
342 
343  if (!file_exists($imagepath)) {
344  ilFileUtils::makeDirParents($imagepath);
345  }
346  foreach ($this->getOrderingElementList() as $element) {
347  $filename = $element->getContent();
348 
349  if ($filename === '') {
350  continue;
351  }
352 
353  if (!file_exists($imagepath_original . $filename)
354  || !copy($imagepath_original . $filename, $imagepath . $filename)) {
355  $ilLog->write("image could not be duplicated!!!!");
356  $ilLog->write($imagepath_original . $filename);
357  $ilLog->write($imagepath . $filename);
358  }
359  if (file_exists($imagepath_original . $this->getThumbPrefix() . $filename)
360  && !copy($imagepath_original . $this->getThumbPrefix() . $filename, $imagepath . $this->getThumbPrefix() . $filename)) {
361  $ilLog->write("image thumbnail could not be duplicated!!!!");
362  }
363  }
364  }
365  }
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
global $DIC
Definition: feed.php:28
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
$filename
Definition: buildRTE.php:78
ILIAS DI LoggingServices $ilLog
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ensureImagePathExists()

assOrderingQuestion::ensureImagePathExists ( )
protected

Definition at line 1481 of file class.assOrderingQuestion.php.

References assQuestion\getImagePath(), and ilFileUtils\makeDirParents().

Referenced by storeImageFile().

1481  : void
1482  {
1483  if (!file_exists($this->getImagePath())) {
1485  }
1486  }
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchSolutionListFromFormSubmissionData()

assOrderingQuestion::fetchSolutionListFromFormSubmissionData (   $userSolutionPost)
Parameters
array$userSolutionPost
Returns
ilAssOrderingElementList
Exceptions
ilTestException

Definition at line 1263 of file class.assOrderingQuestion.php.

References ilAssOrderingElementList\buildInstance(), buildNestedOrderingElementInputGui(), ilAssNestedOrderingElementsInputGUI\CONTEXT_USER_SOLUTION_SUBMISSION, assQuestion\getId(), getOrderingElementList(), and isOrderingTypeNested().

Referenced by getSolutionListFromPostSubmit(), and getSolutionOrderingElementListForTestOutput().

1264  {
1265  $orderingGUI = $this->buildNestedOrderingElementInputGui();
1267  $orderingGUI->setValueByArray($userSolutionPost);
1268 
1269  if (!$orderingGUI->checkInput()) {
1270  throw new ilTestException('error on validating user solution post');
1271  }
1272 
1273  $solutionOrderingElementList = ilAssOrderingElementList::buildInstance($this->getId());
1274 
1275  $storedElementList = $this->getOrderingElementList();
1276 
1277  foreach ($orderingGUI->getElementList($this->getId()) as $submittedElement) {
1278  $solutionElement = $storedElementList->getElementByRandomIdentifier(
1279  $submittedElement->getRandomIdentifier()
1280  )->getClone();
1281 
1282  $solutionElement->setPosition($submittedElement->getPosition());
1283 
1284  if ($this->isOrderingTypeNested()) {
1285  $solutionElement->setIndentation($submittedElement->getIndentation());
1286  }
1287 
1288  $solutionOrderingElementList->addElement($solutionElement);
1289  }
1290 
1291  return $solutionOrderingElementList;
1292  }
static buildInstance(int $question_id, array $elements=[])
Base Exception for all Exceptions relating to Modules/Test.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchSolutionSubmit()

assOrderingQuestion::fetchSolutionSubmit (   $formSubmissionDataStructure)
Returns
array

Definition at line 1491 of file class.assOrderingQuestion.php.

References ILIAS\LTI\ToolProvider\$key, getOrderingElementList(), getOrderingType(), OQ_NESTED_PICTURES, and OQ_NESTED_TERMS.

Referenced by getSolutionPostSubmit().

1491  : array
1492  {
1493  $solutionSubmit = array();
1494 
1495  if (isset($formSubmissionDataStructure['orderresult'])) {
1496  $orderresult = $formSubmissionDataStructure['orderresult'];
1497 
1498  if (strlen($orderresult)) {
1499  $orderarray = explode(":", $orderresult);
1500  $ordervalue = 1;
1501  foreach ($orderarray as $index) {
1502  $idmatch = null;
1503  if (preg_match("/id_(\\d+)/", $index, $idmatch)) {
1504  $randomid = $idmatch[1];
1505  foreach ($this->getOrderingElementList() as $answeridx => $answer) {
1506  if ($answer->getRandomIdentifier() == $randomid) {
1507  $solutionSubmit[$answeridx] = $ordervalue;
1508  $ordervalue++;
1509  }
1510  }
1511  }
1512  }
1513  }
1514  } elseif ($this->getOrderingType() == OQ_NESTED_TERMS || $this->getOrderingType() == OQ_NESTED_PICTURES) {
1515  $index = 0;
1516  foreach ($formSubmissionDataStructure['content'] as $randomId => $content) {
1517  $indentation = $formSubmissionDataStructure['indentation'];
1518 
1519  $value1 = $index++;
1520  $value2 = implode(':', array($randomId, $indentation));
1521 
1522  $solutionSubmit[$value1] = $value2;
1523  }
1524  } else {
1525  foreach ($formSubmissionDataStructure as $key => $value) {
1526  $matches = null;
1527  if (preg_match("/^order_(\d+)/", $key, $matches)) {
1528  if (!(preg_match("/initial_value_\d+/", $value))) {
1529  if (strlen($value)) {
1530  foreach ($this->getOrderingElementList() as $answeridx => $answer) {
1531  if ($answer->getRandomIdentifier() == $matches[1]) {
1532  $solutionSubmit[$answeridx] = $value;
1533  }
1534  }
1535  }
1536  }
1537  }
1538  }
1539  }
1540 
1541  return $solutionSubmit;
1542  }
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:

◆ generateThumbForFile()

assOrderingQuestion::generateThumbForFile (   $path,
  $file 
)
protected

Definition at line 1091 of file class.assOrderingQuestion.php.

References $filename, $path, ilShellUtil\convertImage(), getThumbPrefix(), and assQuestion\getThumbSize().

Referenced by rebuildThumbnails().

1091  : void
1092  {
1093  $filename = $path . $file;
1094  if (@file_exists($filename)) {
1095  $thumbpath = $path . $this->getThumbPrefix() . $file;
1096  $path_info = @pathinfo($filename);
1097  $ext = "";
1098  switch (strtoupper($path_info['extension'])) {
1099  case 'PNG':
1100  $ext = 'PNG';
1101  break;
1102  case 'GIF':
1103  $ext = 'GIF';
1104  break;
1105  default:
1106  $ext = 'JPEG';
1107  break;
1108  }
1109  ilShellUtil::convertImage($filename, $thumbpath, $ext, (string) $this->getThumbSize());
1110  }
1111  }
$path
Definition: ltiservices.php:32
static convertImage(string $a_from, string $a_to, string $a_target_format="", string $a_geometry="", string $a_background_color="")
$filename
Definition: buildRTE.php:78
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAdditionalTableName()

assOrderingQuestion::getAdditionalTableName ( )

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

Returns
string The additional table name public

Definition at line 991 of file class.assOrderingQuestion.php.

Referenced by loadFromDb(), and savePreviewData().

991  : string
992  {
993  return "qpl_qst_ordering";
994  }
+ Here is the caller graph for this function:

◆ getAnswer()

assOrderingQuestion::getAnswer (   $index = 0)

Returns the ordering element from the given position.

Parameters
int$position
Returns
ilAssOrderingElement|null

Definition at line 647 of file class.assOrderingQuestion.php.

References getOrderingElementList().

648  {
649  if (!$this->getOrderingElementList()->elementExistByPosition($index)) {
650  return null;
651  }
652 
653  return $this->getOrderingElementList()->getElementByPosition($index);
654  }
+ Here is the call graph for this function:

◆ getAnswerCount()

assOrderingQuestion::getAnswerCount ( )

Returns the number of answers.

Returns
integer The number of answers of the ordering question public
See also
$answers

Definition at line 679 of file class.assOrderingQuestion.php.

References getOrderingElementList().

679  : int
680  {
681  return $this->getOrderingElementList()->countElements();
682  }
+ Here is the call graph for this function:

◆ getAnswerTableName()

assOrderingQuestion::getAnswerTableName ( )

Returns the name of the answer table in the database.

Returns
string The answer table name public

Definition at line 1002 of file class.assOrderingQuestion.php.

1002  : string
1003  {
1004  return "qpl_a_ordering";
1005  }

◆ getAvailableAnswerOptions()

assOrderingQuestion::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

Implements iQuestionCondition.

Definition at line 1446 of file class.assOrderingQuestion.php.

References getOrderingElementList().

1447  {
1448  if ($index !== null) {
1449  return $this->getOrderingElementList()->getElementByPosition($index);
1450  }
1451 
1452  return $this->getOrderingElementList()->getElements();
1453  }
+ Here is the call graph for this function:

◆ getElementHeight()

assOrderingQuestion::getElementHeight ( )

Definition at line 1062 of file class.assOrderingQuestion.php.

References $element_height.

Referenced by savePreviewData().

1062  : ?int
1063  {
1064  return $this->element_height;
1065  }
+ Here is the caller graph for this function:

◆ getEncryptedFilename()

assOrderingQuestion::getEncryptedFilename (   $filename)

Definition at line 752 of file class.assOrderingQuestion.php.

References $filename.

752  : string
753  {
754  $extension = "";
755  if (preg_match("/.*\\.(\\w+)$/", $filename, $matches)) {
756  $extension = $matches[1];
757  }
758  return md5($filename) . "." . $extension;
759  }
$filename
Definition: buildRTE.php:78

◆ getExpressionTypes()

◆ getMaximumPoints()

assOrderingQuestion::getMaximumPoints ( )

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

Returns
double Points
See also
$points

Definition at line 739 of file class.assOrderingQuestion.php.

References assQuestion\getPoints().

Referenced by getExpressionTypes(), and isComplete().

739  : float
740  {
741  return $this->getPoints();
742  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOperators()

assOrderingQuestion::getOperators (   $expression)

Get all available operations for a specific question.

Parameters
string$expression

Implements iQuestionCondition.

Definition at line 1355 of file class.assOrderingQuestion.php.

References ilOperatorsExpressionMapping\getOperatorsByExpression().

1355  : array
1356  {
1358  }
+ Here is the call graph for this function:

◆ getOrderElements()

assOrderingQuestion::getOrderElements ( )

Returns the answers array.

Deprecated:
seriously, stop looking for this kind data at this point (!) look where it comes from and learn (!)

Definition at line 1026 of file class.assOrderingQuestion.php.

References getOrderingElementList().

Referenced by rebuildThumbnails().

1026  : array
1027  {
1028  return $this->getOrderingElementList()->getRandomIdentifierIndexedElements();
1029  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOrderingElementList()

◆ getOrderingElementListForSolutionOutput()

assOrderingQuestion::getOrderingElementListForSolutionOutput (   $forceCorrectSolution,
  $activeId,
  $passIndex 
)
Parameters
$forceCorrectSolution
$activeId
$passIndex
Returns
ilAssOrderingElementList

Definition at line 491 of file class.assOrderingQuestion.php.

References assQuestion\fetchIndexedValuesFromValuePairs(), getOrderingElementList(), getShuffledOrderingElementList(), getSolutionOrderingElementList(), and assQuestion\getSolutionValues().

492  {
493  if ($forceCorrectSolution || !$activeId || $passIndex === null) {
494  return $this->getOrderingElementList();
495  }
496 
497  $solutionValues = $this->getSolutionValues($activeId, $passIndex);
498 
499  if (!count($solutionValues)) {
500  return $this->getShuffledOrderingElementList();
501  }
502 
503  return $this->getSolutionOrderingElementList($this->fetchIndexedValuesFromValuePairs($solutionValues));
504  }
getSolutionValues($active_id, $pass=null, bool $authorized=true)
Loads solutions of a given user from the database an returns it.
getSolutionOrderingElementList($indexedSolutionValues)
fetchIndexedValuesFromValuePairs(array $valuePairs)
+ Here is the call graph for this function:

◆ getOrderingType()

assOrderingQuestion::getOrderingType ( )

◆ getQuestionRepository()

assOrderingQuestion::getQuestionRepository ( )
protected

Definition at line 963 of file class.assOrderingQuestion.php.

References $DIC, and $ilDB.

964  {
965  global $DIC;
966  $ilDB = $DIC['ilDB'];
967  return new \ILIAS\TA\Questions\Ordering\assOrderingQuestionDatabaseRepository($ilDB);
968  }
repository for assOrderingQuestion (the answer elements within, at least...)
global $DIC
Definition: feed.php:28

◆ getQuestionType()

assOrderingQuestion::getQuestionType ( )

Returns the question type of the question.

Returns
integer The question type of the question public

Definition at line 980 of file class.assOrderingQuestion.php.

Referenced by toJSON().

980  : string
981  {
982  return "assOrderingQuestion";
983  }
+ Here is the caller graph for this function:

◆ getRepository()

assOrderingQuestion::getRepository ( )
protected

Definition at line 127 of file class.assOrderingQuestion.php.

References $DIC, $ilDB, and $oq_repository.

Referenced by copyObject(), createNewOriginalFromThisDuplicate(), duplicate(), getOrderingElementList(), and setOrderingElementList().

128  {
129  if (is_null($this->oq_repository)) {
130  global $DIC;
131  $ilDB = $DIC['ilDB'];
132  $this->oq_repository = new OQRepository($ilDB);
133  }
134  return $this->oq_repository;
135  }
repository for assOrderingQuestion (the answer elements within, at least...)
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ getRTETextWithMediaObjects()

assOrderingQuestion::getRTETextWithMediaObjects ( )

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

Definition at line 1011 of file class.assOrderingQuestion.php.

References getOrderingElementList().

1011  : string
1012  {
1013  $text = parent::getRTETextWithMediaObjects();
1014 
1015  foreach ($this->getOrderingElementList() as $orderingElement) {
1016  $text .= $orderingElement->getContent();
1017  }
1018 
1019  return $text;
1020  }
+ Here is the call graph for this function:

◆ getShuffledOrderingElementList()

assOrderingQuestion::getShuffledOrderingElementList ( )
Parameters
$active_id
$pass
Returns
ilAssOrderingElementList

Definition at line 605 of file class.assOrderingQuestion.php.

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

Referenced by getOrderingElementListForSolutionOutput(), and getSolutionOrderingElementListForTestOutput().

606  {
607  $shuffledRandomIdentifierIndex = $this->getShuffler()->transform(
608  $this->getOrderingElementList()->getRandomIdentifierIndex()
609  );
610 
611  $shuffledElementList = $this->getOrderingElementList()->getClone();
612  $shuffledElementList->reorderByRandomIdentifiers($shuffledRandomIdentifierIndex);
613  $shuffledElementList->resetElementsIndentations();
614 
615  return $shuffledElementList;
616  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSolutionListFromPostSubmit()

assOrderingQuestion::getSolutionListFromPostSubmit ( )
Returns
ilAssOrderingElementList

Definition at line 1302 of file class.assOrderingQuestion.php.

References $DIC, $post_array, $postSolutionOrderingElementList, and fetchSolutionListFromFormSubmissionData().

Referenced by savePreviewData(), saveWorkingData(), and validateSolutionSubmit().

1303  {
1304  if ($this->postSolutionOrderingElementList === null) {
1305  $post_array = $_POST;
1306  if (! is_array($post_array)) {
1307  global $DIC;
1308  $request = $DIC->http()->request();
1309  $post_array = $request->getParsedBody();
1310  }
1312  $this->postSolutionOrderingElementList = $list;
1313  }
1314 
1316  }
fetchSolutionListFromFormSubmissionData($userSolutionPost)
$post_array
Definition: webdav.php:33
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSolutionOrderingElementList()

assOrderingQuestion::getSolutionOrderingElementList (   $indexedSolutionValues)
Parameters
array$valuePairs
Returns
ilAssOrderingElementList
Exceptions
ilTestQuestionPoolException

Definition at line 578 of file class.assOrderingQuestion.php.

References assQuestion\getId(), getOrderingElementList(), getSolutionValuePairBrandedOrderingElementByRandomIdentifier(), getSolutionValuePairBrandedOrderingElementBySolutionIdentifier(), and isOrderingTypeNested().

Referenced by calculateReachedPoints(), getOrderingElementListForSolutionOutput(), and getSolutionOrderingElementListForTestOutput().

579  {
580  $solutionOrderingList = new ilAssOrderingElementList();
581  $solutionOrderingList->setQuestionId($this->getId());
582 
583  foreach ($indexedSolutionValues as $value1 => $value2) {
584  if ($this->isOrderingTypeNested()) {
585  $element = $this->getSolutionValuePairBrandedOrderingElementByRandomIdentifier($value1, $value2);
586  } else {
587  $element = $this->getSolutionValuePairBrandedOrderingElementBySolutionIdentifier($value1, $value2);
588  }
589 
590  $solutionOrderingList->addElement($element);
591  }
592 
593  if (!$this->getOrderingElementList()->hasSameElementSetByRandomIdentifiers($solutionOrderingList)) {
594  throw new ilTestQuestionPoolException('inconsistent solution values given');
595  }
596 
597  return $solutionOrderingList;
598  }
getSolutionValuePairBrandedOrderingElementBySolutionIdentifier($value1, $value2)
getSolutionValuePairBrandedOrderingElementByRandomIdentifier($value1, $value2)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSolutionOrderingElementListForTestOutput()

assOrderingQuestion::getSolutionOrderingElementListForTestOutput ( ilAssNestedOrderingElementsInputGUI  $inputGUI,
  $lastPost,
  $activeId,
  $pass 
)
Parameters
ilAssNestedOrderingElementsInputGUI$inputGUI
array$lastPost
integer$activeId
integer$pass
Returns
ilAssOrderingElementList
Exceptions
ilTestException
ilTestQuestionPoolException

Definition at line 515 of file class.assOrderingQuestion.php.

References assQuestion\fetchIndexedValuesFromValuePairs(), fetchSolutionListFromFormSubmissionData(), getShuffledOrderingElementList(), getSolutionOrderingElementList(), assQuestion\getTestOutputSolutions(), and ilAssNestedOrderingElementsInputGUI\isPostSubmit().

516  {
517  if ($inputGUI->isPostSubmit($lastPost)) {
518  return $this->fetchSolutionListFromFormSubmissionData($lastPost);
519  }
520  $indexedSolutionValues = $this->fetchIndexedValuesFromValuePairs(
521  // hey: prevPassSolutions - obsolete due to central check
522  $this->getTestOutputSolutions($activeId, $pass)
523  // hey.
524  );
525 
526  if (count($indexedSolutionValues)) {
527  return $this->getSolutionOrderingElementList($indexedSolutionValues);
528  }
529 
530  return $this->getShuffledOrderingElementList();
531  }
fetchSolutionListFromFormSubmissionData($userSolutionPost)
getSolutionOrderingElementList($indexedSolutionValues)
fetchIndexedValuesFromValuePairs(array $valuePairs)
getTestOutputSolutions(int $activeId, int $pass)
+ Here is the call graph for this function:

◆ getSolutionPostSubmit()

assOrderingQuestion::getSolutionPostSubmit ( )
Returns
array

Definition at line 1321 of file class.assOrderingQuestion.php.

References fetchSolutionSubmit().

1321  : array
1322  {
1323  return $this->fetchSolutionSubmit($_POST);
1324  }
fetchSolutionSubmit($formSubmissionDataStructure)
+ Here is the call graph for this function:

◆ getSolutionValuePairBrandedOrderingElementByRandomIdentifier()

assOrderingQuestion::getSolutionValuePairBrandedOrderingElementByRandomIdentifier (   $value1,
  $value2 
)
protected
Parameters
string$value1
string$value2
Returns
ilAssOrderingElement

Definition at line 538 of file class.assOrderingQuestion.php.

References getOrderingElementList().

Referenced by getSolutionOrderingElementList().

539  {
540  $value2 = explode(':', $value2);
541 
542  $randomIdentifier = $value2[0];
543  $selectedPosition = $value1;
544  $selectedIndentation = $value2[1];
545 
546  $element = $this->getOrderingElementList()->getElementByRandomIdentifier($randomIdentifier)->getClone();
547 
548  $element->setPosition($selectedPosition);
549  $element->setIndentation($selectedIndentation);
550 
551  return $element;
552  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSolutionValuePairBrandedOrderingElementBySolutionIdentifier()

assOrderingQuestion::getSolutionValuePairBrandedOrderingElementBySolutionIdentifier (   $value1,
  $value2 
)
protected
Parameters
string$value1
string$value2
Returns
ilAssOrderingElement

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

References getOrderingElementList().

Referenced by getSolutionOrderingElementList().

560  {
561  $solutionIdentifier = $value1;
562  $selectedPosition = ($value2 - 1);
563  $selectedIndentation = 0;
564 
565  $element = $this->getOrderingElementList()->getElementBySolutionIdentifier($solutionIdentifier)->getClone();
566 
567  $element->setPosition($selectedPosition);
568  $element->setIndentation($selectedIndentation);
569 
570  return $element;
571  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getThumbPrefix()

assOrderingQuestion::getThumbPrefix ( )

◆ getValidOrderingTypes()

assOrderingQuestion::getValidOrderingTypes ( )
protected

Definition at line 397 of file class.assOrderingQuestion.php.

References OQ_NESTED_PICTURES, OQ_NESTED_TERMS, OQ_PICTURES, and OQ_TERMS.

Referenced by setOrderingType().

397  : array
398  {
399  return [
404  ];
405  }
const OQ_NESTED_TERMS
const OQ_PICTURES
Ordering question constants.
const OQ_TERMS
const OQ_NESTED_PICTURES
+ Here is the caller graph for this function:

◆ hasOrderingTypeUploadSupport()

assOrderingQuestion::hasOrderingTypeUploadSupport ( )

Definition at line 480 of file class.assOrderingQuestion.php.

References isImageOrderingType().

Referenced by isImageReplaced().

480  : bool
481  {
482  return $this->isImageOrderingType();
483  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initOrderingElementAuthoringProperties()

assOrderingQuestion::initOrderingElementAuthoringProperties ( ilFormPropertyGUI  $formField)
Parameters
ilAssOrderingTextsInputGUI | ilAssOrderingImagesInputGUI | ilAssNestedOrderingElementsInputGUI$formField

Definition at line 1172 of file class.assOrderingQuestion.php.

References isOrderingTypeNested().

Referenced by ilAssOrderingQuestionAuthoringFormGUI\renewOrderingElementInput().

1172  : void
1173  {
1174  switch (true) {
1175  case $formField instanceof ilAssNestedOrderingElementsInputGUI:
1176  $formField->setInteractionEnabled(true);
1177  $formField->setNestingEnabled($this->isOrderingTypeNested());
1178  break;
1179 
1180  case $formField instanceof ilAssOrderingTextsInputGUI:
1181  case $formField instanceof ilAssOrderingImagesInputGUI:
1182  default:
1183 
1184  $formField->setEditElementOccuranceEnabled(true);
1185  $formField->setEditElementOrderEnabled(true);
1186  }
1187  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initOrderingElementFormFieldLabels()

assOrderingQuestion::initOrderingElementFormFieldLabels ( ilFormPropertyGUI  $formField)
Parameters
ilFormPropertyGUI$formField

Definition at line 1192 of file class.assOrderingQuestion.php.

References ILIAS\Repository\lng(), ilFormPropertyGUI\setInfo(), and ilFormPropertyGUI\setTitle().

Referenced by buildNestedOrderingElementInputGui(), buildOrderingImagesInputGui(), and buildOrderingTextsInputGui().

1192  : void
1193  {
1194  $formField->setInfo($this->lng->txt('ordering_answer_sequence_info'));
1195  $formField->setTitle($this->lng->txt('answers'));
1196  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isComplete()

assOrderingQuestion::isComplete ( )

Returns true, if a ordering question is complete for use.

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

Definition at line 108 of file class.assOrderingQuestion.php.

References assQuestion\getAuthor(), getMaximumPoints(), getOrderingElementList(), assQuestion\getQuestion(), and assQuestion\getTitle().

108  : bool
109  {
110  $elements = array_filter(
111  $this->getOrderingElementList()->getElements(),
112  fn($element) => trim($element->getContent()) != ''
113  );
114  $has_at_least_two_elements = count($elements) > 1;
115 
116  $complete = $this->getAuthor()
117  && $this->getTitle()
118  && $this->getQuestion()
119  && $this->getMaximumPoints()
120  && $has_at_least_two_elements;
121 
122  return $complete;
123  }
getMaximumPoints()
Returns the maximum points, a learner can reach answering the question.
+ Here is the call graph for this function:

◆ isImageFileStored()

assOrderingQuestion::isImageFileStored (   $imageFilename)

Definition at line 810 of file class.assOrderingQuestion.php.

References assQuestion\getImagePath().

810  : bool
811  {
812  if (!strlen($imageFilename)) {
813  return false;
814  }
815 
816  if (!file_exists($this->getImagePath() . $imageFilename)) {
817  return false;
818  }
819 
820  return is_file($this->getImagePath() . $imageFilename);
821  }
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
+ Here is the call graph for this function:

◆ isImageOrderingType()

assOrderingQuestion::isImageOrderingType ( )

Definition at line 429 of file class.assOrderingQuestion.php.

References getOrderingType(), OQ_NESTED_PICTURES, and OQ_PICTURES.

Referenced by ilAssOrderingQuestionAuthoringFormGUI\addSpecificOrderingQuestionCommandButtons(), buildOrderingElementInputGui(), duplicateImages(), hasOrderingTypeUploadSupport(), rebuildThumbnails(), and setNestingType().

429  : bool
430  {
431  $with_images = [
434  ];
435  return in_array($this->getOrderingType(), $with_images);
436  }
const OQ_PICTURES
Ordering question constants.
const OQ_NESTED_PICTURES
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isImageReplaced()

assOrderingQuestion::isImageReplaced ( ilAssOrderingElement  $newElement,
ilAssOrderingElement  $oldElement 
)

Definition at line 823 of file class.assOrderingQuestion.php.

References ilAssOrderingElement\getContent(), and hasOrderingTypeUploadSupport().

823  : bool
824  {
825  if (!$this->hasOrderingTypeUploadSupport()) {
826  return false;
827  }
828 
829  if (!$newElement->getContent()) {
830  return false;
831  }
832 
833  return $newElement->getContent() != $oldElement->getContent();
834  }
+ Here is the call graph for this function:

◆ isOrderingTypeNested()

assOrderingQuestion::isOrderingTypeNested ( )

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

References getOrderingType(), OQ_NESTED_PICTURES, and OQ_NESTED_TERMS.

Referenced by fetchSolutionListFromFormSubmissionData(), getExpressionTypes(), getSolutionOrderingElementList(), initOrderingElementAuthoringProperties(), and setContentType().

420  : bool
421  {
422  $nested = [
425  ];
426  return in_array($this->getOrderingType(), $nested);
427  }
const OQ_NESTED_TERMS
const OQ_NESTED_PICTURES
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadFromDb()

assOrderingQuestion::loadFromDb (   $question_id)

Loads a assOrderingQuestion object from a database.

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

Definition at line 163 of file class.assOrderingQuestion.php.

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

163  : void
164  {
165  global $DIC;
166  $ilDB = $DIC['ilDB'];
167 
168  $result = $ilDB->queryF(
169  "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",
170  array("integer"),
171  array($question_id)
172  );
173  if ($result->numRows() == 1) {
174  $data = $ilDB->fetchAssoc($result);
175  $this->setId($question_id);
176  $this->setObjId($data["obj_fi"]);
177  $this->setTitle((string) $data["title"]);
178  $this->setComment((string) $data["description"]);
179  $this->setOriginalId($data["original_id"]);
180  $this->setAuthor($data["author"]);
181  $this->setNrOfTries($data['nr_of_tries']);
182  $this->setPoints($data["points"]);
183  $this->setOwner($data["owner"]);
184  $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc((string) $data["question_text"], 1));
185  $this->ordering_type = $data["ordering_type"] !== null ? (int) $data["ordering_type"] : OQ_TERMS;
186  if ($data['thumb_geometry'] !== null && $data['thumb_geometry'] >= $this->getMinimumThumbSize()) {
187  $this->setThumbSize($data['thumb_geometry']);
188  }
189  $this->element_height = $data["element_height"] ? (int) $data['element_height'] : null;
190 
191  try {
195  }
196 
197  try {
198  $this->setAdditionalContentEditingMode($data['add_cont_edit_mode']);
199  } catch (ilTestQuestionPoolException $e) {
200  }
201  }
202 
203  parent::loadFromDb($question_id);
204  }
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)
setThumbSize(int $a_size)
setComment(string $comment="")
global $DIC
Definition: feed.php:28
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)
getAdditionalTableName()
Returns the name of the additional question data table in the database.
setQuestion(string $question="")
+ Here is the call graph for this function:

◆ rebuildThumbnails()

assOrderingQuestion::rebuildThumbnails ( )

Definition at line 1075 of file class.assOrderingQuestion.php.

References generateThumbForFile(), assQuestion\getImagePath(), getOrderElements(), and isImageOrderingType().

1075  : void
1076  {
1077  if ($this->isImageOrderingType()) {
1078  foreach ($this->getOrderElements() as $orderingElement) {
1079  if ($orderingElement->getContent() !== '') {
1080  $this->generateThumbForFile($this->getImagePath(), $orderingElement->getContent());
1081  }
1082  }
1083  }
1084  }
getOrderElements()
Returns the answers array.
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
+ Here is the call graph for this function:

◆ saveAnswerSpecificDataToDb()

assOrderingQuestion::saveAnswerSpecificDataToDb ( )

Saves the answer specific records into a question types answer table.

Returns
mixed

Implements ilObjAnswerScoringAdjustable.

Definition at line 970 of file class.assOrderingQuestion.php.

971  {
972  }

◆ savePreviewData()

◆ saveToDb()

assOrderingQuestion::saveToDb (   $original_id = "")

Saves a assOrderingQuestion object to a database.

Parameters
string$original_id

Definition at line 145 of file class.assOrderingQuestion.php.

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

145  : void
146  {
147  if ($original_id == '') {
148  $this->saveQuestionDataToDb();
149  } else {
150  $this->saveQuestionDataToDb((int) $original_id);
151  }
153  parent::saveToDb();
154  }
saveAdditionalQuestionDataToDb()
Saves a record to the question types additional data table.
saveQuestionDataToDb(int $original_id=-1)
+ Here is the call graph for this function:

◆ saveWorkingData()

assOrderingQuestion::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 893 of file class.assOrderingQuestion.php.

References ilObjTest\_getPass(), getOrderingType(), assQuestion\getProcessLocker(), getSolutionListFromPostSubmit(), assQuestion\log(), assQuestion\removeCurrentSolution(), and assQuestion\saveCurrentSolution().

893  : bool
894  {
895  if ($this->dic->testQuestionPool()->internal()->request()->raw('test_answer_changed') === null) {
896  return true;
897  }
898 
899  $entered_values = 0;
900 
901  if (is_null($pass)) {
902  $pass = ilObjTest::_getPass($active_id);
903  }
904 
905  $this->getProcessLocker()->executeUserSolutionUpdateLockOperation(
906  function () use (&$entered_values, $active_id, $pass, $authorized) {
907  $this->removeCurrentSolution($active_id, $pass, $authorized);
908 
909  foreach ($this->getSolutionListFromPostSubmit() as $orderingElement) {
910  $value1 = $orderingElement->getStorageValue1($this->getOrderingType());
911  $value2 = $orderingElement->getStorageValue2($this->getOrderingType());
912 
913  $this->saveCurrentSolution($active_id, $pass, $value1, trim($value2), $authorized);
914 
915  $entered_values++;
916  }
917  }
918  );
919 
920  if ($entered_values) {
921  $this->log($active_id, 'log_user_entered_values');
922  } else {
923  $this->log($active_id, 'log_user_not_entered_values');
924  }
925 
926  return true;
927  }
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
saveCurrentSolution(int $active_id, int $pass, $value1, $value2, bool $authorized=true, $tstamp=0)
log(int $active_id, string $langVar)
removeCurrentSolution(int $active_id, int $pass, bool $authorized=true)
+ Here is the call graph for this function:

◆ setContentType()

assOrderingQuestion::setContentType (   $ct)

Definition at line 438 of file class.assOrderingQuestion.php.

References assQuestion\getThumbSize(), isOrderingTypeNested(), OQ_NESTED_PICTURES, OQ_NESTED_TERMS, OQ_PICTURES, OQ_TERMS, setOrderingType(), and assQuestion\setThumbSize().

439  {
440  if (!in_array($ct, [
441  self::OQ_CT_PICTURES,
442  self::OQ_CT_TERMS
443  ])) {
444  throw new \InvalidArgumentException("use OQ content-type", 1);
445  }
446  if ($ct == self::OQ_CT_PICTURES) {
447  if ($this->isOrderingTypeNested()) {
449  } else {
451  }
452  $this->setThumbSize($this->getThumbSize());
453  }
454  if ($ct == self::OQ_CT_TERMS) {
455  if ($this->isOrderingTypeNested()) {
457  } else {
459  }
460  }
461  }
const OQ_NESTED_TERMS
setThumbSize(int $a_size)
const OQ_PICTURES
Ordering question constants.
const OQ_TERMS
const OQ_NESTED_PICTURES
setOrderingType($ordering_type=self::OQ_TERMS)
+ Here is the call graph for this function:

◆ setElementHeight()

assOrderingQuestion::setElementHeight ( ?int  $a_height)

Definition at line 1067 of file class.assOrderingQuestion.php.

1067  : void
1068  {
1069  $this->element_height = ($a_height < 20) ? null : $a_height;
1070  }

◆ setExportDetailsXLSX()

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

{}

Definition at line 1034 of file class.assOrderingQuestion.php.

References ilExcel\getColumnCoord(), getOrderingElementList(), assQuestion\getSolutionValues(), ilExcel\setBold(), and ilAssExcelFormatHelper\setCell().

1034  : int
1035  {
1036  parent::setExportDetailsXLSX($worksheet, $startrow, $col, $active_id, $pass);
1037 
1038  $solutions = $this->getSolutionValues($active_id, $pass);
1039  $sol = array();
1040  foreach ($solutions as $solution) {
1041  $sol[$solution["value1"]] = $solution["value2"];
1042  }
1043  asort($sol);
1044  $sol = array_keys($sol);
1045 
1046  $i = 1;
1047  foreach ($sol as $idx) {
1048  foreach ($solutions as $solution) {
1049  if ($solution["value1"] == $idx) {
1050  $worksheet->setCell($startrow + $i, $col, $solution["value2"]);
1051  $worksheet->setBold($worksheet->getColumnCoord($col) . ($startrow + $i));
1052  }
1053  }
1054  $element = $this->getOrderingElementList()->getElementBySolutionIdentifier($idx);
1055  $worksheet->setCell($startrow + $i, $col + 2, $element->getContent());
1056  $i++;
1057  }
1058 
1059  return $startrow + $i + 1;
1060  }
getSolutionValues($active_id, $pass=null, bool $authorized=true)
Loads solutions of a given user from the database an returns it.
getColumnCoord(int $a_col)
Get column "name" from number.
setCell($a_row, $a_col, $a_value, $datatype=null)
setBold(string $a_coords)
Set cell(s) to bold.
+ Here is the call graph for this function:

◆ setNestingType()

assOrderingQuestion::setNestingType ( bool  $nesting)

Definition at line 463 of file class.assOrderingQuestion.php.

References isImageOrderingType(), OQ_NESTED_PICTURES, OQ_NESTED_TERMS, OQ_PICTURES, OQ_TERMS, and setOrderingType().

464  {
465  if ($nesting) {
466  if ($this->isImageOrderingType()) {
468  } else {
470  }
471  } else {
472  if ($this->isImageOrderingType()) {
474  } else {
476  }
477  }
478  }
const OQ_NESTED_TERMS
const OQ_PICTURES
Ordering question constants.
const OQ_TERMS
const OQ_NESTED_PICTURES
setOrderingType($ordering_type=self::OQ_TERMS)
+ Here is the call graph for this function:

◆ setOrderingElementList()

assOrderingQuestion::setOrderingElementList ( ilAssOrderingElementList  $list)
Parameters
ilAssOrderingElementList$orderingElementList

Definition at line 629 of file class.assOrderingQuestion.php.

References Vendor\Package\$e, ilAssOrderingElementList\ensureValidIdentifiers(), ilAssOrderingElementList\getElements(), assQuestion\getId(), getRepository(), ilAssOrderingElementList\withElements(), and ilAssOrderingElementList\withQuestionId().

629  : void
630  {
631  $list = $list->withQuestionId($this->getId());
632  $elements = $list->getElements();
633  $nu = [];
634  foreach ($elements as $e) {
635  $nu[] = $list->ensureValidIdentifiers($e);
636  }
637  $list = $list->withElements($nu);
638  $this->getRepository()->updateOrderingList($list);
639  }
ensureValidIdentifiers(ilAssOrderingElement $element)
+ Here is the call graph for this function:

◆ setOrderingType()

assOrderingQuestion::setOrderingType (   $ordering_type = self::OQ_TERMS)

Definition at line 407 of file class.assOrderingQuestion.php.

References $ordering_type, and getValidOrderingTypes().

Referenced by setContentType(), and setNestingType().

408  {
409  if (!in_array($ordering_type, $this->getValidOrderingTypes())) {
410  throw new \InvalidArgumentException('Must be valid ordering type.');
411  }
412  $this->ordering_type = $ordering_type;
413  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ storeImageFile()

assOrderingQuestion::storeImageFile ( string  $upload_file,
string  $upload_name 
)

Definition at line 837 of file class.assOrderingQuestion.php.

References assQuestion\buildHashedImageFilename(), ilShellUtil\convertImage(), ensureImagePathExists(), assQuestion\getImagePath(), getThumbPrefix(), assQuestion\getThumbSize(), and ilFileUtils\moveUploadedFile().

837  : ?string
838  {
839  $name_parts = explode(".", $upload_name);
840  $suffix = strtolower(array_pop($name_parts));
841  if (!in_array($suffix, self::VALID_UPLOAD_SUFFIXES)) {
842  return null;
843  }
844 
845  $this->ensureImagePathExists();
846  $target_filename = $this->buildHashedImageFilename($upload_name, true);
847  $target_filepath = $this->getImagePath() . $target_filename;
848  if (ilFileUtils::moveUploadedFile($upload_file, $target_filename, $target_filepath)) {
849  $thumb_path = $this->getImagePath() . $this->getThumbPrefix() . $target_filename;
850  ilShellUtil::convertImage($target_filepath, $thumb_path, "JPEG", (string) $this->getThumbSize());
851 
852  return $target_filename;
853  }
854 
855  return null;
856  }
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
buildHashedImageFilename(string $plain_image_filename, bool $unique=false)
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
static convertImage(string $a_from, string $a_to, string $a_target_format="", string $a_geometry="", string $a_background_color="")
+ Here is the call graph for this function:

◆ toJSON()

assOrderingQuestion::toJSON ( )

Returns a JSON representation of the question.

Implements ilAssQuestionLMExportable.

Definition at line 1116 of file class.assOrderingQuestion.php.

References ilObjMediaObject\_getMobsOfObject(), assQuestion\formatSAQuestion(), assQuestion\getId(), assQuestion\getImagePathWeb(), assQuestion\getNrOfTries(), getOrderingElementList(), getOrderingType(), assQuestion\getPoints(), assQuestion\getQuestion(), getQuestionType(), assQuestion\getShuffler(), assQuestion\getTitleForHTMLOutput(), and OQ_PICTURES.

1116  : string
1117  {
1118  $result = array();
1119  $result['id'] = $this->getId();
1120  $result['type'] = (string) $this->getQuestionType();
1121  $result['title'] = $this->getTitleForHTMLOutput();
1122  $result['question'] = $this->formatSAQuestion($this->getQuestion());
1123  $result['nr_of_tries'] = $this->getNrOfTries();
1124  $result['shuffle'] = true;
1125  $result['points'] = $this->getPoints();
1126  $result['feedback'] = array(
1127  'onenotcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), false)),
1128  'allcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), true))
1129  );
1130  if ($this->getOrderingType() == self::OQ_PICTURES) {
1131  $result['path'] = $this->getImagePathWeb();
1132  }
1133 
1134  $counter = 1;
1135  $answers = array();
1136  foreach ($this->getOrderingElementList() as $orderingElement) {
1137  $answers[$counter] = $orderingElement->getContent();
1138  $counter++;
1139  }
1140  $answers = $this->getShuffler()->transform($answers);
1141  $arr = array();
1142  foreach ($answers as $order => $answer) {
1143  array_push($arr, array(
1144  "answertext" => (string) $answer,
1145  "order" => (int) $order
1146  ));
1147  }
1148  $result['answers'] = $arr;
1149 
1150  $mobs = ilObjMediaObject::_getMobsOfObject("qpl:html", $this->getId());
1151  $result['mobs'] = $mobs;
1152 
1153  return json_encode($result);
1154  }
getQuestionType()
Returns the question type of the question.
getImagePathWeb()
Returns the web image path for web accessable images of a question.
const OQ_PICTURES
Ordering question constants.
static _getMobsOfObject(string $a_type, int $a_id, int $a_usage_hist_nr=0, string $a_lang="-")
+ Here is the call graph for this function:

◆ updateImageFile()

assOrderingQuestion::updateImageFile ( string  $existing_image_name)

Definition at line 858 of file class.assOrderingQuestion.php.

References assQuestion\buildHashedImageFilename(), ilShellUtil\convertImage(), assQuestion\getImagePath(), getThumbPrefix(), assQuestion\getThumbSize(), and ilFileUtils\rename().

858  : ?string
859  {
860  $existing_image_path = $this->getImagePath() . $existing_image_name;
861  $target_filename = $this->buildHashedImageFilename($existing_image_name, true);
862  $target_filepath = $this->getImagePath() . $target_filename;
863  if (ilFileUtils::rename($existing_image_path, $target_filepath)) {
864  unlink($this->getImagePath() . $this->getThumbPrefix() . $existing_image_name);
865  $thumb_path = $this->getImagePath() . $this->getThumbPrefix() . $target_filename;
866  ilShellUtil::convertImage($target_filepath, $thumb_path, "JPEG", (string) $this->getThumbSize());
867 
868  return $target_filename;
869  }
870 
871  return $existing_image_name;
872  }
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
buildHashedImageFilename(string $plain_image_filename, bool $unique=false)
static convertImage(string $a_from, string $a_to, string $a_target_format="", string $a_geometry="", string $a_background_color="")
static rename(string $a_source, string $a_target)
+ Here is the call graph for this function:

◆ validateSolutionSubmit()

assOrderingQuestion::validateSolutionSubmit ( )

Implements assQuestionInterface.

Definition at line 874 of file class.assOrderingQuestion.php.

References getOrderingElementList(), and getSolutionListFromPostSubmit().

Referenced by savePreviewData().

874  : bool
875  {
876  $submittedSolutionList = $this->getSolutionListFromPostSubmit();
877 
878  if (!$submittedSolutionList->hasElements()) {
879  return true;
880  }
881 
882  return $this->getOrderingElementList()->hasSameElementSetByRandomIdentifiers($submittedSolutionList);
883  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $element_height

int assOrderingQuestion::$element_height = null

Definition at line 68 of file class.assOrderingQuestion.php.

Referenced by getElementHeight().

◆ $leveled_ordering

assOrderingQuestion::$leveled_ordering = array()

Definition at line 71 of file class.assOrderingQuestion.php.

◆ $old_ordering_depth

assOrderingQuestion::$old_ordering_depth = array()

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

◆ $oq_repository

assOrderingQuestion::$oq_repository = null
protected

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

Referenced by getRepository().

◆ $ordering_type

assOrderingQuestion::$ordering_type
protected

Definition at line 66 of file class.assOrderingQuestion.php.

Referenced by __construct(), getOrderingType(), and setOrderingType().

◆ $orderingElementList

assOrderingQuestion::$orderingElementList
protected

Definition at line 60 of file class.assOrderingQuestion.php.

◆ $postSolutionOrderingElementList

assOrderingQuestion::$postSolutionOrderingElementList = null
private

Definition at line 1297 of file class.assOrderingQuestion.php.

Referenced by getSolutionListFromPostSubmit().

◆ HAS_SPECIFIC_FEEDBACK

const assOrderingQuestion::HAS_SPECIFIC_FEEDBACK = false
protected

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

◆ OQ_CT_PICTURES

const assOrderingQuestion::OQ_CT_PICTURES = 'pics'

Definition at line 49 of file class.assOrderingQuestion.php.

◆ OQ_CT_TERMS

const assOrderingQuestion::OQ_CT_TERMS = 'terms'

Definition at line 50 of file class.assOrderingQuestion.php.

◆ OQ_NESTED_PICTURES

◆ OQ_NESTED_TERMS

◆ OQ_PICTURES

◆ OQ_TERMS

◆ ORDERING_ELEMENT_FORM_CMD_REMOVE_IMG

const assOrderingQuestion::ORDERING_ELEMENT_FORM_CMD_REMOVE_IMG = 'removeElementImage'

Definition at line 42 of file class.assOrderingQuestion.php.

◆ ORDERING_ELEMENT_FORM_CMD_UPLOAD_IMG

const assOrderingQuestion::ORDERING_ELEMENT_FORM_CMD_UPLOAD_IMG = 'uploadElementImage'

Definition at line 41 of file class.assOrderingQuestion.php.

◆ ORDERING_ELEMENT_FORM_FIELD_POSTVAR

◆ VALID_UPLOAD_SUFFIXES

const assOrderingQuestion::VALID_UPLOAD_SUFFIXES = ["jpg", "jpeg", "png", "gif"]

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