ILIAS  release_4-4 Revision
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 ($always=true)
 
 editQuestion ($checkonly=FALSE)
 Creates an output of the edit form for the question. More...
 
 populateQuestionSpecificFormPart (ilPropertyFormGUI $form)
 
 flashAddParam ()
 
 outQuestionForTest ($formaction, $active_id, $pass=NULL, $is_postponed=FALSE, $use_post_solutions=FALSE, $show_feedback=FALSE)
 
 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)
 
 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 (ilTestPlayerAbstractGUI $linkTargetGui)
 
 setTargetGuiClass ($targetGuiClass)
 
 getTargetGuiClass ()
 
 writePostData ()
 Evaluates a posted edit form and writes the form data in the question object. More...
 
 assessment ()
 output assessment More...
 
_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...
 
 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 ()
 
 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 ()
 
 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'
 
 $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
 saveTaxonomyAssignments ()
 
 populateTaxonomyFormSection (ilPropertyFormGUI $form)
 
 addTab_QuestionFeedback (ilTabsGUI $tabs)
 adds the feedback tab to ilTabsGUI More...
 
 addTab_QuestionHints (ilTabsGUI $tabs)
 adds the hints tab to ilTabsGUI More...
 
 writeQuestionGenericPostData ()
 

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 133 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().

134  {
135  //$save = ((strcmp($this->ctrl->getCmd(), "save") == 0) || (strcmp($this->ctrl->getCmd(), "saveEdit") == 0)) ? TRUE : FALSE;
136  $save = $this->isSaveCommand();
137  $this->getQuestionTemplate();
138 
139  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
140  $form = new ilPropertyFormGUI();
141  $form->setFormAction($this->ctrl->getFormAction($this));
142  $form->setTitle($this->outQuestionType());
143  $form->setMultipart(TRUE);
144  $form->setTableWidth("100%");
145  $form->setId("flash");
146 
147  $this->addBasicQuestionFormProperties($form);
148  $this->populateQuestionSpecificFormPart( $form );
149 
150  $this->populateTaxonomyFormSection($form);
151 
152  $this->addQuestionFormCommandButtons($form);
153 
154  $errors = false;
155 
156  if ($save)
157  {
158  $form->setValuesByPost();
159  $errors = !$form->checkInput();
160  $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
161  if ($errors) $checkonly = false;
162  }
163 
164  if (!$checkonly) $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
165  return $errors;
166  }
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)
$errors
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 199 of file class.assFlashQuestionGUI.php.

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

200  {
201  $this->writePostData();
202  $this->object->addParameter("", "");
203  $this->editQuestion();
204  }
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[]

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

555  {
556  return array();
557  }

◆ 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

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

568  {
569  // Empty implementation here since a feasible way to aggregate answer is not known.
570  return ''; //print_r($relevant_answers,true);
571  }

◆ 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)

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

References assQuestionGUI\getILIASPage().

341  {
342  $template = new ilTemplate("tpl.il_as_qpl_flash_question_output.html",TRUE, TRUE, "Modules/TestQuestionPool");
343  $params = array();
344  if (is_array($this->object->getParameters()))
345  {
346  foreach ($this->object->getParameters() as $name => $value)
347  {
348  array_push($params, urlencode($name) . "=" . urlencode($value));
349  }
350  }
351  if (count($params))
352  {
353  $template->setCurrentBlock("flash_vars");
354  $template->setVariable("FLASH_VARS", join($params, "&"));
355  $template->parseCurrentBlock();
356  $template->setCurrentBlock("applet_parameters");
357  $template->setVariable("PARAM_VALUE", join($params, "&"));
358  $template->parseCurrentBlock();
359  }
360  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), TRUE));
361  $template->setVariable("APPLET_WIDTH", $this->object->getWidth());
362  $template->setVariable("APPLET_HEIGHT", $this->object->getHeight());
363  $template->setVariable("ID", $this->object->getId());
364  $template->setVariable("APPLET_PATH", $this->object->getFlashPathWeb() . $this->object->getApplet());
365  $template->setVariable("APPLET_FILE", $this->object->getApplet());
366  $questionoutput = $template->get();
367  if (!$show_question_only)
368  {
369  // get page object output
370  $questionoutput = $this->getILIASPage($questionoutput);
371  }
372  return $questionoutput;
373  }
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 226 of file class.assFlashQuestionGUI.php.

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

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

540  {
541  $output = "";
542  return $this->object->prepareTextareaOutput($output, TRUE);
543  }

◆ getTestOutput()

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

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

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

Referenced by outQuestionForTest().

376  {
377  // generate the question output
378  $template = new ilTemplate("tpl.il_as_qpl_flash_question_output.html",TRUE, TRUE, "Modules/TestQuestionPool");
379  $params = array();
380  if (is_array($this->object->getParameters()))
381  {
382  foreach ($this->object->getParameters() as $name => $value)
383  {
384  array_push($params, urlencode($name) . "=" . urlencode($value));
385  }
386  }
387 
388  array_push($params, "session_id=" . urlencode($_COOKIE["PHPSESSID"]));
389  array_push($params, "client=" . urlencode(CLIENT_ID));
390  array_push($params, "points_max=" . urlencode($this->object->getPoints()));
391  array_push($params, "server=" . urlencode(ilUtil::removeTrailingPathSeparators(ILIAS_HTTP_PATH) . "/webservice/soap/server.php?wsdl"));
392  if (strlen($pass))
393  {
394  array_push($params, "pass=" . $pass);
395  }
396  else
397  {
398  include_once "./Modules/Test/classes/class.ilObjTest.php";
399  array_push($params, "pass=" . ilObjTest::_getPass($active_id));
400  }
401  if ($active_id)
402  {
403  array_push($params, "active_id=" . $active_id);
404  }
405  array_push($params, "question_id=" . $this->object->getId());
406 
407  if (count($params))
408  {
409  $template->setCurrentBlock("flash_vars");
410  $template->setVariable("FLASH_VARS", join($params, "&"));
411  $template->parseCurrentBlock();
412  $template->setCurrentBlock("applet_parameters");
413  $template->setVariable("PARAM_VALUE", join($params, "&"));
414  $template->parseCurrentBlock();
415  }
416  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), TRUE));
417  $template->setVariable("APPLET_WIDTH", $this->object->getWidth());
418  $template->setVariable("APPLET_HEIGHT", $this->object->getHeight());
419  $template->setVariable("ID", $this->object->getId());
420  $template->setVariable("APPLET_PATH", $this->object->getFlashPathWeb() . $this->object->getApplet());
421  $template->setVariable("APPLET_FILE", $this->object->getFlashPathWeb() . $this->object->getApplet());
422  $questionoutput = $template->get();
423 
424  $pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput);
425  return $pageoutput;
426  }
_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:
+ Here is the caller graph for this function:

◆ outQuestionForTest()

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

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

References $pass, and getTestOutput().

207  {
208  $test_output = $this->getTestOutput($active_id, $pass, $is_postponed, $use_post_solutions, $show_feedback);
209  $this->tpl->setVariable("QUESTION_OUTPUT", $test_output);
210  $this->tpl->setVariable("FORMACTION", $formaction);
211  }
getTestOutput($active_id, $pass=NULL, $is_postponed=FALSE, $use_post_solutions=FALSE, $show_feedback=FALSE)
+ Here is the call graph for this function:

◆ populateQuestionSpecificFormPart()

assFlashQuestionGUI::populateQuestionSpecificFormPart ( ilPropertyFormGUI  $form)

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

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

Referenced by editQuestion().

169  {
170  // flash file
171  $flash = new ilFlashFileInputGUI($this->lng->txt( "flashfile" ), "flash");
172  $flash->setRequired( TRUE );
173  if (strlen( $this->object->getApplet() ))
174  {
175  $flash->setApplet( $this->object->getApplet() );
176  $flash->setAppletPathWeb( $this->object->getFlashPathWeb() );
177  }
178  $flash->setWidth( $this->object->getWidth() );
179  $flash->setHeight( $this->object->getHeight() );
180  $flash->setParameters( $this->object->getParameters() );
181  $form->addItem( $flash );
182  if ($this->object->getId())
183  {
184  $hidden = new ilHiddenInputGUI("", "ID");
185  $hidden->setValue( $this->object->getId() );
186  $form->addItem( $hidden );
187  }
188  // points
189  $points = new ilNumberInputGUI($this->lng->txt( "points" ), "points");
190  $points->setValue( $this->object->getPoints() );
191  $points->setRequired( TRUE );
192  $points->setSize( 3 );
193  $points->setMinValue( 0.0 );
194  $form->addItem( $points );
195 
196  return $form;
197  }
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 435 of file class.assFlashQuestionGUI.php.

References $_GET, $_POST, $ref_id, assQuestionGUI\addTab_QuestionFeedback(), assQuestionGUI\addTab_QuestionHints(), and ilTestExpressPage\getReturnToPageLink().

436  {
437  global $rbacsystem, $ilTabs;
438 
439  $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
440  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
441  $q_type = $this->object->getQuestionType();
442 
443  if (strlen($q_type))
444  {
445  $classname = $q_type . "GUI";
446  $this->ctrl->setParameterByClass(strtolower($classname), "sel_question_types", $q_type);
447  $this->ctrl->setParameterByClass(strtolower($classname), "q_id", $_GET["q_id"]);
448  }
449 
450  if ($_GET["q_id"])
451  {
452  if ($rbacsystem->checkAccess('write', $_GET["ref_id"]))
453  {
454  // edit page
455  $ilTabs->addTarget("edit_page",
456  $this->ctrl->getLinkTargetByClass("ilAssQuestionPageGUI", "edit"),
457  array("edit", "insert", "exec_pg"),
458  "", "", $force_active);
459  }
460 
461  // edit page
462  $ilTabs->addTarget("preview",
463  $this->ctrl->getLinkTargetByClass("ilAssQuestionPageGUI", "preview"),
464  array("preview"),
465  "ilAssQuestionPageGUI", "", $force_active);
466  }
467 
468  $force_active = false;
469  if ($rbacsystem->checkAccess('write', $_GET["ref_id"]))
470  {
471  $url = "";
472  if ($classname) $url = $this->ctrl->getLinkTargetByClass($classname, "editQuestion");
473  $commands = $_POST["cmd"];
474  if (is_array($commands))
475  {
476  foreach ($commands as $key => $value)
477  {
478  if (preg_match("/^suggestrange_.*/", $key, $matches))
479  {
480  $force_active = true;
481  }
482  }
483  }
484  // edit question properties
485  $ilTabs->addTarget("edit_question",
486  $url,
487  array("editQuestion", "save", "flashAddParam", "saveEdit", "originalSyncForm"),
488  $classname, "", $force_active);
489  }
490 
491  // add tab for question feedback within common class assQuestionGUI
492  $this->addTab_QuestionFeedback($ilTabs);
493 
494  // add tab for question hint within common class assQuestionGUI
495  $this->addTab_QuestionHints($ilTabs);
496 
497  if ($_GET["q_id"])
498  {
499  $ilTabs->addTarget("solution_hint",
500  $this->ctrl->getLinkTargetByClass($classname, "suggestedsolution"),
501  array("suggestedsolution", "saveSuggestedSolution", "outSolutionExplorer", "cancel",
502  "addSuggestedSolution","cancelExplorer", "linkChilds", "removeSuggestedSolution"
503  ),
504  $classname,
505  ""
506  );
507  }
508 
509  // Assessment of questions sub menu entry
510  if ($_GET["q_id"])
511  {
512  $ilTabs->addTarget("statistics",
513  $this->ctrl->getLinkTargetByClass($classname, "assessment"),
514  array("assessment"),
515  $classname, "");
516  }
517 
518  if (($_GET["calling_test"] > 0) || ($_GET["test_ref_id"] > 0))
519  {
520  $ref_id = $_GET["calling_test"];
521  if (strlen($ref_id) == 0) $ref_id = $_GET["test_ref_id"];
522 
523  global $___test_express_mode;
524 
525  if (!$_GET['test_express_mode'] && !$___test_express_mode) {
526  $ilTabs->setBackTarget($this->lng->txt("backtocallingtest"), "ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=$ref_id");
527  }
528  else {
530  $ilTabs->setBackTarget($this->lng->txt("backtocallingtest"), $link);
531  }
532  }
533  else
534  {
535  $ilTabs->setBackTarget($this->lng->txt("qpl"), $this->ctrl->getLinkTargetByClass("ilobjquestionpoolgui", "questions"));
536  }
537  }
$_POST['username']
Definition: cron.php:12
addTab_QuestionHints(ilTabsGUI $tabs)
adds the hints tab to ilTabsGUI
$_GET["client_id"]
static getReturnToPageLink($q_id=null)
addTab_QuestionFeedback(ilTabsGUI $tabs)
adds the feedback tab to ilTabsGUI
$ref_id
Definition: sahs_server.php:39
+ 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  {
83 
84  $this->saveTaxonomyAssignments();
85  return 0;
86  }
87  return 1;
88  }
editQuestion($checkonly=FALSE)
Creates an output of the edit form for the question.
writeQuestionSpecificPostData($always=true)
+ Here is the call graph for this function:

◆ writeQuestionSpecificPostData()

assFlashQuestionGUI::writeQuestionSpecificPostData (   $always = true)

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

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

Referenced by writePostData().

91  {
92  $this->setErrorMessage( "" );
93  if ($_POST['flash']['delete'] == 1)
94  {
95  $this->object->deleteApplet();
96  }
97  else
98  {
99  $this->object->setApplet( $_POST['flash']['filename'] );
100  }
101  if ($_FILES["flash"]["tmp_name"])
102  {
103  $this->object->deleteApplet();
104  $filename = $this->object->moveUploadedFile( $_FILES["flash"]["tmp_name"], $_FILES["flash"]["name"] );
105  $this->object->setApplet( $filename );
106  }
107  $this->object->clearParameters();
108  if (is_array( $_POST["flash"]["flash_param_name"] ))
109  {
110  foreach ($_POST['flash']['flash_param_name'] as $idx => $val)
111  {
112  $this->object->addParameter( $val, $_POST['flash']['flash_param_value'][$idx] );
113  }
114  }
115  if (is_array( $_POST['flash']['flash_param_delete'] ))
116  {
117  foreach ($_POST['flash']['flash_param_delete'] as $key => $value)
118  {
119  $this->object->removeParameter( $_POST['flash']['flash_param_name'][$key] );
120  }
121  }
122 
123  $this->object->setWidth( $_POST["flash"]["width"] );
124  $this->object->setHeight( $_POST["flash"]["height"] );
125  $this->object->setPoints( $_POST["points"] );
126  }
$_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: