ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
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...
 
 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, $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...
 
 getPresentationContext ()
 
 setPresentationContext ($presentationContext)
 
 isTestPresentationContext ()
 
 getRenderPurpose ()
 
 setRenderPurpose ($renderPurpose)
 
 isRenderPurposePrintPdf ()
 
 isRenderPurposePreview ()
 
 isRenderPurposeInputValue ()
 
 isRenderPurposePlayback ()
 
 isRenderPurposeDemoplay ()
 
 renderPurposeSupportsFormHtml ()
 
 getEditContext ()
 
 setEditContext ($editContext)
 
 isAuthoringEditContext ()
 
 isAdjustmentEditContext ()
 
 setAdjustmentEditContext ()
 
 getNavigationGUI ()
 
 setNavigationGUI ($navigationGUI)
 
 setTaxonomyIds ($taxonomyIds)
 
 getTaxonomyIds ()
 
 setTargetGui ($linkTargetGui)
 
 setTargetGuiClass ($targetGuiClass)
 
 getTargetGuiClass ()
 
 setQuestionHeaderBlockBuilder ($questionHeaderBlockBuilder)
 
 getQuestionHeaderBlockBuilder ()
 
 setQuestionActionCmd ($questionActionCmd)
 
 getQuestionActionCmd ()
 
createQuestionGUI ($question_type, $question_id=-1)
 Creates a question gui representation. More...
 
 populateJavascriptFilesRequiredForWorkForm (ilTemplate $tpl)
 
 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...
 
 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, $is_question_postponed=FALSE, $user_post_solutions=FALSE, $show_specific_inline_feedback=FALSE)
 
 magicAfterTestOutput ()
 
 getTestOutput ( $active_id, $pass, $is_question_postponed, $user_post_solutions, $show_specific_inline_feedback)
 
 getFormEncodingType ()
 
 setPreviewSession ($previewSession)
 
 getPreviewSession ()
 
 showHints ()
 

Protected Member Functions

 writePostData ($always=false)
 {} More...
 
- Protected Member Functions inherited from assQuestionGUI
 writePostData ($always=false)
 Evaluates a posted edit form and writes the form data in the question object. More...
 
 renderEditForm ($form)
 
 getPreviousSolutionProvidedMessage ()
 
 getPreviousSolutionConfirmationCheckboxHtml ()
 
 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)
 
 hasCorrectSolution ($activeId, $passIndex)
 
 writeQuestionGenericPostData ()
 
 completeTestOutputFormAction ($formAction, $active_id, $pass)
 
 addBackTab (ilTabsGUI $ilTabs)
 
 buildBasicEditFormObject ()
 
 buildEditForm ()
 

Private Attributes

 $newUnitId
 

Additional Inherited Members

- Static Public Member Functions inherited from assQuestionGUI
static _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...
 
static _getGUIClassNameForId ($a_q_id)
 
static _getClassNameForQType ($q_type)
 
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...
 
const PRESENTATION_CONTEXT_TEST = 'pContextTest'
 
const PRESENTATION_CONTEXT_RESULTS = 'pContextResults'
 
const RENDER_PURPOSE_PLAYBACK = 'renderPurposePlayback'
 
const RENDER_PURPOSE_DEMOPLAY = 'renderPurposeDemoplay'
 
const RENDER_PURPOSE_PREVIEW = 'renderPurposePreview'
 
const RENDER_PURPOSE_PRINT_PDF = 'renderPurposePrintPdf'
 
const RENDER_PURPOSE_INPUT_VALUE = 'renderPurposeInputValue'
 
const EDIT_CONTEXT_AUTHORING = 'authoring'
 
const EDIT_CONTEXT_ADJUSTMENT = 'adjustment'
 
- Protected Attributes inherited from assQuestionGUI
 $editForm
 

Detailed Description

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 35 of file class.assFlashQuestionGUI.php.

36  {
37  parent::__construct();
38  include_once "./Modules/TestQuestionPool/classes/class.assFlashQuestion.php";
39  $this->object = new assFlashQuestion();
40  $this->newUnitId = null;
41  if ($id >= 0)
42  {
43  $this->object->loadFromDb($id);
44  }
45  }
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 131 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().

132  {
133  //$save = ((strcmp($this->ctrl->getCmd(), "save") == 0) || (strcmp($this->ctrl->getCmd(), "saveEdit") == 0)) ? TRUE : FALSE;
134  $save = $this->isSaveCommand();
135  $this->getQuestionTemplate();
136 
137  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
138  $form = new ilPropertyFormGUI();
139  $this->editForm = $form;
140 
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)
Adds the question specific forms parts to a question property form gui.
getQuestionTemplate()
get question template
populateTaxonomyFormSection(ilPropertyFormGUI $form)
$errors
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 writePostData().

200  {
201  $this->writePostData();
202  $this->object->addParameter("", "");
203  $this->editQuestion();
204  }
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 520 of file class.assFlashQuestionGUI.php.

References array.

521  {
522  return array();
523  }
Create styles array
The data for the language used.

◆ 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 533 of file class.assFlashQuestionGUI.php.

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

◆ getCommand()

assFlashQuestionGUI::getCommand (   $cmd)

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

References $cmd.

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

◆ getPreview()

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

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

References $params, array, assQuestionGUI\getILIASPage(), and object.

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

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

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

◆ getSpecificFeedbackOutput()

assFlashQuestionGUI::getSpecificFeedbackOutput (   $active_id,
  $pass 
)

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

References $output.

506  {
507  $output = "";
508  return $this->object->prepareTextareaOutput($output, TRUE);
509  }
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output

◆ getTestOutput()

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

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

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

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

References ilPropertyFormGUI\addItem(), object, 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.
Create new PHPExcel object
obj_idprivate
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 430 of file class.assFlashQuestionGUI.php.

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

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

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

62  {
63  if ($this->writePostData())
64  {
66  }
67  $this->editQuestion();
68  }
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)
protected

{}

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

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

Referenced by flashAddParam(), and suggestRange().

74  {
75  $hasErrors = (!$always) ? $this->editQuestion(true) : false;
76  if (!$hasErrors)
77  {
78  require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
81 
82  $this->saveTaxonomyAssignments();
83  return 0;
84  }
85  return 1;
86  }
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:
+ Here is the caller 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 88 of file class.assFlashQuestionGUI.php.

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

Referenced by writePostData().

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


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