ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilLMPageGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
6 include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
7 
18 {
22  function __construct($a_id = 0, $a_old_nr = 0,
23  $a_prevent_get_id = false, $a_lang = "")
24  {
25  parent::__construct("lm", $a_id, $a_old_nr, $a_prevent_get_id, $a_lang);
26 
27  include_once("./Modules/LearningModule/classes/class.ilObjContentObject.php");
28  $this->getPageConfig()->setUseStoredQuestionTries(ilObjContentObject::_lookupStoreTries($this->getPageObject()->getParentId()));
29  }
30 
35  {
36  global $lng;
37 
38  if (strtolower($_GET["cmdClass"]) == "ilassquestionfeedbackeditinggui")
39  {
40  include_once("./Modules/LearningModule/classes/class.ilObjContentObject.php");
42  {
43  ilUtil::sendInfo($lng->txt("cont_def_feedb_deactivated"));
44  }
45  else
46  {
47  ilUtil::sendInfo($lng->txt("cont_def_feedb_activated"));
48  }
49  }
50  }
51 
55  function processAnswer()
56  {
57  global $ilUser, $ilDB, $lng, $ilPluginAdmin, $ilLog;
58 
60 
61  //
62  // Send notifications to authors that want to be informed on blocked users
63  //
64 
65  $parent_id = ilPageObject::lookupParentId((int) $_GET["page_id"], "lm");
66 
67  // is restriction mode set?
68  include_once("./Modules/LearningModule/classes/class.ilObjContentObject.php");
70  {
71  // check if user is blocked
72  $id = ilUtil::stripSlashes($_POST["id"]);
73 
74  include_once("./Services/COPage/classes/class.ilPageQuestionProcessor.php");
75  $as = ilPageQuestionProcessor::getAnswerStatus($id, $ilUser->getId());
76  // get question information
77  include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionList.php");
78  $qlist = new ilAssQuestionList($ilDB, $lng, $ilPluginAdmin, 0);
79  $qlist->addFieldFilter("question_id", array($id));
80  $qlist->load();
81  $qdata = $qlist->getQuestionDataArray();
82  // has the user been blocked?
83  if ($as["try"] >= $qdata[$as["qst_id"]]["nr_of_tries"] && $qdata[$as["qst_id"]]["nr_of_tries"] > 0 && !$as["passed"])
84  {
85  include_once "./Services/Notification/classes/class.ilNotification.php";
87 
88  if (count($users) > 0)
89  {
90  include_once("./Modules/LearningModule/classes/class.ilLMMailNotification.php");
91  $not = new ilLMMailNotification();
93  $not->setQuestionId($id);
94  $not->setRefId((int) $_GET["ref_id"]);
95  $not->setRecipients($users);
96  $not->send();
97  }
98  }
99 
100  }
101  }
102 
103 }
104 
105 ?>