ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilPCQuestionOverview.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5require_once("./Services/COPage/classes/class.ilPageContent.php");
6
16{
17 var $dom;
19
23 function init()
24 {
25 $this->setType("qover");
26 }
27
31 function setNode(&$a_node)
32 {
33 parent::setNode($a_node); // this is the PageContent node
34 $this->qover_node = $a_node->first_child(); // this is the question overview node
35 }
36
43 function create(&$a_pg_obj, $a_hier_id, $a_pc_id = "")
44 {
45 $this->node = $this->createPageContentNode();
46 $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
47 $this->qover_node = $this->dom->create_element("QuestionOverview");
48 $this->qover_node = $this->node->append_child($this->qover_node);
49 $this->qover_node->set_attribute("ShortMessage", "y");
50 }
51
57 function setShortMessage($a_val)
58 {
59 if ($a_val)
60 {
61 $this->qover_node->set_attribute("ShortMessage", "y");
62 }
63 else
64 {
65 if ($this->qover_node->has_attribute("ShortMessage"))
66 {
67 $this->qover_node->remove_attribute("ShortMessage");
68 }
69 }
70 }
71
77 function getShortMessage()
78 {
79 if (is_object($this->qover_node))
80 {
81 if ($this->qover_node->get_attribute("ShortMessage") == "y")
82 {
83 return true;
84 }
85 }
86 return false;
87 }
88
94 function setListWrongQuestions($a_val)
95 {
96 if ($a_val)
97 {
98 $this->qover_node->set_attribute("ListWrongQuestions", "y");
99 }
100 else
101 {
102 if ($this->qover_node->has_attribute("ListWrongQuestions"))
103 {
104 $this->qover_node->remove_attribute("ListWrongQuestions");
105 }
106 }
107 }
108
115 {
116 if (is_object($this->qover_node))
117 {
118 if ($this->qover_node->get_attribute("ListWrongQuestions") == "y")
119 {
120 return true;
121 }
122 }
123 return false;
124 }
125
126}
127
128?>
const IL_INSERT_AFTER
Question overview page content element.
setShortMessage($a_val)
Set short message.
getListWrongQuestions()
Get list wrong questions.
create(&$a_pg_obj, $a_hier_id, $a_pc_id="")
Create question overview node in xml.
setListWrongQuestions($a_val)
Set list wrong questions.
init()
Init page content component.
getShortMessage()
Get short message.
Class ilPageContent.
createPageContentNode($a_set_this_node=true)
Create page content node (always use this method first when adding a new element)
setType($a_type)
Set Type.