ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilQuestionEditGUI Class Reference

Class ilQuestionEditGUI. More...

+ Collaboration diagram for ilQuestionEditGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 setSelfAssessmentEditingMode ($a_selfassessmenteditingmode)
 Set Self-Assessment Editing Mode. More...
 
 getSelfAssessmentEditingMode ()
 Get Self-Assessment Editing Mode. More...
 
 setDefaultNrOfTries ($a_defaultnroftries)
 Set Default Nr of Tries. More...
 
 getDefaultNrOfTries ()
 Get Default Nr of Tries. More...
 
 setPageConfig ($a_val)
 Set Page Config. More...
 
 getPageConfig ()
 Get Page Config. More...
 
 addNewIdListener (&$a_object, $a_method, $a_parameters="")
 Add a listener that is notified with the new question ID, when a new question is saved. More...
 
 executeCommand ()
 execute command More...
 
 setQuestionId ($a_questionid)
 Set Question Id. More...
 
 getQuestionId ()
 Get Question Id. More...
 
 setPoolRefId ($a_poolrefid)
 Set Pool Ref ID. More...
 
 getPoolRefId ()
 Get Pool Ref ID. More...
 
 setPoolObjId ($a_poolobjid)
 Set Pool Obj Id. More...
 
 getPoolObjId ()
 Get Pool Obj Id. More...
 
 setQuestionType ($a_questiontype)
 Set Question Type. More...
 
 getQuestionType ()
 Get Question Type. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilQuestionEditGUI::__construct ( )

Constructor.

Definition at line 24 of file class.ilQuestionEditGUI.php.

References $_GET, $ilCtrl, $lng, array, setPoolObjId(), setPoolRefId(), setQuestionId(), and setQuestionType().

25  {
26  global $ilCtrl, $lng;
27 
28  if ($_GET["qpool_ref_id"]) {
29  $this->setPoolRefId($_GET["qpool_ref_id"]);
30  } elseif ($_GET["qpool_obj_id"]) {
31  $this->setPoolObjId($_GET["qpool_obj_id"]);
32  }
33  $this->setQuestionId($_GET["q_id"]);
34  $this->setQuestionType($_GET["q_type"]);
35  $lng->loadLanguageModule("assessment");
36 
37  $ilCtrl->saveParameter($this, array("qpool_ref_id", "qpool_obj_id", "q_id", "q_type"));
38 
39  $this->new_id_listeners = array();
40  $this->new_id_listener_cnt = 0;
41  }
$_GET["client_id"]
setPoolRefId($a_poolrefid)
Set Pool Ref ID.
setQuestionType($a_questiontype)
Set Question Type.
global $ilCtrl
Definition: ilias.php:18
setQuestionId($a_questionid)
Set Question Id.
setPoolObjId($a_poolobjid)
Set Pool Obj Id.
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

Member Function Documentation

◆ addNewIdListener()

ilQuestionEditGUI::addNewIdListener ( $a_object,
  $a_method,
  $a_parameters = "" 
)

Add a listener that is notified with the new question ID, when a new question is saved.

Definition at line 108 of file class.ilQuestionEditGUI.php.

109  {
110  $cnt = $this->new_id_listener_cnt;
111  $this->new_id_listeners[$cnt]["object"] =&$a_object;
112  $this->new_id_listeners[$cnt]["method"] = $a_method;
113  $this->new_id_listeners[$cnt]["parameters"] = $a_parameters;
114  $this->new_id_listener_cnt++;
115  }

◆ executeCommand()

ilQuestionEditGUI::executeCommand ( )

execute command

Definition at line 120 of file class.ilQuestionEditGUI.php.

References $i, $ilCtrl, $lng, $ret, assQuestionGUI\_getQuestionGUI(), getDefaultNrOfTries(), getPageConfig(), getPoolObjId(), getQuestionId(), getQuestionType(), getSelfAssessmentEditingMode(), and ilUtil\sendInfo().

121  {
122  global $ilCtrl,$lng;
123 
124  $cmd = $ilCtrl->getCmd();
125  $next_class = $ilCtrl->getNextClass();
126 
127  //echo "-".$cmd."-".$next_class."-".$_GET["q_id"]."-";
128 
129  switch ($next_class) {
130  default:
131  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
133  $this->getQuestionType(),
134  $this->getQuestionId()
135  );
136  $q_gui->object->setSelfAssessmentEditingMode(
138  );
139  $q_gui->object->setDefaultNrOfTries(
140  $this->getDefaultNrOfTries()
141  );
142 
143  if (is_object($this->page_config)) {
144  $q_gui->object->setPreventRteUsage($this->getPageConfig()->getPreventRteUsage());
145  }
146  $q_gui->object->setObjId((int) $this->getPoolObjId());
147 
148  for ($i=0; $i<$this->new_id_listener_cnt; $i++) {
149  $object =&$this->new_id_listeners[$i]["object"];
150  $method = $this->new_id_listeners[$i]["method"];
151  $parameters = $this->new_id_listeners[$i]["parameters"];
152  $q_gui->addNewIdListener(
153  $object,
154  $method,
155  $parameters
156  );
157  //var_dump($object);
158 //var_dump($method);
159 //var_dump($parameters);
160  }
161 
162  //$q_gui->setQuestionTabs();
163  $count = $q_gui->object->isInUse();
164  if ($count > 0) {
165  global $rbacsystem;
166  if ($rbacsystem->checkAccess("write", $this->pool_ref_id)) {
167  ilUtil::sendInfo(sprintf($lng->txt("qpl_question_is_in_use"), $count));
168  }
169  }
170  $ilCtrl->setCmdClass(get_class($q_gui));
171  $ret = $ilCtrl->forwardCommand($q_gui);
172  break;
173  }
174 
175  return $ret;
176  }
getQuestionId()
Get Question Id.
getQuestionType()
Get Question Type.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
getPoolObjId()
Get Pool Obj Id.
getSelfAssessmentEditingMode()
Get Self-Assessment Editing Mode.
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
getDefaultNrOfTries()
Get Default Nr of Tries.
global $lng
Definition: privfeed.php:17
$ret
Definition: parser.php:6
$i
Definition: disco.tpl.php:19
getPageConfig()
Get Page Config.
+ Here is the call graph for this function:

◆ getDefaultNrOfTries()

ilQuestionEditGUI::getDefaultNrOfTries ( )

Get Default Nr of Tries.

Returns
int Default Nr of Tries

Definition at line 78 of file class.ilQuestionEditGUI.php.

Referenced by executeCommand().

79  {
80  return $this->defaultnroftries;
81  }
+ Here is the caller graph for this function:

◆ getPageConfig()

ilQuestionEditGUI::getPageConfig ( )

Get Page Config.

Returns
object Page Config

Definition at line 98 of file class.ilQuestionEditGUI.php.

Referenced by executeCommand().

99  {
100  return $this->page_config;
101  }
+ Here is the caller graph for this function:

◆ getPoolObjId()

ilQuestionEditGUI::getPoolObjId ( )

Get Pool Obj Id.

Returns
int Pool Obj Id

Definition at line 239 of file class.ilQuestionEditGUI.php.

Referenced by executeCommand().

240  {
241  return $this->poolobjid;
242  }
+ Here is the caller graph for this function:

◆ getPoolRefId()

ilQuestionEditGUI::getPoolRefId ( )

Get Pool Ref ID.

Returns
int Pool Ref ID

Definition at line 217 of file class.ilQuestionEditGUI.php.

Referenced by setPoolRefId().

218  {
219  return $this->poolrefid;
220  }
+ Here is the caller graph for this function:

◆ getQuestionId()

ilQuestionEditGUI::getQuestionId ( )

Get Question Id.

Returns
int Question Id

Definition at line 194 of file class.ilQuestionEditGUI.php.

Referenced by executeCommand().

195  {
196  return $this->questionid;
197  }
+ Here is the caller graph for this function:

◆ getQuestionType()

