ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 hasInlineFeedback ()
 this method can be overwritten per question type More...
 
 addHeaderAction ()
 
 redrawHeaderAction ()
 
 getHeaderAction ()
 
 getNotesHTML ()
 
 executeCommand ()
 execute command More...
 
 getCommand ($cmd)
 
 getType ()
 needed for page editor compliance More...
 
 getPresentationContext ()
 
 setPresentationContext ($presentationContext)
 
 isTestPresentationContext ()
 
 isPreviousSolutionPrefilled ()
 
 setPreviousSolutionPrefilled ($previousSolutionPrefilled)
 
 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 (ilGlobalTemplateInterface $tpl)
 
 getPresentationJavascripts ()
 
 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="", $inlineFeedbackEnabled=false)
 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 ($userSolution)
 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)
 
 supportsIntermediateSolutionOutput ()
 Question type specific support of intermediate solution output The function getSolutionOutput respects getUseIntermediateSolution() More...
 
 hasIntermediateSolution ($activeId, $passIndex)
 Check if the question has an intermediate solution. More...
 
 setUseIntermediateSolution ($use)
 
 getUseIntermediateSolution ()
 Get if intermediate solution should be used for solution output. More...
 
 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 ()
 
 buildFocusAnchorHtml ()
 
 isAnswerFreuqencyStatisticSupported ()
 
 getSubQuestionsIndex ()
 
 getAnswersFrequency ($relevantAnswers, $questionIndex)
 
 getAnswerFrequencyTableGUI ($parentGui, $parentCmd, $relevantAnswers, $questionIndex)
 
 prepareReprintableCorrectionsForm (ilPropertyFormGUI $form)
 
 populateCorrectionsFormProperties (ilPropertyFormGUI $form)
 
 saveCorrectionsFormProperties (ilPropertyFormGUI $form)
 

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)
 
 getUseUnchangedAnswerCheckboxHtml ()
 
 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
 
 $use_intermediate_solution = false
 

Private Attributes

 $taxonomyIds = array()
 
 $targetGuiClass = null
 
 $questionActionCmd = 'handleQuestionAction'
 
 $questionHeaderBlockBuilder
 
 $navigationGUI
 
 $presentationContext = null
 
 $renderPurpose = self::RENDER_PURPOSE_PLAYBACK
 
 $editContext = self::EDIT_CONTEXT_AUTHORING
 
 $previousSolutionPrefilled = false
 
 $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 118 of file class.assQuestionGUI.php.

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

119  {
120  global $DIC;
121  $lng = $DIC['lng'];
122  $tpl = $DIC['tpl'];
123  $ilCtrl = $DIC['ilCtrl'];
124 
125  $this->lng = &$lng;
126  $this->tpl = &$tpl;
127  $this->ctrl = &$ilCtrl;
128  $this->ctrl->saveParameter($this, "q_id");
129  $this->ctrl->saveParameter($this, "prev_qid");
130  $this->ctrl->saveParameter($this, "calling_test");
131  $this->ctrl->saveParameter($this, "calling_consumer");
132  $this->ctrl->saveParameter($this, "consumer_context");
133  $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'test_express_mode');
134  $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'calling_consumer');
135  $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'consumer_context');
136  $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'test_express_mode');
137  $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'calling_consumer');
138  $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'consumer_context');
139 
140  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
141  $this->errormessage = $this->lng->txt("fill_out_all_required_fields");
142 
143  $this->selfassessmenteditingmode = false;
144  $this->new_id_listeners = array();
145  $this->new_id_listener_cnt = 0;
146 
147  $this->navigationGUI = null;
148  }
global $ilCtrl
Definition: ilias.php:18
$DIC
Definition: xapitoken.php:46

Member Function Documentation

◆ _getClassNameForQType()

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

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

Referenced by _getGUIClassNameForId().

558  {
559  return $q_type . "GUI";
560  }
+ Here is the caller graph for this function:

◆ _getGUIClassNameForId()

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

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

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

Referenced by ilQuestionBrowserTableGUI\fillRow().

546  {
547  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
548  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
549  $q_type = assQuestion::getQuestionTypeFromDb($a_q_id);
550  $class_name = assQuestionGUI::_getClassNameForQType($q_type);
551  return $class_name;
552  }
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 510 of file class.assQuestionGUI.php.

References $DIC, $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(), ilQuestionEditGUI\executeCommand(), ilObjTestGUI\executeCommand(), ilPageObjectGUI\executeCommand(), ilSCORM2004Asset\exportHTMLPageObjects(), ilQuestionExporter\exportQuestion(), ilObjAssessmentFolder\fetchScoringAdjustableTypes(), ilAssQuestionPageCommandForwarder\forward(), ilPCQuestion\getJavascriptFiles(), ilSCORM2004PageGUI\getQuestionHtmlOfPage(), ilTestExpressPageObjectGUI\handleToolbarCommand(), ilPCQuestion\modifyPageContentPostXsl(), ilAssQuestionSkillAssignmentsGUI\saveSkillQuestionAssignmentPropertiesFormCmd(), ilObjQuestionPoolGUI\setTitleAndDescription(), and ilAssQuestionSkillAssignmentsGUI\showSkillQuestionAssignmentPropertiesFormCmd().

511  {
512  global $DIC;
513  $ilCtrl = $DIC['ilCtrl'];
514  $ilDB = $DIC['ilDB'];
515  $lng = $DIC['lng'];
516 
517  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
518 
519  if ((!$question_type) and ($question_id > 0)) {
520  $question_type = assQuestion::getQuestionTypeFromDb($question_id);
521  }
522 
523  if (strlen($question_type) == 0) {
524  return null;
525  }
526 
527  assQuestion::_includeClass($question_type, 1);
528 
529  $question_type_gui = assQuestion::getGuiClassNameByQuestionType($question_type);
530  $question = new $question_type_gui();
531 
532  $feedbackObjectClassname = assQuestion::getFeedbackClassNameByQuestionType($question_type);
533  $question->object->feedbackOBJ = new $feedbackObjectClassname($question->object, $ilCtrl, $ilDB, $lng);
534 
535  if ($question_id > 0) {
536  $question->object->loadFromDb($question_id);
537  }
538 
539  return $question;
540  }
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
$DIC
Definition: xapitoken.php:46
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 2274 of file class.assQuestionGUI.php.

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

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

2275  {
2276  if (($_GET["calling_test"] > 0) || ($_GET["test_ref_id"] > 0)) {
2277  $ref_id = $_GET["calling_test"];
2278  if (strlen($ref_id) == 0) {
2279  $ref_id = $_GET["test_ref_id"];
2280  }
2281 
2282  if (!$_GET['test_express_mode'] && !$GLOBALS['___test_express_mode']) {
2283  $ilTabs->setBackTarget($this->lng->txt("backtocallingtest"), "ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=$ref_id");
2284  } else {
2286  $ilTabs->setBackTarget($this->lng->txt("backtocallingtest"), $link);
2287  }
2288  } elseif (isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer']) {
2289  $ref_id = (int) $_GET['calling_consumer'];
2290  $consumer = ilObjectFactory::getInstanceByRefId($ref_id);
2291  if ($consumer instanceof ilQuestionEditingFormConsumer) {
2292  $ilTabs->setBackTarget($consumer->getQuestionEditingFormBackTargetLabel(), $consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
2293  } else {
2294  require_once 'Services/Link/classes/class.ilLink.php';
2295  $ilTabs->setBackTarget($this->lng->txt("qpl"), ilLink::_getLink($ref_id));
2296  }
2297  } else {
2298  $ilTabs->setBackTarget($this->lng->txt("qpl"), $this->ctrl->getLinkTargetByClass("ilobjquestionpoolgui", "questions"));
2299  }
2300  }
$_GET["client_id"]
setBackTarget($a_title, $a_target, $a_frame="")
back target for upper context
static getReturnToPageLink($q_id=null)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
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 1206 of file class.assQuestionGUI.php.

References ilObjAdvancedEditing\_getUsedHTMLTags(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT, ilAssSelfAssessmentQuestionFormatter\getSelfAssessmentTags(), ilUtil\prepareFormOutput(), ilDurationInputGUI\setShowHours(), 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().

1207  {
1208  // title
1209  $title = new ilTextInputGUI($this->lng->txt("title"), "title");
1210  $title->setMaxLength(100);
1211  $title->setValue($this->object->getTitle());
1212  $title->setRequired(true);
1213  $form->addItem($title);
1214 
1215  if (!$this->object->getSelfAssessmentEditingMode()) {
1216  // author
1217  $author = new ilTextInputGUI($this->lng->txt("author"), "author");
1218  $author->setValue($this->object->getAuthor());
1219  $author->setRequired(true);
1220  $form->addItem($author);
1221 
1222  // description
1223  $description = new ilTextInputGUI($this->lng->txt("description"), "comment");
1224  $description->setValue($this->object->getComment());
1225  $description->setRequired(false);
1226  $form->addItem($description);
1227  } else {
1228  // author as hidden field
1229  $hi = new ilHiddenInputGUI("author");
1230  $author = ilUtil::prepareFormOutput($this->object->getAuthor());
1231  if (trim($author) == "") {
1232  $author = "-";
1233  }
1234  $hi->setValue($author);
1235  $form->addItem($hi);
1236  }
1237 
1238  // lifecycle
1239  $lifecycle = new ilSelectInputGUI($this->lng->txt('qst_lifecycle'), 'lifecycle');
1240  $lifecycle->setOptions($this->object->getLifecycle()->getSelectOptions($this->lng));
1241  $lifecycle->setValue($this->object->getLifecycle()->getIdentifier());
1242  $form->addItem($lifecycle);
1243 
1244  // questiontext
1245  $question = new ilTextAreaInputGUI($this->lng->txt("question"), "question");
1246  $question->setValue($this->object->getQuestion());
1247  $question->setRequired(true);
1248  $question->setRows(10);
1249  $question->setCols(80);
1250 
1251  if (!$this->object->getSelfAssessmentEditingMode()) {
1252  if ($this->object->getAdditionalContentEditingMode() != assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT) {
1253  $question->setUseRte(true);
1254  include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
1255  $question->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
1256  $question->addPlugin("latex");
1257  $question->addButton("latex");
1258  $question->addButton("pastelatex");
1259  $question->setRTESupport($this->object->getId(), "qpl", "assessment");
1260  }
1261  } else {
1262  require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssSelfAssessmentQuestionFormatter.php';
1264  $question->setUseTagsForRteOnly(false);
1265  }
1266  $form->addItem($question);
1267 
1268  if (!$this->object->getSelfAssessmentEditingMode()) {
1269  // duration
1270  $duration = new ilDurationInputGUI($this->lng->txt("working_time"), "Estimated");
1271  $duration->setShowHours(true);
1272  $duration->setShowMinutes(true);
1273  $duration->setShowSeconds(true);
1274  $ewt = $this->object->getEstimatedWorkingTime();
1275  $duration->setHours($ewt["h"]);
1276  $duration->setMinutes($ewt["m"]);
1277  $duration->setSeconds($ewt["s"]);
1278  $duration->setRequired(false);
1279  $form->addItem($duration);
1280  } else {
1281  // number of tries
1282  if (strlen($this->object->getNrOfTries())) {
1283  $nr_tries = $this->object->getNrOfTries();
1284  } else {
1285  $nr_tries = $this->object->getDefaultNrOfTries();
1286  }
1287  if ($nr_tries < 1) {
1288  $nr_tries = "";
1289  }
1290 
1291  $ni = new ilNumberInputGUI($this->lng->txt("qst_nr_of_tries"), "nr_of_tries");
1292  $ni->setValue($nr_tries);
1293  $ni->setMinValue(0);
1294  $ni->setSize(5);
1295  $ni->setMaxLength(5);
1296  $form->addItem($ni);
1297  }
1298  }
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"
setShowHours($a_showhours)
Set Show Hours.
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 area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addErrorMessage()

assQuestionGUI::addErrorMessage (   $errormessage)

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

References $errormessage.

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

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

◆ addGIT()

assQuestionGUI::addGIT ( )

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

References $_GET.

1894  {
1895  $subquestion_index = 0;
1896  if (strlen($_GET["subquestion_index"]) && $_GET["subquestion_index"] >= 0) {
1897  $subquestion_index = $_GET["subquestion_index"];
1898  }
1899  $this->object->saveSuggestedSolution("git", "il__git_" . $_GET["git"], $subquestion_index);
1900  ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), true);
1901  $this->ctrl->redirect($this, "suggestedsolution");
1902  }
$_GET["client_id"]

◆ addHeaderAction()

assQuestionGUI::addHeaderAction ( )

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

References $DIC, getHeaderAction(), IL_NOTE_PUBLIC, and ilNoteGUI\initJavascript().

161  {
162  global $DIC; /* @var ILIAS\DI\Container $DIC */
163 
164  $DIC->ui()->mainTemplate()->setVariable(
165  "HEAD_ACTION",
166  $this->getHeaderAction()
167  );
168 
169  $notesUrl = $this->ctrl->getLinkTargetByClass(
170  array("ilcommonactiondispatchergui", "ilnotegui"),
171  "",
172  "",
173  true,
174  false
175  );
176 
177  ilNoteGUI::initJavascript($notesUrl, IL_NOTE_PUBLIC, $DIC->ui()->mainTemplate());
178 
179  $redrawActionsUrl = $DIC->ctrl()->getLinkTarget($this, 'redrawHeaderAction', '', true);
180  $DIC->ui()->mainTemplate()->addOnLoadCode("il.Object.setRedrawAHUrl('$redrawActionsUrl');");
181  }
static initJavascript($a_ajax_url, $a_type=IL_NOTE_PRIVATE, ilGlobalTemplateInterface $a_main_tpl=null)
Init javascript.
const IL_NOTE_PUBLIC
Definition: class.ilNote.php:6
$DIC
Definition: xapitoken.php:46
+ 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 1161 of file class.assQuestionGUI.php.

1162  {
1163  $cnt = $this->new_id_listener_cnt;
1164  $this->new_id_listeners[$cnt]["object"] = &$a_object;
1165  $this->new_id_listeners[$cnt]["method"] = $a_method;
1166  $this->new_id_listeners[$cnt]["parameters"] = $a_parameters;
1167  $this->new_id_listener_cnt++;
1168  }

◆ addPG()

assQuestionGUI::addPG ( )

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

References $_GET.

1872  {
1873  $subquestion_index = 0;
1874  if (strlen($_GET["subquestion_index"]) && $_GET["subquestion_index"] >= 0) {
1875  $subquestion_index = $_GET["subquestion_index"];
1876  }
1877  $this->object->saveSuggestedSolution("pg", "il__pg_" . $_GET["pg"], $subquestion_index);
1878  ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), true);
1879  $this->ctrl->redirect($this, "suggestedsolution");
1880  }
$_GET["client_id"]

◆ addQuestionFormCommandButtons()

assQuestionGUI::addQuestionFormCommandButtons (   $form)

Add the command buttons of a question properties form.

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

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

1192  {
1193  //if (!$this->object->getSelfAssessmentEditingMode() && !$_GET["calling_test"]) $form->addCommandButton("saveEdit", $this->lng->txt("save_edit"));
1194  if (!$this->object->getSelfAssessmentEditingMode()) {
1195  $form->addCommandButton("saveReturn", $this->lng->txt("save_return"));
1196  }
1197  $form->addCommandButton("save", $this->lng->txt("save"));
1198  }
+ Here is the caller graph for this function:

◆ addST()

assQuestionGUI::addST ( )

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

References $_GET.

1883  {
1884  $subquestion_index = 0;
1885  if (strlen($_GET["subquestion_index"]) && $_GET["subquestion_index"] >= 0) {
1886  $subquestion_index = $_GET["subquestion_index"];
1887  }
1888  $this->object->saveSuggestedSolution("st", "il__st_" . $_GET["st"], $subquestion_index);
1889  ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), true);
1890  $this->ctrl->redirect($this, "suggestedsolution");
1891  }
$_GET["client_id"]

◆ addTab_QuestionFeedback()

assQuestionGUI::addTab_QuestionFeedback ( ilTabsGUI  $tabs)
protected

adds the feedback tab to ilTabsGUI

ilCtrl $ilCtrl

Parameters
ilTabsGUI$tabs

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

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

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

2047  {
2048  global $DIC;
2049  $ilCtrl = $DIC['ilCtrl'];
2050 
2051  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
2052  $tabCommands = self::getCommandsFromClassConstants('ilAssQuestionFeedbackEditingGUI');
2053 
2054  $tabLink = $ilCtrl->getLinkTargetByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW);
2055 
2056  $tabs->addTarget('tst_feedback', $tabLink, $tabCommands, $ilCtrl->getCmdClass(), '');
2057  }
addTarget( $a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
global $ilCtrl
Definition: ilias.php:18
$DIC
Definition: xapitoken.php:46
+ 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 2079 of file class.assQuestionGUI.php.

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

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

2080  {
2081  global $DIC;
2082  $ilCtrl = $DIC['ilCtrl'];
2083 
2084  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
2085 
2086  switch ($ilCtrl->getCmdClass()) {
2087  case 'ilassquestionhintsgui':
2088 
2089  $tabCommands = self::getCommandsFromClassConstants('ilAssQuestionHintsGUI');
2090  break;
2091 
2092  case 'ilassquestionhintgui':
2093 
2094  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintGUI.php';
2095  $tabCommands = self::getCommandsFromClassConstants('ilAssQuestionHintGUI');
2096  break;
2097 
2098  default:
2099 
2100  $tabCommands = array();
2101  }
2102 
2103  $tabLink = $ilCtrl->getLinkTargetByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST);
2104 
2105  $tabs->addTarget('tst_question_hints_tab', $tabLink, $tabCommands, $ilCtrl->getCmdClass(), '');
2106  }
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
$DIC
Definition: xapitoken.php:46
+ 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 2108 of file class.assQuestionGUI.php.

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

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

2109  {
2110  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php';
2111 
2112  $tabsGUI->addTarget(
2114  $this->ctrl->getLinkTargetByClass('ilAssQuestionPreviewGUI', ilAssQuestionPreviewGUI::CMD_SHOW),
2115  array(),
2116  array('ilAssQuestionPreviewGUI')
2117  );
2118  }
addTarget( $a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
+ 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 2010 of file class.assQuestionGUI.php.

References $_GET, and ilTabsGUI\addTarget().

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

2011  {
2012  if ($_GET["q_id"]) {
2013  $tabs->addTarget(
2014  "suggested_solution",
2015  $this->ctrl->getLinkTargetByClass($classname, "suggestedsolution"),
2016  array("suggestedsolution", "saveSuggestedSolution", "outSolutionExplorer", "cancel",
2017  "addSuggestedSolution","cancelExplorer", "linkChilds", "removeSuggestedSolution"
2018  ),
2019  $classname,
2020  ""
2021  );
2022  }
2023  }
$_GET["client_id"]
addTarget( $a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply()

assQuestionGUI::apply ( )

apply changes

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

References writePostData().

1057  {
1058  $this->writePostData();
1059  $this->object->saveToDb();
1060  $this->ctrl->setParameter($this, "q_id", $this->object->getId());
1061  $this->editQuestion();
1062  }
writePostData($always=false)
Evaluates a posted edit form and writes the form data in the question object.
+ Here is the call graph for this function:

◆ buildBasicEditFormObject()

assQuestionGUI::buildBasicEditFormObject ( )
protected
Returns
ilPropertyFormGUI

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

References getType(), and outQuestionType().

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

2327  {
2328  require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
2329  $form = new ilPropertyFormGUI();
2330 
2331  $form->setFormAction($this->ctrl->getFormAction($this));
2332 
2333  $form->setId($this->getType());
2334  $form->setTitle($this->outQuestionType());
2335 
2336  $form->setTableWidth('100%');
2337 
2338  $form->setMultipart(true);
2339 
2340  return $form;
2341  }
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 2353 of file class.assQuestionGUI.php.

References $editForm, and $errors.

Referenced by executeCommand().

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

◆ buildFocusAnchorHtml()

assQuestionGUI::buildFocusAnchorHtml ( )
Returns
string

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

Referenced by assSingleChoiceGUI\getSolutionOutput(), assMultipleChoiceGUI\getSolutionOutput(), assKprimChoiceGUI\getSolutionOutput(), and outQuestionPage().

2363  {
2364  return '<div id="focus"></div>';
2365  }
+ Here is the caller graph for this function:

◆ callNewIdListeners()

assQuestionGUI::callNewIdListeners (   $a_new_id)

Call the new id listeners.

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

References $i, and $object.

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

1174  {
1175  for ($i = 0; $i < $this->new_id_listener_cnt; $i++) {
1176  $this->new_id_listeners[$i]["parameters"]["new_id"] = $a_new_id;
1177  $object = &$this->new_id_listeners[$i]["object"];
1178  $method = $this->new_id_listeners[$i]["method"];
1179  $parameters = $this->new_id_listeners[$i]["parameters"];
1180  //var_dump($object);
1181  //var_dump($method);
1182  //var_dump($parameters);
1183 
1184  $object->$method($parameters);
1185  }
1186  }
$i
Definition: metadata.php:24
+ Here is the caller graph for this function:

◆ cancel()

assQuestionGUI::cancel ( )

cancel action

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

References $_GET, and ilUtil\redirect().

718  {
719  if ($_GET["calling_test"]) {
720  $_GET["ref_id"] = $_GET["calling_test"];
721  ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET["calling_test"]);
722  } elseif ($_GET["test_ref_id"]) {
723  $_GET["ref_id"] = $_GET["test_ref_id"];
724  ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET["test_ref_id"]);
725  } else {
726  if ($_GET["q_id"] > 0) {
727  $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
728  $this->ctrl->redirectByClass("ilAssQuestionPageGUI", "edit");
729  } else {
730  $this->ctrl->redirectByClass("ilobjquestionpoolgui", "questions");
731  }
732  }
733  }
$_GET["client_id"]
static redirect($a_script)
+ Here is the call graph for this function:

◆ cancelExplorer()

assQuestionGUI::cancelExplorer ( )

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

1727  {
1728  $this->ctrl->redirect($this, "suggestedsolution");
1729  }

◆ cancelSync()

assQuestionGUI::cancelSync ( )

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

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

792  {
793  if (strlen($_GET["return_to"])) {
794  $this->ctrl->redirect($this, $_GET["return_to"]);
795  }
796  if (strlen($_REQUEST['return_to_fb'])) {
797  $this->ctrl->redirectByClass('ilAssQuestionFeedbackEditingGUI', 'showFeedbackForm');
798  } else {
799  if (isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer']) {
800  $ref_id = (int) $_GET['calling_consumer'];
801  $consumer = ilObjectFactory::getInstanceByRefId($ref_id);
802  if ($consumer instanceof ilQuestionEditingFormConsumer) {
803  ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
804  }
805  require_once 'Services/Link/classes/class.ilLink.php';
807  }
808  $_GET["ref_id"] = $_GET["calling_test"];
809 
810  if ($_REQUEST['test_express_mode']) {
812  } else {
813  ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET["calling_test"]);
814  }
815  }
816  }
$_GET["client_id"]
static getReturnToPageLink($q_id=null)
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static redirect($a_script)
+ Here is the call graph for this function:

◆ completeTestOutputFormAction()

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

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

Referenced by outQuestionForTest().

2249  {
2250  return $formAction;
2251  }
+ 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 574 of file class.assQuestionGUI.php.

References _getQuestionGUI().

575  {
576  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
577  $this->question = &assQuestionGUI::_getQuestionGUI($question_type, $question_id);
578  }
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 226 of file class.assQuestionGUI.php.

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

227  {
228  global $DIC; /* @var \ILIAS\DI\Container $DIC */
229  $ilHelp = $DIC['ilHelp']; /* @var ilHelpGUI $ilHelp */
230  $ilHelp->setScreenIdComponent('qpl');
231 
232  $cmd = $this->ctrl->getCmd("editQuestion");
233  $next_class = $this->ctrl->getNextClass($this);
234 
235  $cmd = $this->getCommand($cmd);
236 
237  switch ($next_class) {
238  case 'ilformpropertydispatchgui':
239  $form = $this->buildEditForm();
240 
241  require_once 'Services/Form/classes/class.ilFormPropertyDispatchGUI.php';
242  $form_prop_dispatch = new ilFormPropertyDispatchGUI();
243  $form_prop_dispatch->setItem($form->getItemByPostVar(ilUtil::stripSlashes($_GET['postvar'])));
244  return $this->ctrl->forwardCommand($form_prop_dispatch);
245  break;
246 
247  default:
248  $ret = $this->$cmd();
249  break;
250  }
251  return $ret;
252  }
$_GET["client_id"]
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$ret
Definition: parser.php:6
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ getAdditionalEditQuestionCommands()

assQuestionGUI::getAdditionalEditQuestionCommands ( )
protected

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

Referenced by getEditQuestionTabCommands().

2036  {
2037  return array();
2038  }
+ 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 1357 of file class.assQuestionGUI.php.

References $pass, and getGenericFeedbackOutput().

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

1358  {
1359  return $this->getGenericFeedbackOutput($active_id, $pass);
1360  }
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:

◆ getAnswerFrequencyTableGUI()

assQuestionGUI::getAnswerFrequencyTableGUI (   $parentGui,
  $parentCmd,
  $relevantAnswers,
  $questionIndex 
)
Parameters
$parentGui
$parentCmd
$relevantAnswers
$questionIndex
Returns
ilAnswerFrequencyStatisticTableGUI

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

References getAnswersFrequency().

2390  {
2391  require_once 'Modules/TestQuestionPool/classes/tables/class.ilAnswerFrequencyStatisticTableGUI.php';
2392 
2393  $table = new ilAnswerFrequencyStatisticTableGUI($parentGui, $parentCmd, $this->object);
2394  $table->setQuestionIndex($questionIndex);
2395  $table->setData($this->getAnswersFrequency($relevantAnswers, $questionIndex));
2396  $table->initColumns();
2397 
2398  return $table;
2399  }
getAnswersFrequency($relevantAnswers, $questionIndex)
+ Here is the call graph for this function:

◆ getAnswersFrequency()

assQuestionGUI::getAnswersFrequency (   $relevantAnswers,
  $questionIndex 
)

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

Referenced by getAnswerFrequencyTableGUI().

2378  {
2379  return array();
2380  }
+ 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 1147 of file class.assQuestionGUI.php.

References $result.

1148  {
1149  $result = "";
1150  if (strlen($a_value)) {
1151  $result = " value=\"$a_value\" ";
1152  }
1153  return $result;
1154  }
$result

◆ getBasicEditQuestionTabCommands()

assQuestionGUI::getBasicEditQuestionTabCommands ( )
protected

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

Referenced by getEditQuestionTabCommands().

2031  {
2032  return array('editQuestion', 'save', 'saveEdit', 'originalSyncForm');
2033  }
+ Here is the caller graph for this function:

◆ getCommand()

assQuestionGUI::getCommand (   $cmd)

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

Referenced by executeCommand().

255  {
256  return $cmd;
257  }
+ 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 1917 of file class.assQuestionGUI.php.

Referenced by ilPCQuestionGUI\setTabs().

1918  {
1919  $reflectionClass = new ReflectionClass($guiClassName);
1920 
1921  $commands = null;
1922 
1923  if ($reflectionClass instanceof ReflectionClass) {
1924  $commands = array();
1925 
1926  foreach ($reflectionClass->getConstants() as $constName => $constValue) {
1927  if (substr($constName, 0, strlen($cmdConstantNameBegin)) == $cmdConstantNameBegin) {
1928  $commands[] = $constValue;
1929  }
1930  }
1931  }
1932 
1933  return $commands;
1934  }
+ 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 1070 of file class.assQuestionGUI.php.

References $i.

Referenced by outPageSelector().

1071  {
1072  $path = "";
1073 
1074  $tmpPath = $cont_obj->getLMTree()->getPathFull($a_endnode_id, $a_startnode_id);
1075 
1076  // count -1, to exclude the learning module itself
1077  for ($i = 1; $i < (count($tmpPath) - 1); $i++) {
1078  if ($path != "") {
1079  $path .= " > ";
1080  }
1081 
1082  $path .= $tmpPath[$i]["title"];
1083  }
1084 
1085  return $path;
1086  }
$i
Definition: metadata.php:24
+ Here is the caller graph for this function:

◆ getEditContext()

assQuestionGUI::getEditContext ( )
Returns
string

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

References $editContext.

Referenced by isAdjustmentEditContext(), and isAuthoringEditContext().

364  {
365  return $this->editContext;
366  }
+ Here is the caller graph for this function:

◆ getEditQuestionTabCommands()

assQuestionGUI::getEditQuestionTabCommands ( )
final

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

References getAdditionalEditQuestionCommands(), and getBasicEditQuestionTabCommands().

Referenced by setQuestionTabs().

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

◆ getErrorMessage()

assQuestionGUI::getErrorMessage ( )

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

References $errormessage.

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

1109  {
1110  return $this->errormessage;
1111  }
+ Here is the caller graph for this function:

◆ getFormEncodingType()

assQuestionGUI::getFormEncodingType ( )

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

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

2267  {
2268  return self::FORM_ENCODING_URLENCODE;
2269  }
+ 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 1371 of file class.assQuestionGUI.php.

References $pass, and ilObjTest\getManualFeedback().

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

1372  {
1373  $output = "";
1374  include_once "./Modules/Test/classes/class.ilObjTest.php";
1375  $manual_feedback = ilObjTest::getManualFeedback($active_id, $this->object->getId(), $pass);
1376  if (strlen($manual_feedback)) {
1377  return $manual_feedback;
1378  }
1379  $correct_feedback = $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), true);
1380  $incorrect_feedback = $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), false);
1381  if (strlen($correct_feedback . $incorrect_feedback)) {
1382  $reached_points = $this->object->calculateReachedPoints($active_id, $pass);
1383  $max_points = $this->object->getMaximumPoints();
1384  if ($reached_points == $max_points) {
1385  $output = $correct_feedback;
1386  } else {
1387  $output = $incorrect_feedback;
1388  }
1389  }
1390  return $this->object->prepareTextareaOutput($output, true);
1391  }
static getManualFeedback($active_id, $question_id, $pass)
Retrieves the feedback comment for a question in a test if it is finalized.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGenericFeedbackOutputForCorrectSolution()

assQuestionGUI::getGenericFeedbackOutputForCorrectSolution ( )

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

1394  {
1395  return $this->object->prepareTextareaOutput(
1396  $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), true),
1397  true
1398  );
1399  }

◆ getGenericFeedbackOutputForIncorrectSolution()

assQuestionGUI::getGenericFeedbackOutputForIncorrectSolution ( )

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

References getSpecificFeedbackOutput().

1402  {
1403  return $this->object->prepareTextareaOutput(
1404  $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), false),
1405  true
1406  );
1407  }
+ Here is the call graph for this function:

◆ getHeaderAction()

assQuestionGUI::getHeaderAction ( )

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

References $_GET, $DIC, ilCommonActionDispatcherGUI\setSubObject(), and ilCommonActionDispatcherGUI\TYPE_REPOSITORY.

Referenced by addHeaderAction(), and redrawHeaderAction().

191  {
192  global $DIC; /* @var ILIAS\DI\Container $DIC */
193  /* @var ilObjectDataCache $ilObjDataCache */
194  $ilObjDataCache = $DIC['ilObjDataCache'];
195 
196  $parentObjType = $ilObjDataCache->lookupType($this->object->getObjId());
197 
198  $dispatcher = new ilCommonActionDispatcherGUI(
200  $DIC->access(),
201  $parentObjType,
202  $_GET["ref_id"],
203  $this->object->getObjId()
204  );
205 
206  $dispatcher->setSubObject("quest", $this->object->getId());
207 
208  $ha = $dispatcher->initHeaderAction();
209  $ha->enableComments(true, false);
210 
211  return $ha->getHeaderAction($DIC->ui()->mainTemplate());
212  }
$_GET["client_id"]
$DIC
Definition: xapitoken.php:46
Class ilCommonActionDispatcherGUI.
setSubObject($a_sub_obj_type, $a_sub_obj_id)
Set sub object attributes.
+ Here is the call graph for this function:
+ Here is the caller 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 626 of file class.assQuestionGUI.php.

References ILIAS_HTTP_PATH, and ilPageObjectGUI\setQuestionHTML().

Referenced by assTextSubsetGUI\getPreview(), assOrderingHorizontalGUI\getPreview(), assNumericGUI\getPreview(), assFlashQuestionGUI\getPreview(), assErrorTextGUI\getPreview(), assFileUploadGUI\getPreview(), assLongMenuGUI\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(), assFlashQuestionGUI\getSolutionOutput(), assSingleChoiceGUI\getSolutionOutput(), assMultipleChoiceGUI\getSolutionOutput(), assFileUploadGUI\getSolutionOutput(), assErrorTextGUI\getSolutionOutput(), assJavaAppletGUI\getSolutionOutput(), assLongMenuGUI\getSolutionOutput(), assOrderingQuestionGUI\getSolutionOutput(), assMatchingQuestionGUI\getSolutionOutput(), assKprimChoiceGUI\getSolutionOutput(), assClozeTestGUI\getSolutionOutput(), assFormulaQuestionGUI\getSolutionOutput(), assOrderingHorizontalGUI\getTestOutput(), assErrorTextGUI\getTestOutput(), assFileUploadGUI\getTestOutput(), and assImagemapQuestionGUI\supportsIntermediateSolutionOutput().

627  {
628  include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
629  $page_gui = new ilAssQuestionPageGUI($this->object->getId());
630  $page_gui->setQuestionHTML(array($this->object->getId() => $html));
631  $presentation = $page_gui->presentation();
632  $presentation = preg_replace("/src=\"\\.\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $presentation);
633  return $presentation;
634  }
Question page GUI class.
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 400 of file class.assQuestionGUI.php.

References $navigationGUI.

Referenced by outQuestionPage().

401  {
402  return $this->navigationGUI;
403  }
+ Here is the caller graph for this function:

◆ getNotesHTML()

assQuestionGUI::getNotesHTML ( )

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

References ilNoteGUI\enablePublicNotes().

215  {
216  $notesGUI = new ilNoteGUI($this->object->getObjId(), $this->object->getId(), 'quest');
217  $notesGUI->enablePublicNotes(true);
218  $notesGUI->enablePublicNotesDeletion(true);
219 
220  return $notesGUI->getNotesHTML();
221  }
enablePublicNotes($a_enable=true)
enable public notes
Notes GUI class.
+ Here is the call graph for this function:

◆ getPresentationContext()

assQuestionGUI::getPresentationContext ( )
Returns
string

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

References $presentationContext.

Referenced by isTestPresentationContext().

271  {
273  }
+ Here is the caller graph for this function:

◆ getPresentationJavascripts()

assQuestionGUI::getPresentationJavascripts ( )

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

Referenced by populateJavascriptFilesRequiredForWorkForm().

588  {
589  return array();
590  }
+ 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 704 of file class.assQuestionGUI.php.

References $tpl.

Referenced by outQuestionPage().

705  {
706  $tpl = new ilTemplate('tpl.tst_question_additional_behaviour_checkbox.html', true, true, 'Modules/TestQuestionPool');
707  // hey: prevPassSolutions - use abtract template
708  $tpl->setVariable('TXT_FORCE_FORM_DIFF_LABEL', $this->lng->txt('use_previous_solution'));
709  // hey.
710  return $tpl->get();
711  }
+ Here is the caller graph for this function:

◆ getPreviousSolutionProvidedMessage()

assQuestionGUI::getPreviousSolutionProvidedMessage ( )
protected

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

Referenced by outQuestionPage().

700  {
701  return $this->lng->txt('use_previous_solution_advice');
702  }
+ Here is the caller graph for this function:

◆ getQuestionActionCmd()

◆ getQuestionCount()

assQuestionGUI::getQuestionCount ( )

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

References $question_count.

1104  {
1105  return $this->question_count;
1106  }
$question_count
question count in test

◆ getQuestionHeaderBlockBuilder()

assQuestionGUI::getQuestionHeaderBlockBuilder ( )
Returns
$questionHeaderBlockBuilder

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

References $questionHeaderBlockBuilder.

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

451  {
453  }
+ Here is the caller graph for this function:

◆ getQuestionTemplate()

assQuestionGUI::getQuestionTemplate ( )

get question template

Definition at line 595 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(), assErrorTextGUI\editQuestion(), assMultipleChoiceGUI\editQuestion(), assLongMenuGUI\editQuestion(), assJavaAppletGUI\editQuestion(), assFlashQuestionGUI\editQuestion(), assImagemapQuestionGUI\editQuestion(), assMatchingQuestionGUI\editQuestion(), assClozeTestGUI\editQuestion(), assFormulaQuestionGUI\isSaveCommand(), and renderEditForm().

596  {
597  // @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)
598  if (!$this->tpl->blockExists('content')) {
599  $this->tpl->addBlockFile("CONTENT", "content", "tpl.il_as_qpl_content.html", "Modules/TestQuestionPool");
600  }
601  // @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)
602  if (!$this->tpl->blockExists('statusline')) {
603  $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
604  }
605  // @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
606  if (!$this->tpl->blockExists('adm_content')) {
607  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_question.html", "Modules/TestQuestionPool");
608  }
609  }
+ 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 1135 of file class.assQuestionGUI.php.

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

1136  {
1137  return $this->object->getQuestionType();
1138  }
+ Here is the caller graph for this function:

◆ getRenderPurpose()

assQuestionGUI::getRenderPurpose ( )
Returns
string

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

References $renderPurpose.

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

310  {
311  return $this->renderPurpose;
312  }
+ Here is the caller graph for this function:

◆ getSequenceNumber()

assQuestionGUI::getSequenceNumber ( )

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

References $sequence_no.

1094  {
1095  return $this->sequence_no;
1096  }
$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 (   $userSolution)
abstract

Returns the answer specific feedback for the question.

This method should be overwritten by the actual question.

Todo:
Mark this method abstract!
Parameters
array$userSolution($userSolution[<value1>] = <value2>)
Returns
string HTML Code with the answer specific feedback public

Referenced by getGenericFeedbackOutputForIncorrectSolution(), and ilTestPlayerAbstractGUI\populateSpecificFeedbackBlock().

+ Here is the caller graph for this function:

◆ getSubQuestionsIndex()

assQuestionGUI::getSubQuestionsIndex ( )

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

2373  {
2374  return array(0);
2375  }

◆ getTargetGuiClass()

assQuestionGUI::getTargetGuiClass ( )

◆ getTaxonomyIds()

assQuestionGUI::getTaxonomyIds ( )

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

References $taxonomyIds.

Referenced by populateTaxonomyFormSection(), and saveTaxonomyAssignments().

419  {
420  return $this->taxonomyIds;
421  }
+ 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 262 of file class.assQuestionGUI.php.

References getQuestionType().

Referenced by buildBasicEditFormObject().

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

◆ getUseIntermediateSolution()

◆ getUseUnchangedAnswerCheckboxHtml()

assQuestionGUI::getUseUnchangedAnswerCheckboxHtml ( )
protected

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

References $tpl.

Referenced by outQuestionPage().

689  {
690  // hey: prevPassSolutions - use abstracted template to share with other purposes of this kind
691  $tpl = new ilTemplate('tpl.tst_question_additional_behaviour_checkbox.html', true, true, 'Modules/TestQuestionPool');
692  $tpl->setVariable('TXT_FORCE_FORM_DIFF_LABEL', $this->object->getTestPresentationConfig()->getUseUnchangedAnswerLabel());
693  // hey.
694  return $tpl->get();
695  }
+ Here is the caller graph for this function:

◆ hasCorrectSolution()

◆ hasInlineFeedback()

assQuestionGUI::hasInlineFeedback ( )

this method can be overwritten per question type

Returns
bool

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

Referenced by outQuestionPage(), and ilTestPlayerAbstractGUI\populateInstantResponseBlocks().

156  {
157  return false;
158  }
+ Here is the caller graph for this function:

◆ hasIntermediateSolution()

assQuestionGUI::hasIntermediateSolution (   $activeId,
  $passIndex 
)

Check if the question has an intermediate solution.

Parameters
int$activeId
int$passIndex
Returns
bool

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

References $result.

2149  {
2150  $result = $this->object->lookupForExistingSolutions($activeId, $passIndex);
2151  return ($result['intermediate']);
2152  }
$result

◆ isAdjustmentEditContext()

assQuestionGUI::isAdjustmentEditContext ( )
Parameters
bool$isAdjustmentEditContext

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

References getEditContext().

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

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

◆ isAnswerFreuqencyStatisticSupported()

assQuestionGUI::isAnswerFreuqencyStatisticSupported ( )

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

Referenced by ilTestCorrectionsGUI\setCorrectionTabsContext().

2368  {
2369  return true;
2370  }
+ Here is the caller graph for this function:

◆ isAuthoringEditContext()

assQuestionGUI::isAuthoringEditContext ( )
Parameters
bool$isAuthoringEditContext

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

References getEditContext().

380  {
381  return $this->getEditContext() == self::EDIT_CONTEXT_AUTHORING;
382  }
+ Here is the call graph for this function:

◆ isAutosaveable()

assQuestionGUI::isAutosaveable ( )

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

2181  {
2182  return $this->object->isAutosaveable();
2183  }

◆ isPreviousSolutionPrefilled()

assQuestionGUI::isPreviousSolutionPrefilled ( )
Returns
boolean

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

References $previousSolutionPrefilled.

293  {
295  }

◆ isRenderPurposeDemoplay()

assQuestionGUI::isRenderPurposeDemoplay ( )

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

References getRenderPurpose().

Referenced by assOrderingQuestionGUI\isInteractivePresentation().

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

◆ isRenderPurposeInputValue()

assQuestionGUI::isRenderPurposeInputValue ( )

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

References getRenderPurpose().

Referenced by renderPurposeSupportsFormHtml().

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

◆ isRenderPurposePlayback()

assQuestionGUI::isRenderPurposePlayback ( )

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

References getRenderPurpose().

Referenced by assOrderingQuestionGUI\isInteractivePresentation().

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

◆ isRenderPurposePreview()

assQuestionGUI::isRenderPurposePreview ( )

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

References getRenderPurpose().

328  {
329  return $this->getRenderPurpose() == self::RENDER_PURPOSE_PREVIEW;
330  }
+ Here is the call graph for this function:

◆ isRenderPurposePrintPdf()

assQuestionGUI::isRenderPurposePrintPdf ( )

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

References getRenderPurpose().

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

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

◆ isSaveCommand()

◆ isTestPresentationContext()

◆ linkChilds()

assQuestionGUI::linkChilds ( )

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

References $_GET, outChapterSelector(), outGlossarySelector(), and outPageSelector().

1850  {
1851  $this->ctrl->saveParameter($this, array("subquestion_index", "link_new_type", "search_link_type"));
1852  switch ($_GET["search_link_type"]) {
1853  case "pg":
1854  return $this->outPageSelector();
1855  break;
1856  case "st":
1857  return $this->outChapterSelector();
1858  break;
1859  case "glo":
1860  return $this->outGlossarySelector();
1861  break;
1862  case "lm":
1863  $subquestion_index = ($_GET["subquestion_index"] > 0) ? $_GET["subquestion_index"] : 0;
1864  $this->object->saveSuggestedSolution("lm", "il__lm_" . $_GET["source_id"], $subquestion_index);
1865  ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), true);
1866  $this->ctrl->redirect($this, "suggestedsolution");
1867  break;
1868  }
1869  }
$_GET["client_id"]
+ Here is the call graph for this function:

◆ magicAfterTestOutput()

assQuestionGUI::magicAfterTestOutput ( )

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

References $pass, and getTestOutput().

Referenced by outQuestionForTest().

2254  {
2255  return;
2256  }
+ 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 739 of file class.assQuestionGUI.php.

Referenced by suggestedsolution().

740  {
741  if (strlen($return_to)) {
742  $this->ctrl->setParameter($this, "return_to", $return_to);
743  } elseif ($_REQUEST['return_to']) {
744  $this->ctrl->setParameter($this, "return_to", $_REQUEST['return_to']);
745  }
746  if (strlen($return_to_feedback)) {
747  $this->ctrl->setParameter($this, 'return_to_fb', 'true');
748  }
749 
750  $this->ctrl->saveParameter($this, 'test_express_mode');
751 
752  $template = new ilTemplate("tpl.il_as_qpl_sync_original.html", true, true, "Modules/TestQuestionPool");
753  $template->setVariable("BUTTON_YES", $this->lng->txt("yes"));
754  $template->setVariable("BUTTON_NO", $this->lng->txt("no"));
755  $template->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
756  $template->setVariable("TEXT_SYNC", $this->lng->txt("confirm_sync_questions"));
757  $this->tpl->setVariable("ADM_CONTENT", $template->get());
758  }
+ Here is the caller graph for this function:

◆ outAdditionalOutput()

assQuestionGUI::outAdditionalOutput ( )

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

1124  {
1125  }

◆ outChapterSelector()

assQuestionGUI::outChapterSelector ( )

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

References $_GET, $rows, and ilUtil\stripSlashes().

Referenced by linkChilds().

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

◆ outGlossarySelector()

assQuestionGUI::outGlossarySelector ( )

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

References $_GET, and $rows.

Referenced by linkChilds().

1824  {
1825  $this->ctrl->setParameter($this, 'q_id', $this->object->getId());
1826 
1827  $glossary = new ilObjGlossary($_GET['source_id'], true);
1828  $terms = $glossary->getTermList();
1829 
1830  $rows = array();
1831 
1832  foreach ($terms as $term) {
1833  $this->ctrl->setParameter($this, 'git', $term['id']);
1834  $rows[] = array(
1835  'title' => $term['term'],
1836  'description' => '',
1837  'text_add' => $this->lng->txt('add'),
1838  'href_add' => $this->ctrl->getLinkTarget($this, 'addGIT')
1839  );
1840  }
1841 
1842  $table = new ilQuestionInternalLinkSelectionTableGUI($this, 'cancelExplorer', __METHOD__);
1843  $table->setTitle($this->lng->txt('glossary_term'));
1844  $table->setData($rows);
1845 
1846  $this->tpl->setContent($table->getHTML());
1847  }
$_GET["client_id"]
Class ilObjGlossary.
$rows
Definition: xhr_table.php:10
+ Here is the caller graph for this function:

◆ outPageSelector()

assQuestionGUI::outPageSelector ( )

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

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

Referenced by linkChilds().

1732  {
1733  require_once 'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1734  require_once 'Modules/LearningModule/classes/class.ilLMPageObject.php';
1735  require_once 'Modules/LearningModule/classes/class.ilObjContentObjectGUI.php';
1736 
1737  $this->ctrl->setParameter($this, 'q_id', $this->object->getId());
1738 
1739  $cont_obj_gui = new ilObjContentObjectGUI('', $_GET['source_id'], true);
1740  $cont_obj = $cont_obj_gui->object;
1741  $pages = ilLMPageObject::getPageList($cont_obj->getId());
1742  $shownpages = array();
1743  $tree = $cont_obj->getLMTree();
1744  $chapters = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
1745 
1746  $rows = array();
1747 
1748  foreach ($chapters as $chapter) {
1749  $chapterpages = $tree->getChildsByType($chapter['obj_id'], 'pg');
1750  foreach ($chapterpages as $page) {
1751  if ($page['type'] == $_GET['search_link_type']) {
1752  array_push($shownpages, $page['obj_id']);
1753 
1754  if ($tree->isInTree($page['obj_id'])) {
1755  $path_str = $this->getContextPath($cont_obj, $page['obj_id']);
1756  } else {
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  if (!in_array($page['obj_id'], $shownpages)) {
1772  $this->ctrl->setParameter($this, $page['type'], $page['obj_id']);
1773  $rows[] = array(
1774  'title' => $page['title'],
1775  'description' => '---',
1776  'text_add' => $this->lng->txt('add'),
1777  'href_add' => $this->ctrl->getLinkTarget($this, 'add' . strtoupper($page['type']))
1778  );
1779  }
1780  }
1781 
1782  require_once 'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1783  $table = new ilQuestionInternalLinkSelectionTableGUI($this, 'cancelExplorer', __METHOD__);
1784  $table->setTitle($this->lng->txt('obj_' . ilUtil::stripSlashes($_GET['search_link_type'])));
1785  $table->setData($rows);
1786 
1787  $this->tpl->setContent($table->getHTML());
1788  }
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
$rows
Definition: xhr_table.php:10
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 2218 of file class.assQuestionGUI.php.

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

Referenced by ilTestPlayerAbstractGUI\showQuestionEditable().

2227  {
2228  $formaction = $this->completeTestOutputFormAction($formaction, $active_id, $pass);
2229 
2230  $test_output = $this->getTestOutput(
2231  $active_id,
2232  $pass,
2233  $is_question_postponed,
2234  $user_post_solutions,
2235  $show_specific_inline_feedback
2236  );
2237 
2238  $this->magicAfterTestOutput();
2239 
2240  $this->tpl->setVariable("QUESTION_OUTPUT", $test_output);
2241  $this->tpl->setVariable("FORMACTION", $formaction);
2242  $this->tpl->setVariable("ENCTYPE", 'enctype="' . $this->getFormEncodingType() . '"');
2243  $this->tpl->setVariable("FORM_TIMESTAMP", time());
2244  }
getTestOutput( $active_id, $pass, $is_question_postponed, $user_post_solutions, $show_specific_inline_feedback)
completeTestOutputFormAction($formAction, $active_id, $pass)
+ 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 = "",
  $inlineFeedbackEnabled = false 
)

output question page

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

References buildFocusAnchorHtml(), getNavigationGUI(), getPreviousSolutionConfirmationCheckboxHtml(), getPreviousSolutionProvidedMessage(), getUseUnchangedAnswerCheckboxHtml(), hasInlineFeedback(), ilUtil\sendInfo(), and ilPageObjectGUI\setOutputMode().

Referenced by assTextSubsetGUI\getTestOutput(), assOrderingHorizontalGUI\getTestOutput(), assNumericGUI\getTestOutput(), assFlashQuestionGUI\getTestOutput(), assKprimChoiceGUI\getTestOutput(), assErrorTextGUI\getTestOutput(), assLongMenuGUI\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().

640  {
641  // hey: prevPassSolutions - add the "use previous answer"
642  // hey: prevPassSolutions - refactored identifiers
643  if ($this->object->getTestPresentationConfig()->isSolutionInitiallyPrefilled()) {
644  // hey
647  } elseif // (!) --> if ($this->object->getTestQuestionConfig()->isUnchangedAnswerPossible())
648  // hey.
649 // fau: testNav - add the "use unchanged answer checkbox"
650  // hey: prevPassSolutions - refactored identifiers
651  ($this->object->getTestPresentationConfig()->isUnchangedAnswerPossible()) {
652  // hey.
653  $html .= $this->getUseUnchangedAnswerCheckboxHtml();
654  }
655  // fau.
656 
657  $this->lng->loadLanguageModule("content");
658 
659  // fau: testNav - add question buttons below question, add actions menu
660  include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
661  $page_gui = new ilAssQuestionPageGUI($this->object->getId());
662  $page_gui->setOutputMode("presentation");
663  $page_gui->setTemplateTargetVar($a_temp_var);
664 
665  if ($this->getNavigationGUI()) {
666  $html .= $this->getNavigationGUI()->getHTML();
667  $page_gui->setQuestionActionsHTML($this->getNavigationGUI()->getActionsHTML());
668  }
669  // fau.
670 
671  if (strlen($html)) {
672  if ($inlineFeedbackEnabled && $this->hasInlineFeedback()) {
673  $html = $this->buildFocusAnchorHtml() . $html;
674  }
675 
676  $page_gui->setQuestionHTML(array($this->object->getId() => $html));
677  }
678 
679  // fau: testNav - fill the header with subtitle blocks for question info an actions
680  $page_gui->setPresentationTitle($this->questionHeaderBlockBuilder->getPresentationTitle());
681  $page_gui->setQuestionInfoHTML($this->questionHeaderBlockBuilder->getQuestionInfoHTML());
682  // fau.
683 
684  return $page_gui->presentation();
685  }
hasInlineFeedback()
this method can be overwritten per question type
Question page GUI class.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
setOutputMode($a_mode=self::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 1421 of file class.assQuestionGUI.php.

References $_GET, $DIC, assQuestion\_getQuestionTypeName(), 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(), assFormulaQuestionGUI\isSaveCommand(), and ilTestCorrectionsGUI\populatePageTitleAndDescription().

1422  {
1423  $count = $this->object->isInUse();
1424 
1425  if ($this->object->_questionExistsInPool($this->object->getId()) && $count) {
1426  global $DIC;
1427  $rbacsystem = $DIC['rbacsystem'];
1428  if ($rbacsystem->checkAccess("write", $_GET["ref_id"])) {
1429  ilUtil::sendInfo(sprintf($this->lng->txt("qpl_question_is_in_use"), $count));
1430  }
1431  }
1432 
1433  return assQuestion::_getQuestionTypeName($this->object->getQuestionType());
1434  }
$_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.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outSolutionExplorer()

assQuestionGUI::outSolutionExplorer ( )

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

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

1652  {
1653  global $DIC;
1654  $tree = $DIC['tree'];
1655 
1656  include_once("./Modules/TestQuestionPool/classes/class.ilSolutionExplorer.php");
1657  $type = $_GET["link_new_type"];
1658  $search = $_GET["search_link_type"];
1659  $this->ctrl->setParameter($this, "link_new_type", $type);
1660  $this->ctrl->setParameter($this, "search_link_type", $search);
1661  $this->ctrl->saveParameter($this, array("subquestion_index", "link_new_type", "search_link_type"));
1662 
1663  ilUtil::sendInfo($this->lng->txt("select_object_to_link"));
1664 
1665  $parent_ref_id = $tree->getParentId($_GET["ref_id"]);
1666  $exp = new ilSolutionExplorer($this->ctrl->getLinkTarget($this, 'suggestedsolution'), get_class($this));
1667  $exp->setExpand($_GET['expand_sol'] ? $_GET['expand_sol'] : $parent_ref_id);
1668  $exp->setExpandTarget($this->ctrl->getLinkTarget($this, 'outSolutionExplorer'));
1669  $exp->setTargetGet("ref_id");
1670  $exp->setRefId($_GET["ref_id"]);
1671  $exp->addFilter($type);
1672  $exp->setSelectableType($type);
1673  if (isset($_GET['expandCurrentPath']) && $_GET['expandCurrentPath']) {
1674  $exp->expandPathByRefId($parent_ref_id);
1675  }
1676 
1677  // build html-output
1678  $exp->setOutput(0);
1679 
1680  $template = new ilTemplate("tpl.il_as_qpl_explorer.html", true, true, "Modules/TestQuestionPool");
1681  $template->setVariable("EXPLORER_TREE", $exp->getOutput());
1682  $template->setVariable("BUTTON_CANCEL", $this->lng->txt("cancel"));
1683  $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "suggestedsolution"));
1684  $this->tpl->setVariable("ADM_CONTENT", $template->get());
1685  }
$type
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$DIC
Definition: xapitoken.php:46
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:

◆ populateCorrectionsFormProperties()

assQuestionGUI::populateCorrectionsFormProperties ( ilPropertyFormGUI  $form)
Parameters
ilPropertyFormGUI$form

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

Referenced by ilTestCorrectionsGUI\buildQuestionCorrectionForm().

2412  {
2413  }
+ Here is the caller graph for this function:

◆ populateJavascriptFilesRequiredForWorkForm()

assQuestionGUI::populateJavascriptFilesRequiredForWorkForm ( ilGlobalTemplateInterface  $tpl)

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

References ilGlobalTemplateInterface\addJavaScript(), and getPresentationJavascripts().

581  {
582  foreach ($this->getPresentationJavascripts() as $jsFile) {
583  $tpl->addJavaScript($jsFile);
584  }
585  }
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 1315 of file class.assQuestionGUI.php.

References ilObject\_lookupType(), ilPropertyFormGUI\addItem(), ilTaxNodeAssignment\getAssignmentsOfItem(), getTaxonomyIds(), 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().

1316  {
1317  if (count($this->getTaxonomyIds())) {
1318  // this is needed by ilTaxSelectInputGUI in some cases
1319  require_once 'Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php';
1320  ilOverlayGUI::initJavaScript();
1321 
1322  $sectHeader = new ilFormSectionHeaderGUI();
1323  $sectHeader->setTitle($this->lng->txt('qpl_qst_edit_form_taxonomy_section'));
1324  $form->addItem($sectHeader);
1325 
1326  require_once 'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
1327 
1328  foreach ($this->getTaxonomyIds() as $taxonomyId) {
1329  $taxonomy = new ilObjTaxonomy($taxonomyId);
1330  $label = sprintf($this->lng->txt('qpl_qst_edit_form_taxonomy'), $taxonomy->getTitle());
1331  $postvar = "tax_node_assign_$taxonomyId";
1332 
1333  $taxSelect = new ilTaxSelectInputGUI($taxonomy->getId(), $postvar, true);
1334  $taxSelect->setTitle($label);
1335 
1336  require_once 'Services/Taxonomy/classes/class.ilTaxNodeAssignment.php';
1337  $taxNodeAssignments = new ilTaxNodeAssignment(ilObject::_lookupType($this->object->getObjId()), $this->object->getObjId(), 'quest', $taxonomyId);
1338  $assignedNodes = $taxNodeAssignments->getAssignmentsOfItem($this->object->getId());
1339 
1340  $taxSelect->setValue(array_map(function ($assignedNode) {
1341  return $assignedNode['node_id'];
1342  }, $assignedNodes));
1343  $form->addItem($taxSelect);
1344  }
1345  }
1346  }
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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareReprintableCorrectionsForm()

assQuestionGUI::prepareReprintableCorrectionsForm ( ilPropertyFormGUI  $form)
Parameters
ilPropertyFormGUI$form

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

2405  {
2406  }

◆ redrawHeaderAction()

assQuestionGUI::redrawHeaderAction ( )

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

References $DIC, exit, and getHeaderAction().

184  {
185  global $DIC; /* @var ILIAS\DI\Container $DIC */
186  echo $this->getHeaderAction() . $DIC->ui()->mainTemplate()->getOnLoadCodeForAsynch();
187  exit;
188  }
exit
Definition: login.php:29
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ renderEditForm()

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

Definition at line 614 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().

615  {
616  $this->getQuestionTemplate();
617  $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
618  }
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 347 of file class.assQuestionGUI.php.

References isRenderPurposeInputValue(), and isRenderPurposePrintPdf().

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

348  {
349  if ($this->isRenderPurposePrintPdf()) {
350  return false;
351  }
352 
353  if ($this->isRenderPurposeInputValue()) {
354  return false;
355  }
356 
357  return true;
358  }
+ 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 872 of file class.assQuestionGUI.php.

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

Referenced by assFormulaQuestionGUI\saveFQ().

873  {
874  global $DIC;
875  $ilUser = $DIC['ilUser'];
876  $old_id = $_GET["q_id"];
877  $result = $this->writePostData();
878 
879  if ($result == 0) {
880  $ilUser->setPref("tst_lastquestiontype", $this->object->getQuestionType());
881  $ilUser->writePref("tst_lastquestiontype", $this->object->getQuestionType());
882  $this->object->saveToDb();
883  $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
884 
885 
886  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
887  if (($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId())) {
888  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
889  $this->ctrl->setParameter($this, 'return_to', 'editQuestion');
890  $this->ctrl->redirect($this, "originalSyncForm");
891  return;
892  } elseif ($_GET["calling_test"]) {
893  require_once 'Modules/Test/classes/class.ilObjTest.php';
894  $test = new ilObjTest($_GET["calling_test"]);
895  if (!assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId())) {
896  global $DIC;
897  $tree = $DIC['tree'];
898  $ilDB = $DIC['ilDB'];
899  $ilPluginAdmin = $DIC['ilPluginAdmin'];
900 
901  include_once("./Modules/Test/classes/class.ilObjTest.php");
902  $_GET["ref_id"] = $_GET["calling_test"];
903  $test = new ilObjTest($_GET["calling_test"], true);
904 
905  require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
906  $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
907 
908  $new_id = $test->insertQuestion(
909  $testQuestionSetConfigFactory->getQuestionSetConfig(),
910  $this->object->getId()
911  );
912 
913  if (isset($_REQUEST['prev_qid'])) {
914  $test->moveQuestionAfter($this->object->getId() + 1, $_REQUEST['prev_qid']);
915  }
916 
917  $this->ctrl->setParameter($this, 'q_id', $new_id);
918  $this->ctrl->setParameter($this, 'calling_test', $_GET['calling_test']);
919  #$this->ctrl->setParameter($this, 'test_ref_id', false);
920  }
921  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
922  $this->ctrl->redirect($this, 'editQuestion');
923  } else {
924  $this->callNewIdListeners($this->object->getId());
925 
926  if ($this->object->getId() != $old_id) {
927  // first save
928  $this->ctrl->setParameterByClass($_GET["cmdClass"], "q_id", $this->object->getId());
929  $this->ctrl->setParameterByClass($_GET["cmdClass"], "sel_question_types", $_GET["sel_question_types"]);
930  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
931 
932  //global $___test_express_mode;
936  if ($_REQUEST['prev_qid']) {
937  // @todo: bheyser/mbecker wtf? ..... thx@jposselt ....
938  // mbecker: Possible fix: Just instantiate the obj?
939  include_once("./Modules/Test/classes/class.ilObjTest.php");
940  $test = new ilObjTest($_GET["ref_id"], true);
941  $test->moveQuestionAfter($_REQUEST['prev_qid'], $this->object->getId());
942  }
943  if ( /*$___test_express_mode || */ $_REQUEST['express_mode']) {
944  global $DIC;
945  $tree = $DIC['tree'];
946  $ilDB = $DIC['ilDB'];
947  $ilPluginAdmin = $DIC['ilPluginAdmin'];
948 
949  include_once("./Modules/Test/classes/class.ilObjTest.php");
950  $test = new ilObjTest($_GET["ref_id"], true);
951 
952  require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
953  $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
954 
955  $test->insertQuestion(
956  $testQuestionSetConfigFactory->getQuestionSetConfig(),
957  $this->object->getId()
958  );
959 
960  require_once 'Modules/Test/classes/class.ilTestExpressPage.php';
961  $_REQUEST['q_id'] = $this->object->getId();
963  }
964 
965  $this->ctrl->redirectByClass($_GET["cmdClass"], "editQuestion");
966  }
967  if (strcmp($_SESSION["info"], "") != 0) {
968  ilUtil::sendSuccess($_SESSION["info"] . "<br />" . $this->lng->txt("msg_obj_modified"), true);
969  } else {
970  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
971  }
972  $this->ctrl->redirect($this, 'editQuestion');
973  }
974  }
975  }
$_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)
global $ilDB
$DIC
Definition: xapitoken.php:46
static redirect($a_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:

◆ saveCorrectionsFormProperties()

assQuestionGUI::saveCorrectionsFormProperties ( ilPropertyFormGUI  $form)
Parameters
ilPropertyFormGUI$form

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

2419  {
2420  }

◆ saveEdit()

assQuestionGUI::saveEdit ( )

save question

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

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

822  {
823  global $DIC;
824  $ilUser = $DIC['ilUser'];
825 
826  $result = $this->writePostData();
827  if ($result == 0) {
828  $ilUser->setPref("tst_lastquestiontype", $this->object->getQuestionType());
829  $ilUser->writePref("tst_lastquestiontype", $this->object->getQuestionType());
830  $this->object->saveToDb();
831  $originalexists = $this->object->_questionExists($this->object->original_id);
832  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
833  if ($_GET["calling_test"] && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId())) {
834  $this->ctrl->redirect($this, "originalSyncForm");
835  } elseif ($_GET["calling_test"]) {
836  $_GET["ref_id"] = $_GET["calling_test"];
837  ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET["calling_test"]);
838  return;
839  } elseif ($_GET["test_ref_id"]) {
840  global $DIC;
841  $tree = $DIC['tree'];
842  $ilDB = $DIC['ilDB'];
843  $ilPluginAdmin = $DIC['ilPluginAdmin'];
844 
845  include_once("./Modules/Test/classes/class.ilObjTest.php");
846  $_GET["ref_id"] = $_GET["test_ref_id"];
847  $test = new ilObjTest($_GET["test_ref_id"], true);
848 
849  require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
850  $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
851 
852  $test->insertQuestion($testQuestionSetConfigFactory->getQuestionSetConfig(), $this->object->getId());
853 
854  ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET["test_ref_id"]);
855  } else {
856  $this->ctrl->setParameter($this, "q_id", $this->object->getId());
857  $this->editQuestion();
858  if (strcmp($_SESSION["info"], "") != 0) {
859  ilUtil::sendSuccess($_SESSION["info"] . "<br />" . $this->lng->txt("msg_obj_modified"), false);
860  } else {
861  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), false);
862  }
863  $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $this->object->getId());
864  $this->ctrl->redirectByClass("ilAssQuestionPageGUI", "edit");
865  }
866  }
867  }
$_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
global $ilDB
$DIC
Definition: xapitoken.php:46
static redirect($a_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 980 of file class.assQuestionGUI.php.

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

981  {
982  global $DIC;
983  $ilUser = $DIC['ilUser'];
984  $old_id = $_GET["q_id"];
985  $result = $this->writePostData();
986  if ($result == 0) {
987  $ilUser->setPref("tst_lastquestiontype", $this->object->getQuestionType());
988  $ilUser->writePref("tst_lastquestiontype", $this->object->getQuestionType());
989  $this->object->saveToDb();
990  $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
991  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
992  if (($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId())) {
993  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
994  $this->ctrl->setParameter($this, 'test_express_mode', $_REQUEST['test_express_mode']);
995  $this->ctrl->redirect($this, "originalSyncForm");
996  return;
997  } elseif ($_GET["calling_test"]) {
998  require_once 'Modules/Test/classes/class.ilObjTest.php';
999  $test = new ilObjTest($_GET["calling_test"]);
1000  #var_dump(assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId()));
1001  $q_id = $this->object->getId();
1002  if (!assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId())) {
1003  global $DIC;
1004  $tree = $DIC['tree'];
1005  $ilDB = $DIC['ilDB'];
1006  $ilPluginAdmin = $DIC['ilPluginAdmin'];
1007 
1008  include_once("./Modules/Test/classes/class.ilObjTest.php");
1009  $_GET["ref_id"] = $_GET["calling_test"];
1010  $test = new ilObjTest($_GET["calling_test"], true);
1011 
1012  require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
1013  $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
1014 
1015  $new_id = $test->insertQuestion(
1016  $testQuestionSetConfigFactory->getQuestionSetConfig(),
1017  $this->object->getId()
1018  );
1019 
1020  $q_id = $new_id;
1021  if (isset($_REQUEST['prev_qid'])) {
1022  $test->moveQuestionAfter($this->object->getId() + 1, $_REQUEST['prev_qid']);
1023  }
1024 
1025  $this->ctrl->setParameter($this, 'q_id', $new_id);
1026  $this->ctrl->setParameter($this, 'calling_test', $_GET['calling_test']);
1027  #$this->ctrl->setParameter($this, 'test_ref_id', false);
1028  }
1029  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1030  if ( /*$___test_express_mode || */
1031  $_REQUEST['test_express_mode']
1032  ) {
1034  } else {
1035  ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET["calling_test"]);
1036  }
1037  } else {
1038  if ($this->object->getId() != $old_id) {
1039  $this->callNewIdListeners($this->object->getId());
1040  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1041  $this->ctrl->redirectByClass("ilobjquestionpoolgui", "questions");
1042  }
1043  if (strcmp($_SESSION["info"], "") != 0) {
1044  ilUtil::sendSuccess($_SESSION["info"] . "<br />" . $this->lng->txt("msg_obj_modified"), true);
1045  } else {
1046  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1047  }
1048  $this->ctrl->redirectByClass("ilobjquestionpoolgui", "questions");
1049  }
1050  }
1051  }
$_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)
global $ilDB
$DIC
Definition: xapitoken.php:46
static redirect($a_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 1687 of file class.assQuestionGUI.php.

References $_POST, $DIC, $type, and suggestedsolution().

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

◆ saveTaxonomyAssignments()

assQuestionGUI::saveTaxonomyAssignments ( )
protected

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

References getTaxonomyIds().

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

1301  {
1302  if (count($this->getTaxonomyIds())) {
1303  require_once 'Services/Taxonomy/classes/class.ilTaxAssignInputGUI.php';
1304 
1305  foreach ($this->getTaxonomyIds() as $taxonomyId) {
1306  $postvar = "tax_node_assign_$taxonomyId";
1307 
1308  $tax_node_assign = new ilTaxAssignInputGUI($taxonomyId, true, '', $postvar);
1309  // TODO: determine tst/qpl when tax assigns become maintainable within tests
1310  $tax_node_assign->saveInput("qpl", $this->object->getObjId(), "quest", $this->object->getId());
1311  }
1312  }
1313  }
Input GUI class for taxonomy assignments.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAdjustmentEditContext()

assQuestionGUI::setAdjustmentEditContext ( )

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

References setEditContext().

393  {
394  return $this->setEditContext(self::EDIT_CONTEXT_ADJUSTMENT);
395  }
setEditContext($editContext)
+ Here is the call graph for this function:

◆ setEditContext()

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

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

References $editContext.

Referenced by setAdjustmentEditContext().

372  {
373  $this->editContext = $editContext;
374  }
+ Here is the caller graph for this function:

◆ setErrorMessage()

assQuestionGUI::setErrorMessage (   $errormessage)

◆ setNavigationGUI()

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

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

References $navigationGUI.

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

409  {
410  $this->navigationGUI = $navigationGUI;
411  }
+ Here is the caller graph for this function:

◆ setPresentationContext()

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

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

References $presentationContext.

279  {
280  $this->presentationContext = $presentationContext;
281  }

◆ setPreviewSession()

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

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

References $previewSession.

2311  {
2312  $this->previewSession = $previewSession;
2313  }

◆ setPreviousSolutionPrefilled()

assQuestionGUI::setPreviousSolutionPrefilled (   $previousSolutionPrefilled)
Parameters
boolean$previousSolutionPrefilled

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

References $previousSolutionPrefilled.

301  {
302  $this->previousSolutionPrefilled = $previousSolutionPrefilled;
303  }

◆ setQuestionActionCmd()

assQuestionGUI::setQuestionActionCmd (   $questionActionCmd)

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

References $questionActionCmd.

457  {
458  $this->questionActionCmd = $questionActionCmd;
459 
460  if (is_object($this->object)) {
461  $this->object->questionActionCmd = $questionActionCmd;
462  }
463  }

◆ setQuestionCount()

assQuestionGUI::setQuestionCount (   $a_question_count)

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

1099  {
1100  $this->question_count = $a_question_count;
1101  }

◆ setQuestionHeaderBlockBuilder()

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

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

References $questionHeaderBlockBuilder.

442  {
443  $this->questionHeaderBlockBuilder = $questionHeaderBlockBuilder;
444  }

◆ setQuestionTabs()

assQuestionGUI::setQuestionTabs ( )

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

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

Referenced by assNumericGUI\getTestOutput().

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

References $renderPurpose.

Referenced by suggestedsolution().

318  {
319  $this->renderPurpose = $renderPurpose;
320  }
+ Here is the caller graph for this function:

◆ setSequenceNumber()

assQuestionGUI::setSequenceNumber (   $nr)

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

1089  {
1090  $this->sequence_no = $nr;
1091  }

◆ setTargetGui()

assQuestionGUI::setTargetGui (   $linkTargetGui)

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

References setTargetGuiClass().

424  {
425  $this->setTargetGuiClass(get_class($linkTargetGui));
426  }
setTargetGuiClass($targetGuiClass)
+ Here is the call graph for this function:

◆ setTargetGuiClass()

assQuestionGUI::setTargetGuiClass (   $targetGuiClass)

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

References $targetGuiClass.

Referenced by setTargetGui().

429  {
430  $this->targetGuiClass = $targetGuiClass;
431  }
+ Here is the caller graph for this function:

◆ setTaxonomyIds()

assQuestionGUI::setTaxonomyIds (   $taxonomyIds)

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

References $taxonomyIds.

414  {
415  $this->taxonomyIds = $taxonomyIds;
416  }

◆ setUseIntermediateSolution()

assQuestionGUI::setUseIntermediateSolution (   $use)

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

2159  {
2160  $this->use_intermediate_solution = (bool) $use;
2161  }

◆ showHints()

assQuestionGUI::showHints ( )

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

References $DIC, $ilCtrl, and ilAssQuestionHintsGUI\CMD_SHOW_LIST.

2344  {
2345  global $DIC;
2346  $ilCtrl = $DIC['ilCtrl'];
2347  $ilCtrl->redirectByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST);
2348  }
const CMD_SHOW_LIST
command constants
global $ilCtrl
Definition: ilias.php:18
$DIC
Definition: xapitoken.php:46

◆ showSuggestedSolution()

assQuestionGUI::showSuggestedSolution ( )

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

References suggestedsolution().

1437  {
1438  $this->suggestedsolution();
1439  }
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 1446 of file class.assQuestionGUI.php.

References $_GET, $_POST, $DIC, $ilUser, $res, assQuestion\_getInternalLinkHref(), assQuestion\_isWriteable(), ilRadioGroupInputGUI\addOption(), getRenderPurpose(), getSolutionOutput(), ilUtil\makeDirParents(), ilUtil\moveUploadedFile(), originalSyncForm(), ilUtil\prepareFormOutput(), ilUtil\renameExecutables(), ilUtil\sendInfo(), ilCustomInputGUI\setHtml(), setRenderPurpose(), ilFormPropertyGUI\setRequired(), and ilTextAreaInputGUI\setValue().

Referenced by saveSuggestedSolution(), and showSuggestedSolution().

1447  {
1448  global $DIC;
1449  $ilUser = $DIC['ilUser'];
1450  global $DIC;
1451  $ilAccess = $DIC['ilAccess'];
1452 
1453  $save = (is_array($_POST["cmd"]) && array_key_exists("suggestedsolution", $_POST["cmd"])) ? true : false;
1454 
1455  if ($save && $_POST["deleteSuggestedSolution"] == 1) {
1456  $this->object->deleteSuggestedSolutions();
1457  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1458  $this->ctrl->redirect($this, "suggestedsolution");
1459  }
1460 
1461  $output = "";
1462  $solution_array = $this->object->getSuggestedSolution(0);
1463  $options = array(
1464  "lm" => $this->lng->txt("obj_lm"),
1465  "st" => $this->lng->txt("obj_st"),
1466  "pg" => $this->lng->txt("obj_pg"),
1467  "git" => $this->lng->txt("glossary_term"),
1468  "file" => $this->lng->txt("fileDownload"),
1469  "text" => $this->lng->txt("solutionText")
1470  );
1471 
1472  if ((strcmp($_POST["solutiontype"], "file") == 0) && (strcmp($solution_array["type"], "file") != 0)) {
1473  $solution_array = array(
1474  "type" => "file"
1475  );
1476  } elseif ((strcmp($_POST["solutiontype"], "text") == 0) && (strcmp($solution_array["type"], "text") != 0)) {
1477  $oldOutputMode = $this->getRenderPurpose();
1478  $this->setRenderPurpose(self::RENDER_PURPOSE_INPUT_VALUE);
1479 
1480  $solution_array = array(
1481  "type" => "text",
1482  "value" => $this->getSolutionOutput(0, null, false, false, true, false, true)
1483  );
1484  $this->setRenderPurpose($oldsaveSuggestedSolutionOutputMode);
1485  }
1486  if ($save && strlen($_POST["filename"])) {
1487  $solution_array["value"]["filename"] = $_POST["filename"];
1488  }
1489  if ($save && strlen($_POST["solutiontext"])) {
1490  $solution_array["value"] = $_POST["solutiontext"];
1491  }
1492  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1493  if (count($solution_array)) {
1494  $form = new ilPropertyFormGUI();
1495  $form->setFormAction($this->ctrl->getFormAction($this));
1496  $form->setTitle($this->lng->txt("solution_hint"));
1497  $form->setMultipart(true);
1498  $form->setTableWidth("100%");
1499  $form->setId("suggestedsolutiondisplay");
1500 
1501  // suggested solution output
1502  include_once "./Modules/TestQuestionPool/classes/class.ilSolutionTitleInputGUI.php";
1503  $title = new ilSolutionTitleInputGUI($this->lng->txt("showSuggestedSolution"), "solutiontype");
1504  $template = new ilTemplate("tpl.il_as_qpl_suggested_solution_input_presentation.html", true, true, "Modules/TestQuestionPool");
1505  if (strlen($solution_array["internal_link"])) {
1506  $href = assQuestion::_getInternalLinkHref($solution_array["internal_link"]);
1507  $template->setCurrentBlock("preview");
1508  $template->setVariable("TEXT_SOLUTION", $this->lng->txt("suggested_solution"));
1509  $template->setVariable("VALUE_SOLUTION", " <a href=\"$href\" target=\"content\">" . $this->lng->txt("view") . "</a> ");
1510  $template->parseCurrentBlock();
1511  } elseif ((strcmp($solution_array["type"], "file") == 0) && (is_array($solution_array["value"]))) {
1512  $href = $this->object->getSuggestedSolutionPathWeb() . $solution_array["value"]["name"];
1513  $template->setCurrentBlock("preview");
1514  $template->setVariable("TEXT_SOLUTION", $this->lng->txt("suggested_solution"));
1515  $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> ");
1516  $template->parseCurrentBlock();
1517  }
1518  $template->setVariable("TEXT_TYPE", $this->lng->txt("type"));
1519  $template->setVariable("VALUE_TYPE", $options[$solution_array["type"]]);
1520  $title->setHtml($template->get());
1521  $deletesolution = new ilCheckboxInputGUI("", "deleteSuggestedSolution");
1522  $deletesolution->setOptionTitle($this->lng->txt("deleteSuggestedSolution"));
1523  $title->addSubItem($deletesolution);
1524  $form->addItem($title);
1525 
1526  if (strcmp($solution_array["type"], "file") == 0) {
1527  // file
1528  $file = new ilFileInputGUI($this->lng->txt("fileDownload"), "file");
1529  $file->setRequired(true);
1530  $file->enableFileNameSelection("filename");
1531  //$file->setSuffixes(array("doc","xls","png","jpg","gif","pdf"));
1532  if ($_FILES["file"]["tmp_name"] && $file->checkInput()) {
1533  if (!file_exists($this->object->getSuggestedSolutionPath())) {
1534  ilUtil::makeDirParents($this->object->getSuggestedSolutionPath());
1535  }
1536 
1537  $res = ilUtil::moveUploadedFile($_FILES["file"]["tmp_name"], $_FILES["file"]["name"], $this->object->getSuggestedSolutionPath() . $_FILES["file"]["name"]);
1538  if ($res) {
1539  ilUtil::renameExecutables($this->object->getSuggestedSolutionPath());
1540 
1541  // remove an old file download
1542  if (is_array($solution_array["value"])) {
1543  @unlink($this->object->getSuggestedSolutionPath() . $solution_array["value"]["name"]);
1544  }
1545  $file->setValue($_FILES["file"]["name"]);
1546  $this->object->saveSuggestedSolution("file", "", 0, array("name" => $_FILES["file"]["name"], "type" => $_FILES["file"]["type"], "size" => $_FILES["file"]["size"], "filename" => $_POST["filename"]));
1547  $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
1548  if (($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId())) {
1549  return $this->originalSyncForm("suggestedsolution");
1550  } else {
1551  ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), true);
1552  $this->ctrl->redirect($this, "suggestedsolution");
1553  }
1554  } else {
1555  // BH: $res as info string? wtf? it holds a bool or something else!!?
1556  ilUtil::sendInfo($res);
1557  }
1558  } else {
1559  if (is_array($solution_array["value"])) {
1560  $file->setValue($solution_array["value"]["name"]);
1561  $file->setFilename((strlen($solution_array["value"]["filename"])) ? $solution_array["value"]["filename"] : $solution_array["value"]["name"]);
1562  }
1563  }
1564  $form->addItem($file);
1565  $hidden = new ilHiddenInputGUI("solutiontype");
1566  $hidden->setValue("file");
1567  $form->addItem($hidden);
1568  } elseif (strcmp($solution_array["type"], "text") == 0) {
1569  $solutionContent = $solution_array['value'];
1570  $solutionContent = $this->object->fixSvgToPng($solutionContent);
1571  $solutionContent = $this->object->fixUnavailableSkinImageSources($solutionContent);
1572  $question = new ilTextAreaInputGUI($this->lng->txt("solutionText"), "solutiontext");
1573  $question->setValue($this->object->prepareTextareaOutput($solutionContent));
1574  $question->setRequired(true);
1575  $question->setRows(10);
1576  $question->setCols(80);
1577  $question->setUseRte(true);
1578  $question->addPlugin("latex");
1579  $question->addButton("latex");
1580  $question->setRTESupport($this->object->getId(), "qpl", "assessment");
1581  $hidden = new ilHiddenInputGUI("solutiontype");
1582  $hidden->setValue("text");
1583  $form->addItem($hidden);
1584  $form->addItem($question);
1585  }
1586  if ($ilAccess->checkAccess("write", "", $_GET['ref_id'])) {
1587  $form->addCommandButton('showSuggestedSolution', $this->lng->txt('cancel'));
1588  $form->addCommandButton('suggestedsolution', $this->lng->txt('save'));
1589  }
1590 
1591  if ($save) {
1592  if ($form->checkInput()) {
1593  switch ($solution_array["type"]) {
1594  case "file":
1595  $this->object->saveSuggestedSolution("file", "", 0, array(
1596  "name" => $solution_array["value"]["name"],
1597  "type" => $solution_array["value"]["type"],
1598  "size" => $solution_array["value"]["size"],
1599  "filename" => $_POST["filename"]
1600  ));
1601  break;
1602  case "text":
1603  $this->object->saveSuggestedSolution("text", "", 0, $solution_array["value"]);
1604  break;
1605  }
1606  $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
1607  if (($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId())) {
1608  return $this->originalSyncForm("suggestedsolution");
1609  } else {
1610  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1611  $this->ctrl->redirect($this, "suggestedsolution");
1612  }
1613  }
1614  }
1615 
1616  $output = $form->getHTML();
1617  }
1618 
1619  $savechange = (strcmp($this->ctrl->getCmd(), "saveSuggestedSolution") == 0) ? true : false;
1620 
1621  $changeoutput = "";
1622  if ($ilAccess->checkAccess("write", "", $_GET['ref_id'])) {
1623  $formchange = new ilPropertyFormGUI();
1624  $formchange->setFormAction($this->ctrl->getFormAction($this));
1625  $formchange->setTitle((count($solution_array)) ? $this->lng->txt("changeSuggestedSolution") : $this->lng->txt("addSuggestedSolution"));
1626  $formchange->setMultipart(false);
1627  $formchange->setTableWidth("100%");
1628  $formchange->setId("suggestedsolution");
1629 
1630  $solutiontype = new ilRadioGroupInputGUI($this->lng->txt("suggestedSolutionType"), "solutiontype");
1631  foreach ($options as $opt_value => $opt_caption) {
1632  $solutiontype->addOption(new ilRadioOption($opt_caption, $opt_value));
1633  }
1634  if (count($solution_array)) {
1635  $solutiontype->setValue($solution_array["type"]);
1636  }
1637  $solutiontype->setRequired(true);
1638  $formchange->addItem($solutiontype);
1639 
1640  $formchange->addCommandButton("saveSuggestedSolution", $this->lng->txt("select"));
1641 
1642  if ($savechange) {
1643  $formchange->checkInput();
1644  }
1645  $changeoutput = $formchange->getHTML();
1646  }
1647 
1648  $this->tpl->setVariable("ADM_CONTENT", $changeoutput . $output);
1649  }
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.
setHtml($a_html)
Set Html.
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.
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.
foreach($_POST as $key=> $value) $res
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
originalSyncForm($return_to="", $return_to_feedback='')
$ilUser
Definition: imgupload.php:18
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
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 text area property in a property form.
$DIC
Definition: xapitoken.php:46
$_POST["username"]
setRequired($a_required)
Set Required.
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:

◆ supportsIntermediateSolutionOutput()

assQuestionGUI::supportsIntermediateSolutionOutput ( )

Question type specific support of intermediate solution output The function getSolutionOutput respects getUseIntermediateSolution()

Returns
bool

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

2138  {
2139  return false;
2140  }

◆ sync()

assQuestionGUI::sync ( )

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

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

761  {
762  $original_id = $this->object->original_id;
763  if ($original_id) {
764  $this->object->syncWithOriginal();
765  }
766  if (strlen($_GET["return_to"])) {
767  $this->ctrl->redirect($this, $_GET["return_to"]);
768  }
769  if (strlen($_REQUEST["return_to_fb"])) {
770  $this->ctrl->redirectByClass('ilAssQuestionFeedbackEditingGUI', 'showFeedbackForm');
771  } else {
772  if (isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer']) {
773  $ref_id = (int) $_GET['calling_consumer'];
774  $consumer = ilObjectFactory::getInstanceByRefId($ref_id);
775  if ($consumer instanceof ilQuestionEditingFormConsumer) {
776  ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
777  }
778  require_once 'Services/Link/classes/class.ilLink.php';
780  }
781  $_GET["ref_id"] = $_GET["calling_test"];
782 
783  if ($_REQUEST['test_express_mode']) {
785  } else {
786  ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET["calling_test"]);
787  }
788  }
789  }
$_GET["client_id"]
static getReturnToPageLink($q_id=null)
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static redirect($a_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 474 of file class.assQuestionGUI.php.

References $DIC, and $tpl.

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

475  {
476  }
+ Here is the caller graph for this function:

◆ writeQuestionGenericPostData()

assQuestionGUI::writeQuestionGenericPostData ( )
protected

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

References $_POST, Vendor\Package\$e, ilAssQuestionLifecycle\getInstance(), getPreview(), and ilUtil\stripOnlySlashes().

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

2186  {
2187  $this->object->setTitle($_POST["title"]);
2188  $this->object->setAuthor($_POST["author"]);
2189  $this->object->setComment($_POST["comment"]);
2190  if ($this->object->getSelfAssessmentEditingMode()) {
2191  $this->object->setNrOfTries($_POST['nr_of_tries']);
2192  }
2193 
2194  try {
2195  $lifecycle = ilAssQuestionLifecycle::getInstance($_POST['lifecycle']);
2196  $this->object->setLifecycle($lifecycle);
2198  }
2199 
2200  $this->object->setQuestion(ilUtil::stripOnlySlashes($_POST['question'])); // ?
2201  $this->object->setEstimatedWorkingTime(
2202  $_POST["Estimated"]["hh"],
2203  $_POST["Estimated"]["mm"],
2204  $_POST["Estimated"]["ss"]
2205  );
2206  }
static stripOnlySlashes($a_str)
strip slashes if magic qoutes is enabled
$_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 95 of file class.assQuestionGUI.php.

Referenced by getEditContext(), and setEditContext().

◆ $editForm

assQuestionGUI::$editForm
protected

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

Referenced by buildEditForm().

◆ $error

assQuestionGUI::$error

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

◆ $errormessage

assQuestionGUI::$errormessage

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

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

◆ $lng

assQuestionGUI::$lng

◆ $navigationGUI

assQuestionGUI::$navigationGUI
private

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

Referenced by getNavigationGUI(), and setNavigationGUI().

◆ $object

assQuestionGUI::$object

◆ $presentationContext

assQuestionGUI::$presentationContext = null
private

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

Referenced by getPresentationContext(), and setPresentationContext().

◆ $previewSession

assQuestionGUI::$previewSession
private

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

Referenced by getPreviewSession(), and setPreviewSession().

◆ $previousSolutionPrefilled

assQuestionGUI::$previousSolutionPrefilled = false
private

◆ $question_count

assQuestionGUI::$question_count

question count in test

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

Referenced by getQuestionCount().

◆ $questionActionCmd

assQuestionGUI::$questionActionCmd = 'handleQuestionAction'
private

Definition at line 58 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 87 of file class.assQuestionGUI.php.

Referenced by getRenderPurpose(), and setRenderPurpose().

◆ $sequence_no

assQuestionGUI::$sequence_no

sequence number in test

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

Referenced by getSequenceNumber().

◆ $targetGuiClass

assQuestionGUI::$targetGuiClass = null
private

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

Referenced by getTargetGuiClass(), and setTargetGuiClass().

◆ $taxonomyIds

assQuestionGUI::$taxonomyIds = array()
private

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

Referenced by getTaxonomyIds(), and setTaxonomyIds().

◆ $tpl

◆ $use_intermediate_solution

assQuestionGUI::$use_intermediate_solution = false
protected

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

Referenced by getUseIntermediateSolution().

◆ EDIT_CONTEXT_ADJUSTMENT

const assQuestionGUI::EDIT_CONTEXT_ADJUSTMENT = 'adjustment'

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

◆ 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 71 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 79 of file class.assQuestionGUI.php.

Referenced by ilAssQuestionPreviewGUI\initQuestion().

◆ RENDER_PURPOSE_INPUT_VALUE

const assQuestionGUI::RENDER_PURPOSE_INPUT_VALUE = 'renderPurposeInputValue'

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

◆ RENDER_PURPOSE_PLAYBACK

const assQuestionGUI::RENDER_PURPOSE_PLAYBACK = 'renderPurposePlayback'

Definition at line 78 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: