ILIAS  release_7 Revision v7.30-3-g800a261c036
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
15{
19 protected $db;
20
24 protected $refinery;
25
29 public function __construct(
30 $a_id = 0,
31 $a_old_nr = 0,
32 $a_prevent_get_id = false,
33 $a_lang = "",
34 $concrete_lang = ""
35 ) {
36 global $DIC;
37 $this->lng = $DIC->language();
38 $this->user = $DIC->user();
39 $this->db = $DIC->database();
40 $this->plugin_admin = $DIC["ilPluginAdmin"];
41 $this->log = $DIC["ilLog"];
42 $this->refinery = $DIC['refinery'];
43 parent::__construct("lm", $a_id, $a_old_nr, $a_prevent_get_id, $a_lang, $concrete_lang);
44
45 $this->getPageConfig()->setUseStoredQuestionTries(ilObjContentObject::_lookupStoreTries($this->getPageObject()->getParentId()));
46 }
47
52 {
54
55 if (strtolower($_GET["cmdClass"]) == "ilassquestionfeedbackeditinggui") {
57 ilUtil::sendInfo($lng->txt("cont_def_feedb_deactivated"));
58 } else {
59 ilUtil::sendInfo($lng->txt("cont_def_feedb_activated"));
60 }
61 }
62 }
63
67 public function processAnswer()
68 {
73 $ilPluginAdmin = $this->plugin_admin;
74 $ilLog = $this->log;
75
76 parent::processAnswer();
77
78 //
79 // Send notifications to authors that want to be informed on blocked users
80 //
81
82 $parent_id = ilPageObject::lookupParentId((int) $_GET["page_id"], "lm");
83
84 // is restriction mode set?
86 // check if user is blocked
87 $id = ilUtil::stripSlashes($_POST["id"]);
88
90 // get question information
91 $qlist = new ilAssQuestionList($ilDB, $lng, $refinery, $ilPluginAdmin);
92 $qlist->setParentObjId(0);
93 $qlist->setJoinObjectData(false);
94 $qlist->addFieldFilter("question_id", array($id));
95 $qlist->load();
96 $qdata = $qlist->getQuestionDataArray();
97 // has the user been blocked?
98 if ($as["try"] >= $qdata[$as["qst_id"]]["nr_of_tries"] && $qdata[$as["qst_id"]]["nr_of_tries"] > 0 && !$as["passed"]) {
100
101 if (count($users) > 0) {
102 $not = new ilLMMailNotification();
104 $not->setQuestionId($id);
105 $not->setRefId((int) $_GET["ref_id"]);
106 $not->setRecipients($users);
107 $not->send();
108 }
109 }
110 }
111 }
112
113 public function finishEditing() : void
114 {
115 $lm_tree = new ilLMTree($this->getPageObject()->getParentId());
116 if ($lm_tree->isInTree($this->getPageObject()->getId())) {
117 $parent_id = $lm_tree->getParentId($this->getPageObject()->getId());
118 $this->ctrl->setParameterByClass(
119 ilStructureObjectGUI::class,
120 "obj_id",
121 $parent_id
122 );
123 $this->ctrl->redirectByClass([
124 ilObjLearningModuleGUI::class,
125 ilStructureObjectGUI::class
126 ], "view");
127 }
128 $this->ctrl->redirectByClass(
129 ilObjLearningModuleGUI::class,
130 "pages"
131 );
132 }
133}
user()
Definition: user.php:4
$_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.
__construct( $a_id=0, $a_old_nr=0, $a_prevent_get_id=false, $a_lang="", $concrete_lang="")
Constructor.
processAnswer()
Process answer.
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.
global $DIC
Definition: goto.php:24
$ilUser
Definition: imgupload.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $ilDB