ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
assFlashQuestionGUI Class Reference

The assFlashQuestionGUI class encapsulates the GUI representation for flash questions. More...

+ Inheritance diagram for assFlashQuestionGUI:
+ Collaboration diagram for assFlashQuestionGUI:

Public Member Functions

 __construct ($id=-1)
 assFlashQuestionGUI constructor More...
 
 getCommand ($cmd)
 
 suggestRange ()
 Suggest a range for a result. More...
 
 writePostData ($always=false)
 Evaluates a posted edit form and writes the form data in the question object. More...
 
 writeQuestionSpecificPostData (ilPropertyFormGUI $form)
 Extracts the question specific values from $_POST and applies them to the data object. More...
 
 editQuestion ($checkonly=FALSE)
 Creates an output of the edit form for the question. More...
 
 populateQuestionSpecificFormPart (ilPropertyFormGUI $form)
 Adds the question specific forms parts to a question property form gui. More...
 
 flashAddParam ()
 
 getSolutionOutput ( $active_id, $pass=NULL, $graphicalOutput=FALSE, $result_output=FALSE, $show_question_only=TRUE, $show_feedback=FALSE, $show_correct_solution=FALSE, $show_manual_scoring=FALSE, $show_question_text=TRUE)
 Get the question solution output. More...
 
 getPreview ($show_question_only=FALSE, $showInlineFeedback=false)
 
 getTestOutput ($active_id, $pass=NULL, $is_postponed=FALSE, $use_post_solutions=FALSE, $show_feedback=FALSE)
 
 setQuestionTabs ()
 Sets the ILIAS tabs for this question type. More...
 
 getSpecificFeedbackOutput ($active_id, $pass)
 
 getAfterParticipationSuppressionQuestionPostVars ()
 Returns a list of postvars which will be suppressed in the form output when used in scoring adjustment. More...
 
 getAggregatedAnswersView ($relevant_answers)
 Returns an html string containing a question specific representation of the answers so far given in the test for use in the right column in the scoring adjustment user interface. More...
 
- Public Member Functions inherited from assQuestionGUI
 __construct ()
 assQuestionGUI constructor More...
 
executeCommand ()
 execute command More...
 
 getCommand ($cmd)
 
 getType ()
 needed for page editor compliance More...
 
 setTaxonomyIds ($taxonomyIds)
 
 getTaxonomyIds ()
 
 setTargetGui ($linkTargetGui)
 
 setTargetGuiClass ($targetGuiClass)
 
 getTargetGuiClass ()
 
 setQuestionHeaderBlockBuilder ($questionHeaderBlockBuilder)
 
 setQuestionActionCmd ($questionActionCmd)
 
 getQuestionActionCmd ()
 
_getQuestionGUI ($question_type, $question_id=-1)
 Creates a question gui representation and returns the alias to the question gui note: please do not use $this inside this method to allow static calls. More...
 
 _getGUIClassNameForId ($a_q_id)
 
 _getClassNameForQType ($q_type)
 
createQuestionGUI ($question_type, $question_id=-1)
 Creates a question gui representation. More...
 
 getQuestionTemplate ()
 get question template More...
 
 getILIASPage ($html="")
 Returns the ILIAS Page around a question. More...
 
 outQuestionPage ($a_temp_var, $a_postponed=false, $active_id="", $html="")
 output question page More...
 
 cancel ()
 cancel action More...
 
 originalSyncForm ($return_to="", $return_to_feedback='')
 
 sync ()
 
 cancelSync ()
 
 saveEdit ()
 save question More...
 
 save ()
 save question More...
 
 saveReturn ()
 save question More...
 
 apply ()
 apply changes More...
 
 getContextPath ($cont_obj, $a_endnode_id, $a_startnode_id=1)
 get context path in content object tree More...
 
 setSequenceNumber ($nr)
 
 getSequenceNumber ()
 
 setQuestionCount ($a_question_count)
 
 getQuestionCount ()
 
 getErrorMessage ()
 
 setErrorMessage ($errormessage)
 
 addErrorMessage ($errormessage)
 
 outAdditionalOutput ()
 
 getQuestionType ()
 Returns the question type string. More...
 
 getAsValueAttribute ($a_value)
 Returns a HTML value attribute. 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...
 
 callNewIdListeners ($a_new_id)
 Call the new id listeners. More...
 
 addQuestionFormCommandButtons ($form)
 Add the command buttons of a question properties form. More...
 
 addBasicQuestionFormProperties ($form)
 Add basic question form properties: assessment: title, author, description, question, working time. More...
 
 getSelfAssessmentTags ()
 Get tags allowed in question tags in self assessment mode. More...
 
 getAnswerFeedbackOutput ($active_id, $pass)
 Returns the answer generic feedback depending on the results of the question. More...
 
 getGenericFeedbackOutput ($active_id, $pass)
 Returns the answer specific feedback for the question. More...
 
 getGenericFeedbackOutputForCorrectSolution ()
 
 getGenericFeedbackOutputForIncorrectSolution ()
 
 getSpecificFeedbackOutput ($active_id, $pass)
 Returns the answer specific feedback for the question. More...
 
 outQuestionType ()
 
 showSuggestedSolution ()
 
 suggestedsolution ()
 Allows to add suggested solutions for questions. More...
 
 outSolutionExplorer ()
 
 saveSuggestedSolution ()
 
 cancelExplorer ()
 
 outPageSelector ()
 
 outChapterSelector ()
 
 outGlossarySelector ()
 
 linkChilds ()
 
 addPG ()
 
 addST ()
 
 addGIT ()
 
 isSaveCommand ()
 
 setQuestionTabs ()
 
 addTab_SuggestedSolution (ilTabsGUI $tabs, $classname)
 
 getEditQuestionTabCommands ()
 
 getSolutionOutput ( $active_id, $pass=NULL, $graphicalOutput=FALSE, $result_output=FALSE, $show_question_only=TRUE, $show_feedback=FALSE, $show_correct_solution=FALSE, $show_manual_scoring=FALSE, $show_question_text=TRUE)
 
 isAutosaveable ()
 
 getPreview ($show_question_only=FALSE, $showInlineFeedback=false)
 
 outQuestionForTest ( $formaction, $active_id, $pass=NULL, $is_question_postponed=FALSE, $user_post_solutions=FALSE, $show_specific_inline_feedback=FALSE)
 
 setPreviewSession ($previewSession)
 
 getPreviewSession ()
 
 showHints ()
 

Private Attributes

 $newUnitId
 

Additional Inherited Members

- Static Public Member Functions inherited from assQuestionGUI
static getCommandsFromClassConstants ($guiClassName, $cmdConstantNameBegin='CMD_')
 extracts values of all constants of given class with given prefix as array can be used to get all possible commands in case of these commands are defined as constants More...
 
- Data Fields inherited from assQuestionGUI
const FORM_MODE_EDIT = 'edit'
 
const FORM_MODE_ADJUST = 'adjust'
 
const FORM_ENCODING_URLENCODE = 'application/x-www-form-urlencoded'
 
const FORM_ENCODING_MULTIPART = 'multipart/form-data'
 
const SESSION_PREVIEW_DATA_BASE_INDEX = 'ilAssQuestionPreviewAnswers'
 
 $object
 
 $tpl
 
 $lng
 
 $error
 
 $errormessage
 
 $sequence_no
 sequence number in test More...
 
 $question_count
 question count in test More...
 
- Protected Member Functions inherited from assQuestionGUI
 writePostData ()
 Evaluates a posted edit form and writes the form data in the question object. More...
 
 saveTaxonomyAssignments ()
 
 populateTaxonomyFormSection (ilPropertyFormGUI $form)
 
 getBasicEditQuestionTabCommands ()
 
 getAdditionalEditQuestionCommands ()
 
 addTab_QuestionFeedback (ilTabsGUI $tabs)
 adds the feedback tab to ilTabsGUI More...
 
 addTab_QuestionHints (ilTabsGUI $tabs)
 adds the hints tab to ilTabsGUI More...
 
 addTab_QuestionPreview (ilTabsGUI $tabsGUI)
 
 writeQuestionGenericPostData ()
 
 getFormEncodingType ()
 
 addBackTab (ilTabsGUI $ilTabs)
 
 buildBasicEditFormObject ()
 

Detailed Description

The assFlashQuestionGUI class encapsulates the GUI representation for flash questions.

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Björn Heyser bheys.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

assFlashQuestionGUI: ilObjQuestionPoolGUI

Definition at line 22 of file class.assFlashQuestionGUI.php.

Constructor & Destructor Documentation

◆ __construct()

assFlashQuestionGUI::__construct (   $id = -1)

assFlashQuestionGUI constructor

The constructor takes possible arguments an creates an instance of the assFlashQuestionGUI object.

Parameters
integer$idThe database id of a single choice question object public

Definition at line 34 of file class.assFlashQuestionGUI.php.

35  {
36  parent::__construct();
37  include_once "./Modules/TestQuestionPool/classes/class.assFlashQuestion.php";
38  $this->object = new assFlashQuestion();
39  $this->newUnitId = null;
40  if ($id >= 0)
41  {
42  $this->object->loadFromDb($id);
43  }
44  }
Class for Flash based questions.

Member Function Documentation

◆ editQuestion()

assFlashQuestionGUI::editQuestion (   $checkonly = FALSE)

Creates an output of the edit form for the question.

public

Definition at line 134 of file class.assFlashQuestionGUI.php.

References $errors, assQuestionGUI\addBasicQuestionFormProperties(), assQuestionGUI\addQuestionFormCommandButtons(), assQuestionGUI\getQuestionTemplate(), assQuestionGUI\isSaveCommand(), assQuestionGUI\outQuestionType(), populateQuestionSpecificFormPart(), and assQuestionGUI\populateTaxonomyFormSection().

Referenced by flashAddParam(), suggestRange(), and writePostData().

135  {
136  //$save = ((strcmp($this->ctrl->getCmd(), "save") == 0) || (strcmp($this->ctrl->getCmd(), "saveEdit") == 0)) ? TRUE : FALSE;
137  $save = $this->isSaveCommand();
138  $this->getQuestionTemplate();
139 
140  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
141  $form = new ilPropertyFormGUI();
142  $form->setFormAction($this->ctrl->getFormAction($this));
143  $form->setTitle($this->outQuestionType());
144  $form->setMultipart(TRUE);
145  $form->setTableWidth("100%");
146  $form->setId("flash");
147 
148  $this->addBasicQuestionFormProperties($form);
149  $this->populateQuestionSpecificFormPart( $form );
150 
151  $this->populateTaxonomyFormSection($form);
152 
153  $this->addQuestionFormCommandButtons($form);
154 
155  $errors = false;
156 
157  if ($save)
158  {
159  $form->setValuesByPost();
160  $errors = !$form->checkInput();
161  $form->setValuesByPost(); // again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes
162  if ($errors) $checkonly = false;
163  }
164 
165  if (!$checkonly) $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
166  return $errors;
167  }
$errors
addBasicQuestionFormProperties($form)
Add basic question form properties: assessment: title, author, description, question, working time.
This class represents a property form user interface.
populateQuestionSpecificFormPart(ilPropertyFormGUI $form)
Adds the question specific forms parts to a question property form gui.
getQuestionTemplate()
get question template
populateTaxonomyFormSection(ilPropertyFormGUI $form)
addQuestionFormCommandButtons($form)
Add the command buttons of a question properties form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flashAddParam()

assFlashQuestionGUI::flashAddParam ( )

Definition at line 200 of file class.assFlashQuestionGUI.php.

References editQuestion(), and assQuestionGUI\writePostData().

201  {
202  $this->writePostData();
203  $this->object->addParameter("", "");
204  $this->editQuestion();
205  }
writePostData()
Evaluates a posted edit form and writes the form data in the question object.
editQuestion($checkonly=FALSE)
Creates an output of the edit form for the question.
+ Here is the call graph for this function:

◆ getAfterParticipationSuppressionQuestionPostVars()

assFlashQuestionGUI::getAfterParticipationSuppressionQuestionPostVars ( )

Returns a list of postvars which will be suppressed in the form output when used in scoring adjustment.

The form elements will be shown disabled, so the users see the usual form but can only edit the settings, which make sense in the given context.

E.g. array('cloze_type', 'image_filename')

Returns
string[]

Implements ilGuiQuestionScoringAdjustable.

Definition at line 519 of file class.assFlashQuestionGUI.php.

520  {
521  return array();
522  }

◆ getAggregatedAnswersView()

assFlashQuestionGUI::getAggregatedAnswersView (   $relevant_answers)

Returns an html string containing a question specific representation of the answers so far given in the test for use in the right column in the scoring adjustment user interface.

Parameters
array$relevant_answers
Returns
string

Implements ilGuiQuestionScoringAdjustable.

Definition at line 532 of file class.assFlashQuestionGUI.php.

533  {
534  // Empty implementation here since a feasible way to aggregate answer is not known.
535  return ''; //print_r($relevant_answers,true);
536  }

◆ getCommand()

assFlashQuestionGUI::getCommand (   $cmd)

Definition at line 46 of file class.assFlashQuestionGUI.php.

References $cmd.

47  {
48  if (preg_match("/suggestrange_(.*?)/", $cmd, $matches))
49  {
50  $cmd = "suggestRange";
51  }
52  return $cmd;
53  }
$cmd
Definition: sahs_server.php:35

◆ getPreview()

assFlashQuestionGUI::getPreview (   $show_question_only = FALSE,
  $showInlineFeedback = false 
)

Definition at line 334 of file class.assFlashQuestionGUI.php.

References assQuestionGUI\getILIASPage().

335  {
336  $template = new ilTemplate("tpl.il_as_qpl_flash_question_output.html",TRUE, TRUE, "Modules/TestQuestionPool");
337  $params = array();
338  if (is_array($this->object->getParameters()))
339  {
340  foreach ($this->object->getParameters() as $name => $value)
341  {
342  array_push($params, urlencode($name) . "=" . urlencode($value));
343  }
344  }
345  if (count($params))
346  {
347  $template->setCurrentBlock("flash_vars");
348  $template->setVariable("FLASH_VARS", join($params, "&"));
349  $template->parseCurrentBlock();
350  $template->setCurrentBlock("applet_parameters");
351  $template->setVariable("PARAM_VALUE", join($params, "&"));
352  $template->parseCurrentBlock();
353  }
354  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), TRUE));
355  $template->setVariable("APPLET_WIDTH", $this->object->getWidth());
356  $template->setVariable("APPLET_HEIGHT", $this->object->getHeight());
357  $template->setVariable("ID", $this->object->getId());
358  $template->setVariable("APPLET_PATH", $this->object->getFlashPathWeb() . $this->object->getApplet());
359  $template->setVariable("APPLET_FILE", $this->object->getApplet());
360  $questionoutput = $template->get();
361  if (!$show_question_only)
362  {
363  // get page object output
364  $questionoutput = $this->getILIASPage($questionoutput);
365  }
366  return $questionoutput;
367  }
getILIASPage($html="")
Returns the ILIAS Page around a question.
special template class to simplify handling of ITX/PEAR
+ Here is the call graph for this function:

◆ getSolutionOutput()

assFlashQuestionGUI::getSolutionOutput (   $active_id,
  $pass = NULL,
  $graphicalOutput = FALSE,
  $result_output = FALSE,
  $show_question_only = TRUE,
  $show_feedback = FALSE,
  $show_correct_solution = FALSE,
  $show_manual_scoring = FALSE,
  $show_question_text = TRUE 
)

Get the question solution output.

Parameters
integer$active_idThe active user id
integer$passThe test pass
boolean$graphicalOutputShow visual feedback for right/wrong answers
boolean$result_outputShow the reached points for parts of the question
boolean$show_question_onlyShow the question without the ILIAS content around
boolean$show_feedbackShow the question feedback
boolean$show_correct_solutionShow the correct solution instead of the user solution
boolean$show_manual_scoringShow specific information for the manual scoring output
Returns
The solution output of the question as HTML code

Definition at line 220 of file class.assFlashQuestionGUI.php.

References $_COOKIE, $pass, ilObjTest\_getPass(), assQuestionGUI\getILIASPage(), ilUtil\getImagePath(), and ilUtil\removeTrailingPathSeparators().

231  {
232  // get the solution of the user for the active pass or from the last pass if allowed
233  $template = new ilTemplate("tpl.il_as_qpl_flash_question_output_solution.html", TRUE, TRUE, "Modules/TestQuestionPool");
234 
235  $params = array();
236  if (is_array($this->object->getParameters()))
237  {
238  foreach ($this->object->getParameters() as $name => $value)
239  {
240  array_push($params, urlencode($name) . "=" . urlencode($value));
241  }
242  }
243 
244  array_push($params, "session_id=" . urlencode($_COOKIE["PHPSESSID"]));
245  array_push($params, "client=" . urlencode(CLIENT_ID));
246  array_push($params, "points_max=" . urlencode($this->object->getPoints()));
247  array_push($params, "server=" . urlencode(ilUtil::removeTrailingPathSeparators(ILIAS_HTTP_PATH) . "/webservice/soap/server.php?wsdl"));
248  if (!is_null($pass))
249  {
250  array_push($params, "pass=" . $pass);
251  }
252  else
253  {
254  include_once "./Modules/Test/classes/class.ilObjTest.php";
255  array_push($params, "pass=" . ilObjTest::_getPass($active_id));
256  }
257  if ($active_id)
258  {
259  array_push($params, "active_id=" . $active_id);
260  }
261  array_push($params, "question_id=" . $this->object->getId());
262 
263  if ($show_correct_solution)
264  {
265  array_push($params, "solution=correct");
266  }
267  else
268  {
269  array_push($params, "solution=user");
270  }
271 
272  if (($active_id > 0) && (!$show_correct_solution))
273  {
274  if ($graphicalOutput)
275  {
276  // output of ok/not ok icons for user entered solutions
277  $reached_points = $this->object->getReachedPoints($active_id, $pass);
278  if ($reached_points == $this->object->getMaximumPoints())
279  {
280  $template->setCurrentBlock("icon_ok");
281  $template->setVariable("ICON_OK", ilUtil::getImagePath("icon_ok.svg"));
282  $template->setVariable("TEXT_OK", $this->lng->txt("answer_is_right"));
283  $template->parseCurrentBlock();
284  }
285  else
286  {
287  $template->setCurrentBlock("icon_ok");
288  if ($reached_points > 0)
289  {
290  $template->setVariable("ICON_NOT_OK", ilUtil::getImagePath("icon_mostly_ok.svg"));
291  $template->setVariable("TEXT_NOT_OK", $this->lng->txt("answer_is_not_correct_but_positive"));
292  }
293  else
294  {
295  $template->setVariable("ICON_NOT_OK", ilUtil::getImagePath("icon_not_ok.svg"));
296  $template->setVariable("TEXT_NOT_OK", $this->lng->txt("answer_is_wrong"));
297  }
298  $template->parseCurrentBlock();
299  }
300  }
301  }
302 
303  if (count($params))
304  {
305  $template->setCurrentBlock("flash_vars");
306  $template->setVariable("FLASH_VARS", join($params, "&"));
307  $template->parseCurrentBlock();
308  $template->setCurrentBlock("applet_parameters");
309  $template->setVariable("PARAM_VALUE", join($params, "&"));
310  $template->parseCurrentBlock();
311  }
312  if ($show_question_text==true)
313  {
314  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), TRUE));
315  }
316  $template->setVariable("APPLET_WIDTH", $this->object->getWidth());
317  $template->setVariable("APPLET_HEIGHT", $this->object->getHeight());
318  $template->setVariable("ID", $this->object->getId());
319  $template->setVariable("APPLET_PATH", $this->object->getFlashPathWeb() . $this->object->getApplet());
320  $template->setVariable("APPLET_FILE", $this->object->getApplet());
321 
322  $questionoutput = $template->get();
323  $solutiontemplate = new ilTemplate("tpl.il_as_tst_solution_output.html",TRUE, TRUE, "Modules/TestQuestionPool");
324  $solutiontemplate->setVariable("SOLUTION_OUTPUT", $questionoutput);
325  $solutionoutput = $solutiontemplate->get();
326  if (!$show_question_only)
327  {
328  // get page object output
329  $solutionoutput = $this->getILIASPage($solutionoutput);
330  }
331  return $solutionoutput;
332  }
_getPass($active_id)
Retrieves the actual pass of a given user for a given test.
$_COOKIE["ilClientId"]
Definition: cron.php:11
getILIASPage($html="")
Returns the ILIAS Page around a question.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
static removeTrailingPathSeparators($path)
+ Here is the call graph for this function:

◆ getSpecificFeedbackOutput()

assFlashQuestionGUI::getSpecificFeedbackOutput (   $active_id,
  $pass 
)

Definition at line 504 of file class.assFlashQuestionGUI.php.

505  {
506  $output = "";
507  return $this->object->prepareTextareaOutput($output, TRUE);
508  }

◆ getTestOutput()

assFlashQuestionGUI::getTestOutput (   $active_id,
  $pass = NULL,
  $is_postponed = FALSE,
  $use_post_solutions = FALSE,
  $show_feedback = FALSE 
)

Definition at line 369 of file class.assFlashQuestionGUI.php.

References $_COOKIE, $pass, ilObjTest\_getPass(), assQuestionGUI\outQuestionPage(), and ilUtil\removeTrailingPathSeparators().

370  {
371  // generate the question output
372  $template = new ilTemplate("tpl.il_as_qpl_flash_question_output.html",TRUE, TRUE, "Modules/TestQuestionPool");
373  $params = array();
374  if (is_array($this->object->getParameters()))
375  {
376  foreach ($this->object->getParameters() as $name => $value)
377  {
378  array_push($params, urlencode($name) . "=" . urlencode($value));
379  }
380  }
381 
382  array_push($params, "session_id=" . urlencode($_COOKIE["PHPSESSID"]));
383  array_push($params, "client=" . urlencode(CLIENT_ID));
384  array_push($params, "points_max=" . urlencode($this->object->getPoints()));
385  array_push($params, "server=" . urlencode(ilUtil::removeTrailingPathSeparators(ILIAS_HTTP_PATH) . "/webservice/soap/server.php?wsdl"));
386  if (strlen($pass))
387  {
388  array_push($params, "pass=" . $pass);
389  }
390  else
391  {
392  include_once "./Modules/Test/classes/class.ilObjTest.php";
393  array_push($params, "pass=" . ilObjTest::_getPass($active_id));
394  }
395  if ($active_id)
396  {
397  array_push($params, "active_id=" . $active_id);
398  }
399  array_push($params, "question_id=" . $this->object->getId());
400 
401  if (count($params))
402  {
403  $template->setCurrentBlock("flash_vars");
404  $template->setVariable("FLASH_VARS", join($params, "&"));
405  $template->parseCurrentBlock();
406  $template->setCurrentBlock("applet_parameters");
407  $template->setVariable("PARAM_VALUE", join($params, "&"));
408  $template->parseCurrentBlock();
409  }
410  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), TRUE));
411  $template->setVariable("APPLET_WIDTH", $this->object->getWidth());
412  $template->setVariable("APPLET_HEIGHT", $this->object->getHeight());
413  $template->setVariable("ID", $this->object->getId());
414  $template->setVariable("APPLET_PATH", $this->object->getFlashPathWeb() . $this->object->getApplet());
415  $template->setVariable("APPLET_FILE", $this->object->getFlashPathWeb() . $this->object->getApplet());
416  $questionoutput = $template->get();
417 
418  $pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput);
419  return $pageoutput;
420  }
_getPass($active_id)
Retrieves the actual pass of a given user for a given test.
$_COOKIE["ilClientId"]
Definition: cron.php:11
special template class to simplify handling of ITX/PEAR
static removeTrailingPathSeparators($path)
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="")
output question page
+ Here is the call graph for this function:

◆ populateQuestionSpecificFormPart()

assFlashQuestionGUI::populateQuestionSpecificFormPart ( ilPropertyFormGUI  $form)

Adds the question specific forms parts to a question property form gui.

Parameters
ilPropertyFormGUI$form
Returns
ilPropertyFormGUI

Implements ilGuiQuestionScoringAdjustable.

Definition at line 169 of file class.assFlashQuestionGUI.php.

References ilPropertyFormGUI\addItem(), ilFormPropertyGUI\setRequired(), and ilNumberInputGUI\setValue().

Referenced by editQuestion().

170  {
171  // flash file
172  $flash = new ilFlashFileInputGUI($this->lng->txt( "flashfile" ), "flash");
173  $flash->setRequired( TRUE );
174  if (strlen( $this->object->getApplet() ))
175  {
176  $flash->setApplet( $this->object->getApplet() );
177  $flash->setAppletPathWeb( $this->object->getFlashPathWeb() );
178  }
179  $flash->setWidth( $this->object->getWidth() );
180  $flash->setHeight( $this->object->getHeight() );
181  $flash->setParameters( $this->object->getParameters() );
182  $form->addItem( $flash );
183  if ($this->object->getId())
184  {
185  $hidden = new ilHiddenInputGUI("", "ID");
186  $hidden->setValue( $this->object->getId() );
187  $form->addItem( $hidden );
188  }
189  // points
190  $points = new ilNumberInputGUI($this->lng->txt( "points" ), "points");
191  $points->setValue( $this->object->getPoints() );
192  $points->setRequired( TRUE );
193  $points->setSize( 3 );
194  $points->setMinValue( 0.0 );
195  $form->addItem( $points );
196 
197  return $form;
198  }
setValue($a_value)
Set Value.
This class represents an image file property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
This class represents a hidden form property in a property form.
This class represents a number property in a property form.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setQuestionTabs()

assFlashQuestionGUI::setQuestionTabs ( )

Sets the ILIAS tabs for this question type.

public

Todo:
: MOVE THIS STEPS TO COMMON QUESTION CLASS assQuestionGUI

Definition at line 429 of file class.assFlashQuestionGUI.php.

References $_GET, $_POST, assQuestionGUI\addBackTab(), assQuestionGUI\addTab_QuestionFeedback(), assQuestionGUI\addTab_QuestionHints(), assQuestionGUI\addTab_QuestionPreview(), and assQuestionGUI\addTab_SuggestedSolution().

430  {
431  global $rbacsystem, $ilTabs;
432 
433  $ilTabs->clearTargets();
434 
435  $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
436  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
437  $q_type = $this->object->getQuestionType();
438 
439  if (strlen($q_type))
440  {
441  $classname = $q_type . "GUI";
442  $this->ctrl->setParameterByClass(strtolower($classname), "sel_question_types", $q_type);
443  $this->ctrl->setParameterByClass(strtolower($classname), "q_id", $_GET["q_id"]);
444  }
445 
446  if ($_GET["q_id"])
447  {
448  if ($rbacsystem->checkAccess('write', $_GET["ref_id"]))
449  {
450  // edit page
451  $ilTabs->addTarget("edit_page",
452  $this->ctrl->getLinkTargetByClass("ilAssQuestionPageGUI", "edit"),
453  array("edit", "insert", "exec_pg"),
454  "", "", $force_active);
455  }
456 
457  $this->addTab_QuestionPreview($ilTabs);
458  }
459 
460  $force_active = false;
461  if ($rbacsystem->checkAccess('write', $_GET["ref_id"]))
462  {
463  $url = "";
464  if ($classname) $url = $this->ctrl->getLinkTargetByClass($classname, "editQuestion");
465  $commands = $_POST["cmd"];
466  if (is_array($commands))
467  {
468  foreach ($commands as $key => $value)
469  {
470  if (preg_match("/^suggestrange_.*/", $key, $matches))
471  {
472  $force_active = true;
473  }
474  }
475  }
476  // edit question properties
477  $ilTabs->addTarget("edit_question",
478  $url,
479  array("editQuestion", "save", "flashAddParam", "saveEdit", "originalSyncForm"),
480  $classname, "", $force_active);
481  }
482 
483  // add tab for question feedback within common class assQuestionGUI
484  $this->addTab_QuestionFeedback($ilTabs);
485 
486  // add tab for question hint within common class assQuestionGUI
487  $this->addTab_QuestionHints($ilTabs);
488 
489  // add tab for question's suggested solution within common class assQuestionGUI
490  $this->addTab_SuggestedSolution($ilTabs, $classname);
491 
492  // Assessment of questions sub menu entry
493  if ($_GET["q_id"])
494  {
495  $ilTabs->addTarget("statistics",
496  $this->ctrl->getLinkTargetByClass($classname, "assessment"),
497  array("assessment"),
498  $classname, "");
499  }
500 
501  $this->addBackTab($ilTabs);
502  }
addTab_QuestionPreview(ilTabsGUI $tabsGUI)
$_POST['username']
Definition: cron.php:12
addTab_QuestionHints(ilTabsGUI $tabs)
adds the hints tab to ilTabsGUI
$_GET["client_id"]
addTab_QuestionFeedback(ilTabsGUI $tabs)
adds the feedback tab to ilTabsGUI
addBackTab(ilTabsGUI $ilTabs)
addTab_SuggestedSolution(ilTabsGUI $tabs, $classname)
+ Here is the call graph for this function:

◆ suggestRange()

assFlashQuestionGUI::suggestRange ( )

Suggest a range for a result.

public

Definition at line 60 of file class.assFlashQuestionGUI.php.

References editQuestion(), assQuestionGUI\getErrorMessage(), ilUtil\sendInfo(), and assQuestionGUI\writePostData().

61  {
62  if ($this->writePostData())
63  {
65  }
66  $this->editQuestion();
67  }
writePostData()
Evaluates a posted edit form and writes the form data in the question object.
editQuestion($checkonly=FALSE)
Creates an output of the edit form for the question.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ writePostData()

assFlashQuestionGUI::writePostData (   $always = false)

Evaluates a posted edit form and writes the form data in the question object.

Parameters
bool$always
Returns
integer A positive value, if one of the required fields wasn't set, else 0

Definition at line 76 of file class.assFlashQuestionGUI.php.

References editQuestion(), assQuestionGUI\saveTaxonomyAssignments(), assQuestionGUI\writeQuestionGenericPostData(), and writeQuestionSpecificPostData().

77  {
78  $hasErrors = (!$always) ? $this->editQuestion(true) : false;
79  if (!$hasErrors)
80  {
81  require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
84 
85  $this->saveTaxonomyAssignments();
86  return 0;
87  }
88  return 1;
89  }
This class represents a property form user interface.
editQuestion($checkonly=FALSE)
Creates an output of the edit form for the question.
writeQuestionSpecificPostData(ilPropertyFormGUI $form)
Extracts the question specific values from $_POST and applies them to the data object.
+ Here is the call graph for this function:

◆ writeQuestionSpecificPostData()

assFlashQuestionGUI::writeQuestionSpecificPostData ( ilPropertyFormGUI  $form)

Extracts the question specific values from $_POST and applies them to the data object.

Parameters
bool$alwaysIf true, a check for form validity is omitted.
Returns
void

Implements ilGuiQuestionScoringAdjustable.

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

References $_POST, $filename, and assQuestionGUI\setErrorMessage().

Referenced by writePostData().

92  {
93  $this->setErrorMessage( "" );
94  if ($_POST['flash']['delete'] == 1)
95  {
96  $this->object->deleteApplet();
97  }
98  else
99  {
100  $this->object->setApplet( $_POST['flash']['filename'] );
101  }
102  if ($_FILES["flash"]["tmp_name"])
103  {
104  $this->object->deleteApplet();
105  $filename = $this->object->moveUploadedFile( $_FILES["flash"]["tmp_name"], $_FILES["flash"]["name"] );
106  $this->object->setApplet( $filename );
107  }
108  $this->object->clearParameters();
109  if (is_array( $_POST["flash"]["flash_param_name"] ))
110  {
111  foreach ($_POST['flash']['flash_param_name'] as $idx => $val)
112  {
113  $this->object->addParameter( $val, $_POST['flash']['flash_param_value'][$idx] );
114  }
115  }
116  if (is_array( $_POST['flash']['flash_param_delete'] ))
117  {
118  foreach ($_POST['flash']['flash_param_delete'] as $key => $value)
119  {
120  $this->object->removeParameter( $_POST['flash']['flash_param_name'][$key] );
121  }
122  }
123 
124  $this->object->setWidth( $_POST["flash"]["width"] );
125  $this->object->setHeight( $_POST["flash"]["height"] );
126  $this->object->setPoints( $_POST["points"] );
127  }
$_POST['username']
Definition: cron.php:12
setErrorMessage($errormessage)
$filename
Definition: buildRTE.php:89
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $newUnitId

assFlashQuestionGUI::$newUnitId
private

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


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