ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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, $DIC, $ilCtrl, $lng, setPoolObjId(), setPoolRefId(), setQuestionId(), and setQuestionType().

25  {
26  global $DIC;
27  $ilCtrl = $DIC['ilCtrl'];
28  $lng = $DIC['lng'];
29 
30  if ($_GET["qpool_ref_id"]) {
31  $this->setPoolRefId($_GET["qpool_ref_id"]);
32  } elseif ($_GET["qpool_obj_id"]) {
33  $this->setPoolObjId($_GET["qpool_obj_id"]);
34  }
35  $this->setQuestionId($_GET["q_id"]);
36  $this->setQuestionType($_GET["q_type"]);
37  $lng->loadLanguageModule("assessment");
38 
39  $ilCtrl->saveParameter($this, array("qpool_ref_id", "qpool_obj_id", "q_id", "q_type"));
40 
41  $this->new_id_listeners = array();
42  $this->new_id_listener_cnt = 0;
43  }
global $DIC
Definition: saml.php:7
$_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.
$lng
setPoolObjId($a_poolobjid)
Set Pool Obj Id.
+ 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 110 of file class.ilQuestionEditGUI.php.

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

◆ executeCommand()

ilQuestionEditGUI::executeCommand ( )

execute command

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

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

123  {
124  global $DIC;
125  $ilCtrl = $DIC['ilCtrl'];
126  $lng = $DIC['lng'];
127 
128  $cmd = $ilCtrl->getCmd();
129  $next_class = $ilCtrl->getNextClass();
130 
131  //echo "-".$cmd."-".$next_class."-".$_GET["q_id"]."-";
132 
133  switch ($next_class) {
134  default:
135  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
137  $this->getQuestionType(),
138  $this->getQuestionId()
139  );
140  $q_gui->object->setSelfAssessmentEditingMode(
142  );
143  $q_gui->object->setDefaultNrOfTries(
144  $this->getDefaultNrOfTries()
145  );
146 
147  if (is_object($this->page_config)) {
148  $q_gui->object->setPreventRteUsage($this->getPageConfig()->getPreventRteUsage());
149  }
150  $q_gui->object->setObjId((int) $this->getPoolObjId());
151 
152  for ($i = 0; $i < $this->new_id_listener_cnt; $i++) {
153  $object = &$this->new_id_listeners[$i]["object"];
154  $method = $this->new_id_listeners[$i]["method"];
155  $parameters = $this->new_id_listeners[$i]["parameters"];
156  $q_gui->addNewIdListener(
157  $object,
158  $method,
159  $parameters
160  );
161  //var_dump($object);
162 //var_dump($method);
163 //var_dump($parameters);
164  }
165 
166  //$q_gui->setQuestionTabs();
167  $count = $q_gui->object->isInUse();
168  if ($count > 0) {
169  global $DIC;
170  $rbacsystem = $DIC['rbacsystem'];
171  if ($rbacsystem->checkAccess("write", $this->pool_ref_id)) {
172  ilUtil::sendInfo(sprintf($lng->txt("qpl_question_is_in_use"), $count));
173  }
174  }
175  $ilCtrl->setCmdClass(get_class($q_gui));
176  $ret = $ilCtrl->forwardCommand($q_gui);
177  break;
178  }
179 
180  return $ret;
181  }
global $DIC
Definition: saml.php:7
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.
$lng
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.
$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 80 of file class.ilQuestionEditGUI.php.

Referenced by executeCommand().

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

◆ getPageConfig()

ilQuestionEditGUI::getPageConfig ( )

Get Page Config.

Returns
object Page Config

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

Referenced by executeCommand().

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

◆ getPoolObjId()

ilQuestionEditGUI::getPoolObjId ( )

Get Pool Obj Id.

Returns
int Pool Obj Id

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

Referenced by executeCommand().

245  {
246  return $this->poolobjid;
247  }
+ Here is the caller graph for this function:

◆ getPoolRefId()

ilQuestionEditGUI::getPoolRefId ( )

Get Pool Ref ID.

Returns
int Pool Ref ID

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

Referenced by setPoolRefId().

223  {
224  return $this->poolrefid;
225  }
+ Here is the caller graph for this function:

◆ getQuestionId()

ilQuestionEditGUI::getQuestionId ( )

Get Question Id.

Returns
int Question Id

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

Referenced by executeCommand().

200  {
201  return $this->questionid;
202  }
+ Here is the caller graph for this function:

◆ getQuestionType()

ilQuestionEditGUI::getQuestionType ( )

Get Question Type.

Returns
string Question Type

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

Referenced by executeCommand().

266  {
267  return $this->questiontype;
268  }
+ 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 60 of file class.ilQuestionEditGUI.php.

Referenced by executeCommand().

61  {
62  return $this->selfassessmenteditingmode;
63  }
+ 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 70 of file class.ilQuestionEditGUI.php.

71  {
72  $this->defaultnroftries = $a_defaultnroftries;
73  }

◆ setPageConfig()

ilQuestionEditGUI::setPageConfig (   $a_val)

Set Page Config.

Parameters
objectPage Config

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

91  {
92  $this->page_config = $a_val;
93  }

◆ setPoolObjId()

ilQuestionEditGUI::setPoolObjId (   $a_poolobjid)

Set Pool Obj Id.

Parameters
int$a_poolobjidPool Obj Id

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

References $_GET.

Referenced by __construct(), and setPoolRefId().

233  {
234  //echo "<br>Setting Pool Obj ID:".$a_poolobjid;
235  $this->poolobjid = $a_poolobjid;
236  $_GET["qpool_obj_id"] = $this->poolobjid;
237  }
$_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 209 of file class.ilQuestionEditGUI.php.

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

Referenced by __construct().

210  {
211  //echo "<br>Setting Pool Ref ID:".$a_poolrefid;
212  $this->poolrefid = $a_poolrefid;
213  $_GET["qpool_ref_id"] = $this->poolrefid;
215  }
$_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 188 of file class.ilQuestionEditGUI.php.

References $_GET.

Referenced by __construct().

189  {
190  $this->questionid = $a_questionid;
191  $_GET["q_id"] = $this->questionid;
192  }
$_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 254 of file class.ilQuestionEditGUI.php.

References $_GET.

Referenced by __construct().

255  {
256  $this->questiontype = $a_questiontype;
257  $_GET["q_type"] = $this->questiontype;
258  }
$_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 50 of file class.ilQuestionEditGUI.php.

51  {
52  $this->selfassessmenteditingmode = $a_selfassessmenteditingmode;
53  }

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