ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
assOrderingQuestion Class Reference

Class for ordering questions. More...

+ Inheritance diagram for assOrderingQuestion:
+ Collaboration diagram for assOrderingQuestion:

Public Member Functions

 __construct (string $title="", string $comment="", string $author="", int $owner=-1, string $question="", protected int $ordering_type=self::OQ_TERMS)
 
 isComplete ()
 
 saveToDb (?int $original_id=null)
 
 loadFromDb ($question_id)
 Loads a assOrderingQuestion object from a database. More...
 
 cloneImages (int $source_question_id, int $source_parent_id, int $target_question_id, int $target_parent_id)
 
 setOrderingType (int $ordering_type=self::OQ_TERMS)
 
 getOrderingType ()
 
 isOrderingTypeNested ()
 
 isImageOrderingType ()
 
 setContentType ($ct)
 
 setNestingType (bool $nesting)
 
 hasOrderingTypeUploadSupport ()
 
 getOrderingElementListForSolutionOutput (bool $force_correct_solution, int $active_id, ?int $pass_index)
 
 getSolutionOrderingElementListForTestOutput (ilAssNestedOrderingElementsInputGUI $input_gui, array $last_post, int $active_id, int $pass)
 
 getSolutionOrderingElementList (array $indexed_solution_values)
 
 getShuffledOrderingElementList ()
 
 getOrderingElementList ()
 
 setOrderingElementList (ilAssOrderingElementList $list)
 
 getAnswer (int $index=0)
 Returns the ordering element from the given position. More...
 
 deleteAnswer (int $random_identifier)
 
 getAnswerCount ()
 
 calculateReachedPoints (int $active_id, ?int $pass=null, bool $authorized_solution=true)
 
 calculateReachedPointsFromPreviewSession (ilAssQuestionPreviewSession $preview_session)
 
 getMaximumPoints ()
 
 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 (int $active_id, ?int $pass=null, bool $authorized=true)
 
 saveAdditionalQuestionDataToDb ()
 Saves a record to the question types additional data table. 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...
 
 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 (array $user_solution_post)
 
 getSolutionListFromPostSubmit ()
 
 getOperators (string $expression)
 Get all available operations for a specific question. More...
 
 getExpressionTypes ()
 Get all available expression types for a specific question. More...
 
 getUserQuestionResult (int $active_id, int $pass)
 Get the user solution for a question by active_id and the test pass. 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 (array $form_submission_data_structure)
 
 toLog (AdditionalInformationGenerator $additional_info)
 
 solutionValuesToText (array $solution_values)
 
 getCorrectSolutionForTextOutput (int $active_id, int $pass)
 
- Public Member Functions inherited from assQuestion
 getQuestionType ()
 
 isComplete ()
 
 saveWorkingData (int $active_id, ?int $pass=null, bool $authorized=true)
 
 calculateReachedPoints (int $active_id, ?int $pass=null, bool $authorized_solution=true)
 
 getAdditionalTableName ()
 
 getAnswerTableName ()
 
 toLog (AdditionalInformationGenerator $additional_info)
 MUST return an array of the question settings that can be stored in the log. More...
 
 getCurrentUser ()
 
 getShuffler ()
 
 setShuffler (Transformation $shuffler)
 
 setProcessLocker (ilAssQuestionProcessLocker $processLocker)
 
 getProcessLocker ()
 
 fromXML (string $importdirectory, int $user_id, ilQTIItem $item, int $questionpool_id, ?int $tst_id, ?ilObject &$tst_object, int &$question_counter, array $import_mapping)
 
 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...
 
 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 $authorized_solution=true)
 
 calculateResultsFromSolution (int $active_id, int $pass)
 Calculates the question results from a previously saved question solution. More...
 
 persistWorkingState (int $active_id, $pass, bool $authorized=true)
 persists the working state for current testactive and testpass More...
 
 persistPreviewState (ilAssQuestionPreviewSession $preview_session)
 persists the preview state for current user and question More...
 
 validateSolutionSubmit ()
 
 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, ?int $pass=null)
 
 getSolutionValues (int $active_id, ?int $pass=null, bool $authorized=true)
 Loads solutions of a given user from the database an returns it. More...
 
 deleteAnswers (int $question_id)
 
 deleteAdditionalTableData (int $question_id)
 
 delete (int $question_id)
 
 getTotalAnswers ()
 
 cloneXHTMLMediaObjectsOfQuestion (int $source_question_id)
 
 createPageObject ()
 
 clonePageOfQuestion (int $a_q_id)
 
 getPageOfQuestion ()
 
 setOriginalId (?int $original_id)
 
 getOriginalId ()
 
static 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=null)
 
 duplicate (bool $for_test=true, string $title='', string $author='', int $owner=-1, $test_obj_id=null)
 
 copyObject (int $target_parent_id, string $title='')
 
 createNewOriginalFromThisDuplicate (int $target_parent_id, string $target_question_title='')
 
 saveToDb (?int $original_id=null)
 
 deleteSuggestedSolutions ()
 
 getSuggestedSolution (int $subquestion_index=0)
 
 resolveInternalLink (string $internal_link)
 
 resolveSuggestedSolutionLinks ()
 
 getInternalLinkHref (string $target)
 
 syncWithOriginal ()
 
 getPoints ()
 
 setPoints (float $points)
 
 getSolutionMaxPass (int $active_id)
 
 isWriteable ()
 
 calculateReachedPointsFromPreviewSession (ilAssQuestionPreviewSession $preview_session)
 
 isPreviewSolutionCorrect (ilAssQuestionPreviewSession $preview_session)
 
 adjustReachedPointsByScoringOptions (float $points, int $active_id)
 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="")
 
 getQuestionTypeID ()
 
 cleanupMediaObjectUsage ()
 
 getInstances ()
 
 getActiveUserData (int $active_id)
 Returns the user id and the test id for a given active id. More...
 
 hasSpecificFeedback ()
 
 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)
 
 isAnswered (int $active_id, int $pass)
 
 getAdditionalContentEditingMode ()
 
 setAdditionalContentEditingMode (?string $additionalContentEditingMode)
 
 isAdditionalContentEditingModePageObject ()
 
 isValidAdditionalContentEditingMode (string $additionalContentEditingMode)
 
 getValidAdditionalContentEditingModes ()
 
 getHtmlUserSolutionPurifier ()
 
 getHtmlQuestionContentPurifier ()
 
 setLastChange (int $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 ()
 
 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 $value_pairs)
 
 updateTimestamp ()
 
 getTestPresentationConfig ()
 
 hasWritableOriginalInQuestionPool ()
 
 answerToParticipantInteraction (AdditionalInformationGenerator $additional_info, int $test_ref_id, int $active_id, int $pass, string $source_ip, TestParticipantInteractionTypes $interaction_type)
 
 toQuestionAdministrationInteraction (AdditionalInformationGenerator $additional_info, int $test_ref_id, TestQuestionAdministrationInteractionTypes $interaction_type)
 
 getSolutionForTextOutput (int $active_id, int $pass)
 
 getCorrectSolutionForTextOutput (int $active_id, int $pass)
 
 getVariablesAsTextArray (int $active_id, int $pass)
 
- Public Member Functions inherited from iQuestionCondition
 getAvailableAnswerOptions (?int $index=null)
 If index is null, the function returns an array with all anwser options else it returns the specific answer option. 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 = []
 
 $leveled_ordering = []
 
- Data Fields inherited from assQuestion
const ADDITIONAL_CONTENT_EDITING_MODE_RTE = 'default'
 
const ADDITIONAL_CONTENT_EDITING_MODE_IPE = 'pageobject'
 
const TRIM_PATTERN = '/^[\p{C}\p{Z}]+|[\p{C}\p{Z}]+$/u'
 
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 ()
 
 cloneQuestionTypeSpecificProperties (\assQuestion $target)
 
 getValidOrderingTypes ()
 
 getSolutionValuePairBrandedOrderingElementByRandomIdentifier (int $value1, string $value2)
 
 getSolutionValuePairBrandedOrderingElementBySolutionIdentifier (int $value1, string $value2)
 
 cleanImagefiles ()
 
 savePreviewData (ilAssQuestionPreviewSession $previewSession)
 
 getQuestionRepository ()
 
 generateThumbForFile ($path, $file)
 
 calculateReachedPointsForSolution (ilAssOrderingElementList $solution_ordering_element_list)
 
 ensureImagePathExists ()
 
 buildOrderingElementFormDataConverter ()
 
 buildOrderingImagesFormDataConverter ()
 
 buildOrderingTextsFormDataConverter ()
 
 buildNestedOrderingFormDataConverter ()
 
 solutionValuesToLog (AdditionalInformationGenerator $additional_info, array $solution_values)
 
- Protected Member Functions inherited from assQuestion
 solutionValuesToLog (AdditionalInformationGenerator $additional_info, array $solution_values)
 MUST convert the given solution values into an array or a string that can be stored in the log. More...
 
 solutionValuesToText (array $solution_values)
 MUST convert the given solution values into text. More...
 
 getQuestionAction ()
 
 isNonEmptyItemListPostSubmission (string $post_submission_field_name)
 
 savePreviewData (ilAssQuestionPreviewSession $preview_session)
 
 deletePageOfQuestion (int $question_id)
 
 cloneQuestionTypeSpecificProperties (self $target)
 
 removeAllImageFiles (string $image_target_path)
 
 onDuplicate (int $original_parent_id, int $original_question_id, int $duplicate_parent_id, int $duplicate_question_id)
 
 afterSyncWithOriginal (int $original_question_id, int $clone_question_id, int $original_parent_id, int $clone_parent_id)
 
 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 ()
 
 cloneSuggestedSolutions (int $source_question_id, int $target_question_id)
 
 duplicateSuggestedSolutionFiles (int $parent_id, int $question_id)
 Duplicates the files of a suggested solution if the question is duplicated. More...
 
 cloneSuggestedSolutionFiles (int $source_question_id, int $target_question_id)
 
 copySuggestedSolutions (int $target_question_id)
 
 ensureNonNegativePoints (float $points)
 
 purifyAndPrepareTextAreaOutput (string $content)
 
 getRTETextWithMediaObjects ()
 
 getSelfAssessmentFormatter ()
 
 lmMigrateQuestionTypeGenericContent (ilAssSelfAssessmentMigrator $migrator)
 
 lmMigrateQuestionTypeSpecificContent (ilAssSelfAssessmentMigrator $migrator)
 
 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 ()
 
 getSuggestedSolutionsRepo ()
 
 loadSuggestedSolutions ()
 
 answerToLog (AdditionalInformationGenerator $additional_info, int $active_id, int $pass)
 

Protected Attributes

const HAS_SPECIFIC_FEEDBACK = false
 
OQRepository $oq_repository = null
 
ilAssOrderingElementList $element_list_for_deferred_saving = null
 
- Protected Attributes inherited from assQuestion
const HAS_SPECIFIC_FEEDBACK = true
 
GeneralQuestionPropertiesRepository $questionrepository
 
RequestDataCollector $questionpool_request
 
QuestionFiles $question_files
 
ilAssQuestionProcessLocker $processLocker
 
ilTestQuestionConfig $testQuestionConfig
 
SuggestedSolutionsDatabaseRepository $suggestedsolution_repo
 
ILIAS $ilias
 
ilGlobalPageTemplate $tpl
 
ilLanguage $lng
 
ilDBInterface $db
 
ilObjUser $current_user
 
SkillUsageService $skillUsageService
 
HTTPServices $http
 
Refinery $refinery
 
Transformation $shuffler
 
LoggingServices $log
 
Container $dic
 
ilAssQuestionLifecycle $lifecycle
 
ilAssQuestionPage $page
 
TestResultRepository $test_result_repository
 
int $id
 
string $title
 
string $comment
 
int $owner
 
string $author
 
int $thumb_size
 
string $question
 
float $points = 0.0
 
bool $shuffle = true
 
int $test_id
 
int $obj_id = 0
 
int $original_id = null
 
int $lastChange = null
 
string $external_id = null
 
int $step = null
 
array $suggested_solutions
 

Private Member Functions

 getOrderingTypeLangVars (int $ordering_type)
 
 getSolutionOutputForLog ()
 
 getElementArrayWithIdentationsForTextOutput (array $elements)
 

Private Attributes

ilAssOrderingElementList $postSolutionOrderingElementList = null
 

Additional Inherited Members

- Static Public Member Functions inherited from assQuestion
static setForcePassResultUpdateEnabled (bool $force_pass_results_update_enabled)
 
static isForcePassResultUpdateEnabled ()
 
static _getSuggestedSolutionOutput (int $question_id)
 
static _getReachedPoints (int $active_id, int $question_id, int $pass)
 
static isFileAvailable (string $file)
 
static saveOriginalId (int $questionId, int $originalId)
 
static resetOriginalId (int $questionId)
 
static instantiateQuestion (int $question_id)
 
static _getSolutionMaxPass (int $question_id, int $active_id)
 Returns the maximum pass a users question solution. More...
 
static getFeedbackClassNameByQuestionType (string $questionType)
 
static _questionExistsInTest (int $question_id, int $test_id)
 
static lookupParentObjId (int $question_id)
 
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 $force_pass_results_update_enabled = false
 
static $imageSourceFixReplaceMap
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ buildNestedOrderingElementInputGui()

assOrderingQuestion::buildNestedOrderingElementInputGui ( )
Returns
ilAssNestedOrderingElementsInputGUI

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

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

Referenced by fetchSolutionListFromFormSubmissionData(), and getSolutionOutputForLog().

959  {
960  $form_data_converter = $this->buildNestedOrderingFormDataConverter();
961 
962  $ordering_element_input = new ilAssNestedOrderingElementsInputGUI(
963  $form_data_converter,
964  self::ORDERING_ELEMENT_FORM_FIELD_POSTVAR
965  );
966 
967  $ordering_element_input->setUniquePrefix($this->getId());
968  $ordering_element_input->setOrderingType($this->getOrderingType());
969  $ordering_element_input->setElementImagePath($this->getImagePathWeb());
970  $ordering_element_input->setThumbPrefix($this->getThumbPrefix());
971 
972  $this->initOrderingElementFormFieldLabels($ordering_element_input);
973 
974  return $ordering_element_input;
975  }
initOrderingElementFormFieldLabels(ilFormPropertyGUI $formField)
getImagePathWeb()
Returns the web image path for web accessable images of a question.
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:

◆ buildNestedOrderingFormDataConverter()

assOrderingQuestion::buildNestedOrderingFormDataConverter ( )
protected
Returns
ilAssOrderingFormValuesObjectsConverter

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

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

Referenced by buildNestedOrderingElementInputGui().

1246  {
1247  $form_data_converter = $this->buildOrderingElementFormDataConverter();
1249 
1250  if ($this->getOrderingType() === self::OQ_NESTED_PICTURES) {
1251  $form_data_converter->setImageRemovalCommand(self::ORDERING_ELEMENT_FORM_CMD_REMOVE_IMG);
1252  $form_data_converter->setImageUrlPath($this->getImagePathWeb());
1253  $form_data_converter->setThumbnailPrefix($this->getThumbPrefix());
1254  }
1255 
1256  return $form_data_converter;
1257  }
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 1206 of file class.assOrderingQuestion.php.

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

1207  {
1208  $converter = new ilAssOrderingFormValuesObjectsConverter();
1209  $converter->setPostVar(self::ORDERING_ELEMENT_FORM_FIELD_POSTVAR);
1210 
1211  return $converter;
1212  }
+ Here is the caller graph for this function:

◆ buildOrderingElementInputGui()

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

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

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

Referenced by ilAssOrderingQuestionAuthoringFormGUI\renewOrderingElementInput().

880  {
881  if ($this->isImageOrderingType()) {
882  return $this->buildOrderingImagesInputGui();
883  }
884  return $this->buildOrderingTextsInputGui();
885  }
+ 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 1217 of file class.assOrderingQuestion.php.

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

Referenced by buildOrderingImagesInputGui().

1218  {
1219  $formDataConverter = $this->buildOrderingElementFormDataConverter();
1221 
1222  $formDataConverter->setImageRemovalCommand(self::ORDERING_ELEMENT_FORM_CMD_REMOVE_IMG);
1223  $formDataConverter->setImageUrlPath($this->getImagePathWeb());
1224  $formDataConverter->setImageFsPath($this->getImagePath());
1225 
1226  if ($this->getThumbPrefix()) {
1227  $formDataConverter->setThumbnailPrefix($this->getThumbPrefix());
1228  }
1229  return $formDataConverter;
1230  }
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 938 of file class.assOrderingQuestion.php.

References buildOrderingImagesFormDataConverter(), and initOrderingElementFormFieldLabels().

Referenced by buildOrderingElementInputGui().

939  {
940  $formDataConverter = $this->buildOrderingImagesFormDataConverter();
941 
942  $orderingElementInput = new ilAssOrderingImagesInputGUI(
943  $formDataConverter,
944  self::ORDERING_ELEMENT_FORM_FIELD_POSTVAR
945  );
946 
947  $orderingElementInput->setImageUploadCommand(self::ORDERING_ELEMENT_FORM_CMD_UPLOAD_IMG);
948  $orderingElementInput->setImageRemovalCommand(self::ORDERING_ELEMENT_FORM_CMD_REMOVE_IMG);
949 
950  $this->initOrderingElementFormFieldLabels($orderingElementInput);
951 
952  return $orderingElementInput;
953  }
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 920 of file class.assOrderingQuestion.php.

References buildOrderingTextsFormDataConverter(), initOrderingElementFormFieldLabels(), and ILIAS\Repository\lng().

Referenced by buildOrderingElementInputGui().

921  {
922  $formDataConverter = $this->buildOrderingTextsFormDataConverter();
923 
924  $orderingElementInput = new ilAssOrderingTextsInputGUI(
925  $formDataConverter,
926  self::ORDERING_ELEMENT_FORM_FIELD_POSTVAR
927  );
928 
929  $this->initOrderingElementFormFieldLabels($orderingElementInput);
930  $orderingElementInput->setInfo($orderingElementInput->getInfo() . ' ' . $this->lng->txt('latex_edit_info'));
931 
932  return $orderingElementInput;
933  }
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 1129 of file class.assOrderingQuestion.php.

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

1130  // hey.
1131  {
1132  // hey: refactored identifiers
1133  return parent::buildTestPresentationConfig()
1134  // hey.
1136  ->setUseUnchangedAnswerLabel($this->lng->txt('tst_unchanged_order_is_correct'));
1137  }
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 ( int  $active_id,
?int  $pass = null,
bool  $authorized_solution = true 
)

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

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

Referenced by getUserQuestionResult().

476  : float {
477  if ($pass === null) {
478  $pass = $this->getSolutionMaxPass($active_id);
479  }
480 
481  $solution_value_pairs = $this->getSolutionValues($active_id, $pass, $authorized_solution);
482 
483  if ($solution_value_pairs === []) {
484  return 0.0;
485  }
486 
487  $solution_ordering_element_list = $this->getSolutionOrderingElementList(
488  $this->fetchIndexedValuesFromValuePairs($solution_value_pairs)
489  );
490 
491  return $this->calculateReachedPointsForSolution($solution_ordering_element_list);
492  }
getSolutionValues(int $active_id, ?int $pass=null, bool $authorized=true)
Loads solutions of a given user from the database an returns it.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
fetchIndexedValuesFromValuePairs(array $value_pairs)
getSolutionMaxPass(int $active_id)
getSolutionOrderingElementList(array $indexed_solution_values)
calculateReachedPointsForSolution(ilAssOrderingElementList $solution_ordering_element_list)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculateReachedPointsForSolution()

assOrderingQuestion::calculateReachedPointsForSolution ( ilAssOrderingElementList  $solution_ordering_element_list)
protected

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

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

Referenced by calculateReachedPoints(), and calculateReachedPointsFromPreviewSession().

1022  : float
1023  {
1024  $reached_points = $this->getPoints();
1025 
1026  foreach ($this->getOrderingElementList() as $correct_element) {
1027  $user_element = $solution_ordering_element_list->getElementByPosition($correct_element->getPosition());
1028  if (!$correct_element->isSameElement($user_element)) {
1029  $reached_points = 0;
1030  break;
1031  }
1032  }
1033 
1034  return $reached_points;
1035  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculateReachedPointsFromPreviewSession()

assOrderingQuestion::calculateReachedPointsFromPreviewSession ( ilAssQuestionPreviewSession  $preview_session)

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

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

494  : float
495  {
496  if (!$preview_session->hasParticipantSolution()) {
497  return 0.0;
498  }
499 
500  $solution_ordering_element_list = unserialize(
501  $preview_session->getParticipantsSolution(),
502  ['allowed_classes' => true]
503  );
504 
505  $reached_points = $this->calculateReachedPointsForSolution($solution_ordering_element_list);
506 
507  return $this->ensureNonNegativePoints($reached_points);
508  }
ensureNonNegativePoints(float $points)
calculateReachedPointsForSolution(ilAssOrderingElementList $solution_ordering_element_list)
+ Here is the call graph for this function:

◆ cleanImagefiles()

assOrderingQuestion::cleanImagefiles ( )
protected

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

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

532  : void
533  {
534  if ($this->getOrderingType() == self::OQ_PICTURES) {
535  if (@file_exists($this->getImagePath())) {
536  $contents = ilFileUtils::getDir($this->getImagePath());
537  foreach ($contents as $f) {
538  if (strcmp($f['type'], 'file') == 0) {
539  $found = false;
540  foreach ($this->getOrderingElementList() as $orderElement) {
541  if (strcmp($f['entry'], $orderElement->getContent()) == 0) {
542  $found = true;
543  }
544  if (strcmp($f['entry'], $this->getThumbPrefix() . $orderElement->getContent()) == 0) {
545  $found = true;
546  }
547  }
548  if (!$found) {
549  if (@file_exists($this->getImagePath() . $f['entry'])) {
550  @unlink($this->getImagePath() . $f['entry']);
551  }
552  }
553  }
554  }
555  }
556  } else {
557  if (@file_exists($this->getImagePath())) {
559  }
560  }
561  }
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
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:

◆ cloneImages()

assOrderingQuestion::cloneImages ( int  $source_question_id,
int  $source_parent_id,
int  $target_question_id,
int  $target_parent_id 
)

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

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

Referenced by cloneQuestionTypeSpecificProperties().

180  : void {
181  if (!$this->isImageOrderingType()) {
182  return;
183  }
184 
185  $image_source_path = $this->getImagePath($source_question_id, $source_parent_id);
186  $image_target_path = $this->getImagePath($target_question_id, $target_parent_id);
187 
188  if (!file_exists($image_target_path)) {
189  ilFileUtils::makeDirParents($image_target_path);
190  } else {
191  $this->removeAllImageFiles($image_target_path);
192  }
193  foreach ($this->getOrderingElementList() as $element) {
194  $filename = $element->getContent();
195 
196  if ($filename === '') {
197  continue;
198  }
199 
200  if (!file_exists($image_source_path . $filename)
201  || !copy($image_source_path . $filename, $image_target_path . $filename)) {
202  $this->log->root()->warning('Image could not be cloned for object for question: ' . $target_question_id);
203  }
204  if (!file_exists($image_source_path . $this->getThumbPrefix() . $filename)
205  || !copy($image_source_path . $this->getThumbPrefix() . $filename, $image_target_path . $this->getThumbPrefix() . $filename)) {
206  $this->log->root()->warning('Image thumbnails could not be cloned for object for question: ' . $target_question_id);
207  }
208  }
209  }
removeAllImageFiles(string $image_target_path)
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.
$filename
Definition: buildRTE.php:78
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneQuestionTypeSpecificProperties()

assOrderingQuestion::cloneQuestionTypeSpecificProperties ( \assQuestion  $target)
protected

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

References cloneImages(), assQuestion\getId(), assQuestion\getObjId(), getRepository(), and assQuestion\saveToDb().

165  : \assQuestion {
166  $list = $this->getRepository()->getOrderingList($this->getId())
167  ->withQuestionId($target->getId());
168  $list->distributeNewRandomIdentifiers();
169  $target->setOrderingElementList($list);
170  $this->cloneImages($this->getId(), $this->getObjId(), $target->getId(), $target->getObjId());
171  $target->saveToDb();
172  return $target;
173  }
cloneImages(int $source_question_id, int $source_parent_id, int $target_question_id, int $target_parent_id)
+ Here is the call graph for this function:

◆ deleteAnswer()

assOrderingQuestion::deleteAnswer ( int  $random_identifier)

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

References getOrderingElementList().

459  : void
460  {
461  $this->getOrderingElementList()->removeElement(
462  $this->getOrderingElementList()->getElementByRandomIdentifier($random_identifier)
463  );
464  $this->getOrderingElementList()->saveToDb();
465  }
+ Here is the call graph for this function:

◆ dropImageFile()

assOrderingQuestion::dropImageFile (   $imageFilename)

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

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

570  {
571  if (!strlen($imageFilename)) {
572  return false;
573  }
574 
575  $result = @unlink($this->getImagePath() . $imageFilename);
576  $result = $result && @unlink($this->getImagePath() . $this->getThumbPrefix() . $imageFilename);
577 
578  return $result;
579  }
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:

◆ ensureImagePathExists()

assOrderingQuestion::ensureImagePathExists ( )
protected

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

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

Referenced by storeImageFile().

1140  : void
1141  {
1142  if (!file_exists($this->getImagePath())) {
1144  }
1145  }
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 ( array  $user_solution_post)

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

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

Referenced by getSolutionListFromPostSubmit(), and getSolutionOrderingElementListForTestOutput().

978  {
979  $ordering_gui = $this->buildNestedOrderingElementInputGui();
981  $ordering_gui->setValueByArray($user_solution_post);
982 
983  if (!$ordering_gui->checkInput()) {
984  throw new ilTestException('error on validating user solution post');
985  }
986 
987  $solution_ordering_element_list = ilAssOrderingElementList::buildInstance($this->getId());
988 
989  $stored_element_list = $this->getOrderingElementList();
990 
991  foreach ($ordering_gui->getElementList($this->getId()) as $submitted_element) {
992  $solution_element = $stored_element_list->getElementByRandomIdentifier(
993  $submitted_element->getRandomIdentifier()
994  )->getClone();
995 
996  $solution_element->setPosition($submitted_element->getPosition());
997 
998  if ($this->isOrderingTypeNested()) {
999  $solution_element->setIndentation($submitted_element->getIndentation());
1000  }
1001 
1002  $solution_ordering_element_list->addElement($solution_element);
1003  }
1004 
1005  return $solution_ordering_element_list;
1006  }
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 ( array  $form_submission_data_structure)
Returns
array

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

References getOrderingElementList(), getOrderingType(), and null.

1150  : array
1151  {
1152  $solution_submit = [];
1153 
1154  if (isset($form_submission_data_structure['orderresult'])) {
1155  $orderresult = $form_submission_data_structure['orderresult'];
1156 
1157  if (strlen($orderresult)) {
1158  $orderarray = explode(":", $orderresult);
1159  $ordervalue = 1;
1160  foreach ($orderarray as $index) {
1161  $idmatch = null;
1162  if (preg_match("/id_(\\d+)/", $index, $idmatch)) {
1163  $randomid = $idmatch[1];
1164  foreach ($this->getOrderingElementList() as $answeridx => $answer) {
1165  if ($answer->getRandomIdentifier() == $randomid) {
1166  $solution_submit[$answeridx] = $ordervalue;
1167  $ordervalue++;
1168  }
1169  }
1170  }
1171  }
1172  }
1173  } elseif ($this->getOrderingType() == self::OQ_NESTED_TERMS || $this->getOrderingType() == self::OQ_NESTED_PICTURES) {
1174  $index = 0;
1175  foreach ($form_submission_data_structure['content'] as $randomId => $content) {
1176  $indentation = $form_submission_data_structure['indentation'];
1177 
1178  $value1 = $index++;
1179  $value2 = implode(':', [$randomId, $indentation]);
1180 
1181  $solution_submit[$value1] = $value2;
1182  }
1183  } else {
1184  foreach ($form_submission_data_structure as $key => $value) {
1185  $matches = null;
1186  if (preg_match("/^order_(\d+)/", $key, $matches)) {
1187  if (!(preg_match("/initial_value_\d+/", $value))) {
1188  if (strlen($value)) {
1189  foreach ($this->getOrderingElementList() as $answeridx => $answer) {
1190  if ($answer->getRandomIdentifier() == $matches[1]) {
1191  $solution_submit[$answeridx] = $value;
1192  }
1193  }
1194  }
1195  }
1196  }
1197  }
1198  }
1199 
1200  return $solution_submit;
1201  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ generateThumbForFile()

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

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

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

Referenced by rebuildThumbnails().

810  : void
811  {
812  $filename = $path . $file;
813  if (@file_exists($filename)) {
814  $thumbpath = $path . $this->getThumbPrefix() . $file;
815  $path_info = @pathinfo($filename);
816  $ext = "";
817  switch (strtoupper($path_info['extension'])) {
818  case 'PNG':
819  $ext = 'PNG';
820  break;
821  case 'GIF':
822  $ext = 'GIF';
823  break;
824  default:
825  $ext = 'JPEG';
826  break;
827  }
828  ilShellUtil::convertImage($filename, $thumbpath, $ext, (string) $this->getThumbSize());
829  }
830  }
$path
Definition: ltiservices.php:29
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 741 of file class.assOrderingQuestion.php.

Referenced by loadFromDb(), and saveAdditionalQuestionDataToDb().

741  : string
742  {
743  return "qpl_qst_ordering";
744  }
+ Here is the caller graph for this function:

◆ getAnswer()

assOrderingQuestion::getAnswer ( int  $index = 0)

Returns the ordering element from the given position.

Parameters
int$position
Returns
ilAssOrderingElement|null

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

References getOrderingElementList(), and null.

451  {
452  if (!$this->getOrderingElementList()->elementExistByPosition($index)) {
453  return null;
454  }
455 
456  return $this->getOrderingElementList()->getElementByPosition($index);
457  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getAnswerCount()

assOrderingQuestion::getAnswerCount ( )

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

References getOrderingElementList().

467  : int
468  {
469  return $this->getOrderingElementList()->countElements();
470  }
+ 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 752 of file class.assOrderingQuestion.php.

752  : string
753  {
754  return "qpl_a_ordering";
755  }

◆ 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

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

References getOrderingElementList(), and null.

1115  {
1116  if ($index !== null) {
1117  return $this->getOrderingElementList()->getElementByPosition($index);
1118  }
1119 
1120  return $this->getOrderingElementList()->getElements();
1121  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getCorrectSolutionForTextOutput()

assOrderingQuestion::getCorrectSolutionForTextOutput ( int  $active_id,
int  $pass 
)

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

References getElementArrayWithIdentationsForTextOutput(), and getOrderingElementList().

1333  : array
1334  {
1336  $this->getOrderingElementList()->getElements()
1337  );
1338  }
getElementArrayWithIdentationsForTextOutput(array $elements)
+ Here is the call graph for this function:

◆ getElementArrayWithIdentationsForTextOutput()

assOrderingQuestion::getElementArrayWithIdentationsForTextOutput ( array  $elements)
private
Parameters
array<ilAssOrderingElement>$elements
Returns
array

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

References Vendor\Package\$a, Vendor\Package\$b, ilAssOrderingElement\getContent(), ilAssOrderingElement\getIndentation(), and ilAssOrderingElement\getPosition().

Referenced by getCorrectSolutionForTextOutput(), solutionValuesToLog(), and solutionValuesToText().

1345  : array
1346  {
1347  usort(
1348  $elements,
1350  => $a->getPosition() - $b->getPosition()
1351  );
1352 
1353  return array_map(
1354  function (ilAssOrderingElement $v): string {
1355  $indentation = '';
1356  for ($i = 0;$i < $v->getIndentation();$i++) {
1357  $indentation .= ' |';
1358  }
1359  return $indentation . $v->getContent();
1360  },
1361  $elements
1362  );
1363  }
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getElementHeight()

assOrderingQuestion::getElementHeight ( )

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

References $element_height.

Referenced by saveAdditionalQuestionDataToDb().

781  : ?int
782  {
783  return $this->element_height;
784  }
+ Here is the caller graph for this function:

◆ getEncryptedFilename()

assOrderingQuestion::getEncryptedFilename (   $filename)

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

References $filename.

523  : string
524  {
525  $extension = "";
526  if (preg_match("/.*\\.(\\w+)$/", $filename, $matches)) {
527  $extension = $matches[1];
528  }
529  return md5($filename) . "." . $extension;
530  }
$filename
Definition: buildRTE.php:78

◆ getExpressionTypes()

◆ getMaximumPoints()

assOrderingQuestion::getMaximumPoints ( )

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

References assQuestion\getPoints().

Referenced by getUserQuestionResult(), and isComplete().

510  : float
511  {
512  return $this->getPoints();
513  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOperators()

assOrderingQuestion::getOperators ( string  $expression)

Get all available operations for a specific question.

Parameters
$expression

Implements iQuestionCondition.

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

1037  : array
1038  {
1039  return ilOperatorsExpressionMapping::getOperatorsByExpression($expression);
1040  }

◆ 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 776 of file class.assOrderingQuestion.php.

References getOrderingElementList().

Referenced by rebuildThumbnails().

776  : array
777  {
778  return $this->getOrderingElementList()->getRandomIdentifierIndexedElements();
779  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOrderingElementList()

◆ getOrderingElementListForSolutionOutput()

assOrderingQuestion::getOrderingElementListForSolutionOutput ( bool  $force_correct_solution,
int  $active_id,
?int  $pass_index 
)

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

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

304  if ($force_correct_solution || !$active_id || $pass_index === null) {
305  return $this->getOrderingElementList();
306  }
307 
308  $solution_values = $this->getSolutionValues($active_id, $pass_index);
309 
310  if (!count($solution_values)) {
311  return $this->getShuffledOrderingElementList();
312  }
313 
314  return $this->getSolutionOrderingElementList($this->fetchIndexedValuesFromValuePairs($solution_values));
315  }
getSolutionValues(int $active_id, ?int $pass=null, bool $authorized=true)
Loads solutions of a given user from the database an returns it.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
fetchIndexedValuesFromValuePairs(array $value_pairs)
getSolutionOrderingElementList(array $indexed_solution_values)
+ Here is the call graph for this function:

◆ getOrderingType()

assOrderingQuestion::getOrderingType ( )

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

Referenced by buildNestedOrderingElementInputGui(), buildNestedOrderingFormDataConverter(), cleanImagefiles(), fetchSolutionSubmit(), isImageOrderingType(), isOrderingTypeNested(), saveWorkingData(), toJSON(), and toLog().

229  : int
230  {
231  return $this->ordering_type;
232  }
+ Here is the caller graph for this function:

◆ getOrderingTypeLangVars()

assOrderingQuestion::getOrderingTypeLangVars ( int  $ordering_type)
private

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

Referenced by toLog().

1279  : array
1280  {
1281  switch ($ordering_type) {
1282  case self::OQ_PICTURES:
1283  return ['qst_nested_nested_answers_off', 'oq_btn_use_order_pictures'];
1284  case self::OQ_TERMS:
1285  return ['qst_nested_nested_answers_off', 'oq_btn_use_order_terms'];
1286  case self::OQ_NESTED_PICTURES:
1287  return ['qst_nested_nested_answers_on', 'oq_btn_use_order_pictures'];
1288  case self::OQ_NESTED_TERMS:
1289  return ['qst_nested_nested_answers_on', 'oq_btn_use_order_terms'];
1290  default:
1291  return ['', ''];
1292  }
1293  }
+ Here is the caller graph for this function:

◆ getQuestionRepository()

assOrderingQuestion::getQuestionRepository ( )
protected

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

715  : OQRepository
716  {
717  return new OQRepository($this->db);
718  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getQuestionType()

assOrderingQuestion::getQuestionType ( )

Returns the question type of the question.

Returns
integer The question type of the question public

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

Referenced by toJSON(), and toLog().

730  : string
731  {
732  return "assOrderingQuestion";
733  }
+ Here is the caller graph for this function:

◆ getRepository()

assOrderingQuestion::getRepository ( )
protected

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

References $oq_repository.

Referenced by cloneQuestionTypeSpecificProperties(), getOrderingElementList(), and setOrderingElementList().

98  : OQRepository
99  {
100  if (is_null($this->oq_repository)) {
101  $this->oq_repository = new OQRepository($this->db);
102  }
103  return $this->oq_repository;
104  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ 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 761 of file class.assOrderingQuestion.php.

References getOrderingElementList().

761  : string
762  {
763  $text = parent::getRTETextWithMediaObjects();
764 
765  foreach ($this->getOrderingElementList() as $orderingElement) {
766  $text .= $orderingElement->getContent();
767  }
768 
769  return $text;
770  }
+ Here is the call graph for this function:

◆ getShuffledOrderingElementList()

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

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

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

Referenced by getOrderingElementListForSolutionOutput(), and getSolutionOrderingElementListForTestOutput().

404  {
405  $shuffledRandomIdentifierIndex = $this->getShuffler()->transform(
406  $this->getOrderingElementList()->getRandomIdentifierIndex()
407  );
408 
409  $shuffledElementList = $this->getOrderingElementList()->getClone();
410  $shuffledElementList->reorderByRandomIdentifiers($shuffledRandomIdentifierIndex);
411  $shuffledElementList->resetElementsIndentations();
412 
413  return $shuffledElementList;
414  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSolutionListFromPostSubmit()

assOrderingQuestion::getSolutionListFromPostSubmit ( )

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

References $postSolutionOrderingElementList, fetchSolutionListFromFormSubmissionData(), ILIAS\FileDelivery\http(), and null.

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

1011  {
1012  if ($this->postSolutionOrderingElementList === null) {
1014  $this->http->request()->getParsedBody()
1015  );
1016  $this->postSolutionOrderingElementList = $list;
1017  }
1018 
1020  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static http()
Fetches the global http state from ILIAS.
fetchSolutionListFromFormSubmissionData(array $user_solution_post)
ilAssOrderingElementList $postSolutionOrderingElementList
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSolutionOrderingElementList()

assOrderingQuestion::getSolutionOrderingElementList ( array  $indexed_solution_values)
Exceptions
ilTestQuestionPoolException

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

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

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

377  {
378  $solution_ordering_list = new ilAssOrderingElementList();
379  $solution_ordering_list->setQuestionId($this->getId());
380 
381  foreach ($indexed_solution_values as $value1 => $value2) {
382  if ($this->isOrderingTypeNested()) {
383  $element = $this->getSolutionValuePairBrandedOrderingElementByRandomIdentifier($value1, $value2);
384  } else {
385  $element = $this->getSolutionValuePairBrandedOrderingElementBySolutionIdentifier($value1, $value2);
386  }
387 
388  $solution_ordering_list->addElement($element);
389  }
390 
391  if (!$this->getOrderingElementList()->hasSameElementSetByRandomIdentifiers($solution_ordering_list)) {
392  throw new ilTestQuestionPoolException('inconsistent solution values given');
393  }
394 
395  return $solution_ordering_list;
396  }
getSolutionValuePairBrandedOrderingElementByRandomIdentifier(int $value1, string $value2)
getSolutionValuePairBrandedOrderingElementBySolutionIdentifier(int $value1, string $value2)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSolutionOrderingElementListForTestOutput()

assOrderingQuestion::getSolutionOrderingElementListForTestOutput ( ilAssNestedOrderingElementsInputGUI  $input_gui,
array  $last_post,
int  $active_id,
int  $pass 
)

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

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

323  if ($input_gui->isPostSubmit($last_post)) {
324  return $this->fetchSolutionListFromFormSubmissionData($last_post);
325  }
326  $indexedSolutionValues = $this->fetchIndexedValuesFromValuePairs(
327  // hey: prevPassSolutions - obsolete due to central check
328  $this->getTestOutputSolutions($active_id, $pass)
329  // hey.
330  );
331 
332  if (count($indexedSolutionValues)) {
333  return $this->getSolutionOrderingElementList($indexedSolutionValues);
334  }
335 
336  return $this->getShuffledOrderingElementList();
337  }
fetchIndexedValuesFromValuePairs(array $value_pairs)
fetchSolutionListFromFormSubmissionData(array $user_solution_post)
getTestOutputSolutions(int $activeId, int $pass)
getSolutionOrderingElementList(array $indexed_solution_values)
+ Here is the call graph for this function:

◆ getSolutionOutputForLog()

assOrderingQuestion::getSolutionOutputForLog ( )
private

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

References buildNestedOrderingElementInputGui(), ilAssNestedOrderingElementsInputGUI\CONTEXT_CORRECT_SOLUTION_PRESENTATION, and getOrderingElementList().

Referenced by toLog().

1295  : string
1296  {
1297  $solution_ordering_list = $this->getOrderingElementList();
1298 
1299  $answers_gui = $this->buildNestedOrderingElementInputGui();
1301  $answers_gui->setInteractionEnabled(false);
1302  $answers_gui->setElementList($solution_ordering_list);
1303 
1304  return $answers_gui->getHTML();
1305  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSolutionValuePairBrandedOrderingElementByRandomIdentifier()

assOrderingQuestion::getSolutionValuePairBrandedOrderingElementByRandomIdentifier ( int  $value1,
string  $value2 
)
protected

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

References getOrderingElementList(), and ILIAS\Repository\int().

Referenced by getSolutionOrderingElementList().

343  $value = explode(':', $value2);
344 
345  $random_identifier = (int) $value[0];
346  $selected_position = $value1;
347  $selected_indentation = (int) $value[1];
348 
349  $element = $this->getOrderingElementList()->getElementByRandomIdentifier($random_identifier)->getClone();
350 
351  $element->setPosition($selected_position);
352  $element->setIndentation($selected_indentation);
353 
354  return $element;
355  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSolutionValuePairBrandedOrderingElementBySolutionIdentifier()

assOrderingQuestion::getSolutionValuePairBrandedOrderingElementBySolutionIdentifier ( int  $value1,
string  $value2 
)
protected

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

References getOrderingElementList().

Referenced by getSolutionOrderingElementList().

361  $solution_identifier = $value1;
362  $selected_position = ($value2 - 1);
363  $selected_indentation = 0;
364 
365  $element = $this->getOrderingElementList()->getElementBySolutionIdentifier($solution_identifier)->getClone();
366 
367  $element->setPosition($selected_position);
368  $element->setIndentation($selected_indentation);
369 
370  return $element;
371  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getThumbPrefix()

assOrderingQuestion::getThumbPrefix ( )

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

Referenced by buildNestedOrderingElementInputGui(), buildNestedOrderingFormDataConverter(), buildOrderingImagesFormDataConverter(), cleanImagefiles(), cloneImages(), dropImageFile(), generateThumbForFile(), storeImageFile(), and updateImageFile().

805  : string
806  {
807  return "thumb.";
808  }
+ Here is the caller graph for this function:

◆ getUserQuestionResult()

assOrderingQuestion::getUserQuestionResult ( int  $active_id,
int  $pass 
)

Get the user solution for a question by active_id and the test pass.

Implements iQuestionCondition.

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

References $data, assQuestion\$points, calculateReachedPoints(), assQuestion\getId(), getMaximumPoints(), getOrderingElementList(), isOrderingTypeNested(), and assQuestion\lookupMaxStep().

1056  $result = new ilUserQuestionResult($this, $active_id, $pass);
1057 
1058  $maxStep = $this->lookupMaxStep($active_id, $pass);
1059  if ($maxStep > 0) {
1060  $data = $this->db->queryF(
1061  "SELECT value1, value2 FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s AND step = %s ORDER BY value1 ASC ",
1062  ["integer", "integer", "integer","integer"],
1063  [$active_id, $pass, $this->getId(), $maxStep]
1064  );
1065  } else {
1066  $data = $this->db->queryF(
1067  "SELECT value1, value2 FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s ORDER BY value1 ASC ",
1068  ["integer", "integer", "integer"],
1069  [$active_id, $pass, $this->getId()]
1070  );
1071  }
1072 
1073  $elements = [];
1074  while ($row = $this->db->fetchAssoc($data)) {
1075  $newKey = explode(":", $row["value2"]);
1076 
1077  foreach ($this->getOrderingElementList() as $answer) {
1078  // Images not supported
1079  if (!$this->isOrderingTypeNested()) {
1080  if ($answer->getSolutionIdentifier() == $row["value1"]) {
1081  $elements[$row["value2"]] = $answer->getSolutionIdentifier() + 1;
1082  break;
1083  }
1084  } else {
1085  if ($answer->getRandomIdentifier() == $newKey[0]) {
1086  $elements[$row["value1"]] = $answer->getSolutionIdentifier() + 1;
1087  break;
1088  }
1089  }
1090  }
1091  }
1092 
1093  ksort($elements);
1094 
1095  foreach (array_values($elements) as $element) {
1096  $result->addKeyValue($element, $element);
1097  }
1098 
1099  $points = $this->calculateReachedPoints($active_id, $pass);
1100  $max_points = $this->getMaximumPoints();
1101 
1102  $result->setReachedPercentage(($points / $max_points) * 100);
1103 
1104  return $result;
1105  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
calculateReachedPoints(int $active_id, ?int $pass=null, bool $authorized_solution=true)
lookupMaxStep(int $active_id, int $pass)
+ Here is the call graph for this function:

◆ getValidOrderingTypes()

assOrderingQuestion::getValidOrderingTypes ( )
protected

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

Referenced by setOrderingType().

211  : array
212  {
213  return [
214  self::OQ_PICTURES,
215  self::OQ_TERMS,
216  self::OQ_NESTED_PICTURES,
217  self::OQ_NESTED_TERMS
218  ];
219  }
+ Here is the caller graph for this function:

◆ hasOrderingTypeUploadSupport()

assOrderingQuestion::hasOrderingTypeUploadSupport ( )

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

References isImageOrderingType().

Referenced by isImageReplaced().

294  : bool
295  {
296  return $this->isImageOrderingType();
297  }
+ 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 891 of file class.assOrderingQuestion.php.

References isOrderingTypeNested().

Referenced by ilAssOrderingQuestionAuthoringFormGUI\renewOrderingElementInput().

891  : void
892  {
893  switch (true) {
894  case $formField instanceof ilAssNestedOrderingElementsInputGUI:
895  $formField->setInteractionEnabled(true);
896  $formField->setNestingEnabled($this->isOrderingTypeNested());
897  break;
898 
899  case $formField instanceof ilAssOrderingTextsInputGUI:
900  case $formField instanceof ilAssOrderingImagesInputGUI:
901  default:
902 
903  $formField->setEditElementOccuranceEnabled(true);
904  $formField->setEditElementOrderEnabled(true);
905  }
906  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 911 of file class.assOrderingQuestion.php.

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

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

911  : void
912  {
913  $formField->setInfo($this->lng->txt('ordering_answer_sequence_info'));
914  $formField->setTitle($this->lng->txt('answers'));
915  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isComplete()

assOrderingQuestion::isComplete ( )

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

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

76  : bool
77  {
78  $elements_list = $this->getOrderingElementList()->getElements();
79  if ($elements_list === [] && $this->element_list_for_deferred_saving !== null) {
80  $elements_list = $this->element_list_for_deferred_saving->getElements();
81  }
82  $elements = array_filter(
83  $elements_list,
84  fn($element) => trim($element->getContent()) != ''
85  );
86 
87  $has_at_least_two_elements = count($elements) > 1;
88 
89  $complete = $this->getAuthor()
90  && $this->getTitle()
91  && $this->getQuestion()
92  && $this->getMaximumPoints()
93  && $has_at_least_two_elements;
94 
95  return $complete;
96  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ isImageFileStored()

assOrderingQuestion::isImageFileStored (   $imageFilename)

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

References assQuestion\getImagePath().

581  : bool
582  {
583  if (!strlen($imageFilename)) {
584  return false;
585  }
586 
587  if (!file_exists($this->getImagePath() . $imageFilename)) {
588  return false;
589  }
590 
591  return is_file($this->getImagePath() . $imageFilename);
592  }
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 243 of file class.assOrderingQuestion.php.

References getOrderingType().

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

243  : bool
244  {
245  $with_images = [
246  self::OQ_PICTURES,
247  self::OQ_NESTED_PICTURES
248  ];
249  return in_array($this->getOrderingType(), $with_images);
250  }
+ 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 594 of file class.assOrderingQuestion.php.

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

594  : bool
595  {
596  if (!$this->hasOrderingTypeUploadSupport()) {
597  return false;
598  }
599 
600  if (!$newElement->getContent()) {
601  return false;
602  }
603 
604  return $newElement->getContent() != $oldElement->getContent();
605  }
+ Here is the call graph for this function:

◆ isOrderingTypeNested()

assOrderingQuestion::isOrderingTypeNested ( )

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

References getOrderingType().

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

234  : bool
235  {
236  $nested = [
237  self::OQ_NESTED_TERMS,
238  self::OQ_NESTED_PICTURES
239  ];
240  return in_array($this->getOrderingType(), $nested);
241  }
+ 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 123 of file class.assOrderingQuestion.php.

References $data, Vendor\Package\$e, ilRTE\_replaceMediaObjectImageSrc(), getAdditionalTableName(), ilAssQuestionLifecycle\getDraftInstance(), ilAssQuestionLifecycle\getInstance(), assQuestion\getMinimumThumbSize(), ILIAS\Repository\int(), null, 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().

123  : void
124  {
125  $result = $this->db->queryF(
126  "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",
127  ["integer"],
128  [$question_id]
129  );
130  if ($result->numRows() == 1) {
131  $data = $this->db->fetchAssoc($result);
132  $this->setId($question_id);
133  $this->setObjId($data["obj_fi"]);
134  $this->setTitle((string) $data["title"]);
135  $this->setComment((string) $data["description"]);
136  $this->setOriginalId($data["original_id"]);
137  $this->setAuthor($data["author"]);
138  $this->setNrOfTries($data['nr_of_tries']);
139  $this->setPoints($data["points"]);
140  $this->setOwner($data["owner"]);
141  $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc((string) $data["question_text"], 1));
142  $this->ordering_type = $data["ordering_type"] !== null ? (int) $data["ordering_type"] : self::OQ_TERMS;
143  if ($data['thumb_geometry'] !== null && $data['thumb_geometry'] >= $this->getMinimumThumbSize()) {
144  $this->setThumbSize($data['thumb_geometry']);
145  }
146  $this->element_height = $data["element_height"] ? (int) $data['element_height'] : null;
147 
148  try {
152  }
153 
154  try {
155  $this->setAdditionalContentEditingMode($data['add_cont_edit_mode']);
156  } catch (ilTestQuestionPoolException $e) {
157  }
158  }
159 
160  parent::loadFromDb($question_id);
161  }
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="")
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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 794 of file class.assOrderingQuestion.php.

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

794  : void
795  {
796  if ($this->isImageOrderingType()) {
797  foreach ($this->getOrderElements() as $orderingElement) {
798  if ($orderingElement->getContent() !== '') {
799  $this->generateThumbForFile($this->getImagePath(), $orderingElement->getContent());
800  }
801  }
802  }
803  }
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:

◆ saveAdditionalQuestionDataToDb()

assOrderingQuestion::saveAdditionalQuestionDataToDb ( )

Saves a record to the question types additional data table.

Returns
mixed

Implements ilObjQuestionScoringAdjustable.

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

References getAdditionalTableName(), getElementHeight(), assQuestion\getId(), assQuestion\getThumbSize(), and null.

Referenced by saveToDb().

693  {
694  // save additional data
695  $this->db->manipulateF(
696  "DELETE FROM " . $this->getAdditionalTableName() . " WHERE question_fi = %s",
697  ["integer"],
698  [$this->getId()]
699  );
700 
701  $this->db->manipulateF(
702  "INSERT INTO " . $this->getAdditionalTableName() . " (question_fi, ordering_type, thumb_geometry, element_height)
703  VALUES (%s, %s, %s, %s)",
704  ["integer", "text", "integer", "integer"],
705  [
706  $this->getId(),
707  $this->ordering_type,
708  $this->getThumbSize(),
709  ($this->getElementHeight() > 20) ? $this->getElementHeight() : null
710  ]
711  );
712  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getAdditionalTableName()
Returns the name of the additional question data table in the database.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAnswerSpecificDataToDb()

assOrderingQuestion::saveAnswerSpecificDataToDb ( )

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

Returns
mixed

Implements ilObjAnswerScoringAdjustable.

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

721  {
722  }

◆ savePreviewData()

assOrderingQuestion::savePreviewData ( ilAssQuestionPreviewSession  $previewSession)
protected

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

References getSolutionListFromPostSubmit(), ilAssQuestionPreviewSession\setParticipantsSolution(), and validateSolutionSubmit().

685  : void
686  {
687  if ($this->validateSolutionSubmit()) {
688  $previewSession->setParticipantsSolution(serialize($this->getSolutionListFromPostSubmit()));
689  }
690  }
+ Here is the call graph for this function:

◆ saveToDb()

assOrderingQuestion::saveToDb ( ?int  $original_id = null)

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

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

106  : void
107  {
110  parent::saveToDb();
111  if ($this->element_list_for_deferred_saving !== null) {
112  $this->setOrderingElementList($this->element_list_for_deferred_saving);
113  }
114  }
setOrderingElementList(ilAssOrderingElementList $list)
saveAdditionalQuestionDataToDb()
Saves a record to the question types additional data table.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
saveQuestionDataToDb(?int $original_id=null)
+ Here is the call graph for this function:

◆ saveWorkingData()

assOrderingQuestion::saveWorkingData ( int  $active_id,
?int  $pass = null,
bool  $authorized = true 
)

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

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

660  : bool {
661  if ($this->questionpool_request->raw('test_answer_changed') === null) {
662  return true;
663  }
664 
665  if (is_null($pass)) {
666  $pass = ilObjTest::_getPass($active_id);
667  }
668 
669  $this->getProcessLocker()->executeUserSolutionUpdateLockOperation(
670  function () use ($active_id, $pass, $authorized) {
671  $this->removeCurrentSolution($active_id, $pass, $authorized);
672 
673  foreach ($this->getSolutionListFromPostSubmit() as $orderingElement) {
674  $value1 = $orderingElement->getStorageValue1($this->getOrderingType());
675  $value2 = $orderingElement->getStorageValue2($this->getOrderingType());
676 
677  $this->saveCurrentSolution($active_id, $pass, $value1, trim((string) $value2), $authorized);
678  }
679  }
680  );
681 
682  return true;
683  }
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
saveCurrentSolution(int $active_id, int $pass, $value1, $value2, bool $authorized=true, $tstamp=0)
removeCurrentSolution(int $active_id, int $pass, bool $authorized=true)
+ Here is the call graph for this function:

◆ setContentType()

assOrderingQuestion::setContentType (   $ct)

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

References assQuestion\getThumbSize(), isOrderingTypeNested(), setOrderingType(), and assQuestion\setThumbSize().

253  {
254  if (!in_array($ct, [
255  self::OQ_CT_PICTURES,
256  self::OQ_CT_TERMS
257  ])) {
258  throw new \InvalidArgumentException("use OQ content-type", 1);
259  }
260  if ($ct == self::OQ_CT_PICTURES) {
261  if ($this->isOrderingTypeNested()) {
262  $this->setOrderingType(self::OQ_NESTED_PICTURES);
263  } else {
264  $this->setOrderingType(self::OQ_PICTURES);
265  }
266  $this->setThumbSize($this->getThumbSize());
267  }
268  if ($ct == self::OQ_CT_TERMS) {
269  if ($this->isOrderingTypeNested()) {
270  $this->setOrderingType(self::OQ_NESTED_TERMS);
271  } else {
272  $this->setOrderingType(self::OQ_TERMS);
273  }
274  }
275  }
setOrderingType(int $ordering_type=self::OQ_TERMS)
setThumbSize(int $a_size)
+ Here is the call graph for this function:

◆ setElementHeight()

assOrderingQuestion::setElementHeight ( ?int  $a_height)

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

References null.

786  : void
787  {
788  $this->element_height = ($a_height < 20) ? null : $a_height;
789  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ setNestingType()

assOrderingQuestion::setNestingType ( bool  $nesting)

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

References isImageOrderingType(), and setOrderingType().

278  {
279  if ($nesting) {
280  if ($this->isImageOrderingType()) {
281  $this->setOrderingType(self::OQ_NESTED_PICTURES);
282  } else {
283  $this->setOrderingType(self::OQ_NESTED_TERMS);
284  }
285  } else {
286  if ($this->isImageOrderingType()) {
287  $this->setOrderingType(self::OQ_PICTURES);
288  } else {
289  $this->setOrderingType(self::OQ_TERMS);
290  }
291  }
292  }
setOrderingType(int $ordering_type=self::OQ_TERMS)
+ Here is the call graph for this function:

◆ setOrderingElementList()

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

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

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

Referenced by saveToDb().

427  : void
428  {
429  if ($this->getId() <= 0) {
430  $this->element_list_for_deferred_saving = $list;
431  return;
432  }
433  $list = $list->withQuestionId($this->getId());
434  $elements = $list->getElements();
435  $nu = [];
436  foreach ($elements as $e) {
437  $nu[] = $list->ensureValidIdentifiers($e);
438  }
439  $this->getRepository()->updateOrderingList(
440  $list->withElements($nu)
441  );
442  }
ensureValidIdentifiers(ilAssOrderingElement $element)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setOrderingType()

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

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

References getValidOrderingTypes().

Referenced by setContentType(), and setNestingType().

222  {
223  if (!in_array($ordering_type, $this->getValidOrderingTypes())) {
224  throw new \InvalidArgumentException('Must be valid ordering type.');
225  }
226  $this->ordering_type = $ordering_type;
227  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ solutionValuesToLog()

assOrderingQuestion::solutionValuesToLog ( AdditionalInformationGenerator  $additional_info,
array  $solution_values 
)
protected

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

References assQuestion\fetchIndexedValuesFromValuePairs(), getElementArrayWithIdentationsForTextOutput(), and getSolutionOrderingElementList().

1310  : array {
1311  if ($solution_values === []) {
1312  return [];
1313  }
1316  $this->fetchIndexedValuesFromValuePairs($solution_values)
1317  )->getElements()
1318  );
1319  }
getElementArrayWithIdentationsForTextOutput(array $elements)
fetchIndexedValuesFromValuePairs(array $value_pairs)
getSolutionOrderingElementList(array $indexed_solution_values)
+ Here is the call graph for this function:

◆ solutionValuesToText()

assOrderingQuestion::solutionValuesToText ( array  $solution_values)

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

References assQuestion\fetchIndexedValuesFromValuePairs(), getElementArrayWithIdentationsForTextOutput(), and getSolutionOrderingElementList().

1321  : array
1322  {
1323  if ($solution_values === []) {
1324  return [];
1325  }
1328  $this->fetchIndexedValuesFromValuePairs($solution_values)
1329  )->getElements()
1330  );
1331  }
getElementArrayWithIdentationsForTextOutput(array $elements)
fetchIndexedValuesFromValuePairs(array $value_pairs)
getSolutionOrderingElementList(array $indexed_solution_values)
+ Here is the call graph for this function:

◆ storeImageFile()

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

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

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

608  : ?string
609  {
610  $name_parts = explode(".", $upload_name);
611  $suffix = strtolower(array_pop($name_parts));
612  if (!in_array($suffix, self::VALID_UPLOAD_SUFFIXES)) {
613  return null;
614  }
615 
616  $this->ensureImagePathExists();
617  $target_filename = $this->buildHashedImageFilename($upload_name, true);
618  $target_filepath = $this->getImagePath() . $target_filename;
619  if (ilFileUtils::moveUploadedFile($upload_file, $target_filename, $target_filepath)) {
620  $thumb_path = $this->getImagePath() . $this->getThumbPrefix() . $target_filename;
621  ilShellUtil::convertImage($target_filepath, $thumb_path, "JPEG", (string) $this->getThumbSize());
622 
623  return $target_filename;
624  }
625 
626  return null;
627  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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 ILIAS\TestQuestionPool\Questions\QuestionLMExportable.

Definition at line 835 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(), and assQuestion\getTitleForHTMLOutput().

835  : string
836  {
837  $result = [];
838  $result['id'] = $this->getId();
839  $result['type'] = (string) $this->getQuestionType();
840  $result['title'] = $this->getTitleForHTMLOutput();
841  $result['question'] = $this->formatSAQuestion($this->getQuestion());
842  $result['nr_of_tries'] = $this->getNrOfTries();
843  $result['shuffle'] = true;
844  $result['points'] = $this->getPoints();
845  $result['feedback'] = [
846  'onenotcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), false)),
847  'allcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), true))
848  ];
849  if ($this->getOrderingType() == self::OQ_PICTURES) {
850  $result['path'] = $this->getImagePathWeb();
851  }
852 
853  $counter = 1;
854  $answers = [];
855  foreach ($this->getOrderingElementList() as $orderingElement) {
856  $answers[$counter] = $orderingElement->getContent();
857  $counter++;
858  }
859  $answers = $this->getShuffler()->transform($answers);
860  $arr = [];
861  foreach ($answers as $order => $answer) {
862  array_push($arr, [
863  "answertext" => (string) $answer,
864  "order" => (int) $order
865  ]);
866  }
867  $result['answers'] = $arr;
868 
869  $mobs = ilObjMediaObject::_getMobsOfObject("qpl:html", $this->getId());
870  $result['mobs'] = $mobs;
871 
872  return json_encode($result);
873  }
getQuestionType()
Returns the question type of the question.
getImagePathWeb()
Returns the web image path for web accessable images of a question.
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:

◆ toLog()

assOrderingQuestion::toLog ( AdditionalInformationGenerator  $additional_info)

Implements ILIAS\TestQuestionPool\Questions\Question.

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

References assQuestion\formatSAQuestion(), getOrderingType(), getOrderingTypeLangVars(), assQuestion\getPoints(), assQuestion\getQuestion(), getQuestionType(), getSolutionOutputForLog(), ILIAS\Test\Logging\AdditionalInformationGenerator\getTagForLangVar(), and assQuestion\getTitleForHTMLOutput().

1259  : array
1260  {
1261  return [
1262  AdditionalInformationGenerator::KEY_QUESTION_TYPE => (string) $this->getQuestionType(),
1263  AdditionalInformationGenerator::KEY_QUESTION_TITLE => $this->getTitleForHTMLOutput(),
1264  AdditionalInformationGenerator::KEY_QUESTION_TEXT => $this->formatSAQuestion($this->getQuestion()),
1265  AdditionalInformationGenerator::KEY_QUESTION_ORDERING_NESTING_TYPE => array_reduce(
1266  $this->getOrderingTypeLangVars($this->getOrderingType()),
1267  static fn(string $string, string $lang_var) => $string . $additional_info->getTagForLangVar($lang_var),
1268  ''
1269  ),
1270  AdditionalInformationGenerator::KEY_QUESTION_REACHABLE_POINTS => $this->getPoints(),
1271  AdditionalInformationGenerator::KEY_QUESTION_ANSWER_OPTION => $this->getSolutionOutputForLog(),
1272  AdditionalInformationGenerator::KEY_FEEDBACK => [
1273  AdditionalInformationGenerator::KEY_QUESTION_FEEDBACK_ON_INCOMPLETE => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), false)),
1274  AdditionalInformationGenerator::KEY_QUESTION_FEEDBACK_ON_COMPLETE => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), true))
1275  ]
1276  ];
1277  }
getQuestionType()
Returns the question type of the question.
getOrderingTypeLangVars(int $ordering_type)
+ Here is the call graph for this function:

◆ updateImageFile()

assOrderingQuestion::updateImageFile ( string  $existing_image_name)

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

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

629  : ?string
630  {
631  $existing_image_path = $this->getImagePath() . $existing_image_name;
632  $target_filename = $this->buildHashedImageFilename($existing_image_name, true);
633  $target_filepath = $this->getImagePath() . $target_filename;
634  if (ilFileUtils::rename($existing_image_path, $target_filepath)) {
635  unlink($this->getImagePath() . $this->getThumbPrefix() . $existing_image_name);
636  $thumb_path = $this->getImagePath() . $this->getThumbPrefix() . $target_filename;
637  ilShellUtil::convertImage($target_filepath, $thumb_path, "JPEG", (string) $this->getThumbSize());
638 
639  return $target_filename;
640  }
641 
642  return $existing_image_name;
643  }
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 ILIAS\TestQuestionPool\Questions\Question.

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

References getOrderingElementList(), and getSolutionListFromPostSubmit().

Referenced by savePreviewData().

645  : bool
646  {
647  $submittedSolutionList = $this->getSolutionListFromPostSubmit();
648 
649  if (!$submittedSolutionList->hasElements()) {
650  return true;
651  }
652 
653  return $this->getOrderingElementList()->hasSameElementSetByRandomIdentifiers($submittedSolutionList);
654  }
+ 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 58 of file class.assOrderingQuestion.php.

Referenced by getElementHeight().

◆ $element_list_for_deferred_saving

ilAssOrderingElementList assOrderingQuestion::$element_list_for_deferred_saving = null
protected

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

◆ $leveled_ordering

assOrderingQuestion::$leveled_ordering = []

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

◆ $old_ordering_depth

assOrderingQuestion::$old_ordering_depth = []

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

◆ $oq_repository

OQRepository assOrderingQuestion::$oq_repository = null
protected

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

Referenced by getRepository().

◆ $postSolutionOrderingElementList

ilAssOrderingElementList assOrderingQuestion::$postSolutionOrderingElementList = null
private

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

Referenced by getSolutionListFromPostSubmit().

◆ HAS_SPECIFIC_FEEDBACK

const assOrderingQuestion::HAS_SPECIFIC_FEEDBACK = false
protected

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

◆ OQ_CT_PICTURES

const assOrderingQuestion::OQ_CT_PICTURES = 'pics'

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

◆ OQ_CT_TERMS

const assOrderingQuestion::OQ_CT_TERMS = 'terms'

Definition at line 53 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 45 of file class.assOrderingQuestion.php.

◆ ORDERING_ELEMENT_FORM_CMD_UPLOAD_IMG

const assOrderingQuestion::ORDERING_ELEMENT_FORM_CMD_UPLOAD_IMG = 'uploadElementImage'

Definition at line 44 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: