ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
assQuestionGUI Class Reference

Basic GUI class for assessment questions. More...

+ Inheritance diagram for assQuestionGUI:
+ Collaboration diagram for assQuestionGUI:

Public Member Functions

 __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 ()
 

Static Public Member Functions

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

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 Member Functions

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

Protected Attributes

 $editForm
 

Private Member Functions

 getUseUnchangedAnswerCheckboxHtml ()
 

Private Attributes

 $taxonomyIds = array()
 
 $targetGuiClass = null
 
 $questionActionCmd = 'handleQuestionAction'
 
 $questionHeaderBlockBuilder
 
 $navigationGUI
 
 $presentationContext = null
 
 $renderPurpose = self::RENDER_PURPOSE_PLAYBACK
 
 $editContext = self::EDIT_CONTEXT_AUTHORING
 
 $previewSession
 

Detailed Description

Basic GUI class for assessment questions.

The assQuestionGUI class encapsulates basic GUI functions for assessment 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
Version
$Id$

Definition at line 20 of file class.assQuestionGUI.php.

Constructor & Destructor Documentation

◆ __construct()

assQuestionGUI::__construct ( )

assQuestionGUI constructor

Definition at line 104 of file class.assQuestionGUI.php.

References $ilCtrl, $lng, $tpl, and array.

105  {
106  global $lng, $tpl, $ilCtrl;
107 
108  $this->lng =& $lng;
109  $this->tpl =& $tpl;
110  $this->ctrl =& $ilCtrl;
111  $this->ctrl->saveParameter($this, "q_id");
112  $this->ctrl->saveParameter($this, "prev_qid");
113  $this->ctrl->saveParameter($this, "calling_test");
114  $this->ctrl->saveParameter($this, "calling_consumer");
115  $this->ctrl->saveParameter($this, "consumer_context");
116  $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'test_express_mode');
117  $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'calling_consumer');
118  $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'consumer_context');
119  $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'test_express_mode');
120  $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'calling_consumer');
121  $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'consumer_context');
122 
123  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
124  $this->errormessage = $this->lng->txt("fill_out_all_required_fields");
125 
126  $this->selfassessmenteditingmode = false;
127  $this->new_id_listeners = array();
128  $this->new_id_listener_cnt = 0;
129 
130  $this->navigationGUI = null;
131  }
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.

Member Function Documentation

◆ _getClassNameForQType()

static assQuestionGUI::_getClassNameForQType (   $q_type)
static
Deprecated:

Definition at line 449 of file class.assQuestionGUI.php.

Referenced by _getGUIClassNameForId().

450  {
451  return $q_type . "GUI";
452  }
+ Here is the caller graph for this function:

◆ _getGUIClassNameForId()

static assQuestionGUI::_getGUIClassNameForId (   $a_q_id)
static
Deprecated:

Definition at line 437 of file class.assQuestionGUI.php.

References _getClassNameForQType(), and assQuestion\getQuestionTypeFromDb().

Referenced by ilQuestionBrowserTableGUI\fillRow().

438  {
439  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
440  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
441  $q_type = assQuestion::getQuestionTypeFromDb($a_q_id);
442  $class_name = assQuestionGUI::_getClassNameForQType($q_type);
443  return $class_name;
444  }
static getQuestionTypeFromDb($question_id)
get question type for question id
static _getClassNameForQType($q_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getQuestionGUI()

static assQuestionGUI::_getQuestionGUI (   $question_type,
  $question_id = -1 
)
static

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.

Parameters
string$question_typeThe question type as it is used in the language database
integer$question_idThe database ID of an existing question to load it into assQuestionGUI
Returns
assQuestionGUI The alias to the question object

Definition at line 405 of file class.assQuestionGUI.php.

References $ilCtrl, $ilDB, $lng, assQuestion\_includeClass(), assQuestion\getFeedbackClassNameByQuestionType(), assQuestion\getGuiClassNameByQuestionType(), and assQuestion\getQuestionTypeFromDb().

Referenced by ilObjQuestionPoolGUI\addLocatorItems(), ilTestExpressPageObjectGUI\addPageOfQuestions(), ilObjQuestionPoolGUI\createQuestionForTestObject(), createQuestionGUI(), ilObjQuestionPoolGUI\createQuestionObject(), ilPCQuestionGUI\edit(), ilObjQuestionPoolGUI\editQuestionForTestObject(), ilTestExpressPageObjectGUI\executeCommand(), ilObjQuestionPoolGUI\executeCommand(), ilObjTestGUI\executeCommand(), ilQuestionEditGUI\executeCommand(), ilPageObjectGUI\executeCommand(), ilSCORM2004Asset\exportHTMLPageObjects(), ilQuestionExporter\exportQuestion(), ilObjAssessmentFolder\fetchScoringAdjustableTypes(), ilSCORM2004PageGUI\getQuestionHtmlOfPage(), ilTestExpressPageObjectGUI\handleToolbarCommand(), ilPCQuestion\modifyPageContentPostXsl(), ilAssQuestionSkillAssignmentsGUI\saveSkillQuestionAssignmentPropertiesFormCmd(), ilObjQuestionPoolGUI\setTitleAndDescription(), and ilAssQuestionSkillAssignmentsGUI\showSkillQuestionAssignmentPropertiesFormCmd().

406  {
407  global $ilCtrl, $ilDB, $lng;
408 
409  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
410 
411  if ((!$question_type) and ($question_id > 0))
412  {
413  $question_type = assQuestion::getQuestionTypeFromDb($question_id);
414  }
415 
416  if (strlen($question_type) == 0) return NULL;
417 
418  assQuestion::_includeClass($question_type, 1);
419 
420  $question_type_gui = assQuestion::getGuiClassNameByQuestionType($question_type);
421  $question = new $question_type_gui();
422 
423  $feedbackObjectClassname = assQuestion::getFeedbackClassNameByQuestionType($question_type);
424  $question->object->feedbackOBJ = new $feedbackObjectClassname($question->object, $ilCtrl, $ilDB, $lng);
425 
426  if ($question_id > 0)
427  {
428  $question->object->loadFromDb($question_id);
429  }
430 
431  return $question;
432  }
static _includeClass($question_type, $gui=0)
Include the php class file for a given question type.
static getQuestionTypeFromDb($question_id)
get question type for question id
global $ilCtrl
Definition: ilias.php:18
global $ilDB
static getGuiClassNameByQuestionType($questionType)
static getFeedbackClassNameByQuestionType($questionType)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addBackTab()

assQuestionGUI::addBackTab ( ilTabsGUI  $ilTabs)
protected
Parameters
ilTabsGUI$ilTabs

Definition at line 2232 of file class.assQuestionGUI.php.

References $_GET, $GLOBALS, $ref_id, ilLink\_getLink(), ilObjectFactory\getInstanceByRefId(), ilTestExpressPage\getReturnToPageLink(), and ilTabsGUI\setBackTarget().

Referenced by assNumericGUI\getTestOutput(), assFormulaQuestionGUI\setQuestionTabs(), assTextSubsetGUI\setQuestionTabs(), assOrderingHorizontalGUI\setQuestionTabs(), assErrorTextGUI\setQuestionTabs(), assLongMenuGUI\setQuestionTabs(), assFlashQuestionGUI\setQuestionTabs(), assTextQuestionGUI\setQuestionTabs(), assSingleChoiceGUI\setQuestionTabs(), assOrderingQuestionGUI\setQuestionTabs(), assJavaAppletGUI\setQuestionTabs(), assMultipleChoiceGUI\setQuestionTabs(), assImagemapQuestionGUI\setQuestionTabs(), assMatchingQuestionGUI\setQuestionTabs(), assClozeTestGUI\setQuestionTabs(), and setQuestionTabs().

2233  {
2234  if(($_GET["calling_test"] > 0) || ($_GET["test_ref_id"] > 0))
2235  {
2236  $ref_id = $_GET["calling_test"];
2237  if(strlen($ref_id) == 0) $ref_id = $_GET["test_ref_id"];
2238 
2239  if(!$_GET['test_express_mode'] && !$GLOBALS['___test_express_mode'])
2240  {
2241  $ilTabs->setBackTarget($this->lng->txt("backtocallingtest"), "ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=$ref_id");
2242  }
2243  else
2244  {
2246  $ilTabs->setBackTarget($this->lng->txt("backtocallingtest"), $link);
2247  }
2248  }
2249  else if(isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])
2250  {
2251  $ref_id = (int)$_GET['calling_consumer'];
2253  if($consumer instanceof ilQuestionEditingFormConsumer)
2254  {
2255  $ilTabs->setBackTarget($consumer->getQuestionEditingFormBackTargetLabel(), $consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
2256  }
2257  else
2258  {
2259  require_once 'Services/Link/classes/class.ilLink.php';
2260  $ilTabs->setBackTarget($this->lng->txt("qpl"), ilLink::_getLink($ref_id));
2261  }
2262  }
2263  else
2264  {
2265  $ilTabs->setBackTarget($this->lng->txt("qpl"), $this->ctrl->getLinkTargetByClass("ilobjquestionpoolgui", "questions"));
2266  }
2267  }
$_GET["client_id"]
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
setBackTarget($a_title, $a_target, $a_frame="")
back target for upper context
static getReturnToPageLink($q_id=null)
$ref_id
Definition: sahs_server.php:39
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addBasicQuestionFormProperties()

assQuestionGUI::addBasicQuestionFormProperties (   $form)

Add basic question form properties: assessment: title, author, description, question, working time.

Returns
int Default Nr of Tries

Definition at line 1156 of file class.assQuestionGUI.php.

References $duration, $title, ilObjAdvancedEditing\_getUsedHTMLTags(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT, ilAssSelfAssessmentQuestionFormatter\getSelfAssessmentTags(), object, ilUtil\prepareFormOutput(), ilTextInputGUI\setValue(), ilNumberInputGUI\setValue(), and ilTextAreaInputGUI\setValue().

Referenced by assLongMenuGUI\buildEditForm(), assKprimChoiceGUI\buildEditForm(), assImagemapQuestionGUI\buildEditForm(), assOrderingQuestionGUI\buildEditForm(), assTextSubsetGUI\editQuestion(), assTextQuestionGUI\editQuestion(), assOrderingHorizontalGUI\editQuestion(), assFileUploadGUI\editQuestion(), assNumericGUI\editQuestion(), assSingleChoiceGUI\editQuestion(), assErrorTextGUI\editQuestion(), assJavaAppletGUI\editQuestion(), assFlashQuestionGUI\editQuestion(), assMatchingQuestionGUI\editQuestion(), and assFormulaQuestionGUI\isSaveCommand().

1157  {
1158  // title
1159  $title = new ilTextInputGUI($this->lng->txt("title"), "title");
1160  $title->setMaxLength(100);
1161  $title->setValue($this->object->getTitle());
1162  $title->setRequired(TRUE);
1163  $form->addItem($title);
1164 
1165  if (!$this->object->getSelfAssessmentEditingMode())
1166  {
1167  // author
1168  $author = new ilTextInputGUI($this->lng->txt("author"), "author");
1169  $author->setValue($this->object->getAuthor());
1170  $author->setRequired(TRUE);
1171  $form->addItem($author);
1172 
1173  // description
1174  $description = new ilTextInputGUI($this->lng->txt("description"), "comment");
1175  $description->setValue($this->object->getComment());
1176  $description->setRequired(FALSE);
1177  $form->addItem($description);
1178  }
1179  else
1180  {
1181  // author as hidden field
1182  $hi = new ilHiddenInputGUI("author");
1183  $author = ilUtil::prepareFormOutput($this->object->getAuthor());
1184  if (trim($author) == "")
1185  {
1186  $author = "-";
1187  }
1188  $hi->setValue($author);
1189  $form->addItem($hi);
1190 
1191  }
1192 
1193  // questiontext
1194  $question = new ilTextAreaInputGUI($this->lng->txt("question"), "question");
1195  $question->setValue($this->object->getQuestion());
1196  $question->setRequired(TRUE);
1197  $question->setRows(10);
1198  $question->setCols(80);
1199 
1200  if (!$this->object->getSelfAssessmentEditingMode())
1201  {
1202  if( $this->object->getAdditionalContentEditingMode() != assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT )
1203  {
1204  $question->setUseRte(TRUE);
1205  include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
1206  $question->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
1207  $question->addPlugin("latex");
1208  $question->addButton("latex");
1209  $question->addButton("pastelatex");
1210  $question->setRTESupport($this->object->getId(), "qpl", "assessment");
1211  }
1212  }
1213  else
1214  {
1215  require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssSelfAssessmentQuestionFormatter.php';
1217  $question->setUseTagsForRteOnly(false);
1218  }
1219  $form->addItem($question);
1220 
1221  if (!$this->object->getSelfAssessmentEditingMode())
1222  {
1223  // duration
1224  $duration = new ilDurationInputGUI($this->lng->txt("working_time"), "Estimated");
1225  $duration->setShowHours(TRUE);
1226  $duration->setShowMinutes(TRUE);
1227  $duration->setShowSeconds(TRUE);
1228  $ewt = $this->object->getEstimatedWorkingTime();
1229  $duration->setHours($ewt["h"]);
1230  $duration->setMinutes($ewt["m"]);
1231  $duration->setSeconds($ewt["s"]);
1232  $duration->setRequired(FALSE);
1233  $form->addItem($duration);
1234  }
1235  else
1236  {
1237  // number of tries
1238  if (strlen($this->object->getNrOfTries()))
1239  {
1240  $nr_tries = $this->object->getNrOfTries();
1241  }
1242  else
1243  {
1244  $nr_tries = $this->object->getDefaultNrOfTries();
1245  }
1246  if ($nr_tries < 1)
1247  {
1248  $nr_tries = "";
1249  }
1250 
1251  $ni = new ilNumberInputGUI($this->lng->txt("qst_nr_of_tries"), "nr_of_tries");
1252  $ni->setValue($nr_tries);
1253  $ni->setMinValue(0);
1254  $ni->setSize(5);
1255  $ni->setMaxLength(5);
1256  $form->addItem($ni);
1257  }
1258  }
static getSelfAssessmentTags()
Get tags allowed in question tags in self assessment mode.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
This class represents a duration (typical hh:mm:ss) property in a property form.
setValue($a_value)
Set Value.
const ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT
constant for additional content editing mode "pageobject"
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
setValue($a_value)
Set Value.
This class represents a hidden form property in a property form.
This class represents a number property in a property form.
This class represents a text property in a property form.
Create new PHPExcel object
obj_idprivate
This class represents a text area property in a property form.
setValue($a_value)
Set Value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addErrorMessage()

assQuestionGUI::addErrorMessage (   $errormessage)

Definition at line 1064 of file class.assQuestionGUI.php.

References $errormessage.

Referenced by assFormulaQuestionGUI\checkInput(), and assFormulaQuestionGUI\writePostData().

1065  {
1066  $this->errormessage .= ((strlen($this->errormessage)) ? "<br />" : "") . $errormessage;
1067  }
+ Here is the caller graph for this function:

◆ addGIT()

assQuestionGUI::addGIT ( )

Definition at line 1904 of file class.assQuestionGUI.php.

References $_GET, and ilUtil\sendSuccess().

1905  {
1906  $subquestion_index = 0;
1907  if (strlen($_GET["subquestion_index"]) && $_GET["subquestion_index"] >= 0)
1908  {
1909  $subquestion_index = $_GET["subquestion_index"];
1910  }
1911  $this->object->saveSuggestedSolution("git", "il__git_" . $_GET["git"], $subquestion_index);
1912  ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), TRUE);
1913  $this->ctrl->redirect($this, "suggestedsolution");
1914  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
+ Here is the call graph for this function:

◆ addNewIdListener()

assQuestionGUI::addNewIdListener ( $a_object,
  $a_method,
  $a_parameters = "" 
)

Add a listener that is notified with the new question ID, when a new question is saved.

Definition at line 1108 of file class.assQuestionGUI.php.

1109  {
1110  $cnt = $this->new_id_listener_cnt;
1111  $this->new_id_listeners[$cnt]["object"] =& $a_object;
1112  $this->new_id_listeners[$cnt]["method"] = $a_method;
1113  $this->new_id_listeners[$cnt]["parameters"] = $a_parameters;
1114  $this->new_id_listener_cnt++;
1115  }

◆ addPG()

assQuestionGUI::addPG ( )

Definition at line 1880 of file class.assQuestionGUI.php.

References $_GET, and ilUtil\sendSuccess().

1881  {
1882  $subquestion_index = 0;
1883  if (strlen($_GET["subquestion_index"]) && $_GET["subquestion_index"] >= 0)
1884  {
1885  $subquestion_index = $_GET["subquestion_index"];
1886  }
1887  $this->object->saveSuggestedSolution("pg", "il__pg_" . $_GET["pg"], $subquestion_index);
1888  ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), TRUE);
1889  $this->ctrl->redirect($this, "suggestedsolution");
1890  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
+ Here is the call graph for this function:

◆ addQuestionFormCommandButtons()

assQuestionGUI::addQuestionFormCommandButtons (   $form)

Add the command buttons of a question properties form.

Definition at line 1140 of file class.assQuestionGUI.php.

References object.

Referenced by assLongMenuGUI\buildEditForm(), assKprimChoiceGUI\buildEditForm(), assImagemapQuestionGUI\buildEditForm(), assMultipleChoiceGUI\buildEditForm(), assTextSubsetGUI\editQuestion(), assTextQuestionGUI\editQuestion(), assOrderingHorizontalGUI\editQuestion(), assFileUploadGUI\editQuestion(), assNumericGUI\editQuestion(), assSingleChoiceGUI\editQuestion(), assErrorTextGUI\editQuestion(), assJavaAppletGUI\editQuestion(), assFlashQuestionGUI\editQuestion(), assMatchingQuestionGUI\editQuestion(), and assClozeTestGUI\editQuestion().

1141  {
1142  //if (!$this->object->getSelfAssessmentEditingMode() && !$_GET["calling_test"]) $form->addCommandButton("saveEdit", $this->lng->txt("save_edit"));
1143  if(!$this->object->getSelfAssessmentEditingMode())
1144  {
1145  $form->addCommandButton("saveReturn", $this->lng->txt("save_return"));
1146  }
1147  $form->addCommandButton("save", $this->lng->txt("save"));
1148  }
Create new PHPExcel object
obj_idprivate
+ Here is the caller graph for this function:

◆ addST()

assQuestionGUI::addST ( )

Definition at line 1892 of file class.assQuestionGUI.php.

References $_GET, and ilUtil\sendSuccess().

1893  {
1894  $subquestion_index = 0;
1895  if (strlen($_GET["subquestion_index"]) && $_GET["subquestion_index"] >= 0)
1896  {
1897  $subquestion_index = $_GET["subquestion_index"];
1898  }
1899  $this->object->saveSuggestedSolution("st", "il__st_" . $_GET["st"], $subquestion_index);
1900  ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), TRUE);
1901  $this->ctrl->redirect($this, "suggestedsolution");
1902  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
+ Here is the call graph for this function:

◆ addTab_QuestionFeedback()

assQuestionGUI::addTab_QuestionFeedback ( ilTabsGUI  $tabs)
protected

adds the feedback tab to ilTabsGUI

ilCtrl $ilCtrl

Parameters
ilTabsGUI$tabs

Definition at line 2051 of file class.assQuestionGUI.php.

References $ilCtrl, ilTabsGUI\addTarget(), and ilAssQuestionFeedbackEditingGUI\CMD_SHOW.

Referenced by assNumericGUI\getTestOutput(), assFormulaQuestionGUI\setQuestionTabs(), assTextSubsetGUI\setQuestionTabs(), assOrderingHorizontalGUI\setQuestionTabs(), assErrorTextGUI\setQuestionTabs(), assLongMenuGUI\setQuestionTabs(), assFlashQuestionGUI\setQuestionTabs(), assFileUploadGUI\setQuestionTabs(), assTextQuestionGUI\setQuestionTabs(), assSingleChoiceGUI\setQuestionTabs(), assOrderingQuestionGUI\setQuestionTabs(), assJavaAppletGUI\setQuestionTabs(), assMultipleChoiceGUI\setQuestionTabs(), assImagemapQuestionGUI\setQuestionTabs(), assMatchingQuestionGUI\setQuestionTabs(), assClozeTestGUI\setQuestionTabs(), and setQuestionTabs().

2052  {
2053  global $ilCtrl;
2054 
2055  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
2056  $tabCommands = self::getCommandsFromClassConstants('ilAssQuestionFeedbackEditingGUI');
2057 
2058  $tabLink = $ilCtrl->getLinkTargetByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW);
2059 
2060  $tabs->addTarget('tst_feedback', $tabLink, $tabCommands, $ilCtrl->getCmdClass(), '');
2061  }
addTarget($a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTab_QuestionHints()

assQuestionGUI::addTab_QuestionHints ( ilTabsGUI  $tabs)
protected

adds the hints tab to ilTabsGUI

ilCtrl $ilCtrl

Parameters
ilTabsGUI$tabs

Definition at line 2082 of file class.assQuestionGUI.php.

References $ilCtrl, ilTabsGUI\addTarget(), array, and ilAssQuestionHintsGUI\CMD_SHOW_LIST.

Referenced by assNumericGUI\getTestOutput(), assFormulaQuestionGUI\setQuestionTabs(), assTextSubsetGUI\setQuestionTabs(), assOrderingHorizontalGUI\setQuestionTabs(), assErrorTextGUI\setQuestionTabs(), assLongMenuGUI\setQuestionTabs(), assFlashQuestionGUI\setQuestionTabs(), assFileUploadGUI\setQuestionTabs(), assTextQuestionGUI\setQuestionTabs(), assSingleChoiceGUI\setQuestionTabs(), assOrderingQuestionGUI\setQuestionTabs(), assJavaAppletGUI\setQuestionTabs(), assMultipleChoiceGUI\setQuestionTabs(), assImagemapQuestionGUI\setQuestionTabs(), assMatchingQuestionGUI\setQuestionTabs(), assClozeTestGUI\setQuestionTabs(), and setQuestionTabs().

2083  {
2084  global $ilCtrl;
2085 
2086  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
2087 
2088  switch( $ilCtrl->getCmdClass() )
2089  {
2090  case 'ilassquestionhintsgui':
2091 
2092  $tabCommands = self::getCommandsFromClassConstants('ilAssQuestionHintsGUI');
2093  break;
2094 
2095  case 'ilassquestionhintgui':
2096 
2097  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintGUI.php';
2098  $tabCommands = self::getCommandsFromClassConstants('ilAssQuestionHintGUI');
2099  break;
2100 
2101  default:
2102 
2103  $tabCommands = array();
2104  }
2105 
2106  $tabLink = $ilCtrl->getLinkTargetByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST);
2107 
2108  $tabs->addTarget('tst_question_hints_tab', $tabLink, $tabCommands, $ilCtrl->getCmdClass(), '');
2109  }
addTarget($a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
const CMD_SHOW_LIST
command constants
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTab_QuestionPreview()

assQuestionGUI::addTab_QuestionPreview ( ilTabsGUI  $tabsGUI)
protected

Definition at line 2111 of file class.assQuestionGUI.php.

References $pass, ilTabsGUI\addTarget(), array, ilAssQuestionPreviewGUI\CMD_SHOW, getSolutionOutput(), and ilAssQuestionPreviewGUI\TAB_ID_QUESTION_PREVIEW.

Referenced by assNumericGUI\getTestOutput(), assFormulaQuestionGUI\setQuestionTabs(), assTextSubsetGUI\setQuestionTabs(), assOrderingHorizontalGUI\setQuestionTabs(), assErrorTextGUI\setQuestionTabs(), assLongMenuGUI\setQuestionTabs(), assFlashQuestionGUI\setQuestionTabs(), assFileUploadGUI\setQuestionTabs(), assTextQuestionGUI\setQuestionTabs(), assSingleChoiceGUI\setQuestionTabs(), assOrderingQuestionGUI\setQuestionTabs(), assJavaAppletGUI\setQuestionTabs(), assMultipleChoiceGUI\setQuestionTabs(), assImagemapQuestionGUI\setQuestionTabs(), assMatchingQuestionGUI\setQuestionTabs(), assClozeTestGUI\setQuestionTabs(), and setQuestionTabs().

2112  {
2113  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php';
2114 
2115  $tabsGUI->addTarget(
2117  $this->ctrl->getLinkTargetByClass('ilAssQuestionPreviewGUI', ilAssQuestionPreviewGUI::CMD_SHOW),
2118  array(),
2119  array('ilAssQuestionPreviewGUI')
2120  );
2121  }
addTarget($a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTab_SuggestedSolution()

assQuestionGUI::addTab_SuggestedSolution ( ilTabsGUI  $tabs,
  $classname 
)

Definition at line 2015 of file class.assQuestionGUI.php.

References $_GET, ilTabsGUI\addTarget(), and array.

Referenced by assNumericGUI\getTestOutput(), assTextSubsetGUI\setQuestionTabs(), assOrderingHorizontalGUI\setQuestionTabs(), assErrorTextGUI\setQuestionTabs(), assLongMenuGUI\setQuestionTabs(), assFlashQuestionGUI\setQuestionTabs(), assFileUploadGUI\setQuestionTabs(), assTextQuestionGUI\setQuestionTabs(), assSingleChoiceGUI\setQuestionTabs(), assOrderingQuestionGUI\setQuestionTabs(), assJavaAppletGUI\setQuestionTabs(), assMultipleChoiceGUI\setQuestionTabs(), assImagemapQuestionGUI\setQuestionTabs(), assMatchingQuestionGUI\setQuestionTabs(), assClozeTestGUI\setQuestionTabs(), and setQuestionTabs().

2016  {
2017  if ($_GET["q_id"])
2018  {
2019  $tabs->addTarget("suggested_solution",
2020  $this->ctrl->getLinkTargetByClass($classname, "suggestedsolution"),
2021  array("suggestedsolution", "saveSuggestedSolution", "outSolutionExplorer", "cancel",
2022  "addSuggestedSolution","cancelExplorer", "linkChilds", "removeSuggestedSolution"
2023  ),
2024  $classname,
2025  ""
2026  );
2027  }
2028  }
$_GET["client_id"]
addTarget($a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply()

assQuestionGUI::apply ( )

apply changes

Definition at line 1000 of file class.assQuestionGUI.php.

References object, and writePostData().

1001  {
1002  $this->writePostData();
1003  $this->object->saveToDb();
1004  $this->ctrl->setParameter($this, "q_id", $this->object->getId());
1005  $this->editQuestion();
1006  }
writePostData($always=false)
Evaluates a posted edit form and writes the form data in the question object.
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ buildBasicEditFormObject()

assQuestionGUI::buildBasicEditFormObject ( )
protected
Returns
ilPropertyFormGUI

Definition at line 2293 of file class.assQuestionGUI.php.

References getType(), and outQuestionType().

Referenced by assLongMenuGUI\buildEditForm(), assKprimChoiceGUI\buildEditForm(), and assImagemapQuestionGUI\buildEditForm().

2294  {
2295  require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
2296  $form = new ilPropertyFormGUI();
2297 
2298  $form->setFormAction($this->ctrl->getFormAction($this));
2299 
2300  $form->setId($this->getType());
2301  $form->setTitle($this->outQuestionType());
2302 
2303  $form->setTableWidth('100%');
2304 
2305  $form->setMultipart(true);
2306 
2307  return $form;
2308  }
This class represents a property form user interface.
getType()
needed for page editor compliance
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildEditForm()

assQuestionGUI::buildEditForm ( )
protected

Definition at line 2319 of file class.assQuestionGUI.php.

References $editForm, and $errors.

Referenced by executeCommand().

2320  {
2321  $errors = $this->editQuestion(true); // TODO bheyser: editQuestion should be added to the abstract base class with a unified signature
2322  return $this->editForm;
2323  }
$errors
+ Here is the caller graph for this function:

◆ callNewIdListeners()

assQuestionGUI::callNewIdListeners (   $a_new_id)

Call the new id listeners.

Definition at line 1120 of file class.assQuestionGUI.php.

Referenced by save(), saveReturn(), and assFormulaQuestionGUI\saveReturnFQ().

1121  {
1122 
1123  for ($i=0; $i<$this->new_id_listener_cnt; $i++)
1124  {
1125  $this->new_id_listeners[$i]["parameters"]["new_id"] = $a_new_id;
1126  $object =& $this->new_id_listeners[$i]["object"];
1127  $method = $this->new_id_listeners[$i]["method"];
1128  $parameters = $this->new_id_listeners[$i]["parameters"];
1129 //var_dump($object);
1130 //var_dump($method);
1131 //var_dump($parameters);
1132 
1133  $object->$method($parameters);
1134  }
1135  }
+ Here is the caller graph for this function:

◆ cancel()

assQuestionGUI::cancel ( )

cancel action

Definition at line 607 of file class.assQuestionGUI.php.

References $_GET, and ilUtil\redirect().

608  {
609  if ($_GET["calling_test"])
610  {
611  $_GET["ref_id"] = $_GET["calling_test"];
612  ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=".$_GET["calling_test"]);
613  }
614  elseif ($_GET["test_ref_id"])
615  {
616  $_GET["ref_id"] = $_GET["test_ref_id"];
617  ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=".$_GET["test_ref_id"]);
618  }
619  else
620  {
621  if ($_GET["q_id"] > 0)
622  {
623  $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
624  $this->ctrl->redirectByClass("ilAssQuestionPageGUI", "edit");
625  }
626  else
627  {
628  $this->ctrl->redirectByClass("ilobjquestionpoolgui", "questions");
629  }
630  }
631  }
$_GET["client_id"]
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ cancelExplorer()

assQuestionGUI::cancelExplorer ( )

Definition at line 1720 of file class.assQuestionGUI.php.

1721  {
1722  $this->ctrl->redirect($this, "suggestedsolution");
1723  }

◆ cancelSync()

assQuestionGUI::cancelSync ( )

Definition at line 702 of file class.assQuestionGUI.php.

References $_GET, $ref_id, ilLink\_getLink(), ilObjectFactory\getInstanceByRefId(), ilTestExpressPage\getReturnToPageLink(), object, and ilUtil\redirect().

703  {
704  if (strlen($_GET["return_to"]))
705  {
706  $this->ctrl->redirect($this, $_GET["return_to"]);
707  }
708  if(strlen($_REQUEST['return_to_fb']))
709  {
710  $this->ctrl->redirectByClass('ilAssQuestionFeedbackEditingGUI', 'showFeedbackForm');
711  }
712  else
713  {
714  if(isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])
715  {
716  $ref_id = (int)$_GET['calling_consumer'];
718  if($consumer instanceof ilQuestionEditingFormConsumer)
719  {
720  ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
721  }
722  require_once 'Services/Link/classes/class.ilLink.php';
724  }
725  $_GET["ref_id"] = $_GET["calling_test"];
726 
727  if($_REQUEST['test_express_mode'])
728  {
730  }
731  else
732  {
733  ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=".$_GET["calling_test"]);
734  }
735  }
736  }
$_GET["client_id"]
static getReturnToPageLink($q_id=null)
$ref_id
Definition: sahs_server.php:39
Create new PHPExcel object
obj_idprivate
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ completeTestOutputFormAction()

assQuestionGUI::completeTestOutputFormAction (   $formAction,
  $active_id,
  $pass 
)
protected

Definition at line 2205 of file class.assQuestionGUI.php.

Referenced by outQuestionForTest().

2207  {
2208  return $formAction;
2209  }
+ Here is the caller graph for this function:

◆ createQuestionGUI()

& assQuestionGUI::createQuestionGUI (   $question_type,
  $question_id = -1 
)

Creates a question gui representation.

Creates a question gui representation and returns the alias to the question gui

Parameters
string$question_typeThe question type as it is used in the language database
integer$question_idThe database ID of an existing question to load it into assQuestionGUI
Returns
object The alias to the question object public
Deprecated:
: WTF is this? GUIobject::question should be a GUIobject !? WTF is a question alias !?

Definition at line 466 of file class.assQuestionGUI.php.

References _getQuestionGUI().

467  {
468  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
469  $this->question =& assQuestionGUI::_getQuestionGUI($question_type, $question_id);
470  }
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
+ Here is the call graph for this function:

◆ executeCommand()

assQuestionGUI::executeCommand ( )

execute command

Definition at line 136 of file class.assQuestionGUI.php.

References $_GET, $cmd, $DIC, $ret, buildEditForm(), getCommand(), and ilUtil\stripSlashes().

137  {
138  global $DIC; /* @var \ILIAS\DI\Container $DIC */
139  $ilHelp = $DIC['ilHelp']; /* @var ilHelpGUI $ilHelp */
140  $ilHelp->setScreenIdComponent('qpl');
141 
142  $cmd = $this->ctrl->getCmd("editQuestion");
143  $next_class = $this->ctrl->getNextClass($this);
144 
145  $cmd = $this->getCommand($cmd);
146 
147  switch($next_class)
148  {
149  case 'ilformpropertydispatchgui':
150  $form = $this->buildEditForm();
151 
152  require_once 'Services/Form/classes/class.ilFormPropertyDispatchGUI.php';
153  $form_prop_dispatch = new ilFormPropertyDispatchGUI();
154  $form_prop_dispatch->setItem($form->getItemByPostVar(ilUtil::stripSlashes($_GET['postvar'])));
155  return $this->ctrl->forwardCommand($form_prop_dispatch);
156  break;
157 
158  default:
159  $ret = $this->$cmd();
160  break;
161  }
162  return $ret;
163  }
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$ret
Definition: parser.php:6
global $DIC
+ Here is the call graph for this function:

◆ getAdditionalEditQuestionCommands()

assQuestionGUI::getAdditionalEditQuestionCommands ( )
protected

Definition at line 2040 of file class.assQuestionGUI.php.

References array.

Referenced by getEditQuestionTabCommands().

2041  {
2042  return array();
2043  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ getAnswerFeedbackOutput()

assQuestionGUI::getAnswerFeedbackOutput (   $active_id,
  $pass 
)

Returns the answer generic feedback depending on the results of the question.

Deprecated:
Use getGenericFeedbackOutput instead.
Parameters
integer$active_idActive ID of the user
integer$passActive pass
Returns
string HTML Code with the answer specific feedback public

Definition at line 1317 of file class.assQuestionGUI.php.

References $pass, and getGenericFeedbackOutput().

Referenced by assTextSubsetGUI\getSolutionOutput(), assSingleChoiceGUI\getSolutionOutput(), assMultipleChoiceGUI\getSolutionOutput(), assFileUploadGUI\getSolutionOutput(), assJavaAppletGUI\getSolutionOutput(), and assImagemapQuestionGUI\getSolutionOutput().

1318  {
1319  return $this->getGenericFeedbackOutput($active_id, $pass);
1320  }
getGenericFeedbackOutput($active_id, $pass)
Returns the answer specific feedback for the question.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAsValueAttribute()

assQuestionGUI::getAsValueAttribute (   $a_value)

Returns a HTML value attribute.

Parameters
mixed$a_valueA given text or value
Returns
string The value as HTML value attribute public

Definition at line 1093 of file class.assQuestionGUI.php.

References $result.

1094  {
1095  $result = "";
1096  if (strlen($a_value))
1097  {
1098  $result = " value=\"$a_value\" ";
1099  }
1100  return $result;
1101  }
$result

◆ getBasicEditQuestionTabCommands()

assQuestionGUI::getBasicEditQuestionTabCommands ( )
protected

Definition at line 2035 of file class.assQuestionGUI.php.

References array.

Referenced by getEditQuestionTabCommands().

2036  {
2037  return array('editQuestion', 'save', 'saveEdit', 'originalSyncForm');
2038  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ getCommand()

assQuestionGUI::getCommand (   $cmd)

Definition at line 165 of file class.assQuestionGUI.php.

References $cmd.

Referenced by executeCommand().

166  {
167  return $cmd;
168  }
$cmd
Definition: sahs_server.php:35
+ Here is the caller graph for this function:

◆ getCommandsFromClassConstants()

static assQuestionGUI::getCommandsFromClassConstants (   $guiClassName,
  $cmdConstantNameBegin = 'CMD_' 
)
static

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

Parameters
string$guiClassName
string$cmdConstantNameBegin
Returns
array

Definition at line 1929 of file class.assQuestionGUI.php.

References array.

Referenced by ilPCQuestionGUI\setTabs().

1930  {
1931  $reflectionClass = new ReflectionClass($guiClassName);
1932 
1933  $commands = null;
1934 
1935  if( $reflectionClass instanceof ReflectionClass )
1936  {
1937  $commands = array();
1938 
1939  foreach($reflectionClass->getConstants() as $constName => $constValue)
1940  {
1941  if( substr($constName, 0, strlen($cmdConstantNameBegin)) == $cmdConstantNameBegin )
1942  {
1943  $commands[] = $constValue;
1944  }
1945  }
1946  }
1947 
1948  return $commands;
1949  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ getContextPath()

assQuestionGUI::getContextPath (   $cont_obj,
  $a_endnode_id,
  $a_startnode_id = 1 
)

get context path in content object tree

Parameters
int$a_endnode_idid of endnode
int$a_startnode_idid of startnode

Definition at line 1014 of file class.assQuestionGUI.php.

References $path.

Referenced by outPageSelector().

1015  {
1016  $path = "";
1017 
1018  $tmpPath = $cont_obj->getLMTree()->getPathFull($a_endnode_id, $a_startnode_id);
1019 
1020  // count -1, to exclude the learning module itself
1021  for ($i = 1; $i < (count($tmpPath) - 1); $i++)
1022  {
1023  if ($path != "")
1024  {
1025  $path .= " > ";
1026  }
1027 
1028  $path .= $tmpPath[$i]["title"];
1029  }
1030 
1031  return $path;
1032  }
$path
Definition: aliased.php:25
+ Here is the caller graph for this function:

◆ getEditContext()

assQuestionGUI::getEditContext ( )
Returns
string

Definition at line 258 of file class.assQuestionGUI.php.

References $editContext.

Referenced by isAdjustmentEditContext(), and isAuthoringEditContext().

259  {
260  return $this->editContext;
261  }
+ Here is the caller graph for this function:

◆ getEditQuestionTabCommands()

assQuestionGUI::getEditQuestionTabCommands ( )
final

Definition at line 2030 of file class.assQuestionGUI.php.

References getAdditionalEditQuestionCommands(), and getBasicEditQuestionTabCommands().

Referenced by setQuestionTabs().

2031  {
2032  return array_merge($this->getBasicEditQuestionTabCommands(), $this->getAdditionalEditQuestionCommands());
2033  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getErrorMessage()

assQuestionGUI::getErrorMessage ( )

Definition at line 1054 of file class.assQuestionGUI.php.

References $errormessage.

Referenced by assTextQuestionGUI\addSuggestedSolution(), assFlashQuestionGUI\suggestRange(), and assFormulaQuestionGUI\suggestRange().

1055  {
1056  return $this->errormessage;
1057  }
+ Here is the caller graph for this function:

◆ getFormEncodingType()

assQuestionGUI::getFormEncodingType ( )

Definition at line 2224 of file class.assQuestionGUI.php.

Referenced by outQuestionForTest(), and ilTestPlayerAbstractGUI\showQuestionViewable().

2225  {
2226  return self::FORM_ENCODING_URLENCODE;
2227  }
+ Here is the caller graph for this function:

◆ getGenericFeedbackOutput()

assQuestionGUI::getGenericFeedbackOutput (   $active_id,
  $pass 
)

Returns the answer specific feedback for the question.

Parameters
integer$active_idActive ID of the user
integer$passActive pass
Returns
string HTML Code with the answer specific feedback public

Definition at line 1331 of file class.assQuestionGUI.php.

References $output, $pass, ilObjTest\getManualFeedback(), and object.

Referenced by getAnswerFeedbackOutput(), assOrderingHorizontalGUI\getSolutionOutput(), assTextQuestionGUI\getSolutionOutput(), assNumericGUI\getSolutionOutput(), assErrorTextGUI\getSolutionOutput(), assLongMenuGUI\getSolutionOutput(), assMatchingQuestionGUI\getSolutionOutput(), assOrderingQuestionGUI\getSolutionOutput(), assKprimChoiceGUI\getSolutionOutput(), assClozeTestGUI\getSolutionOutput(), assFormulaQuestionGUI\getSolutionOutput(), and ilTestPlayerAbstractGUI\populateGenericFeedbackBlock().

1332  {
1333  $output = "";
1334  include_once "./Modules/Test/classes/class.ilObjTest.php";
1335  $manual_feedback = ilObjTest::getManualFeedback($active_id, $this->object->getId(), $pass);
1336  if (strlen($manual_feedback))
1337  {
1338  return $manual_feedback;
1339  }
1340  $correct_feedback = $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), true);
1341  $incorrect_feedback = $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), false);
1342  if (strlen($correct_feedback.$incorrect_feedback))
1343  {
1344  $reached_points = $this->object->calculateReachedPoints($active_id, $pass);
1345  $max_points = $this->object->getMaximumPoints();
1346  if ($reached_points == $max_points)
1347  {
1348  $output = $correct_feedback;
1349  }
1350  else
1351  {
1352  $output = $incorrect_feedback;
1353  }
1354  }
1355  return $this->object->prepareTextareaOutput($output, TRUE);
1356  }
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
static getManualFeedback($active_id, $question_id, $pass)
Retrieves the manual feedback for a question in a test.
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGenericFeedbackOutputForCorrectSolution()

assQuestionGUI::getGenericFeedbackOutputForCorrectSolution ( )

Definition at line 1358 of file class.assQuestionGUI.php.

References object.

1359  {
1360  return $this->object->prepareTextareaOutput(
1361  $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), true), true
1362  );
1363  }
Create new PHPExcel object
obj_idprivate

◆ getGenericFeedbackOutputForIncorrectSolution()

assQuestionGUI::getGenericFeedbackOutputForIncorrectSolution ( )

Definition at line 1365 of file class.assQuestionGUI.php.

References $pass, getSpecificFeedbackOutput(), and object.

1366  {
1367  return $this->object->prepareTextareaOutput(
1368  $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), false), true
1369  );
1370  }
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ getILIASPage()

assQuestionGUI::getILIASPage (   $html = "")

Returns the ILIAS Page around a question.

Returns
string The ILIAS page content public

Definition at line 514 of file class.assQuestionGUI.php.

References $html, array, object, and ilPageObjectGUI\setQuestionHTML().

Referenced by assTextSubsetGUI\getPreview(), assOrderingHorizontalGUI\getPreview(), assNumericGUI\getPreview(), assErrorTextGUI\getPreview(), assFlashQuestionGUI\getPreview(), assLongMenuGUI\getPreview(), assFileUploadGUI\getPreview(), assTextQuestionGUI\getPreview(), assSingleChoiceGUI\getPreview(), assMultipleChoiceGUI\getPreview(), assJavaAppletGUI\getPreview(), assKprimChoiceGUI\getPreview(), assOrderingQuestionGUI\getPreview(), assImagemapQuestionGUI\getPreview(), assMatchingQuestionGUI\getPreview(), assClozeTestGUI\getPreview(), assFormulaQuestionGUI\getPreview(), assOrderingHorizontalGUI\getSolutionOutput(), assTextSubsetGUI\getSolutionOutput(), assTextQuestionGUI\getSolutionOutput(), assNumericGUI\getSolutionOutput(), assSingleChoiceGUI\getSolutionOutput(), assMultipleChoiceGUI\getSolutionOutput(), assFileUploadGUI\getSolutionOutput(), assFlashQuestionGUI\getSolutionOutput(), assErrorTextGUI\getSolutionOutput(), assLongMenuGUI\getSolutionOutput(), assJavaAppletGUI\getSolutionOutput(), assMatchingQuestionGUI\getSolutionOutput(), assOrderingQuestionGUI\getSolutionOutput(), assImagemapQuestionGUI\getSolutionOutput(), assKprimChoiceGUI\getSolutionOutput(), assClozeTestGUI\getSolutionOutput(), assFormulaQuestionGUI\getSolutionOutput(), assOrderingHorizontalGUI\getTestOutput(), assErrorTextGUI\getTestOutput(), and assFileUploadGUI\getTestOutput().

515  {
516  include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
517  $page_gui = new ilAssQuestionPageGUI($this->object->getId());
518  $page_gui->setQuestionHTML(array($this->object->getId() => $html));
519  $page_gui->setOutputMode("presentation");
520  $presentation = $page_gui->presentation();
521  $presentation = preg_replace("/src=\"\\.\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $presentation);
522  return $presentation;
523  }
Question page GUI class.
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
$html
Definition: example_001.php:87
setQuestionHTML($question_html)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNavigationGUI()

assQuestionGUI::getNavigationGUI ( )
Returns
ilTestQuestionNavigationGUI

Definition at line 295 of file class.assQuestionGUI.php.

References $navigationGUI.

Referenced by outQuestionPage().

296  {
297  return $this->navigationGUI;
298  }
+ Here is the caller graph for this function:

◆ getPresentationContext()

assQuestionGUI::getPresentationContext ( )
Returns
string

Definition at line 181 of file class.assQuestionGUI.php.

References $presentationContext.

Referenced by isTestPresentationContext().

182  {
184  }
+ Here is the caller graph for this function:

◆ getPreview()

assQuestionGUI::getPreview (   $show_question_only = FALSE,
  $showInlineFeedback = false 
)
abstract

Referenced by writeQuestionGenericPostData().

+ Here is the caller graph for this function:

◆ getPreviewSession()

◆ getPreviousSolutionConfirmationCheckboxHtml()

assQuestionGUI::getPreviousSolutionConfirmationCheckboxHtml ( )
protected

Definition at line 594 of file class.assQuestionGUI.php.

Referenced by outQuestionPage().

595  {
596  $tpl = new ilTemplate('tpl.tst_question_additional_behaviour_checkbox.html', true, true, 'Modules/TestQuestionPool');
597  // hey: prevPassSolutions - use abtract template
598  $tpl->setVariable('TXT_FORCE_FORM_DIFF_LABEL', $this->lng->txt('use_previous_solution'));
599  // hey.
600  return $tpl->get();
601  }
special template class to simplify handling of ITX/PEAR
+ Here is the caller graph for this function:

◆ getPreviousSolutionProvidedMessage()

assQuestionGUI::getPreviousSolutionProvidedMessage ( )
protected

Definition at line 589 of file class.assQuestionGUI.php.

Referenced by outQuestionPage().

590  {
591  return $this->lng->txt('use_previous_solution_advice');
592  }
+ Here is the caller graph for this function:

◆ getQuestionActionCmd()

◆ getQuestionCount()

assQuestionGUI::getQuestionCount ( )

Definition at line 1049 of file class.assQuestionGUI.php.

References $question_count.

1050  {
1051  return $this->question_count;
1052  }
$question_count
question count in test

◆ getQuestionHeaderBlockBuilder()

assQuestionGUI::getQuestionHeaderBlockBuilder ( )
Returns
$questionHeaderBlockBuilder

Definition at line 345 of file class.assQuestionGUI.php.

References $questionHeaderBlockBuilder.

Referenced by ilTestPlayerAbstractGUI\populateInstantResponseModal(), ilTestPlayerAbstractGUI\showQuestionEditable(), and ilTestPlayerAbstractGUI\showQuestionViewable().

346  {
348  }
+ Here is the caller graph for this function:

◆ getQuestionTemplate()

assQuestionGUI::getQuestionTemplate ( )

get question template

Definition at line 480 of file class.assQuestionGUI.php.

Referenced by assTextQuestionGUI\addSuggestedSolution(), assImagemapQuestionGUI\areaEditor(), assKprimChoiceGUI\editQuestion(), assTextSubsetGUI\editQuestion(), assTextQuestionGUI\editQuestion(), assOrderingHorizontalGUI\editQuestion(), assFileUploadGUI\editQuestion(), assNumericGUI\editQuestion(), assSingleChoiceGUI\editQuestion(), assMultipleChoiceGUI\editQuestion(), assErrorTextGUI\editQuestion(), assLongMenuGUI\editQuestion(), assJavaAppletGUI\editQuestion(), assFlashQuestionGUI\editQuestion(), assImagemapQuestionGUI\editQuestion(), assMatchingQuestionGUI\editQuestion(), assClozeTestGUI\editQuestion(), assFormulaQuestionGUI\isSaveCommand(), and renderEditForm().

481  {
482  // @todo Björn: Maybe this has to be changed for PHP 7/ILIAS 5.2.x (ilObjTestGUI::executeCommand, switch -> default case -> $this->prepareOutput(); already added a template to the CONTENT variable wrapped in a block named content)
483  if(!$this->tpl->blockExists('content'))
484  {
485  $this->tpl->addBlockFile("CONTENT", "content", "tpl.il_as_qpl_content.html", "Modules/TestQuestionPool");
486  }
487  // @todo Björn: Maybe this has to be changed for PHP 7/ILIAS 5.2.x (ilObjTestGUI::executeCommand, switch -> default case -> $this->prepareOutput(); already added a template to the STATUSLINE variable wrapped in a block named statusline)
488  if(!$this->tpl->blockExists('statusline'))
489  {
490  $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
491  }
492  // @todo Björn: Maybe this has to be changed for PHP 7/ILIAS 5.2.x because ass[XYZ]QuestionGUI::editQuestion is called multiple times
493  if(!$this->tpl->blockExists('adm_content'))
494  {
495  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_question.html", "Modules/TestQuestionPool");
496  }
497  }
+ Here is the caller graph for this function:

◆ getQuestionType()

assQuestionGUI::getQuestionType ( )

Returns the question type string.

Returns the question type string

Returns
string The question type string public

Definition at line 1081 of file class.assQuestionGUI.php.

Referenced by ilScoringAdjustmentGUI\allowedInAdjustment(), and getType().

1082  {
1083  return $this->object->getQuestionType();
1084  }
+ Here is the caller graph for this function:

◆ getRenderPurpose()

assQuestionGUI::getRenderPurpose ( )
Returns
string

Definition at line 202 of file class.assQuestionGUI.php.

References $renderPurpose.

Referenced by isRenderPurposeDemoplay(), isRenderPurposeInputValue(), isRenderPurposePlayback(), isRenderPurposePreview(), isRenderPurposePrintPdf(), and suggestedsolution().

203  {
204  return $this->renderPurpose;
205  }
+ Here is the caller graph for this function:

◆ getSequenceNumber()

assQuestionGUI::getSequenceNumber ( )

Definition at line 1039 of file class.assQuestionGUI.php.

References $sequence_no.

1040  {
1041  return $this->sequence_no;
1042  }
$sequence_no
sequence number in test

◆ getSolutionOutput()

assQuestionGUI::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 
)
abstract

◆ getSpecificFeedbackOutput()

assQuestionGUI::getSpecificFeedbackOutput (   $active_id,
  $pass 
)
abstract

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 public

Referenced by getGenericFeedbackOutputForIncorrectSolution().

+ Here is the caller graph for this function:

◆ getTargetGuiClass()

assQuestionGUI::getTargetGuiClass ( )

◆ getTaxonomyIds()

assQuestionGUI::getTaxonomyIds ( )

Definition at line 313 of file class.assQuestionGUI.php.

References $taxonomyIds.

Referenced by populateTaxonomyFormSection(), and saveTaxonomyAssignments().

314  {
315  return $this->taxonomyIds;
316  }
+ Here is the caller graph for this function:

◆ getTestOutput()

assQuestionGUI::getTestOutput (   $active_id,
  $pass,
  $is_question_postponed,
  $user_post_solutions,
  $show_specific_inline_feedback 
)
abstract

Referenced by magicAfterTestOutput(), and outQuestionForTest().

+ Here is the caller graph for this function:

◆ getType()

assQuestionGUI::getType ( )

needed for page editor compliance

Definition at line 173 of file class.assQuestionGUI.php.

References getQuestionType().

Referenced by buildBasicEditFormObject().

174  {
175  return $this->getQuestionType();
176  }
getQuestionType()
Returns the question type string.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUseUnchangedAnswerCheckboxHtml()

assQuestionGUI::getUseUnchangedAnswerCheckboxHtml ( )
private

Definition at line 578 of file class.assQuestionGUI.php.

References object.

Referenced by outQuestionPage().

579  {
580  // hey: prevPassSolutions - use abstracted template to share with other purposes of this kind
581  $tpl = new ilTemplate('tpl.tst_question_additional_behaviour_checkbox.html', true, true, 'Modules/TestQuestionPool');
582  $tpl->setVariable('TXT_FORCE_FORM_DIFF_LABEL', $this->object->getTestPresentationConfig()->getUseUnchangedAnswerLabel());
583  // hey.
584  return $tpl->get();
585  }
special template class to simplify handling of ITX/PEAR
Create new PHPExcel object
obj_idprivate
+ Here is the caller graph for this function:

◆ hasCorrectSolution()

assQuestionGUI::hasCorrectSolution (   $activeId,
  $passIndex 
)
protected

◆ isAdjustmentEditContext()

assQuestionGUI::isAdjustmentEditContext ( )
Parameters
bool$isAdjustmentEditContext

Definition at line 282 of file class.assQuestionGUI.php.

References getEditContext().

Referenced by assOrderingQuestionGUI\populateAnswerSpecificFormPart(), and assOrderingQuestionGUI\writeAnswerSpecificPostData().

283  {
284  return $this->getEditContext() == self::EDIT_CONTEXT_ADJUSTMENT;
285  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAuthoringEditContext()

assQuestionGUI::isAuthoringEditContext ( )
Parameters
bool$isAuthoringEditContext

Definition at line 274 of file class.assQuestionGUI.php.

References getEditContext().

275  {
276  return $this->getEditContext() == self::EDIT_CONTEXT_AUTHORING;
277  }
+ Here is the call graph for this function:

◆ isAutosaveable()

assQuestionGUI::isAutosaveable ( )

Definition at line 2143 of file class.assQuestionGUI.php.

2144  {
2145  return $this->object->isAutosaveable();
2146  }

◆ isRenderPurposeDemoplay()

assQuestionGUI::isRenderPurposeDemoplay ( )

Definition at line 235 of file class.assQuestionGUI.php.

References getRenderPurpose().

Referenced by assOrderingQuestionGUI\isInteractivePresentation().

236  {
237  return $this->getRenderPurpose() == self::RENDER_PURPOSE_DEMOPLAY;
238  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRenderPurposeInputValue()

assQuestionGUI::isRenderPurposeInputValue ( )

Definition at line 225 of file class.assQuestionGUI.php.

References getRenderPurpose().

Referenced by renderPurposeSupportsFormHtml().

226  {
227  return $this->getRenderPurpose() == self::RENDER_PURPOSE_INPUT_VALUE;
228  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRenderPurposePlayback()

assQuestionGUI::isRenderPurposePlayback ( )

Definition at line 230 of file class.assQuestionGUI.php.

References getRenderPurpose().

Referenced by assOrderingQuestionGUI\isInteractivePresentation().

231  {
232  return $this->getRenderPurpose() == self::RENDER_PURPOSE_PLAYBACK;
233  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRenderPurposePreview()

assQuestionGUI::isRenderPurposePreview ( )

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

References getRenderPurpose().

221  {
222  return $this->getRenderPurpose() == self::RENDER_PURPOSE_PREVIEW;
223  }
+ Here is the call graph for this function:

◆ isRenderPurposePrintPdf()

assQuestionGUI::isRenderPurposePrintPdf ( )

Definition at line 215 of file class.assQuestionGUI.php.

References getRenderPurpose().

Referenced by assSingleChoiceGUI\getSolutionOutput(), assMultipleChoiceGUI\getSolutionOutput(), assKprimChoiceGUI\getSolutionOutput(), assOrderingQuestionGUI\populateAnswerSpecificFormPart(), assClozeTestGUI\populateSolutiontextToGapTpl(), and renderPurposeSupportsFormHtml().

216  {
217  return $this->getRenderPurpose() == self::RENDER_PURPOSE_PRINT_PDF;
218  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSaveCommand()

◆ isTestPresentationContext()

◆ linkChilds()

assQuestionGUI::linkChilds ( )

Definition at line 1857 of file class.assQuestionGUI.php.

References $_GET, array, outChapterSelector(), outGlossarySelector(), outPageSelector(), and ilUtil\sendSuccess().

1858  {
1859  $this->ctrl->saveParameter($this, array("subquestion_index", "link_new_type", "search_link_type"));
1860  switch ($_GET["search_link_type"])
1861  {
1862  case "pg":
1863  return $this->outPageSelector();
1864  break;
1865  case "st":
1866  return $this->outChapterSelector();
1867  break;
1868  case "glo":
1869  return $this->outGlossarySelector();
1870  break;
1871  case "lm":
1872  $subquestion_index = ($_GET["subquestion_index"] > 0) ? $_GET["subquestion_index"] : 0;
1873  $this->object->saveSuggestedSolution("lm", "il__lm_" . $_GET["source_id"], $subquestion_index);
1874  ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), TRUE);
1875  $this->ctrl->redirect($this, "suggestedsolution");
1876  break;
1877  }
1878  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ magicAfterTestOutput()

assQuestionGUI::magicAfterTestOutput ( )

Definition at line 2211 of file class.assQuestionGUI.php.

References $pass, and getTestOutput().

Referenced by outQuestionForTest().

2212  {
2213  return;
2214  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ originalSyncForm()

assQuestionGUI::originalSyncForm (   $return_to = "",
  $return_to_feedback = '' 
)
Parameters
string$return_to
string$return_to_feedbackilAssQuestionFeedbackEditingGUI

Definition at line 637 of file class.assQuestionGUI.php.

Referenced by suggestedsolution().

638  {
639  if (strlen($return_to))
640  {
641  $this->ctrl->setParameter($this, "return_to", $return_to);
642  }
643  else if ($_REQUEST['return_to']) {
644  $this->ctrl->setParameter($this, "return_to", $_REQUEST['return_to']);
645  }
646  if(strlen($return_to_feedback))
647  {
648  $this->ctrl->setParameter($this, 'return_to_fb', 'true');
649  }
650 
651  $this->ctrl->saveParameter($this, 'test_express_mode');
652 
653  $template = new ilTemplate("tpl.il_as_qpl_sync_original.html",TRUE, TRUE, "Modules/TestQuestionPool");
654  $template->setVariable("BUTTON_YES", $this->lng->txt("yes"));
655  $template->setVariable("BUTTON_NO", $this->lng->txt("no"));
656  $template->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
657  $template->setVariable("TEXT_SYNC", $this->lng->txt("confirm_sync_questions"));
658  $this->tpl->setVariable("ADM_CONTENT", $template->get());
659  }
special template class to simplify handling of ITX/PEAR
+ Here is the caller graph for this function:

◆ outAdditionalOutput()

assQuestionGUI::outAdditionalOutput ( )

Definition at line 1069 of file class.assQuestionGUI.php.

1070  {
1071  }

◆ outChapterSelector()

assQuestionGUI::outChapterSelector ( )

Definition at line 1792 of file class.assQuestionGUI.php.

References $_GET, array, object, and ilUtil\stripSlashes().

Referenced by linkChilds().

1793  {
1794  require_once 'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1795  require_once 'Modules/LearningModule/classes/class.ilObjContentObjectGUI.php';
1796 
1797  $this->ctrl->setParameter($this, 'q_id', $this->object->getId());
1798 
1799  $cont_obj_gui = new ilObjContentObjectGUI('', $_GET['source_id'], true);
1800  $cont_obj = $cont_obj_gui->object;
1801  $ctree = $cont_obj->getLMTree();
1802  $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
1803 
1804  $rows = array();
1805 
1806  foreach($nodes as $node)
1807  {
1808  if($node['type'] == $_GET['search_link_type'])
1809  {
1810  $this->ctrl->setParameter($this, $node['type'], $node['obj_id']);
1811  $rows[] = array(
1812  'title' => $node['title'],
1813  'description' => '',
1814  'text_add' => $this->lng->txt('add'),
1815  'href_add' => $this->ctrl->getLinkTarget($this, 'add' . strtoupper($node['type']))
1816  );
1817  }
1818  }
1819 
1820  $table = new ilQuestionInternalLinkSelectionTableGUI($this, 'cancelExplorer', __METHOD__);
1821  $table->setTitle($this->lng->txt('obj_' . ilUtil::stripSlashes($_GET['search_link_type'])));
1822  $table->setData($rows);
1823 
1824  $this->tpl->setContent($table->getHTML());
1825  }
$_GET["client_id"]
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
Class ilObjContentObjectGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outGlossarySelector()

assQuestionGUI::outGlossarySelector ( )

Definition at line 1827 of file class.assQuestionGUI.php.

References $_GET, array, and object.

Referenced by linkChilds().

1828  {
1829  require_once 'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1830  require_once 'Modules/Glossary/classes/class.ilObjGlossary.php';
1831 
1832  $this->ctrl->setParameter($this, 'q_id', $this->object->getId());
1833 
1834  $glossary = new ilObjGlossary($_GET['source_id'], true);
1835  $terms = $glossary->getTermList();
1836 
1837  $rows = array();
1838 
1839  foreach($terms as $term)
1840  {
1841  $this->ctrl->setParameter($this, 'git', $term['id']);
1842  $rows[] = array(
1843  'title' => $term['term'],
1844  'description' => '',
1845  'text_add' => $this->lng->txt('add'),
1846  'href_add' => $this->ctrl->getLinkTarget($this, 'addGIT')
1847  );
1848  }
1849 
1850  $table = new ilQuestionInternalLinkSelectionTableGUI($this, 'cancelExplorer', __METHOD__);
1851  $table->setTitle($this->lng->txt('glossary_term'));
1852  $table->setData($rows);
1853 
1854  $this->tpl->setContent($table->getHTML());
1855  }
$_GET["client_id"]
Class ilObjGlossary.
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
+ Here is the caller graph for this function:

◆ outPageSelector()

assQuestionGUI::outPageSelector ( )

Definition at line 1725 of file class.assQuestionGUI.php.

References $_GET, array, getContextPath(), ilLMPageObject\getPageList(), object, ilUtil\prepareFormOutput(), and ilUtil\stripSlashes().

Referenced by linkChilds().

1726  {
1727  require_once 'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1728  require_once 'Modules/LearningModule/classes/class.ilLMPageObject.php';
1729  require_once 'Modules/LearningModule/classes/class.ilObjContentObjectGUI.php';
1730 
1731  $this->ctrl->setParameter($this, 'q_id', $this->object->getId());
1732 
1733  $cont_obj_gui = new ilObjContentObjectGUI('', $_GET['source_id'], true);
1734  $cont_obj = $cont_obj_gui->object;
1735  $pages = ilLMPageObject::getPageList($cont_obj->getId());
1736  $shownpages = array();
1737  $tree = $cont_obj->getLMTree();
1738  $chapters = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
1739 
1740  $rows = array();
1741 
1742  foreach($chapters as $chapter)
1743  {
1744  $chapterpages = $tree->getChildsByType($chapter['obj_id'], 'pg');
1745  foreach($chapterpages as $page)
1746  {
1747  if($page['type'] == $_GET['search_link_type'])
1748  {
1749  array_push($shownpages, $page['obj_id']);
1750 
1751  if($tree->isInTree($page['obj_id']))
1752  {
1753  $path_str = $this->getContextPath($cont_obj, $page['obj_id']);
1754  }
1755  else
1756  {
1757  $path_str = '---';
1758  }
1759 
1760  $this->ctrl->setParameter($this, $page['type'], $page['obj_id']);
1761  $rows[] = array(
1762  'title' => $page['title'],
1763  'description' => ilUtil::prepareFormOutput($path_str),
1764  'text_add' => $this->lng->txt('add'),
1765  'href_add' => $this->ctrl->getLinkTarget($this, 'add' . strtoupper($page['type']))
1766  );
1767  }
1768  }
1769  }
1770  foreach($pages as $page)
1771  {
1772  if(!in_array($page['obj_id'], $shownpages))
1773  {
1774  $this->ctrl->setParameter($this, $page['type'], $page['obj_id']);
1775  $rows[] = array(
1776  'title' => $page['title'],
1777  'description' => '---',
1778  'text_add' => $this->lng->txt('add'),
1779  'href_add' => $this->ctrl->getLinkTarget($this, 'add' . strtoupper($page['type']))
1780  );
1781  }
1782  }
1783 
1784  require_once 'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1785  $table = new ilQuestionInternalLinkSelectionTableGUI($this, 'cancelExplorer', __METHOD__);
1786  $table->setTitle($this->lng->txt('obj_' . ilUtil::stripSlashes($_GET['search_link_type'])));
1787  $table->setData($rows);
1788 
1789  $this->tpl->setContent($table->getHTML());
1790  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
$_GET["client_id"]
getContextPath($cont_obj, $a_endnode_id, $a_startnode_id=1)
get context path in content object tree
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
Class ilObjContentObjectGUI.
static getPageList($lm_id)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outQuestionForTest()

assQuestionGUI::outQuestionForTest (   $formaction,
  $active_id,
  $pass,
  $is_question_postponed = FALSE,
  $user_post_solutions = FALSE,
  $show_specific_inline_feedback = FALSE 
)
final
Parameters
string$formaction
integer$active_id
integer | null$pass
bool$is_question_postponed
bool$user_post_solutions
bool$show_specific_inline_feedback

Definition at line 2175 of file class.assQuestionGUI.php.

References $pass, completeTestOutputFormAction(), getFormEncodingType(), getTestOutput(), magicAfterTestOutput(), and time.

Referenced by ilTestPlayerAbstractGUI\showQuestionEditable().

2185  {
2186  $formaction = $this->completeTestOutputFormAction($formaction, $active_id, $pass);
2187 
2188  $test_output = $this->getTestOutput(
2189  $active_id,
2190  $pass,
2191  $is_question_postponed,
2192  $user_post_solutions,
2193  $show_specific_inline_feedback
2194  );
2195 
2196  $this->magicAfterTestOutput();
2197 
2198  $this->tpl->setVariable("QUESTION_OUTPUT", $test_output);
2199  $this->tpl->setVariable("FORMACTION", $formaction);
2200  $this->tpl->setVariable("ENCTYPE", 'enctype="'.$this->getFormEncodingType().'"');
2201  $this->tpl->setVariable("FORM_TIMESTAMP", time());
2202  }
getTestOutput( $active_id, $pass, $is_question_postponed, $user_post_solutions, $show_specific_inline_feedback)
completeTestOutputFormAction($formAction, $active_id, $pass)
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outQuestionPage()

assQuestionGUI::outQuestionPage (   $a_temp_var,
  $a_postponed = false,
  $active_id = "",
  $html = "" 
)

output question page

Definition at line 528 of file class.assQuestionGUI.php.

References $html, array, getNavigationGUI(), getPreviousSolutionConfirmationCheckboxHtml(), getPreviousSolutionProvidedMessage(), getUseUnchangedAnswerCheckboxHtml(), object, ilUtil\sendInfo(), and ilPageObjectGUI\setOutputMode().

Referenced by assTextSubsetGUI\getTestOutput(), assOrderingHorizontalGUI\getTestOutput(), assNumericGUI\getTestOutput(), assErrorTextGUI\getTestOutput(), assKprimChoiceGUI\getTestOutput(), assLongMenuGUI\getTestOutput(), assFlashQuestionGUI\getTestOutput(), assFileUploadGUI\getTestOutput(), assTextQuestionGUI\getTestOutput(), assSingleChoiceGUI\getTestOutput(), assJavaAppletGUI\getTestOutput(), assMultipleChoiceGUI\getTestOutput(), assOrderingQuestionGUI\getTestOutput(), assImagemapQuestionGUI\getTestOutput(), assMatchingQuestionGUI\getTestOutput(), assFormulaQuestionGUI\getTestOutput(), assClozeTestGUI\getTestOutput(), ilTestPlayerAbstractGUI\populateInstantResponseModal(), and ilTestPlayerAbstractGUI\showQuestionViewable().

529  {
530  // hey: prevPassSolutions - add the "use previous answer"
531  // hey: prevPassSolutions - refactored identifiers
532  if( $this->object->getTestPresentationConfig()->isSolutionInitiallyPrefilled() )
533  // hey
534  {
537  }
538  else /* if( ...->isUnchangedAnswerPossible() ) --> */
539  // hey.
540 // fau: testNav - add the "use unchanged answer checkbox"
541  // hey: prevPassSolutions - refactored identifiers
542  if ($this->object->getTestPresentationConfig()->isUnchangedAnswerPossible())
543  // hey.
544  {
546  }
547 // fau.
548 
549  $this->lng->loadLanguageModule("content");
550 
551 // fau: testNav - add question buttons below question, add actions menu
552  include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
553  $page_gui = new ilAssQuestionPageGUI($this->object->getId());
554  $page_gui->setOutputMode("presentation");
555  $page_gui->setTemplateTargetVar($a_temp_var);
556 
557  if( $this->getNavigationGUI() )
558  {
559  $html .= $this->getNavigationGUI()->getHTML();
560  $page_gui->setQuestionActionsHTML($this->getNavigationGUI()->getActionsHTML());
561  }
562 // fau.
563 
564  if( strlen($html) )
565  {
566  $page_gui->setQuestionHTML(array($this->object->getId() => $html));
567  }
568 
569 // fau: testNav - fill the header with subtitle blocks for question info an actions
570  $page_gui->setPresentationTitle($this->questionHeaderBlockBuilder->getPresentationTitle());
571  $page_gui->setQuestionInfoHTML($this->questionHeaderBlockBuilder->getQuestionInfoHTML());
572 // fau.
573 
574  return $page_gui->presentation();
575  }
Question page GUI class.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
$html
Definition: example_001.php:87
setOutputMode($a_mode=IL_PAGE_PRESENTATION)
Set Output Mode.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outQuestionType()

assQuestionGUI::outQuestionType ( )

Definition at line 1385 of file class.assQuestionGUI.php.

References $_GET, assQuestion\_getQuestionTypeName(), object, and ilUtil\sendInfo().

Referenced by buildBasicEditFormObject(), assOrderingQuestionGUI\buildEditForm(), assMultipleChoiceGUI\buildEditForm(), assTextSubsetGUI\editQuestion(), assTextQuestionGUI\editQuestion(), assOrderingHorizontalGUI\editQuestion(), assFileUploadGUI\editQuestion(), assNumericGUI\editQuestion(), assSingleChoiceGUI\editQuestion(), assErrorTextGUI\editQuestion(), assJavaAppletGUI\editQuestion(), assFlashQuestionGUI\editQuestion(), assMatchingQuestionGUI\editQuestion(), assClozeTestGUI\editQuestion(), and assFormulaQuestionGUI\isSaveCommand().

1386  {
1387  $count = $this->object->isInUse();
1388 
1389  if ($this->object->_questionExistsInPool($this->object->getId()) && $count)
1390  {
1391  global $rbacsystem;
1392  if ($rbacsystem->checkAccess("write", $_GET["ref_id"]))
1393  {
1394  ilUtil::sendInfo(sprintf($this->lng->txt("qpl_question_is_in_use"), $count));
1395  }
1396  }
1397 
1398  return assQuestion::_getQuestionTypeName($this->object->getQuestionType());
1399  }
$_GET["client_id"]
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outSolutionExplorer()

assQuestionGUI::outSolutionExplorer ( )

Definition at line 1644 of file class.assQuestionGUI.php.

References $_GET, array, ilUtil\sendInfo(), and ilExplorer\setExpand().

1645  {
1646  global $tree;
1647 
1648  include_once("./Modules/TestQuestionPool/classes/class.ilSolutionExplorer.php");
1649  $type = $_GET["link_new_type"];
1650  $search = $_GET["search_link_type"];
1651  $this->ctrl->setParameter($this, "link_new_type", $type);
1652  $this->ctrl->setParameter($this, "search_link_type", $search);
1653  $this->ctrl->saveParameter($this, array("subquestion_index", "link_new_type", "search_link_type"));
1654 
1655  ilUtil::sendInfo($this->lng->txt("select_object_to_link"));
1656 
1657  $parent_ref_id = $tree->getParentId($_GET["ref_id"]);
1658  $exp = new ilSolutionExplorer($this->ctrl->getLinkTarget($this, 'suggestedsolution'), get_class($this));
1659  $exp->setExpand($_GET['expand_sol'] ? $_GET['expand_sol'] : $parent_ref_id);
1660  $exp->setExpandTarget($this->ctrl->getLinkTarget($this, 'outSolutionExplorer'));
1661  $exp->setTargetGet("ref_id");
1662  $exp->setRefId($_GET["ref_id"]);
1663  $exp->addFilter($type);
1664  $exp->setSelectableType($type);
1665  if(isset($_GET['expandCurrentPath']) && $_GET['expandCurrentPath'])
1666  {
1667  $exp->expandPathByRefId($parent_ref_id);
1668  }
1669 
1670  // build html-output
1671  $exp->setOutput(0);
1672 
1673  $template = new ilTemplate("tpl.il_as_qpl_explorer.html", TRUE, TRUE, "Modules/TestQuestionPool");
1674  $template->setVariable("EXPLORER_TREE",$exp->getOutput());
1675  $template->setVariable("BUTTON_CANCEL",$this->lng->txt("cancel"));
1676  $template->setVariable("FORMACTION",$this->ctrl->getFormAction($this, "suggestedsolution"));
1677  $this->tpl->setVariable("ADM_CONTENT", $template->get());
1678  }
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
setExpand($a_node_id)
set the expand option this value is stored in a SESSION variable to save it different view (lo view...
+ Here is the call graph for this function:

◆ populateJavascriptFilesRequiredForWorkForm()

assQuestionGUI::populateJavascriptFilesRequiredForWorkForm ( ilTemplate  $tpl)

Definition at line 472 of file class.assQuestionGUI.php.

References ilTemplate\addJavaScript().

473  {
474  $tpl->addJavaScript('Modules/TestQuestionPool/js/ilAssMultipleChoice.js');
475  }
addJavaScript($a_js_file, $a_add_version_parameter=true, $a_batch=2)
Add a javascript file that should be included in the header.
+ Here is the call graph for this function:

◆ populateTaxonomyFormSection()

assQuestionGUI::populateTaxonomyFormSection ( ilPropertyFormGUI  $form)
protected

Definition at line 1277 of file class.assQuestionGUI.php.

References ilObject\_lookupType(), ilPropertyFormGUI\addItem(), ilTaxNodeAssignment\getAssignmentsOfItem(), getTaxonomyIds(), object, and ilFormPropertyGUI\setTitle().

Referenced by assLongMenuGUI\buildEditForm(), assKprimChoiceGUI\buildEditForm(), assImagemapQuestionGUI\buildEditForm(), assOrderingQuestionGUI\buildEditForm(), assMultipleChoiceGUI\buildEditForm(), assTextSubsetGUI\editQuestion(), assTextQuestionGUI\editQuestion(), assOrderingHorizontalGUI\editQuestion(), assFileUploadGUI\editQuestion(), assNumericGUI\editQuestion(), assSingleChoiceGUI\editQuestion(), assErrorTextGUI\editQuestion(), assJavaAppletGUI\editQuestion(), assFlashQuestionGUI\editQuestion(), assMatchingQuestionGUI\editQuestion(), assClozeTestGUI\editQuestion(), and assFormulaQuestionGUI\isSaveCommand().

1278  {
1279  if( count($this->getTaxonomyIds()) )
1280  {
1281  $sectHeader = new ilFormSectionHeaderGUI();
1282  $sectHeader->setTitle($this->lng->txt('qpl_qst_edit_form_taxonomy_section'));
1283  $form->addItem($sectHeader);
1284 
1285  require_once 'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
1286 
1287  foreach($this->getTaxonomyIds() as $taxonomyId)
1288  {
1289  $taxonomy = new ilObjTaxonomy($taxonomyId);
1290  $label = sprintf($this->lng->txt('qpl_qst_edit_form_taxonomy'), $taxonomy->getTitle());
1291  $postvar = "tax_node_assign_$taxonomyId";
1292 
1293  $taxSelect = new ilTaxSelectInputGUI($taxonomy->getId(), $postvar, true);
1294  $taxSelect->setTitle($label);
1295 
1296  require_once 'Services/Taxonomy/classes/class.ilTaxNodeAssignment.php';
1297  $taxNodeAssignments = new ilTaxNodeAssignment(ilObject::_lookupType($this->object->getObjId()), $this->object->getObjId(), 'quest', $taxonomyId);
1298  $assignedNodes = $taxNodeAssignments->getAssignmentsOfItem($this->object->getId());
1299 
1300  $taxSelect->setValue(array_map(function($assignedNode) {
1301  return $assignedNode['node_id'];
1302  }, $assignedNodes));
1303  $form->addItem($taxSelect);
1304  }
1305  }
1306  }
getAssignmentsOfItem($a_item_id)
Get assignments for item.
Taxonomy node <-> item assignment.
Select taxonomy nodes input GUI.
This class represents a section header in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
setTitle($a_title)
Set Title.
static _lookupType($a_id, $a_reference=false)
lookup object type
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderEditForm()

assQuestionGUI::renderEditForm (   $form)
protected
Parameters
$form

Definition at line 502 of file class.assQuestionGUI.php.

References getQuestionTemplate().

Referenced by assOrderingQuestionGUI\changeToPictures(), assOrderingQuestionGUI\changeToText(), assOrderingQuestionGUI\editQuestion(), assOrderingQuestionGUI\orderNestedPictures(), assOrderingQuestionGUI\orderNestedTerms(), assOrderingQuestionGUI\removeElementImage(), assOrderingQuestionGUI\uploadElementImage(), and assOrderingQuestionGUI\writePostData().

503  {
504  $this->getQuestionTemplate();
505  $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
506  }
getQuestionTemplate()
get question template
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderPurposeSupportsFormHtml()

assQuestionGUI::renderPurposeSupportsFormHtml ( )

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

References isRenderPurposeInputValue(), and isRenderPurposePrintPdf().

Referenced by assTextQuestionGUI\getSolutionOutput(), assSingleChoiceGUI\getSolutionOutput(), assMultipleChoiceGUI\getSolutionOutput(), assKprimChoiceGUI\getSolutionOutput(), and assClozeTestGUI\populateSolutiontextToGapTpl().

241  {
242  if( $this->isRenderPurposePrintPdf() )
243  {
244  return false;
245  }
246 
247  if( $this->isRenderPurposeInputValue() )
248  {
249  return false;
250  }
251 
252  return true;
253  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

assQuestionGUI::save ( )

save question

in express mode, so add question to test directly

Definition at line 799 of file class.assQuestionGUI.php.

References $_GET, $_SESSION, $ilDB, $ilUser, $result, $test, assQuestion\_isWriteable(), assQuestion\_questionExistsInTest(), callNewIdListeners(), ilTestExpressPage\getReturnToPageLink(), object, ilUtil\redirect(), ilUtil\sendSuccess(), and writePostData().

Referenced by assFormulaQuestionGUI\saveFQ().

800  {
801  global $ilUser;
802  $old_id = $_GET["q_id"];
803  $result = $this->writePostData();
804 
805  if($result == 0)
806  {
807  $ilUser->setPref("tst_lastquestiontype", $this->object->getQuestionType());
808  $ilUser->writePref("tst_lastquestiontype", $this->object->getQuestionType());
809  $this->object->saveToDb();
810  $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
811 
812 
813  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
814  if(($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId()))
815  {
816  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
817  $this->ctrl->setParameter($this, 'return_to', 'editQuestion');
818  $this->ctrl->redirect($this, "originalSyncForm");
819  return;
820  }
821  elseif($_GET["calling_test"])
822  {
823  require_once 'Modules/Test/classes/class.ilObjTest.php';
824  $test = new ilObjTest($_GET["calling_test"]);
825  if(!assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId()))
826  {
827  global $tree, $ilDB, $ilPluginAdmin;
828 
829  include_once("./Modules/Test/classes/class.ilObjTest.php");
830  $_GET["ref_id"] = $_GET["calling_test"];
831  $test = new ilObjTest($_GET["calling_test"], true);
832 
833  require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
834  $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
835 
836  $new_id = $test->insertQuestion(
837  $testQuestionSetConfigFactory->getQuestionSetConfig(), $this->object->getId()
838  );
839 
840  if(isset($_REQUEST['prev_qid']))
841  {
842  $test->moveQuestionAfter($this->object->getId() + 1, $_REQUEST['prev_qid']);
843  }
844 
845  $this->ctrl->setParameter($this, 'q_id', $new_id);
846  $this->ctrl->setParameter($this, 'calling_test', $_GET['calling_test']);
847  #$this->ctrl->setParameter($this, 'test_ref_id', false);
848  }
849  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
850  $this->ctrl->redirect($this, 'editQuestion');
851 
852  }
853  else
854  {
855  $this->callNewIdListeners($this->object->getId());
856 
857  if($this->object->getId() != $old_id)
858  {
859  // first save
860  $this->ctrl->setParameterByClass($_GET["cmdClass"], "q_id", $this->object->getId());
861  $this->ctrl->setParameterByClass($_GET["cmdClass"], "sel_question_types", $_GET["sel_question_types"]);
862  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
863 
864  //global $___test_express_mode;
868  if($_REQUEST['prev_qid'])
869  {
870  // @todo: bheyser/mbecker wtf? ..... thx@jposselt ....
871  // mbecker: Possible fix: Just instantiate the obj?
872  include_once("./Modules/Test/classes/class.ilObjTest.php");
873  $test = new ilObjTest($_GET["ref_id"], true);
874  $test->moveQuestionAfter($_REQUEST['prev_qid'], $this->object->getId());
875  }
876  if( /*$___test_express_mode || */ $_REQUEST['express_mode'] )
877  {
878  global $tree, $ilDB, $ilPluginAdmin;
879 
880  include_once("./Modules/Test/classes/class.ilObjTest.php");
881  $test = new ilObjTest($_GET["ref_id"], true);
882 
883  require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
884  $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
885 
886  $test->insertQuestion(
887  $testQuestionSetConfigFactory->getQuestionSetConfig(), $this->object->getId()
888  );
889 
890  require_once 'Modules/Test/classes/class.ilTestExpressPage.php';
891  $_REQUEST['q_id'] = $this->object->getId();
893  }
894 
895  $this->ctrl->redirectByClass($_GET["cmdClass"], "editQuestion");
896  }
897  if(strcmp($_SESSION["info"], "") != 0)
898  {
899  ilUtil::sendSuccess($_SESSION["info"] . "<br />" . $this->lng->txt("msg_obj_modified"), true);
900  }
901  else
902  {
903  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
904  }
905  $this->ctrl->redirect($this, 'editQuestion');
906  }
907  }
908  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_SESSION["AccountId"]
$result
writePostData($always=false)
Evaluates a posted edit form and writes the form data in the question object.
$_GET["client_id"]
callNewIdListeners($a_new_id)
Call the new id listeners.
static getReturnToPageLink($q_id=null)
$ilUser
Definition: imgupload.php:18
static _questionExistsInTest($question_id, $test_id)
Create new PHPExcel object
obj_idprivate
global $ilDB
static redirect($a_script)
http redirect to other script
$test
Definition: Utf8Test.php:84
static _isWriteable($question_id, $user_id)
Returns true if the question is writeable by a certain user.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveEdit()

assQuestionGUI::saveEdit ( )

save question

Definition at line 741 of file class.assQuestionGUI.php.

References $_GET, $_SESSION, $ilDB, $ilUser, $result, $test, assQuestion\_isWriteable(), object, ilUtil\redirect(), ilUtil\sendSuccess(), and writePostData().

742  {
743  global $ilUser;
744 
745  $result = $this->writePostData();
746  if ($result == 0)
747  {
748  $ilUser->setPref("tst_lastquestiontype", $this->object->getQuestionType());
749  $ilUser->writePref("tst_lastquestiontype", $this->object->getQuestionType());
750  $this->object->saveToDb();
751  $originalexists = $this->object->_questionExists($this->object->original_id);
752  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
753  if ($_GET["calling_test"] && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId()))
754  {
755  $this->ctrl->redirect($this, "originalSyncForm");
756  }
757  elseif ($_GET["calling_test"])
758  {
759  $_GET["ref_id"] = $_GET["calling_test"];
760  ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=".$_GET["calling_test"]);
761  return;
762  }
763  elseif ($_GET["test_ref_id"])
764  {
765  global $tree, $ilDB, $ilPluginAdmin;
766 
767  include_once ("./Modules/Test/classes/class.ilObjTest.php");
768  $_GET["ref_id"] = $_GET["test_ref_id"];
769  $test = new ilObjTest($_GET["test_ref_id"], true);
770 
771  require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
772  $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
773 
774  $test->insertQuestion( $testQuestionSetConfigFactory->getQuestionSetConfig(), $this->object->getId() );
775 
776  ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=".$_GET["test_ref_id"]);
777  }
778  else
779  {
780  $this->ctrl->setParameter($this, "q_id", $this->object->getId());
781  $this->editQuestion();
782  if (strcmp($_SESSION["info"], "") != 0)
783  {
784  ilUtil::sendSuccess($_SESSION["info"] . "<br />" . $this->lng->txt("msg_obj_modified"), false);
785  }
786  else
787  {
788  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), false);
789  }
790  $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $this->object->getId());
791  $this->ctrl->redirectByClass("ilAssQuestionPageGUI", "edit");
792  }
793  }
794  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_SESSION["AccountId"]
$result
writePostData($always=false)
Evaluates a posted edit form and writes the form data in the question object.
$_GET["client_id"]
$ilUser
Definition: imgupload.php:18
Create new PHPExcel object
obj_idprivate
global $ilDB
static redirect($a_script)
http redirect to other script
$test
Definition: Utf8Test.php:84
static _isWriteable($question_id, $user_id)
Returns true if the question is writeable by a certain user.
+ Here is the call graph for this function:

◆ saveReturn()

assQuestionGUI::saveReturn ( )

save question

Definition at line 913 of file class.assQuestionGUI.php.

References $_GET, $_SESSION, $ilDB, $ilUser, $result, $test, assQuestion\_isWriteable(), assQuestion\_questionExistsInTest(), callNewIdListeners(), ilTestExpressPage\getReturnToPageLink(), object, ilUtil\redirect(), ilUtil\sendSuccess(), and writePostData().

914  {
915  global $ilUser;
916  $old_id = $_GET["q_id"];
917  $result = $this->writePostData();
918  if($result == 0)
919  {
920  $ilUser->setPref("tst_lastquestiontype", $this->object->getQuestionType());
921  $ilUser->writePref("tst_lastquestiontype", $this->object->getQuestionType());
922  $this->object->saveToDb();
923  $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
924  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
925  if(($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId()))
926  {
927  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
928  $this->ctrl->setParameter($this, 'test_express_mode', $_REQUEST['test_express_mode']);
929  $this->ctrl->redirect($this, "originalSyncForm");
930  return;
931  }
932  elseif($_GET["calling_test"])
933  {
934  require_once 'Modules/Test/classes/class.ilObjTest.php';
935  $test = new ilObjTest($_GET["calling_test"]);
936  #var_dump(assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId()));
937  $q_id = $this->object->getId();
938  if(!assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId()))
939  {
940  global $tree, $ilDB, $ilPluginAdmin;
941 
942  include_once("./Modules/Test/classes/class.ilObjTest.php");
943  $_GET["ref_id"] = $_GET["calling_test"];
944  $test = new ilObjTest($_GET["calling_test"], true);
945 
946  require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
947  $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
948 
949  $new_id = $test->insertQuestion(
950  $testQuestionSetConfigFactory->getQuestionSetConfig(), $this->object->getId()
951  );
952 
953  $q_id = $new_id;
954  if(isset($_REQUEST['prev_qid']))
955  {
956  $test->moveQuestionAfter($this->object->getId() + 1, $_REQUEST['prev_qid']);
957  }
958 
959  $this->ctrl->setParameter($this, 'q_id', $new_id);
960  $this->ctrl->setParameter($this, 'calling_test', $_GET['calling_test']);
961  #$this->ctrl->setParameter($this, 'test_ref_id', false);
962 
963  }
964  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
965  if( /*$___test_express_mode || */
966  $_REQUEST['test_express_mode']
967  )
968  {
970  }
971  else
972  {
973  ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET["calling_test"]);
974  }
975  }
976  else
977  {
978  if($this->object->getId() != $old_id)
979  {
980  $this->callNewIdListeners($this->object->getId());
981  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
982  $this->ctrl->redirectByClass("ilobjquestionpoolgui", "questions");
983  }
984  if(strcmp($_SESSION["info"], "") != 0)
985  {
986  ilUtil::sendSuccess($_SESSION["info"] . "<br />" . $this->lng->txt("msg_obj_modified"), true);
987  }
988  else
989  {
990  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
991  }
992  $this->ctrl->redirectByClass("ilobjquestionpoolgui", "questions");
993  }
994  }
995  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_SESSION["AccountId"]
$result
writePostData($always=false)
Evaluates a posted edit form and writes the form data in the question object.
$_GET["client_id"]
callNewIdListeners($a_new_id)
Call the new id listeners.
static getReturnToPageLink($q_id=null)
$ilUser
Definition: imgupload.php:18
static _questionExistsInTest($question_id, $test_id)
Create new PHPExcel object
obj_idprivate
global $ilDB
static redirect($a_script)
http redirect to other script
$test
Definition: Utf8Test.php:84
static _isWriteable($question_id, $user_id)
Returns true if the question is writeable by a certain user.
+ Here is the call graph for this function:

◆ saveSuggestedSolution()

assQuestionGUI::saveSuggestedSolution ( )

Definition at line 1680 of file class.assQuestionGUI.php.

References $_POST, and suggestedsolution().

1681  {
1682  global $tree;
1683 
1684  include_once("./Modules/TestQuestionPool/classes/class.ilSolutionExplorer.php");
1685  switch ($_POST["solutiontype"])
1686  {
1687  case "lm":
1688  $type = "lm";
1689  $search = "lm";
1690  break;
1691  case "git":
1692  $type = "glo";
1693  $search = "glo";
1694  break;
1695  case "st":
1696  $type = "lm";
1697  $search = "st";
1698  break;
1699  case "pg":
1700  $type = "lm";
1701  $search = "pg";
1702  break;
1703  case "file":
1704  case "text":
1705  return $this->suggestedsolution();
1706  break;
1707  default:
1708  return $this->suggestedsolution();
1709  break;
1710  }
1711  if(isset($_POST['solutiontype']))
1712  {
1713  $this->ctrl->setParameter($this, 'expandCurrentPath', 1);
1714  }
1715  $this->ctrl->setParameter($this, "link_new_type", $type);
1716  $this->ctrl->setParameter($this, "search_link_type", $search);
1717  $this->ctrl->redirect($this, "outSolutionExplorer");
1718  }
suggestedsolution()
Allows to add suggested solutions for questions.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveTaxonomyAssignments()

assQuestionGUI::saveTaxonomyAssignments ( )
protected

Definition at line 1260 of file class.assQuestionGUI.php.

References getTaxonomyIds(), and object.

Referenced by assOrderingQuestionGUI\persistAuthoringForm(), assFormulaQuestionGUI\saveFQ(), assFormulaQuestionGUI\saveReturnFQ(), assSingleChoiceGUI\writePostData(), assTextQuestionGUI\writePostData(), assTextSubsetGUI\writePostData(), assErrorTextGUI\writePostData(), assMultipleChoiceGUI\writePostData(), assFileUploadGUI\writePostData(), assMatchingQuestionGUI\writePostData(), assOrderingHorizontalGUI\writePostData(), assJavaAppletGUI\writePostData(), assNumericGUI\writePostData(), assClozeTestGUI\writePostData(), assLongMenuGUI\writePostData(), assFlashQuestionGUI\writePostData(), assImagemapQuestionGUI\writePostData(), assKprimChoiceGUI\writePostData(), and assLongMenuGUI\writeQuestionSpecificPostData().

1261  {
1262  if( count($this->getTaxonomyIds()) )
1263  {
1264  require_once 'Services/Taxonomy/classes/class.ilTaxAssignInputGUI.php';
1265 
1266  foreach($this->getTaxonomyIds() as $taxonomyId)
1267  {
1268  $postvar = "tax_node_assign_$taxonomyId";
1269 
1270  $tax_node_assign = new ilTaxAssignInputGUI($taxonomyId, true, '', $postvar);
1271  // TODO: determine tst/qpl when tax assigns become maintainable within tests
1272  $tax_node_assign->saveInput("qpl", $this->object->getObjId(), "quest", $this->object->getId());
1273  }
1274  }
1275  }
Input GUI class for taxonomy assignments.
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAdjustmentEditContext()

assQuestionGUI::setAdjustmentEditContext ( )

Definition at line 287 of file class.assQuestionGUI.php.

References setEditContext().

288  {
289  return $this->setEditContext(self::EDIT_CONTEXT_ADJUSTMENT);
290  }
setEditContext($editContext)
+ Here is the call graph for this function:

◆ setEditContext()

assQuestionGUI::setEditContext (   $editContext)
Parameters
string$editContext

Definition at line 266 of file class.assQuestionGUI.php.

References $editContext.

Referenced by setAdjustmentEditContext().

267  {
268  $this->editContext = $editContext;
269  }
+ Here is the caller graph for this function:

◆ setErrorMessage()

assQuestionGUI::setErrorMessage (   $errormessage)

◆ setNavigationGUI()

assQuestionGUI::setNavigationGUI (   $navigationGUI)
Parameters
ilTestQuestionNavigationGUI$navigationGUI

Definition at line 303 of file class.assQuestionGUI.php.

References $navigationGUI.

Referenced by ilTestPlayerAbstractGUI\populateInstantResponseModal(), ilTestPlayerAbstractGUI\showQuestionEditable(), and ilTestPlayerAbstractGUI\showQuestionViewable().

304  {
305  $this->navigationGUI = $navigationGUI;
306  }
+ Here is the caller graph for this function:

◆ setPresentationContext()

assQuestionGUI::setPresentationContext (   $presentationContext)
Parameters
string$presentationContext

Definition at line 189 of file class.assQuestionGUI.php.

References $presentationContext.

190  {
191  $this->presentationContext = $presentationContext;
192  }

◆ setPreviewSession()

assQuestionGUI::setPreviewSession (   $previewSession)
Parameters
\ilAssQuestionPreviewSession$previewSession

Definition at line 2277 of file class.assQuestionGUI.php.

References $previewSession.

2278  {
2279  $this->previewSession = $previewSession;
2280  }

◆ setQuestionActionCmd()

assQuestionGUI::setQuestionActionCmd (   $questionActionCmd)

Definition at line 351 of file class.assQuestionGUI.php.

References $questionActionCmd.

352  {
353  $this->questionActionCmd = $questionActionCmd;
354 
355  if( is_object($this->object) )
356  {
357  $this->object->questionActionCmd = $questionActionCmd;
358  }
359  }

◆ setQuestionCount()

assQuestionGUI::setQuestionCount (   $a_question_count)

Definition at line 1044 of file class.assQuestionGUI.php.

1045  {
1046  $this->question_count = $a_question_count;
1047  }

◆ setQuestionHeaderBlockBuilder()

assQuestionGUI::setQuestionHeaderBlockBuilder (   $questionHeaderBlockBuilder)
Parameters
\ilQuestionHeaderBlockBuilder$questionHeaderBlockBuilder

Definition at line 336 of file class.assQuestionGUI.php.

References $questionHeaderBlockBuilder.

337  {
338  $this->questionHeaderBlockBuilder = $questionHeaderBlockBuilder;
339  }

◆ setQuestionTabs()

assQuestionGUI::setQuestionTabs ( )

Definition at line 1951 of file class.assQuestionGUI.php.

References $_GET, $url, addBackTab(), addTab_QuestionFeedback(), addTab_QuestionHints(), addTab_QuestionPreview(), addTab_SuggestedSolution(), array, and getEditQuestionTabCommands().

Referenced by assNumericGUI\getTestOutput().

1952  {
1953  global $rbacsystem, $ilTabs;
1954 
1955  $ilTabs->clearTargets();
1956 
1957  $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
1958  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
1959  $q_type = $this->object->getQuestionType();
1960 
1961  if (strlen($q_type))
1962  {
1963  $classname = $q_type . "GUI";
1964  $this->ctrl->setParameterByClass(strtolower($classname), "sel_question_types", $q_type);
1965  $this->ctrl->setParameterByClass(strtolower($classname), "q_id", $_GET["q_id"]);
1966  }
1967 
1968  if ($_GET["q_id"])
1969  {
1970  if ($rbacsystem->checkAccess('write', $_GET["ref_id"]))
1971  {
1972  // edit page
1973  $ilTabs->addTarget("edit_page",
1974  $this->ctrl->getLinkTargetByClass("ilAssQuestionPageGUI", "edit"),
1975  array("edit", "insert", "exec_pg"),
1976  "", "", $force_active);
1977  }
1978 
1979  $this->addTab_QuestionPreview($ilTabs);
1980  }
1981  $force_active = false;
1982  if ($rbacsystem->checkAccess('write', $_GET["ref_id"]))
1983  {
1984  $url = "";
1985  if ($classname) $url = $this->ctrl->getLinkTargetByClass($classname, "editQuestion");
1986  $force_active = false;
1987  // edit question properties
1988  $ilTabs->addTarget("edit_question",
1989  $url,
1990  $this->getEditQuestionTabCommands(),
1991  $classname, "", $force_active);
1992  }
1993 
1994  // add tab for question feedback within common class assQuestionGUI
1995  $this->addTab_QuestionFeedback($ilTabs);
1996 
1997  // add tab for question hint within common class assQuestionGUI
1998  $this->addTab_QuestionHints($ilTabs);
1999 
2000  // add tab for question's suggested solution within common class assQuestionGUI
2001  $this->addTab_SuggestedSolution($ilTabs, $classname);
2002 
2003  // Assessment of questions sub menu entry
2004  if ($_GET["q_id"])
2005  {
2006  $ilTabs->addTarget("statistics",
2007  $this->ctrl->getLinkTargetByClass($classname, "assessment"),
2008  array("assessment"),
2009  $classname, "");
2010  }
2011 
2012  $this->addBackTab($ilTabs);
2013  }
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)
addTab_SuggestedSolution(ilTabsGUI $tabs, $classname)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setRenderPurpose()

assQuestionGUI::setRenderPurpose (   $renderPurpose)
Parameters
string$renderPurpose

Definition at line 210 of file class.assQuestionGUI.php.

References $renderPurpose.

Referenced by suggestedsolution().

211  {
212  $this->renderPurpose = $renderPurpose;
213  }
+ Here is the caller graph for this function:

◆ setSequenceNumber()

assQuestionGUI::setSequenceNumber (   $nr)

Definition at line 1034 of file class.assQuestionGUI.php.

1035  {
1036  $this->sequence_no = $nr;
1037  }

◆ setTargetGui()

assQuestionGUI::setTargetGui (   $linkTargetGui)

Definition at line 318 of file class.assQuestionGUI.php.

References setTargetGuiClass().

319  {
320  $this->setTargetGuiClass( get_class($linkTargetGui) );
321  }
setTargetGuiClass($targetGuiClass)
+ Here is the call graph for this function:

◆ setTargetGuiClass()

assQuestionGUI::setTargetGuiClass (   $targetGuiClass)

Definition at line 323 of file class.assQuestionGUI.php.

References $targetGuiClass.

Referenced by setTargetGui().

324  {
325  $this->targetGuiClass = $targetGuiClass;
326  }
+ Here is the caller graph for this function:

◆ setTaxonomyIds()

assQuestionGUI::setTaxonomyIds (   $taxonomyIds)

Definition at line 308 of file class.assQuestionGUI.php.

References $taxonomyIds.

309  {
310  $this->taxonomyIds = $taxonomyIds;
311  }

◆ showHints()

assQuestionGUI::showHints ( )

Definition at line 2310 of file class.assQuestionGUI.php.

References $ilCtrl, and ilAssQuestionHintsGUI\CMD_SHOW_LIST.

2311  {
2312  global $ilCtrl;
2313  $ilCtrl->redirectByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST);
2314  }
const CMD_SHOW_LIST
command constants
global $ilCtrl
Definition: ilias.php:18

◆ showSuggestedSolution()

assQuestionGUI::showSuggestedSolution ( )

Definition at line 1401 of file class.assQuestionGUI.php.

References suggestedsolution().

1402  {
1403  $this->suggestedsolution();
1404  }
suggestedsolution()
Allows to add suggested solutions for questions.
+ Here is the call graph for this function:

◆ suggestedsolution()

assQuestionGUI::suggestedsolution ( )

Allows to add suggested solutions for questions.

public

Definition at line 1411 of file class.assQuestionGUI.php.

References $_GET, $_POST, $file, $ilUser, $options, $output, $res, $title, assQuestion\_getInternalLinkHref(), assQuestion\_isWriteable(), ilRadioGroupInputGUI\addOption(), array, getRenderPurpose(), getSolutionOutput(), ilUtil\makeDirParents(), ilUtil\moveUploadedFile(), object, originalSyncForm(), ilUtil\prepareFormOutput(), ilUtil\renameExecutables(), ilUtil\sendInfo(), ilUtil\sendSuccess(), setRenderPurpose(), and ilTextAreaInputGUI\setValue().

Referenced by saveSuggestedSolution(), and showSuggestedSolution().

1412  {
1413  global $ilUser;
1414  global $ilAccess;
1415 
1416  $save = (is_array($_POST["cmd"]) && array_key_exists("suggestedsolution", $_POST["cmd"])) ? TRUE : FALSE;
1417 
1418  if ($save && $_POST["deleteSuggestedSolution"] == 1)
1419  {
1420  $this->object->deleteSuggestedSolutions();
1421  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1422  $this->ctrl->redirect($this, "suggestedsolution");
1423  }
1424 
1425  $output = "";
1426  $solution_array = $this->object->getSuggestedSolution(0);
1427  $options = array(
1428  "lm" => $this->lng->txt("obj_lm"),
1429  "st" => $this->lng->txt("obj_st"),
1430  "pg" => $this->lng->txt("obj_pg"),
1431  "git" => $this->lng->txt("glossary_term"),
1432  "file" => $this->lng->txt("fileDownload"),
1433  "text" => $this->lng->txt("solutionText")
1434  );
1435 
1436  if ((strcmp($_POST["solutiontype"], "file") == 0) && (strcmp($solution_array["type"], "file") != 0))
1437  {
1438  $solution_array = array(
1439  "type" => "file"
1440  );
1441  }
1442  elseif ((strcmp($_POST["solutiontype"], "text") == 0) && (strcmp($solution_array["type"], "text") != 0))
1443  {
1444  $oldOutputMode = $this->getRenderPurpose();
1445  $this->setRenderPurpose(self::RENDER_PURPOSE_INPUT_VALUE);
1446 
1447  $solution_array = array(
1448  "type" => "text",
1449  "value" => $this->getSolutionOutput(0, NULL, FALSE, FALSE, TRUE, FALSE, TRUE)
1450  );
1451  $this->setRenderPurpose($oldsaveSuggestedSolutionOutputMode);
1452  }
1453  if ($save && strlen($_POST["filename"]))
1454  {
1455  $solution_array["value"]["filename"] = $_POST["filename"];
1456  }
1457  if ($save && strlen($_POST["solutiontext"]))
1458  {
1459  $solution_array["value"] = $_POST["solutiontext"];
1460  }
1461  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1462  if (count($solution_array))
1463  {
1464  $form = new ilPropertyFormGUI();
1465  $form->setFormAction($this->ctrl->getFormAction($this));
1466  $form->setTitle($this->lng->txt("solution_hint"));
1467  $form->setMultipart(TRUE);
1468  $form->setTableWidth("100%");
1469  $form->setId("suggestedsolutiondisplay");
1470 
1471  // suggested solution output
1472  include_once "./Modules/TestQuestionPool/classes/class.ilSolutionTitleInputGUI.php";
1473  $title = new ilSolutionTitleInputGUI($this->lng->txt("showSuggestedSolution"), "solutiontype");
1474  $template = new ilTemplate("tpl.il_as_qpl_suggested_solution_input_presentation.html", TRUE, TRUE, "Modules/TestQuestionPool");
1475  if (strlen($solution_array["internal_link"]))
1476  {
1477  $href = assQuestion::_getInternalLinkHref($solution_array["internal_link"]);
1478  $template->setCurrentBlock("preview");
1479  $template->setVariable("TEXT_SOLUTION", $this->lng->txt("suggested_solution"));
1480  $template->setVariable("VALUE_SOLUTION", " <a href=\"$href\" target=\"content\">" . $this->lng->txt("view"). "</a> ");
1481  $template->parseCurrentBlock();
1482  }
1483  elseif ((strcmp($solution_array["type"], "file") == 0) && (is_array($solution_array["value"])))
1484  {
1485  $href = $this->object->getSuggestedSolutionPathWeb() . $solution_array["value"]["name"];
1486  $template->setCurrentBlock("preview");
1487  $template->setVariable("TEXT_SOLUTION", $this->lng->txt("suggested_solution"));
1488  $template->setVariable("VALUE_SOLUTION", " <a href=\"$href\" target=\"content\">" . ilUtil::prepareFormOutput((strlen($solution_array["value"]["filename"])) ? $solution_array["value"]["filename"] : $solution_array["value"]["name"]). "</a> ");
1489  $template->parseCurrentBlock();
1490  }
1491  $template->setVariable("TEXT_TYPE", $this->lng->txt("type"));
1492  $template->setVariable("VALUE_TYPE", $options[$solution_array["type"]]);
1493  $title->setHtml($template->get());
1494  $deletesolution = new ilCheckboxInputGUI("", "deleteSuggestedSolution");
1495  $deletesolution->setOptionTitle($this->lng->txt("deleteSuggestedSolution"));
1496  $title->addSubItem($deletesolution);
1497  $form->addItem($title);
1498 
1499  if (strcmp($solution_array["type"], "file") == 0)
1500  {
1501  // file
1502  $file = new ilFileInputGUI($this->lng->txt("fileDownload"), "file");
1503  $file->setRequired(TRUE);
1504  $file->enableFileNameSelection("filename");
1505  //$file->setSuffixes(array("doc","xls","png","jpg","gif","pdf"));
1506  if( $_FILES["file"]["tmp_name"] && $file->checkInput() )
1507  {
1508  if (!file_exists($this->object->getSuggestedSolutionPath())) ilUtil::makeDirParents($this->object->getSuggestedSolutionPath());
1509 
1510  $res = ilUtil::moveUploadedFile($_FILES["file"]["tmp_name"], $_FILES["file"]["name"], $this->object->getSuggestedSolutionPath() . $_FILES["file"]["name"]);
1511  if ($res)
1512  {
1513  ilUtil::renameExecutables($this->object->getSuggestedSolutionPath());
1514 
1515  // remove an old file download
1516  if (is_array($solution_array["value"])) @unlink($this->object->getSuggestedSolutionPath() . $solution_array["value"]["name"]);
1517  $file->setValue($_FILES["file"]["name"]);
1518  $this->object->saveSuggestedSolution("file", "", 0, array("name" => $_FILES["file"]["name"], "type" => $_FILES["file"]["type"], "size" => $_FILES["file"]["size"], "filename" => $_POST["filename"]));
1519  $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
1520  if (($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId()))
1521  {
1522  return $this->originalSyncForm("suggestedsolution");
1523  }
1524  else
1525  {
1526  ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), TRUE);
1527  $this->ctrl->redirect($this, "suggestedsolution");
1528  }
1529  }
1530  else
1531  {
1532  // BH: $res as info string? wtf? it holds a bool or something else!!?
1533  ilUtil::sendInfo($res);
1534  }
1535  }
1536  else
1537  {
1538  if (is_array($solution_array["value"]))
1539  {
1540  $file->setValue($solution_array["value"]["name"]);
1541  $file->setFilename((strlen($solution_array["value"]["filename"])) ? $solution_array["value"]["filename"] : $solution_array["value"]["name"]);
1542  }
1543  }
1544  $form->addItem($file);
1545  $hidden = new ilHiddenInputGUI("solutiontype");
1546  $hidden->setValue("file");
1547  $form->addItem($hidden);
1548  }
1549  else if (strcmp($solution_array["type"], "text") == 0)
1550  {
1551  $solutionContent = $solution_array['value'];
1552  $solutionContent = $this->object->fixSvgToPng($solutionContent);
1553  $solutionContent = $this->object->fixUnavailableSkinImageSources($solutionContent);
1554  $question = new ilTextAreaInputGUI($this->lng->txt("solutionText"), "solutiontext");
1555  $question->setValue($this->object->prepareTextareaOutput($solutionContent));
1556  $question->setRequired(TRUE);
1557  $question->setRows(10);
1558  $question->setCols(80);
1559  $question->setUseRte(TRUE);
1560  $question->addPlugin("latex");
1561  $question->addButton("latex");
1562  $question->setRTESupport($this->object->getId(), "qpl", "assessment");
1563  $hidden = new ilHiddenInputGUI("solutiontype");
1564  $hidden->setValue("text");
1565  $form->addItem($hidden);
1566  $form->addItem($question);
1567  }
1568  if ($ilAccess->checkAccess("write", "", $_GET['ref_id']))
1569  {
1570  $form->addCommandButton('showSuggestedSolution', $this->lng->txt('cancel'));
1571  $form->addCommandButton('suggestedsolution', $this->lng->txt('save'));
1572  }
1573 
1574  if ($save)
1575  {
1576  if ($form->checkInput())
1577  {
1578  switch ($solution_array["type"])
1579  {
1580  case "file":
1581  $this->object->saveSuggestedSolution("file", "", 0, array(
1582  "name" => $solution_array["value"]["name"],
1583  "type" => $solution_array["value"]["type"],
1584  "size" => $solution_array["value"]["size"],
1585  "filename" => $_POST["filename"]
1586  ));
1587  break;
1588  case "text":
1589  $this->object->saveSuggestedSolution("text", "", 0, $solution_array["value"]);
1590  break;
1591  }
1592  $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
1593  if (($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId()))
1594  {
1595  return $this->originalSyncForm("suggestedsolution");
1596  }
1597  else
1598  {
1599  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1600  $this->ctrl->redirect($this, "suggestedsolution");
1601  }
1602  }
1603  }
1604 
1605  $output = $form->getHTML();
1606  }
1607 
1608  $savechange = (strcmp($this->ctrl->getCmd(), "saveSuggestedSolution") == 0) ? TRUE : FALSE;
1609 
1610  $changeoutput = "";
1611  if ($ilAccess->checkAccess("write", "", $_GET['ref_id']))
1612  {
1613  $formchange = new ilPropertyFormGUI();
1614  $formchange->setFormAction($this->ctrl->getFormAction($this));
1615  $formchange->setTitle((count($solution_array)) ? $this->lng->txt("changeSuggestedSolution") : $this->lng->txt("addSuggestedSolution"));
1616  $formchange->setMultipart(FALSE);
1617  $formchange->setTableWidth("100%");
1618  $formchange->setId("suggestedsolution");
1619 
1620  $solutiontype = new ilRadioGroupInputGUI($this->lng->txt("suggestedSolutionType"), "solutiontype");
1621  foreach($options as $opt_value => $opt_caption)
1622  {
1623  $solutiontype->addOption(new ilRadioOption($opt_caption, $opt_value));
1624  }
1625  if (count($solution_array))
1626  {
1627  $solutiontype->setValue($solution_array["type"]);
1628  }
1629  $solutiontype->setRequired(TRUE);
1630  $formchange->addItem($solutiontype);
1631 
1632  $formchange->addCommandButton("saveSuggestedSolution", $this->lng->txt("select"));
1633 
1634  if ($savechange)
1635  {
1636  $formchange->checkInput();
1637  }
1638  $changeoutput = $formchange->getHTML();
1639  }
1640 
1641  $this->tpl->setVariable("ADM_CONTENT", $changeoutput . $output);
1642  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static makeDirParents($a_dir)
Create a new directory and all parent directories.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
This class represents an option in a radio group.
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)
This class represents a property form user interface.
$_GET["client_id"]
This class represents a file property in a property form.
setValue($a_value)
Set Value.
This class represents a checkbox property in a property form.
setRenderPurpose($renderPurpose)
This class represents a custom property in a property form.
static _getInternalLinkHref($target="")
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
This class represents a hidden form property in a property form.
This class represents a property in a property form.
addOption($a_option)
Add Option.
if(!is_array($argv)) $options
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
special template class to simplify handling of ITX/PEAR
originalSyncForm($return_to="", $return_to_feedback='')
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
This class represents a text area property in a property form.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
$_POST["username"]
static _isWriteable($question_id, $user_id)
Returns true if the question is writeable by a certain user.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sync()

assQuestionGUI::sync ( )

Definition at line 661 of file class.assQuestionGUI.php.

References $_GET, $ref_id, ilLink\_getLink(), ilObjectFactory\getInstanceByRefId(), ilTestExpressPage\getReturnToPageLink(), object, and ilUtil\redirect().

662  {
663  $original_id = $this->object->original_id;
664  if ($original_id)
665  {
666  $this->object->syncWithOriginal();
667  }
668  if (strlen($_GET["return_to"]))
669  {
670  $this->ctrl->redirect($this, $_GET["return_to"]);
671  }
672  if (strlen($_REQUEST["return_to_fb"]))
673  {
674  $this->ctrl->redirectByClass('ilAssQuestionFeedbackEditingGUI', 'showFeedbackForm');
675  }
676  else
677  {
678  if(isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])
679  {
680  $ref_id = (int)$_GET['calling_consumer'];
682  if($consumer instanceof ilQuestionEditingFormConsumer)
683  {
684  ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
685  }
686  require_once 'Services/Link/classes/class.ilLink.php';
688  }
689  $_GET["ref_id"] = $_GET["calling_test"];
690 
691  if($_REQUEST['test_express_mode'])
692  {
694  }
695  else
696  {
697  ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=".$_GET["calling_test"]);
698  }
699  }
700  }
$_GET["client_id"]
static getReturnToPageLink($q_id=null)
$ref_id
Definition: sahs_server.php:39
Create new PHPExcel object
obj_idprivate
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ writePostData()

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

Definition at line 370 of file class.assQuestionGUI.php.

References $tpl, and array.

Referenced by apply(), save(), saveEdit(), and saveReturn().

371  {
372  }
+ Here is the caller graph for this function:

◆ writeQuestionGenericPostData()

assQuestionGUI::writeQuestionGenericPostData ( )
protected

Definition at line 2148 of file class.assQuestionGUI.php.

References $_POST, getPreview(), object, and ilUtil\stripOnlySlashes().

Referenced by assOrderingQuestionGUI\persistAuthoringForm(), assSingleChoiceGUI\writePostData(), assTextQuestionGUI\writePostData(), assTextSubsetGUI\writePostData(), assMultipleChoiceGUI\writePostData(), assErrorTextGUI\writePostData(), assMatchingQuestionGUI\writePostData(), assFileUploadGUI\writePostData(), assOrderingHorizontalGUI\writePostData(), assJavaAppletGUI\writePostData(), assNumericGUI\writePostData(), assClozeTestGUI\writePostData(), assLongMenuGUI\writePostData(), assFlashQuestionGUI\writePostData(), assImagemapQuestionGUI\writePostData(), and assKprimChoiceGUI\writePostData().

2149  {
2150  $this->object->setTitle( $_POST["title"] );
2151  $this->object->setAuthor( $_POST["author"] );
2152  $this->object->setComment( $_POST["comment"] );
2153  if ($this->object->getSelfAssessmentEditingMode())
2154  {
2155  $this->object->setNrOfTries( $_POST['nr_of_tries'] );
2156  }
2157  $this->object->setQuestion( ilUtil::stripOnlySlashes($_POST['question']) ); // ?
2158  $this->object->setEstimatedWorkingTime(
2159  $_POST["Estimated"]["hh"],
2160  $_POST["Estimated"]["mm"],
2161  $_POST["Estimated"]["ss"]
2162  );
2163  }
static stripOnlySlashes($a_str)
strip slashes if magic qoutes is enabled
Create new PHPExcel object
obj_idprivate
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $editContext

assQuestionGUI::$editContext = self::EDIT_CONTEXT_AUTHORING
private

Definition at line 94 of file class.assQuestionGUI.php.

Referenced by getEditContext(), and setEditContext().

◆ $editForm

assQuestionGUI::$editForm
protected

Definition at line 99 of file class.assQuestionGUI.php.

Referenced by buildEditForm().

◆ $error

assQuestionGUI::$error

Definition at line 41 of file class.assQuestionGUI.php.

◆ $errormessage

assQuestionGUI::$errormessage

Definition at line 42 of file class.assQuestionGUI.php.

Referenced by addErrorMessage(), getErrorMessage(), and setErrorMessage().

◆ $lng

assQuestionGUI::$lng

◆ $navigationGUI

assQuestionGUI::$navigationGUI
private

Definition at line 67 of file class.assQuestionGUI.php.

Referenced by getNavigationGUI(), and setNavigationGUI().

◆ $object

assQuestionGUI::$object

Definition at line 37 of file class.assQuestionGUI.php.

Referenced by assFormulaQuestionGUI\isSaveCommand().

◆ $presentationContext

assQuestionGUI::$presentationContext = null
private

Definition at line 75 of file class.assQuestionGUI.php.

Referenced by getPresentationContext(), and setPresentationContext().

◆ $previewSession

assQuestionGUI::$previewSession
private

Definition at line 2272 of file class.assQuestionGUI.php.

Referenced by getPreviewSession(), and setPreviewSession().

◆ $question_count

assQuestionGUI::$question_count

question count in test

Definition at line 51 of file class.assQuestionGUI.php.

Referenced by getQuestionCount().

◆ $questionActionCmd

assQuestionGUI::$questionActionCmd = 'handleQuestionAction'
private

Definition at line 57 of file class.assQuestionGUI.php.

Referenced by getQuestionActionCmd(), and setQuestionActionCmd().

◆ $questionHeaderBlockBuilder

assQuestionGUI::$questionHeaderBlockBuilder
private

◆ $renderPurpose

assQuestionGUI::$renderPurpose = self::RENDER_PURPOSE_PLAYBACK
private

Definition at line 86 of file class.assQuestionGUI.php.

Referenced by getRenderPurpose(), and setRenderPurpose().

◆ $sequence_no

assQuestionGUI::$sequence_no

sequence number in test

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

Referenced by getSequenceNumber().

◆ $targetGuiClass

assQuestionGUI::$targetGuiClass = null
private

Definition at line 55 of file class.assQuestionGUI.php.

Referenced by getTargetGuiClass(), and setTargetGuiClass().

◆ $taxonomyIds

assQuestionGUI::$taxonomyIds = array()
private

Definition at line 53 of file class.assQuestionGUI.php.

Referenced by getTaxonomyIds(), and setTaxonomyIds().

◆ $tpl

◆ EDIT_CONTEXT_ADJUSTMENT

const assQuestionGUI::EDIT_CONTEXT_ADJUSTMENT = 'adjustment'

◆ EDIT_CONTEXT_AUTHORING

const assQuestionGUI::EDIT_CONTEXT_AUTHORING = 'authoring'

◆ FORM_ENCODING_MULTIPART

const assQuestionGUI::FORM_ENCODING_MULTIPART = 'multipart/form-data'

Definition at line 26 of file class.assQuestionGUI.php.

◆ FORM_ENCODING_URLENCODE

const assQuestionGUI::FORM_ENCODING_URLENCODE = 'application/x-www-form-urlencoded'

Definition at line 25 of file class.assQuestionGUI.php.

◆ FORM_MODE_ADJUST

const assQuestionGUI::FORM_MODE_ADJUST = 'adjust'

Definition at line 23 of file class.assQuestionGUI.php.

◆ FORM_MODE_EDIT

const assQuestionGUI::FORM_MODE_EDIT = 'edit'

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

◆ PRESENTATION_CONTEXT_RESULTS

const assQuestionGUI::PRESENTATION_CONTEXT_RESULTS = 'pContextResults'

Definition at line 70 of file class.assQuestionGUI.php.

◆ PRESENTATION_CONTEXT_TEST

const assQuestionGUI::PRESENTATION_CONTEXT_TEST = 'pContextTest'

◆ RENDER_PURPOSE_DEMOPLAY

const assQuestionGUI::RENDER_PURPOSE_DEMOPLAY = 'renderPurposeDemoplay'

Definition at line 78 of file class.assQuestionGUI.php.

Referenced by ilAssQuestionPreviewGUI\initQuestion().

◆ RENDER_PURPOSE_INPUT_VALUE

const assQuestionGUI::RENDER_PURPOSE_INPUT_VALUE = 'renderPurposeInputValue'

Definition at line 81 of file class.assQuestionGUI.php.

◆ RENDER_PURPOSE_PLAYBACK

const assQuestionGUI::RENDER_PURPOSE_PLAYBACK = 'renderPurposePlayback'

Definition at line 77 of file class.assQuestionGUI.php.

◆ RENDER_PURPOSE_PREVIEW

◆ RENDER_PURPOSE_PRINT_PDF

const assQuestionGUI::RENDER_PURPOSE_PRINT_PDF = 'renderPurposePrintPdf'

◆ SESSION_PREVIEW_DATA_BASE_INDEX

const assQuestionGUI::SESSION_PREVIEW_DATA_BASE_INDEX = 'ilAssQuestionPreviewAnswers'

Definition at line 28 of file class.assQuestionGUI.php.


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