ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
QstsQuestionPage Class Reference
+ Inheritance diagram for QstsQuestionPage:
+ Collaboration diagram for QstsQuestionPage:

Public Member Functions

 afterConstructor ()
 
 getParentType ()
 
 getEditView ()
 
 setEditView (Edit $edit_view)
 
 getQuestion ()
 
 setQuestion (Question $question)
 
 getParticipantView ()
 
 setParticipantView (Viewable $participant_view)
 
 getAttemptData ()
 
 setAttemptData (?Attempt $attempt_data)
 
 getRequiredCapabilities ()
 
 setRequiredCapabilities (RequiredCapabilities $required_capabilities)
 
 getViewConfiguration ()
 
 setViewConfiguration (ViewConfiguration $view_configuration)
 
 pasteContents (string $page_content_id, bool $a_self_ass=false)
 Paste contents from pc clipboard. More...
 
 cutContents (array $page_content_ids)
 Copy contents to clipboard and cut them from the page. More...
 
 addQuestionText (string $text)
 
- Public Member Functions inherited from ilPageObject
 __construct (int $a_id=0, int $a_old_nr=0, string $a_lang="-")
 
 setContentIdManager (\ILIAS\COPage\ID\ContentIdManager $content_id_manager)
 
 afterConstructor ()
 
 getParentType ()
 
 initPageConfig ()
 
 setLanguage (string $a_val)
 Set language. More...
 
 getLanguage ()
 
 setPageConfig (ilPageConfig $a_val)
 
 setConcreteLang (string $a_val)
 
 getConcreteLang ()
 
 getPageConfig ()
 
 setRenderMd5 (string $a_rendermd5)
 
 getRenderMd5 ()
 
 setRenderedContent (string $a_renderedcontent)
 
 getRenderedContent ()
 
 setRenderedTime (string $a_renderedtime)
 
 getRenderedTime ()
 
 setLastChange (string $a_lastchange)
 
 getLastChange ()
 
 setLastChangeUser (int $a_val)
 
 getLastChangeUser ()
 
 setShowActivationInfo (bool $a_val)
 
 getShowActivationInfo ()
 
 getCreationUserId ()
 
 read ()
 Read page data. More...
 
 buildDom (bool $a_force=false)
 
 freeDom ()
 
 getDomDoc ()
 Get dom doc (DOMDocument) More...
 
 setId (int $a_id)
 
 getId ()
 
 setParentId (int $a_id)
 
 getParentId ()
 
 addUpdateListener (object $a_object, string $a_method, $a_parameters="")
 
 callUpdateListeners ()
 
 setActive (bool $a_active)
 
 getActive (bool $a_check_scheduled_activation=false)
 
 setActivationStart (?string $a_activationstart)
 
 getActivationStart ()
 
 setActivationEnd (?string $a_activationend)
 Set Activation End. More...
 
 getActivationEnd ()
 
 getContentObject (string $a_hier_id, string $a_pc_id="")
 Get a content object of the page. More...
 
 getContentObjectForPcId (string $pcid)
 Get content object for pc id. More...
 
 getParentContentObjectForPcId (string $pcid)
 Get parent content object for pc id. More...
 
 getContentDomNode (string $a_hier_id, string $a_pc_id="")
 
 getDomNodeForPCId (string $pc_id)
 
 setXMLContent (string $a_xml, string $a_encoding="UTF-8")
 set xml content of page, start with <PageObject...>, end with </PageObject>, comply with ILIAS DTD, omit MetaData, use utf-8! More...
 
 appendXMLContent (string $a_xml)
 
 getXMLContent (bool $a_incl_head=false)
 get xml content of page More...
 
 copyXmlContent (bool $a_clone_mobs=false, int $a_new_parent_id=0, int $obj_copy_id=0, bool $self_ass=true)
 Copy content of page; replace page components with copies where necessary (e.g. More...
 
 handleDeleteContent (?DOMNode $a_node=null, $move_operation=false)
 Handle content before deletion This currently treats only plugged content If no node is given, then the whole dom will be scanned. More...
 
 getXMLFromDom (bool $a_incl_head=false, bool $a_append_mobs=false, bool $a_append_bib=false, string $a_append_str="", bool $a_omit_pageobject_tag=false, int $style_id=0, bool $offline=false)
 get xml content of page from dom (use this, if any changes are made to the document) More...
 
 getLanguageVariablesXML (int $style_id=0)
 Get language variables as XML. More...
 
 getFirstParagraphText ()
 
 getParagraphForPCID (string $pcid)
 
 setContainsIntLink (bool $a_contains_link)
 lm parser set this flag to true, if the page contains intern links (this method should only be called by the import parser) todo: move to ilLMPageObject !? More...
 
 containsIntLink ()
 returns true, if page was marked as containing an intern link (via setContainsIntLink) (this method should only be called by the import parser) More...
 
 setImportMode (bool $a_val)
 
 getImportMode ()
 
 needsImportParsing (?bool $a_parse=null)
 
 setContainsQuestion (bool $a_val)
 
 getContainsQuestion ()
 
 collectMediaObjects (bool $a_inline_only=true)
 get all media objects, that are referenced and used within the page More...
 
 getInternalLinks ()
 get all internal links that are used within the page More...
 
 getMultimediaXML (bool $offline=false)
 get a xml string that contains all media object elements, that are referenced by any media alias in the page More...
 
 getMediaAliasElement (int $a_mob_id, int $a_nr=1)
 get complete media object (alias) element More...
 
 validateDom (bool $throw=false)
 Validate the page content agains page DTD. More...
 
 addHierIDs ()
 Add hierarchical ID (e.g. More...
 
 getHierIds ()
 
 stripHierIDs ()
 
 stripPCIDs ()
 
 getHierIdsForPCIds (array $a_pc_ids)
 Get hier ids for a set of pc ids. More...
 
 getHierIdForPcId (string $pcid)
 
 getPCIdsForHierIds (array $hier_ids)
 Get hier ids for a set of pc ids. More...
 
 getPCIdForHierId (string $hier_id)
 
 addFileSizes ()
 add file sizes More...
 
 resolveIntLinks (?array $a_link_map=null)
 Resolves all internal link targets of the page, if targets are available (after import) More...
 
 resolveMediaAliases (array $a_mapping, bool $a_reuse_existing_by_import=false)
 Resolve media aliases (after import) More...
 
 resolveIIMMediaAliases (array $a_mapping)
 Resolve iim media aliases (in ilContObjParse) More...
 
 resolveFileItems (array $a_mapping)
 Resolve file items (after import) More...
 
 resolveQuestionReferences (array $a_mapping)
 Resolve all quesiont references (after import) More...
 
 moveIntLinks (array $a_from_to)
 Move internal links from one destination to another. More...
 
 handleRepositoryLinksOnCopy (array $a_mapping, int $a_source_ref_id)
 Handle repository links on copy process. More...
 
 setEmptyPageXml ()
 
 createFromXML ()
 Create new page object with current xml content. More...
 
 updateFromXML ()
 Updates page object with current xml content This function is currently (8 beta) called by: More...
 
 afterUpdate (DOMDocument $domdoc, string $xml)
 After update. More...
 
 update (bool $a_validate=true, bool $a_no_history=false)
 update complete page content in db (dom xml content is used) More...
 
 delete ()
 
 saveStyleUsage (DOMDocument $a_domdoc, int $a_old_nr=0)
 Save all style class/template usages. More...
 
 deleteStyleUsages (int $a_old_nr=0)
 Delete style usages. More...
 
 getLastUpdateOfIncludedElements ()
 Get last update of included elements (media objects and files). More...
 
 deleteInternalLinks ()
 Delete internal links. More...
 
 saveInternalLinks (DOMDocument $a_domdoc)
 save internal links of page More...
 
 create (bool $a_import=false)
 create new page (with current xml data) More...
 
 deleteContent (string $a_hid, bool $a_update=true, string $a_pcid="", bool $move_operation=false)
 delete content object with hierarchical id $a_hid More...
 
 deleteContents (array $a_hids, bool $a_update=true, bool $a_self_ass=false, bool $move_operation=false)
 Delete multiple content objects. More...
 
 cutContents (array $a_hids)
 Copy contents to clipboard and cut them from the page. More...
 
 copyContents (array $a_hids)
 Copy contents to clipboard. More...
 
 pasteContents (string $a_hier_id, bool $a_self_ass=false)
 Paste contents from pc clipboard. More...
 
 switchEnableMultiple (array $a_hids, bool $a_update=true, bool $a_self_ass=false)
 (De-)activate elements More...
 
 insertContent (ilPageContent $a_cont_obj, string $a_pos, int $a_mode=IL_INSERT_AFTER, string $a_pcid="", bool $remove_placeholder=true)
 insert a content node before/after a sibling or as first child of a parent More...
 
 insertContentNode (DOMNode $a_cont_node, string $a_pos, int $a_mode=IL_INSERT_AFTER, string $a_pcid="")
 insert a content node before/after a sibling or as first child of a parent More...
 
 moveContentAfter (string $a_source, string $a_target, string $a_spcid="", string $a_tpcid="")
 move content object from position $a_source before position $a_target (both hierarchical content ids) More...
 
 insertInstIntoIDs (string $a_inst, bool $a_res_ref_to_obj_id=true)
 inserts installation id into ids (e.g. More...
 
 checkPCIds ()
 Check, whether (all) page content hashes are set. More...
 
 getAllPCIds ()
 Get all pc ids. More...
 
 hasDuplicatePCIds ()
 
 getDuplicatePCIds ()
 Get all duplicate PC Ids. More...
 
 generatePCId ()
 
 insertPCIds ()
 Insert Page Content IDs. More...
 
 sendParagraph (string $par_id, string $filename)
 
 registerOfflineHandler (object $handler)
 
 getOfflineHandler ()
 
 containsDeactivatedElements (string $a_content)
 Check whether content contains deactivated elements. More...
 
 getHistoryEntries ()
 Get History Entries. More...
 
 getHistoryEntry (int $a_old_nr)
 Get History Entry. More...
 
 getHistoryInfo (int $a_nr)
 Get information about a history entry, its predecessor and its successor. More...
 
 preparePageForCompare (ilPageObject $page)
 
 increaseViewCnt ()
 Increase view cnt. More...
 
 writeRenderedContent (string $a_content, string $a_md5)
 Write rendered content. More...
 
 containsIntLinks (string $a_content)
 Check whether content contains internal links. More...
 
 performAutomaticModifications ()
 Perform automatic modifications (may be overwritten by sub classes) More...
 
 saveInitialOpenedContent (string $a_type, int $a_id, string $a_target)
 Save initial opened content. More...
 
 getInitialOpenedContent ()
 Get initial opened content. More...
 
 beforePageContentUpdate (ilPageContent $a_page_content)
 Before page content update Note: This one is "work in progress", currently only text paragraphs call this hook It is called before the page content object invokes the update procedure of ilPageObject. More...
 
 copy (int $a_id, string $a_parent_type="", int $a_new_parent_id=0, bool $a_clone_mobs=false, int $obj_copy_id=0, bool $overwrite_existing=true)
 Copy page. More...
 
 copyPageToTranslation (string $a_target_lang)
 Copy page to translation. More...
 
 getEditLock ()
 Get page lock. More...
 
 releasePageLock ()
 Release page lock. More...
 
 getEditLockInfo ()
 Get edit lock info. More...
 
 getContentTemplates ()
 Get content templates. More...
 
 getEffectiveEditLockTime ()
 
 resolveResources (array $ref_mapping)
 Resolve resources. More...
 
 getRepoObjId ()
 Get object id of repository object that contains this page, return 0 if page does not belong to a repo object. More...
 
 getPCModel ()
 Get page component model. More...
 
 assignCharacteristic (array $targets, string $char_par, string $char_sec, string $char_med, string $char_tab="")
 Assign characteristic. More...
 

Static Public Member Functions

static getAnswerFormMapping ()
 2026-06-30, sk:This is awfull, but as there are statics used in the copy process this is the only way I found to do this. More...
 
static setAnswerFormMapping (array $answer_form_mapping)
 
- Static Public Member Functions inherited from ilPageObject
static _exists (string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
 Checks whether page exists. More...
 
static _existsAndNotEmpty (string $a_parent_type, int $a_id, string $a_lang="-")
 Checks whether page exists and is not empty (may return true on some empty pages) More...
 
static getAllPages (string $a_parent_type, int $a_parent_id, string $a_lang="-")
 Get all pages for parent object. More...
 
static getPagesWithLinks (string $a_parent_type, int $a_parent_id, string $a_lang="-")
 Get all pages for parent object that contain internal links. More...
 
static lookupTranslations (string $a_parent_type, int $a_id)
 Lookup translations. More...
 
static truncateHTML (string $a_text, int $a_length=100, string $a_ending='...', bool $a_exact=false, bool $a_consider_html=true)
 Truncate (html) string. More...
 
static getLastChangeByParent (string $a_parent_type, int $a_parent_id, string $a_lang="")
 Get all pages for parent object. More...
 

Private Attributes

UuidFactory $uuid_factory
 
readonly Edit $edit_view
 
Question $question
 
Attempt $attempt_data = null
 
Viewable $participant_view = null
 
RequiredCapabilities $required_capabilites = null
 
ViewConfiguration $view_configuration = null
 

Static Private Attributes

static array $answer_form_mapping = []
 

Additional Inherited Members

- Data Fields inherited from ilPageObject
int $old_nr
 
DOMDocument $dom = null
 
string $xml = ""
 
string $encoding = ""
 
DomNode $node
 
string $cur_dtd = "ilias_pg_12.dtd"
 
bool $contains_int_link = false
 
bool $needs_parsing = false
 
string $parent_type = ""
 
int $parent_id = 0
 
array $update_listeners = []
 
int $update_listener_cnt = 0
 
object $offline_handler = null
 
bool $dom_builded = false
 
bool $history_saved = false
 
int $last_change_user = 0
 
- Static Public Attributes inherited from ilPageObject
static array $exists = array()
 
- Protected Member Functions inherited from ilPageObject
 getIliasAbsolutePath ()
 
 getLangVarXML (string $var)
 
 getCharacteristicLangVarXML (string $type, string $char, string $txt)
 
 getLangVarXMLForValue (string $var, string $val)
 
 __afterUpdate (DOMDocument $a_domdoc, string $a_xml, bool $a_creation=false, bool $a_empty=false)
 After update event handler (internal). More...
 
 isTranslationPage ()
 
 __beforeDelete ()
 Before deletion handler (internal). More...
 
 __afterDelete ()
 
 afterDelete ()
 
 __afterHistoryEntry (DOMDocument $a_old_domdoc, string $a_old_content, int $a_old_nr)
 
 getContentManager ()
 
 setCopyProperties (ilPageObject $new_page)
 
 setTranslationProperties (self $transl_page)
 
- Protected Attributes inherited from ilPageObject
ILIAS COPage InternalDomainService $domain
 
ILIAS COPage Dom DomUtil $dom_util
 
ILIAS COPage Link LinkManager $link
 
ILIAS COPage PC PCDefinition $pc_definition
 
int $create_user = 0
 
array $id_elements
 
bool $page_not_found = false
 
bool $show_page_act_info = false
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilObjUser $user
 
ilLanguage $lng
 
ilTree $tree
 
LOMServices $lom_services
 
int $id
 
string $language = "-"
 
bool $import_mode = false
 
ilLogger $log
 
array $page_record = array()
 
bool $active = false
 
ilPageConfig $page_config
 
string $rendermd5 = ""
 
string $renderedcontent = ""
 
string $renderedtime = ""
 
string $lastchange = ""
 
bool $contains_question = false
 
array $hier_ids = []
 
string $activationstart = null
 
string $activationend = null
 
ILIAS COPage ReadingTime ReadingTimeManager $reading_time_manager
 
string $concrete_lang = ""
 
ILIAS COPage ID ContentIdManager $content_id_manager
 
ILIAS COPage Page PageManagerInterface $page_manager
 
ILIAS COPage Style StyleManager $style_manager
 
ILIAS COPage PC DomainService $pc_service
 
ILIAS COPage History HistoryManager $history_manager
 

Detailed Description

Definition at line 29 of file QstsQuestionPage.php.

Member Function Documentation

◆ addQuestionText()

QstsQuestionPage::addQuestionText ( string  $text)

Definition at line 174 of file QstsQuestionPage.php.

176 : void {
177 $this->buildDom();
178
179 $lng = $this->user->getLanguage();
180 if ($lng === '') {
181 $lng = 'de';
182 }
183
184 $page_element = new \ilPCParagraph($this);
185 $page_element->create($this, 'pg');
186 $page_element->setLanguage($lng);
187 $page_element->setText($text);
188
189 $this->update();
190 }
update(bool $a_validate=true, bool $a_no_history=false)
update complete page content in db (dom xml content is used)
buildDom(bool $a_force=false)
$text
Definition: xapiexit.php:21

References $lng.

◆ afterConstructor()

QstsQuestionPage::afterConstructor ( )

Reimplemented from ilPageObject.

Definition at line 43 of file QstsQuestionPage.php.

43 : void
44 {
45 $this->uuid_factory = new UuidFactory();
46 }

◆ cutContents()

QstsQuestionPage::cutContents ( array  $a_hids)

Copy contents to clipboard and cut them from the page.

Returns
array|bool
Exceptions
ilDateTimeException

Reimplemented from ilPageObject.

Definition at line 141 of file QstsQuestionPage.php.

143 : array|bool {
144 return parent::cutContents(
145 array_filter(
146 $page_content_ids,
147 fn(string $v): bool => $this->page_manager
148 ->content($this->getDomDoc())
149 ->getContentDomNode(...explode(':', $v))
150 ?->getElementsByTagName('AnswerForm')
151 ?->length < 1
152 )
153 );
154 }
getContentDomNode(string $a_hier_id, string $a_pc_id="")
getDomDoc()
Get dom doc (DOMDocument)

◆ getAnswerFormMapping()

static QstsQuestionPage::getAnswerFormMapping ( )
static

2026-06-30, sk:This is awfull, but as there are statics used in the copy process this is the only way I found to do this.

If somebody has a better idea...

Returns
array|null

Definition at line 163 of file QstsQuestionPage.php.

163 : array
164 {
166 }
static array $answer_form_mapping

◆ getAttemptData()

QstsQuestionPage::getAttemptData ( )

Definition at line 87 of file QstsQuestionPage.php.

◆ getEditView()

QstsQuestionPage::getEditView ( )

Definition at line 54 of file QstsQuestionPage.php.

References $edit_view.

◆ getParentType()

QstsQuestionPage::getParentType ( )

Reimplemented from ilPageObject.

Definition at line 49 of file QstsQuestionPage.php.

49 : string
50 {
51 return 'qsts';
52 }

◆ getParticipantView()

QstsQuestionPage::getParticipantView ( )

◆ getQuestion()

QstsQuestionPage::getQuestion ( )

Definition at line 65 of file QstsQuestionPage.php.

◆ getRequiredCapabilities()

QstsQuestionPage::getRequiredCapabilities ( )

◆ getViewConfiguration()

QstsQuestionPage::getViewConfiguration ( )

◆ pasteContents()

QstsQuestionPage::pasteContents ( string  $a_hier_id,
bool  $a_self_ass = false 
)

Paste contents from pc clipboard.

Returns
array|bool
Exceptions
ilDateTimeException

Reimplemented from ilPageObject.

Definition at line 121 of file QstsQuestionPage.php.

124 : array|bool {
125 $answer_form_element = $this->page_manager
126 ->content($this->getDomDoc())
127 ->getContentDomNode(...explode(':', $page_content_id))
128 ?->getElementsByTagName(ilPCAnswerForm::ANSWER_FORM_ELEMENT_TAG);
129
130 if ($answer_form_element?->length > 0) {
131 foreach ($answer_form_element->getIterator() as $node) {
132 self::$answer_form_mapping[$node->getAttribute(ilPCAnswerForm::ANSWER_FORM_ID_ATTRIBUTE)]
133 = $this->uuid_factory->uuid4AsString();
134 }
135 }
136
137 return parent::pasteContents($page_content_id, $a_self_ass);
138 }
const string ANSWER_FORM_ID_ATTRIBUTE
const string ANSWER_FORM_ELEMENT_TAG

References ilPCAnswerForm\ANSWER_FORM_ID_ATTRIBUTE.

◆ setAnswerFormMapping()

static QstsQuestionPage::setAnswerFormMapping ( array  $answer_form_mapping)
static

Definition at line 168 of file QstsQuestionPage.php.

170 : void {
171 self::$answer_form_mapping = $answer_form_mapping;
172 }

◆ setAttemptData()

QstsQuestionPage::setAttemptData ( ?Attempt  $attempt_data)

Definition at line 92 of file QstsQuestionPage.php.

94 : void {
95 $this->attempt_data = $attempt_data;
96 }

◆ setEditView()

QstsQuestionPage::setEditView ( Edit  $edit_view)

Definition at line 59 of file QstsQuestionPage.php.

61 : void {
62 $this->edit_view = $edit_view;
63 }

◆ setParticipantView()

QstsQuestionPage::setParticipantView ( Viewable  $participant_view)

Definition at line 81 of file QstsQuestionPage.php.

83 : void {
84 $this->participant_view = $participant_view;
85 }

◆ setQuestion()

QstsQuestionPage::setQuestion ( Question  $question)

Definition at line 70 of file QstsQuestionPage.php.

72 : void {
73 $this->question = $question;
74 }

◆ setRequiredCapabilities()

QstsQuestionPage::setRequiredCapabilities ( RequiredCapabilities  $required_capabilities)

Definition at line 103 of file QstsQuestionPage.php.

105 : void {
106 $this->required_capabilites = $required_capabilities;
107 }

◆ setViewConfiguration()

QstsQuestionPage::setViewConfiguration ( ViewConfiguration  $view_configuration)

Definition at line 114 of file QstsQuestionPage.php.

116 : void {
117 $this->view_configuration = $view_configuration;
118 }

Field Documentation

◆ $answer_form_mapping

array QstsQuestionPage::$answer_form_mapping = []
staticprivate

Definition at line 40 of file QstsQuestionPage.php.

◆ $attempt_data

Attempt QstsQuestionPage::$attempt_data = null
private

Definition at line 35 of file QstsQuestionPage.php.

◆ $edit_view

readonly Edit QstsQuestionPage::$edit_view
private

Definition at line 33 of file QstsQuestionPage.php.

Referenced by getEditView().

◆ $participant_view

Viewable QstsQuestionPage::$participant_view = null
private

Definition at line 36 of file QstsQuestionPage.php.

◆ $question

Question QstsQuestionPage::$question
private

Definition at line 34 of file QstsQuestionPage.php.

◆ $required_capabilites

RequiredCapabilities QstsQuestionPage::$required_capabilites = null
private

Definition at line 37 of file QstsQuestionPage.php.

◆ $uuid_factory

UuidFactory QstsQuestionPage::$uuid_factory
private

Definition at line 31 of file QstsQuestionPage.php.

◆ $view_configuration

ViewConfiguration QstsQuestionPage::$view_configuration = null
private

Definition at line 38 of file QstsQuestionPage.php.


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