ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilScoringAdjustmentGUI Class Reference

Class ilScoringAdjustmentGUI. More...

+ Collaboration diagram for ilScoringAdjustmentGUI:

Public Member Functions

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

Data Fields

 $object

Protected Member Functions

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

Protected Attributes

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

Detailed Description

Constructor & Destructor Documentation

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.

{
$this->lng = $lng;
$this->tpl = $tpl;
$this->ctrl = $ilCtrl;
$this->ilias = $ilias;
$this->object = $a_object;
$this->tree = $tree;
$this->ref_id = $a_object->ref_id;
require_once './Modules/Test/classes/class.ilTestService.php';
$this->service = new ilTestService($a_object);
}

Member Function Documentation

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.

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

{
$setting = new ilSetting('assessment');
$types = explode(',',$setting->get('assessment_scoring_adjustment'));
require_once './Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
$type_def = array();
foreach ($types as $type)
{
$type_def[$type] = ilObjQuestionPool::getQuestionTypeByTypeId($type);
}
$type = $question_object->getQuestionType();
if (in_array($type,$type_def))
{
return true;
}
return false;
}

+ Here is the call graph for this function:

ilScoringAdjustmentGUI::dispatchCommand (   $cmd)
protected

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

References $cmd, and editQuestion().

Referenced by executeCommand().

{
switch (strtolower($cmd))
{
case 'save':
$this->saveQuestion();
break;
case 'adjustscoringfortest':
$this->editQuestion();
break;
case 'showquestionlist':
default:
$this->questionsObject();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilScoringAdjustmentGUI::editQuestion ( )
protected

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

References $_GET, and outputAdjustQuestionForm().

Referenced by dispatchCommand().

{
$form = $this->buildAdjustQuestionForm( (int)$_GET['q_id'], (int)$_GET['qpl_id'] );
$this->outputAdjustQuestionForm( $form );
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilScoringAdjustmentGUI::executeCommand ( )

execute command

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

References $cmd, and dispatchCommand().

{
$setting = new ilSetting('assessment');
if( ! (bool)$setting->get('assessment_adjustments_enabled', false) )
{
$this->ctrl->redirectByClass('ilObjTestGUI');
}
$cmd = $this->ctrl->getCmd();
$next_class = $this->ctrl->getNextClass($this);
switch($next_class)
{
default:
return $this->dispatchCommand($cmd);
}
}

+ Here is the call graph for this function:

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

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

Referenced by editQuestion().

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

+ Here is the caller graph for this function:

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

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

{
if ( $question instanceof ilGuiQuestionScoringAdjustable )
{
$question->populateQuestionSpecificFormPart( $form );
$this->suppressPostParticipationFormElements( $form,
$question->getAfterParticipationSuppressionQuestionPostVars()
);
}
if ( $question instanceof ilGuiAnswerScoringAdjustable )
{
$question->populateAnswerSpecificFormPart( $form );
$this->suppressPostParticipationFormElements( $form,
$question->getAfterParticipationSuppressionAnswerPostVars()
);
}
}
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.

{
return ($question_object instanceof ilGuiQuestionScoringAdjustable
|| $question_object instanceof ilGuiAnswerScoringAdjustable)
&& ($question_object->object instanceof ilObjQuestionScoringAdjustable
|| $question_object->object instanceof ilObjAnswerScoringAdjustable);
}

Field Documentation

ilScoringAdjustmentGUI::$ctrl
protected

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

ilScoringAdjustmentGUI::$ilias
protected

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

Referenced by __construct().

ilScoringAdjustmentGUI::$lng
protected

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

Referenced by __construct().

ilScoringAdjustmentGUI::$object

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

ilScoringAdjustmentGUI::$ref_id
protected

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

ilScoringAdjustmentGUI::$service
protected

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

ilScoringAdjustmentGUI::$tpl
protected

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

Referenced by __construct().

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: