ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 195 of file class.ilScoringAdjustmentGUI.php.

196 {
197 $setting = new ilSetting('assessment');
198 $types = explode(',',$setting->get('assessment_scoring_adjustment'));
199 require_once './Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
200 $type_def = array();
201 foreach ($types as $type)
202 {
203 $type_def[$type] = ilObjQuestionPool::getQuestionTypeByTypeId($type);
204 }
205
206 $type = $question_object->getQuestionType();
207 if (in_array($type,$type_def))
208 {
209 return true;
210 }
211 return false;
212 }
static getQuestionTypeByTypeId($type_id)
ILIAS Setting Class.

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

+ Here is the call graph for this function:

◆ dispatchCommand()

ilScoringAdjustmentGUI::dispatchCommand (   $cmd)
protected

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

86 {
87 switch (strtolower($cmd))
88 {
89 case 'savescoringfortest':
90 $this->saveQuestion();
91 break;
92
93 case 'adjustscoringfortest':
94 $this->editQuestion();
95 break;
96
97 case 'showquestionlist':
98 default:
99 $this->questionsObject();
100 }
101 }
$cmd
Definition: sahs_server.php:35

References $cmd, and 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 214 of file class.ilScoringAdjustmentGUI.php.

215 {
216 $form = $this->buildAdjustQuestionForm( (int)$_GET['q_id'], (int)$_GET['qpl_id'] );
217 $this->outputAdjustQuestionForm( $form );
218 }
$_GET["client_id"]

References $_GET, 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 {
72 $this->ctrl->redirectByClass('ilObjTestGUI');
73 }
74
75 $cmd = $this->ctrl->getCmd();
76 $next_class = $this->ctrl->getNextClass($this);
77
78 switch($next_class)
79 {
80 default:
81 return $this->dispatchCommand($cmd);
82 }
83 }

References $cmd, and dispatchCommand().

+ Here is the call graph for this function:

◆ outputAdjustQuestionForm()

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

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

224 {
225 $this->tpl->addBlockFile( "ADM_CONTENT", "adm_content", "tpl.il_as_tst_questions.html", "Modules/Test" );
226 $this->tpl->setCurrentBlock( "adm_content" );
227 $this->tpl->setVariable( 'QUESTIONBROWSER', $form->getHTML() );
228 $this->tpl->parseCurrentBlock();
229 }

Referenced by editQuestion().

+ Here is the caller graph for this function:

◆ populateScoringAdjustments()

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

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

396 {
397 if ( $question instanceof ilGuiQuestionScoringAdjustable )
398 {
399 $question->populateQuestionSpecificFormPart( $form );
400 $this->suppressPostParticipationFormElements( $form,
401 $question->getAfterParticipationSuppressionQuestionPostVars()
402 );
403 }
404
405 if ( $question instanceof ilGuiAnswerScoringAdjustable )
406 {
407 $question->populateAnswerSpecificFormPart( $form );
408 $this->suppressPostParticipationFormElements( $form,
409 $question->getAfterParticipationSuppressionAnswerPostVars()
410 );
411 }
412 }
Interface ilGuiAnswerScoringAdjustable.
Interface ilGuiQuestionScoringAdjustable.

◆ 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 181 of file class.ilScoringAdjustmentGUI.php.

182 {
183 return ($question_object instanceof ilGuiQuestionScoringAdjustable
184 || $question_object instanceof ilGuiAnswerScoringAdjustable)
185 && ($question_object->object instanceof ilObjQuestionScoringAdjustable
186 || $question_object->object instanceof ilObjAnswerScoringAdjustable);
187 }
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: