ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilScoringAdjustmentGUI Class Reference

Class ilScoringAdjustmentGUI. More...

+ Collaboration diagram for ilScoringAdjustmentGUI:

Public Member Functions

 __construct (ilObjTest $a_object)
 Default constructor. More...
 
 executeCommand ()
 execute command More...
 

Data Fields

 $object
 

Protected Member Functions

 dispatchCommand ($cmd)
 
 supportsAdjustment (\assQuestionGUI $question_object)
 Returns if the given question object support scoring adjustment. More...
 
 allowedInAdjustment (\assQuestionGUI $question_object)
 Returns if the question type is allowed for adjustments in the global test administration. More...
 
 editQuestion ()
 
 outputAdjustQuestionForm ($form)
 
 populateScoringAdjustments ($question, $form)
 

Protected Attributes

 $lng
 
 $tpl
 
 $ctrl
 
 $ilias
 
 $tree
 
 $ref_id
 
 $service
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilScoringAdjustmentGUI::__construct ( ilObjTest  $a_object)

Default constructor.

Parameters
ilObjTest$a_object

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

References $ilCtrl, $ilias, $lng, $tpl, and $tree.

49  {
50  global $lng, $tpl, $ilCtrl, $ilias, $tree;
51 
52  $this->lng = $lng;
53  $this->tpl = $tpl;
54  $this->ctrl = $ilCtrl;
55  $this->ilias = $ilias;
56  $this->object = $a_object;
57  $this->tree = $tree;
58  $this->ref_id = $a_object->ref_id;
59 
60  require_once './Modules/Test/classes/class.ilTestService.php';
61  $this->service = new ilTestService($a_object);
62  }
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
Service class for tests.

Member Function Documentation

◆ allowedInAdjustment()

ilScoringAdjustmentGUI::allowedInAdjustment ( \assQuestionGUI  $question_object)
protected

Returns if the question type is allowed for adjustments in the global test administration.

Parameters
assQuestionGUI$question_object
Returns
bool

Definition at line 188 of file class.ilScoringAdjustmentGUI.php.

References $type, array, assQuestionGUI\getQuestionType(), and ilObjQuestionPool\getQuestionTypeByTypeId().

Referenced by dispatchCommand().

189  {
190  $setting = new ilSetting('assessment');
191  $types = explode(',', $setting->get('assessment_scoring_adjustment'));
192  require_once './Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
193  $type_def = array();
194  foreach ($types as $type) {
196  }
197 
198  $type = $question_object->getQuestionType();
199  if (in_array($type, $type_def)) {
200  return true;
201  }
202  return false;
203  }
$type
static getQuestionTypeByTypeId($type_id)
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dispatchCommand()

ilScoringAdjustmentGUI::dispatchCommand (   $cmd)
protected

Definition at line 83 of file class.ilScoringAdjustmentGUI.php.

References $_GET, $_SESSION, $data, allowedInAdjustment(), array, editQuestion(), exit, assQuestion\instantiateQuestionGUI(), object, ilUtil\sendInfo(), and supportsAdjustment().

Referenced by executeCommand().

84  {
85  switch (strtolower($cmd)) {
86  case 'savescoringfortest':
87  $this->saveQuestion();
88  break;
89 
90  case 'adjustscoringfortest':
91  $this->editQuestion();
92  break;
93 
94  case 'showquestionlist':
95  default:
96  $this->questionsObject();
97  }
98  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editQuestion()

ilScoringAdjustmentGUI::editQuestion ( )
protected

Definition at line 205 of file class.ilScoringAdjustmentGUI.php.

References $_GET, $form, and outputAdjustQuestionForm().

Referenced by dispatchCommand().

206  {
207  $form = $this->buildAdjustQuestionForm((int) $_GET['q_id'], (int) $_GET['qpl_id']);
209  }
$_GET["client_id"]
if(isset($_POST['submit'])) $form
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilScoringAdjustmentGUI::executeCommand ( )

execute command

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

References dispatchCommand().

68  {
69  $setting = new ilSetting('assessment');
70  if (!(bool) $setting->get('assessment_adjustments_enabled', false)) {
71  $this->ctrl->redirectByClass('ilObjTestGUI');
72  }
73 
74  $cmd = $this->ctrl->getCmd();
75  $next_class = $this->ctrl->getNextClass($this);
76 
77  switch ($next_class) {
78  default:
79  return $this->dispatchCommand($cmd);
80  }
81  }
+ Here is the call graph for this function:

◆ outputAdjustQuestionForm()

ilScoringAdjustmentGUI::outputAdjustQuestionForm (   $form)
protected
Parameters
$form

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

References $_POST, $container, $form, $GLOBALS, $pass, $result, $results, array, ilPropertyFormGUI\checkInput(), ilGlyphGUI\CLOSE, assQuestionGUI\EDIT_CONTEXT_ADJUSTMENT, ilGlyphGUI\get(), ilPropertyFormGUI\getItemByPostVar(), iljQueryUtil\initjQuery(), ilYuiUtil\initOverlay(), ilYuiUtil\initPanel(), assQuestion\instantiateQuestionGUI(), populateScoringAdjustments(), ilUtil\sendFailure(), ilUtil\sendSuccess(), ilCheckboxInputGUI\setChecked(), and ilPropertyFormGUI\setValuesByPost().

Referenced by editQuestion().

215  {
216  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_questions.html", "Modules/Test");
217  $this->tpl->setCurrentBlock("adm_content");
218  $this->tpl->setVariable('QUESTIONBROWSER', $form->getHTML());
219  $this->tpl->parseCurrentBlock();
220  }
if(isset($_POST['submit'])) $form
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateScoringAdjustments()

ilScoringAdjustmentGUI::populateScoringAdjustments (   $question,
  $form 
)
protected
Parameters
assQuestionGUI$question
$form

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

Referenced by outputAdjustQuestionForm().

376  {
377  $question->setAdjustmentEditContext();
378 
379  if ($question instanceof ilGuiQuestionScoringAdjustable) {
380  $question->populateQuestionSpecificFormPart($form);
381 
382  $this->suppressPostParticipationFormElements(
383  $form,
384  $question->getAfterParticipationSuppressionQuestionPostVars()
385  );
386  }
387 
388  if ($question instanceof ilGuiAnswerScoringAdjustable) {
389  $question->populateAnswerSpecificFormPart($form);
390 
391  $this->suppressPostParticipationFormElements(
392  $form,
393  $question->getAfterParticipationSuppressionAnswerPostVars()
394  );
395  }
396  }
if(isset($_POST['submit'])) $form
Interface ilGuiAnswerScoringAdjustable.
Interface ilGuiQuestionScoringAdjustable.
+ Here is the caller graph for this function:

◆ supportsAdjustment()

ilScoringAdjustmentGUI::supportsAdjustment ( \assQuestionGUI  $question_object)
protected

Returns if the given question object support scoring adjustment.

Parameters
$question_objectassQuestionGUI
Returns
bool True, if relevant interfaces are implemented to support scoring adjustment.

Definition at line 174 of file class.ilScoringAdjustmentGUI.php.

Referenced by dispatchCommand().

175  {
176  return ($question_object instanceof ilGuiQuestionScoringAdjustable
177  || $question_object instanceof ilGuiAnswerScoringAdjustable)
178  && ($question_object->object instanceof ilObjQuestionScoringAdjustable
179  || $question_object->object instanceof ilObjAnswerScoringAdjustable);
180  }
Interface ilObjAnswerScoringAdjustable.
Interface ilObjQuestionScoringAdjustable.
Interface ilGuiAnswerScoringAdjustable.
Interface ilGuiQuestionScoringAdjustable.
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilScoringAdjustmentGUI::$ctrl
protected

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

◆ $ilias

ilScoringAdjustmentGUI::$ilias
protected

Definition at line 29 of file class.ilScoringAdjustmentGUI.php.

Referenced by __construct().

◆ $lng

ilScoringAdjustmentGUI::$lng
protected

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

Referenced by __construct().

◆ $object

ilScoringAdjustmentGUI::$object

Definition at line 32 of file class.ilScoringAdjustmentGUI.php.

◆ $ref_id

ilScoringAdjustmentGUI::$ref_id
protected

Definition at line 38 of file class.ilScoringAdjustmentGUI.php.

◆ $service

ilScoringAdjustmentGUI::$service
protected

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

◆ $tpl

ilScoringAdjustmentGUI::$tpl
protected

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

Referenced by __construct().

◆ $tree

ilScoringAdjustmentGUI::$tree
protected

Definition at line 35 of file class.ilScoringAdjustmentGUI.php.

Referenced by __construct().


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