ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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  protected $db;
23 
27  public function __construct($a_id = 0, $a_old_nr = 0, $a_prevent_get_id = false, $a_lang = "")
28  {
29  global $DIC;
30 
31  $this->lng = $DIC->language();
32  $this->user = $DIC->user();
33  $this->db = $DIC->database();
34  $this->plugin_admin = $DIC["ilPluginAdmin"];
35  $this->log = $DIC["ilLog"];
36  parent::__construct("lm", $a_id, $a_old_nr, $a_prevent_get_id, $a_lang);
37 
38  include_once("./Modules/LearningModule/classes/class.ilObjContentObject.php");
39  $this->getPageConfig()->setUseStoredQuestionTries(ilObjContentObject::_lookupStoreTries($this->getPageObject()->getParentId()));
40  }
41 
45  public function onFeedbackEditingForwarding()
46  {
47  $lng = $this->lng;
48 
49  if (strtolower($_GET["cmdClass"]) == "ilassquestionfeedbackeditinggui") {
50  include_once("./Modules/LearningModule/classes/class.ilObjContentObject.php");
52  ilUtil::sendInfo($lng->txt("cont_def_feedb_deactivated"));
53  } else {
54  ilUtil::sendInfo($lng->txt("cont_def_feedb_activated"));
55  }
56  }
57  }
58 
62  public function processAnswer()
63  {
65  $ilDB = $this->db;
66  $lng = $this->lng;
67  $ilPluginAdmin = $this->plugin_admin;
69 
70  parent::processAnswer();
71 
72  //
73  // Send notifications to authors that want to be informed on blocked users
74  //
75 
76  $parent_id = ilPageObject::lookupParentId((int) $_GET["page_id"], "lm");
77 
78  // is restriction mode set?
79  include_once("./Modules/LearningModule/classes/class.ilObjContentObject.php");
81  // check if user is blocked
83 
84  include_once("./Services/COPage/classes/class.ilPageQuestionProcessor.php");
86  // get question information
87  include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionList.php");
88  $qlist = new ilAssQuestionList($ilDB, $lng, $ilPluginAdmin);
89  $qlist->setParentObjId(0);
90  $qlist->setJoinObjectData(false);
91  $qlist->addFieldFilter("question_id", array($id));
92  $qlist->load();
93  $qdata = $qlist->getQuestionDataArray();
94  // has the user been blocked?
95  if ($as["try"] >= $qdata[$as["qst_id"]]["nr_of_tries"] && $qdata[$as["qst_id"]]["nr_of_tries"] > 0 && !$as["passed"]) {
96  include_once "./Services/Notification/classes/class.ilNotification.php";
98 
99  if (count($users) > 0) {
100  include_once("./Modules/LearningModule/classes/class.ilLMMailNotification.php");
101  $not = new ilLMMailNotification();
103  $not->setQuestionId($id);
104  $not->setRefId((int) $_GET["ref_id"]);
105  $not->setRecipients($users);
106  $not->send();
107  }
108  }
109  }
110  }
111 }
static _lookupDisableDefaultFeedback($a_id)
Lookup disable default feedback.
getPageObject()
Get Page Object.
global $DIC
Definition: saml.php:7
$_GET["client_id"]
Class ilPageObjectGUI.
if(!array_key_exists('StateId', $_REQUEST)) $id
user()
Definition: user.php:4
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.
$as
$ilUser
Definition: imgupload.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$users
Definition: authpage.php:44
processAnswer()
Process answer.
onFeedbackEditingForwarding()
On feedback editing forwarding.
__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
$_POST["username"]