ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
5 require_once("./Services/COPage/classes/class.ilPageContent.php");
6 
16 {
17  public $dom;
18  public $qover_node;
19 
23  public function init()
24  {
25  $this->setType("qover");
26  }
27 
31  public 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  public 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  public function setShortMessage($a_val)
58  {
59  if ($a_val) {
60  $this->qover_node->set_attribute("ShortMessage", "y");
61  } else {
62  if ($this->qover_node->has_attribute("ShortMessage")) {
63  $this->qover_node->remove_attribute("ShortMessage");
64  }
65  }
66  }
67 
73  public function getShortMessage()
74  {
75  if (is_object($this->qover_node)) {
76  if ($this->qover_node->get_attribute("ShortMessage") == "y") {
77  return true;
78  }
79  }
80  return false;
81  }
82 
88  public function setListWrongQuestions($a_val)
89  {
90  if ($a_val) {
91  $this->qover_node->set_attribute("ListWrongQuestions", "y");
92  } else {
93  if ($this->qover_node->has_attribute("ListWrongQuestions")) {
94  $this->qover_node->remove_attribute("ListWrongQuestions");
95  }
96  }
97  }
98 
104  public function getListWrongQuestions()
105  {
106  if (is_object($this->qover_node)) {
107  if ($this->qover_node->get_attribute("ListWrongQuestions") == "y") {
108  return true;
109  }
110  }
111  return false;
112  }
113 }
getShortMessage()
Get short message.
Question overview page content element.
setListWrongQuestions($a_val)
Set list wrong questions.
setShortMessage($a_val)
Set short message.
create(&$a_pg_obj, $a_hier_id, $a_pc_id="")
Create question overview node in xml.
setType($a_type)
Set Type.
Class ilPageContent.
getListWrongQuestions()
Get list wrong questions.
init()
Init page content component.
const IL_INSERT_AFTER
createPageContentNode($a_set_this_node=true)
Create page content node (always use this method first when adding a new element) ...