ilQuestionEditGUI::getQuestionType ( )

Get Question Type.

Returns
string Question Type

Definition at line 260 of file class.ilQuestionEditGUI.php.

Referenced by executeCommand().

261  {
262  return $this->questiontype;
263  }
+ Here is the caller graph for this function:

◆ getSelfAssessmentEditingMode()

ilQuestionEditGUI::getSelfAssessmentEditingMode ( )

Get Self-Assessment Editing Mode.

Returns
boolean Self-Assessment Editing Mode

Definition at line 58 of file class.ilQuestionEditGUI.php.

Referenced by executeCommand().

59  {
60  return $this->selfassessmenteditingmode;
61  }
+ Here is the caller graph for this function:

◆ setDefaultNrOfTries()

ilQuestionEditGUI::setDefaultNrOfTries (   $a_defaultnroftries)

Set Default Nr of Tries.

Parameters
int$a_defaultnroftriesDefault Nr. of Tries

Definition at line 68 of file class.ilQuestionEditGUI.php.

69  {
70  $this->defaultnroftries = $a_defaultnroftries;
71  }

◆ setPageConfig()

ilQuestionEditGUI::setPageConfig (   $a_val)

Set Page Config.

Parameters
objectPage Config

Definition at line 88 of file class.ilQuestionEditGUI.php.

89  {
90  $this->page_config = $a_val;
91  }

◆ setPoolObjId()

ilQuestionEditGUI::setPoolObjId (   $a_poolobjid)

Set Pool Obj Id.

Parameters
int$a_poolobjidPool Obj Id

Definition at line 227 of file class.ilQuestionEditGUI.php.

References $_GET.

Referenced by __construct(), and setPoolRefId().

228  {
229  //echo "<br>Setting Pool Obj ID:".$a_poolobjid;
230  $this->poolobjid = $a_poolobjid;
231  $_GET["qpool_obj_id"] = $this->poolobjid;
232  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ setPoolRefId()

ilQuestionEditGUI::setPoolRefId (   $a_poolrefid)

Set Pool Ref ID.

Parameters
int$a_poolrefidPool Ref ID

Definition at line 204 of file class.ilQuestionEditGUI.php.

References $_GET, ilObject\_lookupObjId(), getPoolRefId(), and setPoolObjId().

Referenced by __construct().

205  {
206  //echo "<br>Setting Pool Ref ID:".$a_poolrefid;
207  $this->poolrefid = $a_poolrefid;
208  $_GET["qpool_ref_id"] = $this->poolrefid;
210  }
$_GET["client_id"]
static _lookupObjId($a_id)
getPoolRefId()
Get Pool Ref ID.
setPoolObjId($a_poolobjid)
Set Pool Obj Id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setQuestionId()

ilQuestionEditGUI::setQuestionId (   $a_questionid)

Set Question Id.

Parameters
int$a_questionidQuestion Id

Definition at line 183 of file class.ilQuestionEditGUI.php.

References $_GET.

Referenced by __construct().

184  {
185  $this->questionid = $a_questionid;
186  $_GET["q_id"] = $this->questionid;
187  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ setQuestionType()

ilQuestionEditGUI::setQuestionType (   $a_questiontype)

Set Question Type.

Parameters
string$a_questiontypeQuestion Type

Definition at line 249 of file class.ilQuestionEditGUI.php.

References $_GET.

Referenced by __construct().

250  {
251  $this->questiontype = $a_questiontype;
252  $_GET["q_type"] = $this->questiontype;
253  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ setSelfAssessmentEditingMode()

ilQuestionEditGUI::setSelfAssessmentEditingMode (   $a_selfassessmenteditingmode)

Set Self-Assessment Editing Mode.

Parameters
boolean$a_selfassessmenteditingmodeSelf-Assessment Editing Mode

Definition at line 48 of file class.ilQuestionEditGUI.php.

49  {
50  $this->selfassessmenteditingmode = $a_selfassessmenteditingmode;
51  }

The documentation for this class was generated from the following file: