ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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)
 Returns the answer specific feedback for the question. More...
 
 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 ()
 
 populateQuestionSpecificFormPart (ilPropertyFormGUI $form)
 Adds the question specific forms parts to a question property form gui. More...
 
 writeQuestionSpecificPostData (ilPropertyFormGUI $form)
 Extracts the question specific values from $_POST and applies them to the data object. More...
 
 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...
 

Protected Member Functions

 writePostData ($always=false)
 {Evaluates a posted edit form and writes the form data in the question object.
Returns
integer A positive value, if one of the required fields wasn't set, else 0
} 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

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$

@ilctrl_iscalledby assFlashQuestionGUI: ilObjQuestionPoolGUI @ilCtrl_Calls assFlashQuestionGUI: ilFormPropertyDispatchGUI

Definition at line 23 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 @access 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.

@access public

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

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 }
populateQuestionSpecificFormPart(ilPropertyFormGUI $form)
Adds the question specific forms parts to a question property form gui.
populateTaxonomyFormSection(ilPropertyFormGUI $form)
addQuestionFormCommandButtons($form)
Add the command buttons of a question properties form.
getQuestionTemplate()
get question template
addBasicQuestionFormProperties($form)
Add basic question form properties: assessment: title, author, description, question,...
This class represents a property form user interface.
$errors

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

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

+ 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.

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.
writePostData($always=false)
{Evaluates a posted edit form and writes the form data in the question object.integer A positive valu...

References editQuestion(), and writePostData().

+ 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.

521 {
522 return array();
523 }

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

Reimplemented from assQuestionGUI.

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

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

References $cmd.

◆ getPreview()

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

Reimplemented from assQuestionGUI.

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

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
$params
Definition: example_049.php:96

References $params, and assQuestionGUI\getILIASPage().

+ 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

Reimplemented from assQuestionGUI.

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

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 }
$_COOKIE['ilClientId']
Definition: BPMN2Parser.php:15
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static removeTrailingPathSeparators($path)

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

+ Here is the call graph for this function:

◆ getSpecificFeedbackOutput()

assFlashQuestionGUI::getSpecificFeedbackOutput (   $active_id,
  $pass 
)

Returns the answer specific feedback for the question.

This method should be overwritten by the actual question.

Todo:
Mark this method abstract!
Parameters
integer$active_idActive ID of the user
integer$passActive pass
Returns
string HTML Code with the answer specific feedback @access public

Reimplemented from assQuestionGUI.

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

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

References $output.

◆ getTestOutput()

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

Reimplemented from assQuestionGUI.

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

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 }
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="")
output question page

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

+ 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.

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 }
This class represents an image file property in a property form.
This class represents a hidden form property in a property form.
This class represents a number property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).

References ilPropertyFormGUI\addItem().

Referenced by editQuestion().

+ 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.

@access public

Todo:
: MOVE THIS STEPS TO COMMON QUESTION CLASS assQuestionGUI

Reimplemented from assQuestionGUI.

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

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 }
$_GET["client_id"]
$_POST["username"]
addTab_QuestionHints(ilTabsGUI $tabs)
adds the hints tab to ilTabsGUI
addTab_SuggestedSolution(ilTabsGUI $tabs, $classname)
addBackTab(ilTabsGUI $ilTabs)
addTab_QuestionFeedback(ilTabsGUI $tabs)
adds the feedback tab to ilTabsGUI
addTab_QuestionPreview(ilTabsGUI $tabsGUI)
$url
Definition: shib_logout.php:72

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

+ Here is the call graph for this function:

◆ suggestRange()

assFlashQuestionGUI::suggestRange ( )

Suggest a range for a result.

@access public

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

62 {
63 if ($this->writePostData())
64 {
66 }
67 $this->editQuestion();
68 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

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

+ Here is the call graph for this function:

◆ writePostData()

assFlashQuestionGUI::writePostData (   $always = false)
protected

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

Returns
integer A positive value, if one of the required fields wasn't set, else 0
}

Reimplemented from assQuestionGUI.

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

74 {
75 $hasErrors = (!$always) ? $this->editQuestion(true) : false;
76 if (!$hasErrors)
77 {
78 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
81
83 return 0;
84 }
85 return 1;
86 }
writeQuestionSpecificPostData(ilPropertyFormGUI $form)
Extracts the question specific values from $_POST and applies them to the data object.

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

Referenced by flashAddParam(), and suggestRange().

+ 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.

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)

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

Referenced by writePostData().

+ 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: