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

Class ilScoringAdjustmentGUI.

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

@ilCtrl_IsCalledBy ilScoringAdjustmentGUI: ilObjTestGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilScoringAdjustmentGUI::__construct ( ilObjTest  $a_object)

Default constructor.

Parameters
ilObjTest$a_object

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

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 }
Service class for tests.
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file)

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

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.

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 }
static getQuestionTypeByTypeId($type_id)
ILIAS Setting Class.
$type

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

+ Here is the call graph for this function:

◆ dispatchCommand()

ilScoringAdjustmentGUI::dispatchCommand (   $cmd)
protected

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

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 }

References editQuestion().

Referenced by executeCommand().

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

206 {
207 $form = $this->buildAdjustQuestionForm((int) $_GET['q_id'], (int) $_GET['qpl_id']);
209 }
$_GET["client_id"]
if(isset($_POST['submit'])) $form

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

Referenced by dispatchCommand().

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

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 }

References dispatchCommand().

+ Here is the call graph for this function:

◆ outputAdjustQuestionForm()

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

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

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 }

References $form.

Referenced by editQuestion().

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

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 }
Interface ilGuiAnswerScoringAdjustable.
Interface ilGuiQuestionScoringAdjustable.

References $form.

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

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.

Field Documentation

◆ $ctrl

ilCtrl ilScoringAdjustmentGUI::$ctrl
protected

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

◆ $ilias

ILIAS ilScoringAdjustmentGUI::$ilias
protected

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

Referenced by __construct().

◆ $lng

ilLanguage ilScoringAdjustmentGUI::$lng
protected

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

Referenced by __construct().

◆ $object

ilObjTest ilScoringAdjustmentGUI::$object

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

◆ $ref_id

int ilScoringAdjustmentGUI::$ref_id
protected

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

◆ $service

ilTestService ilScoringAdjustmentGUI::$service
protected

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

◆ $tpl

ilTemplate ilScoringAdjustmentGUI::$tpl
protected

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

Referenced by __construct().

◆ $tree

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