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
5include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
6include_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
46 {
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 {
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}
user()
Definition: user.php:4
$users
Definition: authpage.php:44
$_GET["client_id"]
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
Extension of ilPageObjectGUI for learning modules.
onFeedbackEditingForwarding()
On feedback editing forwarding.
processAnswer()
Process answer.
__construct($a_id=0, $a_old_nr=0, $a_prevent_get_id=false, $a_lang="")
Constructor.
static getNotificationsForObject($type, $id, $page_id=null, $ignore_threshold=false)
Get all users for given object.
static _lookupRestrictForwardNavigation($a_obj_id)
Lookup forward restriction navigation.
static _lookupStoreTries($a_id)
Lookup disable default feedback.
static _lookupDisableDefaultFeedback($a_id)
Lookup disable default feedback.
Class ilPageObjectGUI.
getPageObject()
Get Page Object.
getPageConfig()
Get page config object.
static lookupParentId($a_id, $a_type)
Lookup parent id.
static getAnswerStatus($a_q_id, $a_user_id=0)
Get statistics for question.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$as
if(!array_key_exists('StateId', $_REQUEST)) $id
global $DIC
Definition: saml.php:7
global $ilDB
$ilUser
Definition: imgupload.php:18