ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  {
30  $this->setPoolRefId($_GET["qpool_ref_id"]);
31  }
32  else if ($_GET["qpool_obj_id"])
33  {
34  $this->setPoolObjId($_GET["qpool_obj_id"]);
35  }
36  $this->setQuestionId($_GET["q_id"]);
37  $this->setQuestionType($_GET["q_type"]);
38  $lng->loadLanguageModule("assessment");
39 
40  $ilCtrl->saveParameter($this, array("qpool_ref_id", "qpool_obj_id", "q_id", "q_type"));
41 
42  $this->new_id_listeners = array();
43  $this->new_id_listener_cnt = 0;
44  }
$_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 111 of file class.ilQuestionEditGUI.php.

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

◆ executeCommand()

ilQuestionEditGUI::executeCommand ( )

execute command

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

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

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

Referenced by executeCommand().

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

◆ getPageConfig()

ilQuestionEditGUI::getPageConfig ( )

Get Page Config.

Returns
object Page Config

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

Referenced by executeCommand().

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

◆ getPoolObjId()

ilQuestionEditGUI::getPoolObjId ( )

Get Pool Obj Id.

Returns
int Pool Obj Id

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

Referenced by executeCommand().

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

◆ getPoolRefId()

ilQuestionEditGUI::getPoolRefId ( )

Get Pool Ref ID.

Returns
int Pool Ref ID

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

Referenced by setPoolRefId().

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

◆ getQuestionId()

ilQuestionEditGUI::getQuestionId ( )

Get Question Id.

Returns
int Question Id

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

Referenced by executeCommand().

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

◆ getQuestionType()

ilQuestionEditGUI::getQuestionType ( )

Get Question Type.

Returns
string Question Type

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

Referenced by executeCommand().

262  {
263  return $this->questiontype;
264  }
+ 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 61 of file class.ilQuestionEditGUI.php.

Referenced by executeCommand().

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

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

◆ setPageConfig()

ilQuestionEditGUI::setPageConfig (   $a_val)

Set Page Config.

Parameters
objectPage Config

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

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

◆ setPoolObjId()

ilQuestionEditGUI::setPoolObjId (   $a_poolobjid)

Set Pool Obj Id.

Parameters
int$a_poolobjidPool Obj Id

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

References $_GET.

Referenced by __construct(), and setPoolRefId().

229  {
230 //echo "<br>Setting Pool Obj ID:".$a_poolobjid;
231  $this->poolobjid = $a_poolobjid;
232  $_GET["qpool_obj_id"] = $this->poolobjid;
233  }
$_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 205 of file class.ilQuestionEditGUI.php.

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

Referenced by __construct().

206  {
207 //echo "<br>Setting Pool Ref ID:".$a_poolrefid;
208  $this->poolrefid = $a_poolrefid;
209  $_GET["qpool_ref_id"] = $this->poolrefid;
211  }
$_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 184 of file class.ilQuestionEditGUI.php.

References $_GET.

Referenced by __construct().

185  {
186  $this->questionid = $a_questionid;
187  $_GET["q_id"] = $this->questionid;
188  }
$_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 250 of file class.ilQuestionEditGUI.php.

References $_GET.

Referenced by __construct().

251  {
252  $this->questiontype = $a_questiontype;
253  $_GET["q_type"] = $this->questiontype;
254  }
$_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 51 of file class.ilQuestionEditGUI.php.

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

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