ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
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 
59  parent::processAnswer();
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);
79  $qlist->setParentObjId(0);
80  $qlist->setJoinObjectData(false);
81  $qlist->addFieldFilter("question_id", array($id));
82  $qlist->load();
83  $qdata = $qlist->getQuestionDataArray();
84  // has the user been blocked?
85  if ($as["try"] >= $qdata[$as["qst_id"]]["nr_of_tries"] && $qdata[$as["qst_id"]]["nr_of_tries"] > 0 && !$as["passed"])
86  {
87  include_once "./Services/Notification/classes/class.ilNotification.php";
89 
90  if (count($users) > 0)
91  {
92  include_once("./Modules/LearningModule/classes/class.ilLMMailNotification.php");
93  $not = new ilLMMailNotification();
95  $not->setQuestionId($id);
96  $not->setRefId((int) $_GET["ref_id"]);
97  $not->setRecipients($users);
98  $not->send();
99  }
100  }
101 
102  }
103  }
104 
105 }
106 
107 ?>
static _lookupDisableDefaultFeedback($a_id)
Lookup disable default feedback.
$_POST['username']
Definition: cron.php:12
getPageObject()
Get Page Object.
$_GET["client_id"]
Class ilPageObjectGUI.
static getNotificationsForObject($type, $id, $page_id=null, $ignore_threshold=false)
Get all users for given object.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static lookupParentId($a_id, $a_type)
Lookup parent id.
static getAnswerStatus($a_q_id, $a_user_id=0)
Get statistics for question.
getPageConfig()
Get page config object.
Extension of ilPageObjectGUI for learning modules.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
processAnswer()
Process answer.
onFeedbackEditingForwarding()
On feedback editing forwarding.
global $ilUser
Definition: imgupload.php:15
__construct($a_id=0, $a_old_nr=0, $a_prevent_get_id=false, $a_lang="")
Constructor.
static _lookupRestrictForwardNavigation($a_obj_id)
Lookup forward restriction navigation.
static _lookupStoreTries($a_id)
Lookup disable default feedback.
global $ilDB