ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjTestSettingsScoringResultsGUI Class Reference
+ Inheritance diagram for ilObjTestSettingsScoringResultsGUI:
+ Collaboration diagram for ilObjTestSettingsScoringResultsGUI:

Public Member Functions

 __construct (ilCtrl $ctrl, ilAccessHandler $access, ilLanguage $lng, ilTemplate $tpl, ilTree $tree, ilDB $db, ilPluginAdmin $pluginAdmin, ilObjTestGUI $testGUI)
 Constructor.
 executeCommand ()
 Command Execution.
- Public Member Functions inherited from ilTestSettingsGUI
 __construct (ilObjTest $testOBJ)

Data Fields

const CMD_SHOW_FORM = 'showForm'
 command constants
const CMD_SAVE_FORM = 'saveForm'
const CMD_CONFIRMED_SAVE_FORM = 'confirmedSaveForm'

Protected Attributes

 $ctrl = null
 $access = null
 $lng = null
 $tpl = null
 $tree = null
 $db = null
 $pluginAdmin = null
 $testOBJ = null
 $testGUI = null
 $settingsTemplate = null
- Protected Attributes inherited from ilTestSettingsGUI
 $testOBJ = null
 $settingsTemplate = null

Private Member Functions

 showFormCmd (ilPropertyFormGUI $form=null)
 confirmedSaveFormCmd ()
 saveFormCmd ($isConfirmedSave=false)
 performSaveForm (ilPropertyFormGUI $form)
 showConfirmation (ilPropertyFormGUI $form)
 buildForm ()
 addScoringSettingsFormSection (ilPropertyFormGUI $form)
 saveScoringSettingsFormSection (ilPropertyFormGUI $form)
 addResultSummarySettingsFormSection (ilPropertyFormGUI $form)
 saveResultSummarySettings (ilPropertyFormGUI $form)
 addResultDetailsSettingsFormSection (ilPropertyFormGUI $form)
 saveResultDetailsSettings (ilPropertyFormGUI $form)
 addMiscSettingsFormSection (ilPropertyFormGUI $form)
 saveResultMiscOptionsSettings (ilPropertyFormGUI $form)
 areScoringSettingsWritable ()
 isScoreRecalculationRequired (ilPropertyFormGUI $form)
 hasScoringSettingsChanged (ilPropertyFormGUI $form)
 getAvailableTaxonomyIds ()

Private Attributes

 $testQuestionSetConfigFactory = null
 $availableTaxonomyIds = null

Additional Inherited Members

- Protected Member Functions inherited from ilTestSettingsGUI
 getTemplateSettingValue ($settingName)
 isHiddenFormItem ($formFieldId)
 isSectionHeaderRequired ($fields)
 formPropertyExists (ilPropertyFormGUI $form, $propertyId)
 removeHiddenItems (ilPropertyFormGUI $form)

Detailed Description

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

Constructor & Destructor Documentation

ilObjTestSettingsScoringResultsGUI::__construct ( ilCtrl  $ctrl,
ilAccessHandler  $access,
ilLanguage  $lng,
ilTemplate  $tpl,
ilTree  $tree,
ilDB  $db,
ilPluginAdmin  $pluginAdmin,
ilObjTestGUI  $testGUI 
)

Constructor.

Parameters
ilCtrl$ctrl
ilAccessHandler$access
ilLanguage$lng
ilTemplate$tpl
ilDB$db
ilObjTestGUI$testGUI
Returns

Definition at line 75 of file class.ilObjTestSettingsScoringResultsGUI.php.

References $access, $ctrl, $db, $lng, $pluginAdmin, $testGUI, $tpl, $tree, and ilObjAssessmentFolderGUI\getSettingsTemplateConfig().

{
$this->ctrl = $ctrl;
$this->access = $access;
$this->lng = $lng;
$this->tpl = $tpl;
$this->tree = $tree;
$this->db = $db;
$this->pluginAdmin = $pluginAdmin;
$this->testGUI = $testGUI;
$this->testOBJ = $testGUI->object;
require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
$this->testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($this->tree, $this->db, $this->pluginAdmin, $this->testOBJ);
$templateId = $this->testOBJ->getTemplate();
if( $templateId )
{
include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
$this->settingsTemplate = new ilSettingsTemplate($templateId, ilObjAssessmentFolderGUI::getSettingsTemplateConfig());
}
}

+ Here is the call graph for this function:

Member Function Documentation

ilObjTestSettingsScoringResultsGUI::addMiscSettingsFormSection ( ilPropertyFormGUI  $form)
private

Definition at line 737 of file class.ilObjTestSettingsScoringResultsGUI.php.

References $availableTaxonomyIds, ilPropertyFormGUI\addItem(), ilCheckboxGroupInputGUI\addOption(), getAvailableTaxonomyIds(), ilTestSettingsGUI\isSectionHeaderRequired(), ilFormPropertyGUI\setDisabled(), ilFormPropertyGUI\setInfo(), and ilRadioOption\setValue().

Referenced by buildForm().

{
$fields = array('anonymity', 'enable_archiving');
if( $this->isSectionHeaderRequired($fields) || $this->testQuestionSetConfigFactory->getQuestionSetConfig()->isResultTaxonomyFilterSupported() )
{
// misc settings
$header_misc = new ilFormSectionHeaderGUI();
$header_misc->setTitle($this->lng->txt('misc'));
$form->addItem($header_misc);
}
// result filter taxonomies
if( $this->testQuestionSetConfigFactory->getQuestionSetConfig()->isResultTaxonomyFilterSupported() )
{
if( count($availableTaxonomyIds) )
{
require_once 'Modules/Test/classes/class.ilTestTaxonomyFilterLabelTranslater.php';
$labelTranslater = new ilTestTaxonomyFilterLabelTranslater($this->db);
$labelTranslater->loadLabelsFromTaxonomyIds($availableTaxonomyIds);
$results_presentation = new ilCheckboxGroupInputGUI($this->lng->txt('tst_results_tax_filters'), 'results_tax_filters');
foreach($availableTaxonomyIds as $taxonomyId)
{
$results_presentation->addOption(new ilCheckboxOption(
$labelTranslater->getTaxonomyTreeLabel($taxonomyId), $taxonomyId, ''
));
}
$results_presentation->setValue($this->testOBJ->getResultFilterTaxIds());
$form->addItem($results_presentation);
}
}
// anonymity
$anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
if ($this->testOBJ->participantDataExist()) $anonymity->setDisabled(true);
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
$anonymity->addOption($rb);
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
$anonymity->addOption($rb);
$anonymity->setValue((int)$this->testOBJ->getAnonymity());
$form->addItem($anonymity);
// enable_archiving
$enable_archiving = new ilCheckboxInputGUI($this->lng->txt('test_enable_archiving'), 'enable_archiving');
$enable_archiving->setInfo($this->lng->txt('test_enable_archiving_desc'));
$enable_archiving->setValue(1);
$enable_archiving->setChecked($this->testOBJ->getEnableArchiving());
$form->addItem($enable_archiving);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTestSettingsScoringResultsGUI::addResultDetailsSettingsFormSection ( ilPropertyFormGUI  $form)
private

Definition at line 529 of file class.ilObjTestSettingsScoringResultsGUI.php.

References ilPropertyFormGUI\addItem(), ilObjTest\HIGHSCORE_SHOW_ALL_TABLES, ilObjTest\HIGHSCORE_SHOW_OWN_TABLE, ilObjTest\HIGHSCORE_SHOW_TOP_TABLE, ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), ilNumberInputGUI\setSize(), and ilCheckboxInputGUI\setValue().

Referenced by buildForm().

{
// HEADER: result settings
$header_tr = new ilFormSectionHeaderGUI();
$header_tr->setTitle($this->lng->txt('tst_results_details_options'));
$form->addItem($header_tr);
// show solution details
$showSolutionDetails = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_details'), 'solution_details');
$showSolutionDetails->setInfo($this->lng->txt('tst_show_solution_details_desc'));
$showSolutionDetails->setChecked($this->testOBJ->getShowSolutionDetails());
$form->addItem($showSolutionDetails);
// best solution in test results
$results_print_best_solution = new ilCheckboxInputGUI($this->lng->txt('tst_results_print_best_solution'), 'print_bs_with_res');
$results_print_best_solution->setInfo($this->lng->txt('tst_results_print_best_solution_info'));
$results_print_best_solution->setChecked((bool) $this->testOBJ->isBestSolutionPrintedWithResult());
$showSolutionDetails->addSubItem($results_print_best_solution);
// show solution feedback ==> solution feedback in test results
$showSolutionFeedbackOption = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_feedback'), 'solution_feedback');
$showSolutionFeedbackOption->setInfo($this->lng->txt('tst_show_solution_feedback_desc'));
$showSolutionFeedbackOption->setChecked($this->testOBJ->getShowSolutionFeedback());
$form->addItem($showSolutionFeedbackOption);
// show suggested solution
$showSuggestedSolutionOption = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_suggested'), 'solution_suggested');
$showSuggestedSolutionOption->setInfo($this->lng->txt('tst_show_solution_suggested_desc'));
$showSuggestedSolutionOption->setChecked($this->testOBJ->getShowSolutionSuggested());
$form->addItem($showSuggestedSolutionOption);
// show solution printview ==> list of answers
$showSolutionPrintview = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_printview'), 'solution_printview');
$showSolutionPrintview->setInfo($this->lng->txt('tst_show_solution_printview_desc'));
$showSolutionPrintview->setChecked($this->testOBJ->getShowSolutionPrintview());
$form->addItem($showSolutionPrintview);
// show best solution in list of answers
$solutionCompareInput = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_compare'), 'solution_compare');
$solutionCompareInput->setInfo($this->lng->txt('tst_show_solution_compare_desc'));
$solutionCompareInput->setChecked($this->testOBJ->getShowSolutionListComparison());
$showSolutionPrintview->addSubItem($solutionCompareInput);
// solution answers only ==> printview of results (answers only)
$solutionAnswersOnly = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_answers_only'), 'solution_answers_only');
$solutionAnswersOnly->setInfo($this->lng->txt('tst_show_solution_answers_only_desc'));
$solutionAnswersOnly->setChecked($this->testOBJ->getShowSolutionAnswersOnly());
$showSolutionPrintview->addSubItem($solutionAnswersOnly);
// high score
$highscore = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_enabled"), "highscore_enabled");
$highscore->setValue(1);
$highscore->setChecked($this->testOBJ->getHighscoreEnabled());
$highscore->setInfo($this->lng->txt("tst_highscore_description"));
$form->addItem($highscore);
$highscore_tables = new ilRadioGroupInputGUI($this->lng->txt('tst_highscore_mode'), 'highscore_mode');
$highscore_tables->setRequired(true);
$highscore_tables->setValue($this->testOBJ->getHighscoreMode());
$highscore_table_own = new ilRadioOption($this->lng->txt('tst_highscore_own_table'), ilObjTest::HIGHSCORE_SHOW_OWN_TABLE);
$highscore_table_own->setInfo($this->lng->txt('tst_highscore_own_table_description'));
$highscore_tables->addOption($highscore_table_own);
$highscore_table_other = new ilRadioOption($this->lng->txt('tst_highscore_top_table'), ilObjTest::HIGHSCORE_SHOW_TOP_TABLE);
$highscore_table_other->setInfo($this->lng->txt('tst_highscore_top_table_description'));
$highscore_tables->addOption($highscore_table_other);
$highscore_table_other = new ilRadioOption($this->lng->txt('tst_highscore_all_tables'), ilObjTest::HIGHSCORE_SHOW_ALL_TABLES);
$highscore_table_other->setInfo($this->lng->txt('tst_highscore_all_tables_description'));
$highscore_tables->addOption($highscore_table_other);
$highscore->addSubItem($highscore_tables);
$highscore_top_num = new ilNumberInputGUI($this->lng->txt("tst_highscore_top_num"), "highscore_top_num");
$highscore_top_num->setSize(4);
$highscore_top_num->setRequired(true);
$highscore_top_num->setMinValue(1);
$highscore_top_num->setSuffix($this->lng->txt("tst_highscore_top_num_unit"));
$highscore_top_num->setValue($this->testOBJ->getHighscoreTopNum(null));
$highscore_top_num->setInfo($this->lng->txt("tst_highscore_top_num_description"));
$highscore->addSubItem($highscore_top_num);
$highscore_anon = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_anon"), "highscore_anon");
$highscore_anon->setValue(1);
$highscore_anon->setChecked($this->testOBJ->getHighscoreAnon());
$highscore_anon->setInfo($this->lng->txt("tst_highscore_anon_description"));
$highscore->addSubItem($highscore_anon);
$highscore_achieved_ts = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_achieved_ts"), "highscore_achieved_ts");
$highscore_achieved_ts->setValue(1);
$highscore_achieved_ts->setChecked($this->testOBJ->getHighscoreAchievedTS());
$highscore_achieved_ts->setInfo($this->lng->txt("tst_highscore_achieved_ts_description"));
$highscore->addSubItem($highscore_achieved_ts);
$highscore_score = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_score"), "highscore_score");
$highscore_score->setValue(1);
$highscore_score->setChecked($this->testOBJ->getHighscoreScore());
$highscore_score->setInfo($this->lng->txt("tst_highscore_score_description"));
$highscore->addSubItem($highscore_score);
$highscore_percentage = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_percentage"), "highscore_percentage");
$highscore_percentage->setValue(1);
$highscore_percentage->setChecked($this->testOBJ->getHighscorePercentage());
$highscore_percentage->setInfo($this->lng->txt("tst_highscore_percentage_description"));
$highscore->addSubItem($highscore_percentage);
$highscore_hints = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_hints"), "highscore_hints");
$highscore_hints->setValue(1);
$highscore_hints->setChecked($this->testOBJ->getHighscoreHints());
$highscore_hints->setInfo($this->lng->txt("tst_highscore_hints_description"));
$highscore->addSubItem($highscore_hints);
$highscore_wtime = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_wtime"), "highscore_wtime");
$highscore_wtime->setValue(1);
$highscore_wtime->setChecked($this->testOBJ->getHighscoreWTime());
$highscore_wtime->setInfo($this->lng->txt("tst_highscore_wtime_description"));
$highscore->addSubItem($highscore_wtime);
// show signature placeholder
$showSignaturePlaceholder = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_signature'), 'solution_signature');
$showSignaturePlaceholder->setInfo($this->lng->txt('tst_show_solution_signature_desc'));
$showSignaturePlaceholder->setChecked($this->testOBJ->getShowSolutionSignature());
if( $this->testOBJ->getAnonymity() ) { $showSignaturePlaceholder->setDisabled(true); }
$form->addItem($showSignaturePlaceholder);
// show signature placeholder
$showExamId = new ilCheckboxInputGUI($this->lng->txt('examid_in_test_res'), 'examid_in_test_res');
$showExamId->setInfo($this->lng->txt('examid_in_test_res_desc'));
$showExamId->setChecked($this->testOBJ->isShowExamIdInTestResultsEnabled());
$form->addItem($showExamId);
// export settings
$export_settings = new ilCheckboxInputGUI($this->lng->txt('tst_exp_sc_short'), 'exp_sc_short');
$export_settings->setInfo($this->lng->txt('tst_exp_sc_short_desc'));
$export_settings->setChecked($this->testOBJ->getExportSettingsSingleChoiceShort());
$form->addItem($export_settings);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTestSettingsScoringResultsGUI::addResultSummarySettingsFormSection ( ilPropertyFormGUI  $form)
private

Definition at line 422 of file class.ilObjTestSettingsScoringResultsGUI.php.

References ilPropertyFormGUI\addItem(), IL_CAL_TIMESTAMP, IL_CAL_UNIX, ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), and ilDateTimeInputGUI\setShowTime().

Referenced by buildForm().

{
// HEADER: result settings
$header_tr = new ilFormSectionHeaderGUI();
$header_tr->setTitle($this->lng->txt('test_results'));
$form->addItem($header_tr);
// access to test results
$resultsAccessEnabled = new ilCheckboxInputGUI($this->lng->txt('tst_results_access_enabled'), 'results_access_enabled');
$resultsAccessEnabled->setInfo($this->lng->txt('tst_results_access_enabled_desc'));
$resultsAccessEnabled->setChecked($this->testOBJ->isScoreReportingEnabled());
$resultsAccessSetting = new ilRadioGroupInputGUI($this->lng->txt('tst_results_access_setting'), 'results_access_setting');
$resultsAccessSetting->setRequired(true);
$optAlways = new ilRadioOption($this->lng->txt('tst_results_access_always'), 2, '');
$optAlways->setInfo($this->lng->txt('tst_results_access_always_desc'));
$resultsAccessSetting->addOption($optAlways);
$optFinished = $opt = new ilRadioOption($this->lng->txt('tst_results_access_finished'), 1, '');
$optFinished->setInfo($this->lng->txt('tst_results_access_finished_desc'));
$resultsAccessSetting->addOption($optFinished);
$optionDate = new ilRadioOption($this->lng->txt('tst_results_access_date'), 3, '');
$optionDate->setInfo($this->lng->txt('tst_results_access_date_desc'));
// access date
$reportingDate = new ilDateTimeInputGUI($this->lng->txt('tst_reporting_date'), 'reporting_date');
$reportingDate->setShowTime(true);
if (strlen($this->testOBJ->getReportingDate()))
{
$reportingDate->setDate(new ilDateTime($this->testOBJ->getReportingDate(), IL_CAL_TIMESTAMP));
}
else
{
$reportingDate->setDate(new ilDateTime(time(), IL_CAL_UNIX));
}
$optionDate->addSubItem($reportingDate);
$resultsAccessSetting->addOption($optionDate);
$resultsAccessValue = $this->testOBJ->getScoreReporting();
$resultsAccessSetting->setValue(
$resultsAccessValue > 0 && $resultsAccessValue < 4 ? $resultsAccessValue : 2
);
$resultsAccessEnabled->addSubItem($resultsAccessSetting);
// show pass details
$showPassDetails = new ilCheckboxInputGUI($this->lng->txt('tst_show_pass_details'), 'pass_details');
$showPassDetails->setInfo($this->lng->txt('tst_show_pass_details_desc'));
$showPassDetails->setChecked($this->testOBJ->getShowPassDetails());
$resultsAccessEnabled->addSubItem($showPassDetails);
$form->addItem($resultsAccessEnabled);
// grading
$chb_only_passed_failed = new ilCheckboxInputGUI($this->lng->txt('tst_results_grading_opt_show_status'), 'grading_status');
$chb_only_passed_failed->setInfo($this->lng->txt('tst_results_grading_opt_show_status_desc'));
$chb_only_passed_failed->setValue(1);
$chb_only_passed_failed->setChecked($this->testOBJ->isShowGradingStatusEnabled());
$form->addItem($chb_only_passed_failed);
$chb_resulting_mark_only = new ilCheckboxInputGUI($this->lng->txt('tst_results_grading_opt_show_mark'), 'grading_mark');
$chb_resulting_mark_only->setInfo($this->lng->txt('tst_results_grading_opt_show_mark_desc'));
$chb_resulting_mark_only->setValue(1);
$chb_resulting_mark_only->setChecked($this->testOBJ->isShowGradingMarkEnabled());
$form->addItem($chb_resulting_mark_only);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTestSettingsScoringResultsGUI::addScoringSettingsFormSection ( ilPropertyFormGUI  $form)
private

Definition at line 321 of file class.ilObjTestSettingsScoringResultsGUI.php.

References ilPropertyFormGUI\addItem(), ilRadioGroupInputGUI\addOption(), areScoringSettingsWritable(), and ilTestSettingsGUI\isSectionHeaderRequired().

Referenced by buildForm().

{
$fields = array(
'count_system', 'mc_scoring', 'score_cutting', 'pass_scoring', 'pass_deletion_allowed'
);
if( $this->isSectionHeaderRequired($fields) )
{
// scoring settings
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt('test_scoring'));
$form->addItem($header);
}
// scoring system
$count_system = new ilRadioGroupInputGUI($this->lng->txt('tst_text_count_system'), 'count_system');
$count_system->addOption($opt = new ilRadioOption($this->lng->txt('tst_count_partial_solutions'), 0, ''));
$opt->setInfo($this->lng->txt('tst_count_partial_solutions_desc'));
$count_system->addOption($opt = new ilRadioOption($this->lng->txt('tst_count_correct_solutions'), 1, ''));
$opt->setInfo($this->lng->txt('tst_count_correct_solutions_desc'));
$count_system->setValue($this->testOBJ->getCountSystem());
$form->addItem($count_system);
// mc questions
$mc_scoring = new ilRadioGroupInputGUI($this->lng->txt('tst_score_mcmr_questions'), 'mc_scoring');
$mc_scoring->addOption($opt = new ilRadioOption($this->lng->txt('tst_score_mcmr_zero_points_when_unanswered'), 0, ''));
$opt->setInfo($this->lng->txt('tst_score_mcmr_zero_points_when_unanswered_desc'));
$mc_scoring->addOption($opt = new ilRadioOption($this->lng->txt('tst_score_mcmr_use_scoring_system'), 1, ''));
$opt->setInfo($this->lng->txt('tst_score_mcmr_use_scoring_system_desc'));
$mc_scoring->setValue($this->testOBJ->getMCScoring());
$form->addItem($mc_scoring);
// score cutting
$score_cutting = new ilRadioGroupInputGUI($this->lng->txt('tst_score_cutting'), 'score_cutting');
$score_cutting->addOption($opt = new ilRadioOption($this->lng->txt('tst_score_cut_question'), 0, ''));
$opt->setInfo($this->lng->txt('tst_score_cut_question_desc'));
$score_cutting->addOption($opt = new ilRadioOption($this->lng->txt('tst_score_cut_test'), 1, ''));
$opt->setInfo($this->lng->txt('tst_score_cut_test_desc'));
$score_cutting->setValue($this->testOBJ->getScoreCutting());
$form->addItem($score_cutting);
// pass scoring
$pass_scoring = new ilRadioGroupInputGUI($this->lng->txt('tst_pass_scoring'), 'pass_scoring');
$pass_scoring->addOption($opt = new ilRadioOption($this->lng->txt('tst_pass_last_pass'), 0, ''));
$opt->setInfo($this->lng->txt('tst_pass_last_pass_desc'));
$pass_scoring->addOption($opt = new ilRadioOption($this->lng->txt('tst_pass_best_pass'), 1, ''));
$opt->setInfo($this->lng->txt('tst_pass_best_pass_desc'));
$pass_scoring->setValue($this->testOBJ->getPassScoring());
$form->addItem($pass_scoring);
// deletion of test results
$passDeletion = new ilRadioGroupInputGUI($this->lng->txt('tst_pass_deletion'), 'pass_deletion_allowed');
$passDeletion->addOption(new ilRadioOption($this->lng->txt('tst_pass_deletion_not_allowed'), 0, ''));
$passDeletion->addOption(new ilRadioOption($this->lng->txt('tst_pass_deletion_allowed'), 1, ''));
$passDeletion->setValue($this->testOBJ->isPassDeletionAllowed());
$form->addItem($passDeletion);
// disable scoring settings
{
$count_system->setDisabled(true);
$mc_scoring->setDisabled(true);
$score_cutting->setDisabled(true);
$pass_scoring->setDisabled(true);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTestSettingsScoringResultsGUI::areScoringSettingsWritable ( )
private

Definition at line 831 of file class.ilObjTestSettingsScoringResultsGUI.php.

Referenced by addScoringSettingsFormSection(), isScoreRecalculationRequired(), and saveScoringSettingsFormSection().

{
if ( !$this->testOBJ->participantDataExist() )
{
return true;
}
if( !$this->testOBJ->isScoreReportingAvailable() )
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

ilObjTestSettingsScoringResultsGUI::buildForm ( )
private

Definition at line 291 of file class.ilObjTestSettingsScoringResultsGUI.php.

References addMiscSettingsFormSection(), addResultDetailsSettingsFormSection(), addResultSummarySettingsFormSection(), and addScoringSettingsFormSection().

Referenced by saveFormCmd(), and showFormCmd().

{
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTableWidth('100%');
$form->setId('test_scoring_results');
// remove items when using template
if($this->settingsTemplate)
{
foreach($this->settingsTemplate->getSettings() as $id => $item)
{
if($item["hide"])
{
$form->removeItemByPostVar($id);
}
}
}
$form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt('save'));
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTestSettingsScoringResultsGUI::confirmedSaveFormCmd ( )
private

Definition at line 146 of file class.ilObjTestSettingsScoringResultsGUI.php.

References saveFormCmd().

{
return $this->saveFormCmd(true);
}

+ Here is the call graph for this function:

ilObjTestSettingsScoringResultsGUI::executeCommand ( )

Command Execution.

Definition at line 112 of file class.ilObjTestSettingsScoringResultsGUI.php.

References $cmd, and ilUtil\sendInfo().

{
// allow only write access
if (!$this->access->checkAccess('write', '', $this->testGUI->ref_id))
{
ilUtil::sendInfo($this->lng->txt('cannot_edit_test'), true);
$this->ctrl->redirect($this->testGUI, 'infoScreen');
}
// process command
$nextClass = $this->ctrl->getNextClass();
switch($nextClass)
{
default:
$cmd = $this->ctrl->getCmd(self::CMD_SHOW_FORM).'Cmd';
$this->$cmd();
}
}

+ Here is the call graph for this function:

ilObjTestSettingsScoringResultsGUI::getAvailableTaxonomyIds ( )
private

Definition at line 897 of file class.ilObjTestSettingsScoringResultsGUI.php.

References $availableTaxonomyIds, and ilObjTaxonomy\getUsageOfObject().

Referenced by addMiscSettingsFormSection(), and saveResultMiscOptionsSettings().

{
if( $this->getAvailableTaxonomyIds === null )
{
require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
$this->availableTaxonomyIds = (array)ilObjTaxonomy::getUsageOfObject($this->testOBJ->getId());
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTestSettingsScoringResultsGUI::hasScoringSettingsChanged ( ilPropertyFormGUI  $form)
private

Definition at line 866 of file class.ilObjTestSettingsScoringResultsGUI.php.

References ilPropertyFormGUI\getItemByPostVar().

Referenced by isScoreRecalculationRequired().

{
$countSystem = $form->getItemByPostVar('count_system');
if( is_object($countSystem) && $countSystem->getValue() != $this->testOBJ->getCountSystem() )
{
return true;
}
$mcScoring = $form->getItemByPostVar('mc_scoring');
if( is_object($mcScoring) && $mcScoring->getValue() != $this->testOBJ->getMCScoring() )
{
return true;
}
$scoreCutting = $form->getItemByPostVar('score_cutting');
if( is_object($scoreCutting) && $scoreCutting->getValue() != $this->testOBJ->getScoreCutting() )
{
return true;
}
$passScoring = $form->getItemByPostVar('pass_scoring');
if( is_object($passScoring) && $passScoring->getValue() != $this->testOBJ->getPassScoring() )
{
return true;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTestSettingsScoringResultsGUI::isScoreRecalculationRequired ( ilPropertyFormGUI  $form)
private

Definition at line 846 of file class.ilObjTestSettingsScoringResultsGUI.php.

References areScoringSettingsWritable(), and hasScoringSettingsChanged().

Referenced by saveFormCmd().

{
if ( !$this->testOBJ->participantDataExist() )
{
return false;
}
{
return false;
}
if( !$this->hasScoringSettingsChanged($form) )
{
return false;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTestSettingsScoringResultsGUI::performSaveForm ( ilPropertyFormGUI  $form)
private

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

References saveResultDetailsSettings(), saveResultMiscOptionsSettings(), saveResultSummarySettings(), and saveScoringSettingsFormSection().

Referenced by saveFormCmd().

{
// store settings to db
$this->testOBJ->saveToDb(true);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTestSettingsScoringResultsGUI::saveFormCmd (   $isConfirmedSave = false)
private

Definition at line 151 of file class.ilObjTestSettingsScoringResultsGUI.php.

References $errors, buildForm(), isScoreRecalculationRequired(), performSaveForm(), ilUtil\sendFailure(), ilUtil\sendSuccess(), showConfirmation(), and showFormCmd().

Referenced by confirmedSaveFormCmd().

{
$form = $this->buildForm();
// form validation and initialisation
$errors = !$form->checkInput(); // ALWAYS CALL BEFORE setValuesByPost()
$form->setValuesByPost(); // NEVER CALL THIS BEFORE checkInput()
// return to form when any form validation errors exist
if($errors)
{
ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
return $this->showFormCmd($form);
}
// check for required confirmation and redirect if neccessary
if( !$isConfirmedSave && $this->isScoreRecalculationRequired($form) )
{
return $this->showConfirmation($form);
}
// perform save
$this->performSaveForm($form);
if( $this->isScoreRecalculationRequired($form) )
{
$this->testOBJ->recalculateScores(true);
}
// redirect to form output
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
$this->ctrl->redirect($this, self::CMD_SHOW_FORM);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTestSettingsScoringResultsGUI::saveResultDetailsSettings ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 659 of file class.ilObjTestSettingsScoringResultsGUI.php.

References ilTestSettingsGUI\formPropertyExists(), and ilPropertyFormGUI\getItemByPostVar().

Referenced by performSaveForm().

{
if( $this->formPropertyExists($form, 'solution_details') )
{
if( $form->getItemByPostVar('solution_details')->getChecked() )
{
$this->testOBJ->setShowSolutionDetails(1);
$this->testOBJ->setPrintBestSolutionWithResult(
(int)$form->getItemByPostVar('print_bs_with_res')->getChecked()
);
}
else
{
$this->testOBJ->setShowSolutionDetails(0);
$this->testOBJ->setPrintBestSolutionWithResult(0);
}
}
if( $this->formPropertyExists($form, 'solution_feedback') )
{
$this->testOBJ->setShowSolutionFeedback($form->getItemByPostVar('solution_feedback')->getChecked());
}
if( $this->formPropertyExists($form, 'solution_suggested') )
{
$this->testOBJ->setShowSolutionSuggested($form->getItemByPostVar('solution_suggested')->getChecked());
}
if( $this->formPropertyExists($form, 'solution_printview') )
{
if( $form->getItemByPostVar('solution_printview')->getChecked() )
{
$this->testOBJ->setShowSolutionPrintview(1);
$this->testOBJ->setShowSolutionListComparison(
(bool)$form->getItemByPostVar('solution_compare')->getChecked()
);
$this->testOBJ->setShowSolutionAnswersOnly(
(int)$form->getItemByPostVar('solution_answers_only')->getChecked()
);
}
else
{
$this->testOBJ->setShowSolutionPrintview(0);
$this->testOBJ->setShowSolutionListComparison(false);
$this->testOBJ->setShowSolutionAnswersOnly(0);
}
}
if( $this->formPropertyExists($form, 'highscore_enabled') )
{
// highscore settings
$this->testOBJ->setHighscoreEnabled((bool) $form->getItemByPostVar('highscore_enabled')->getChecked());
$this->testOBJ->setHighscoreAnon((bool) $form->getItemByPostVar('highscore_anon')->getChecked());
$this->testOBJ->setHighscoreAchievedTS((bool) $form->getItemByPostVar('highscore_achieved_ts')->getChecked());
$this->testOBJ->setHighscoreScore((bool) $form->getItemByPostVar('highscore_score')->getChecked());
$this->testOBJ->setHighscorePercentage((bool) $form->getItemByPostVar('highscore_percentage')->getChecked());
$this->testOBJ->setHighscoreHints((bool) $form->getItemByPostVar('highscore_hints')->getChecked());
$this->testOBJ->setHighscoreWTime((bool) $form->getItemByPostVar('highscore_wtime')->getChecked());
$this->testOBJ->setHighscoreMode((int) $form->getItemByPostVar('highscore_mode')->getValue());
$this->testOBJ->setHighscoreTopNum((int) $form->getItemByPostVar('highscore_top_num')->getValue());
}
if( $this->formPropertyExists($form, 'solution_signature') )
{
$this->testOBJ->setShowSolutionSignature($form->getItemByPostVar('solution_signature')->getChecked());
}
if( $this->formPropertyExists($form, 'examid_in_test_res') )
{
$this->testOBJ->setShowExamIdInTestResultsEnabled($form->getItemByPostVar('examid_in_test_res')->getChecked());
}
if( $this->formPropertyExists($form, 'exp_sc_short') )
{
$this->testOBJ->setExportSettingsSingleChoiceShort( (int)$form->getItemByPostVar('exp_sc_short')->getChecked() );
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTestSettingsScoringResultsGUI::saveResultMiscOptionsSettings ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 796 of file class.ilObjTestSettingsScoringResultsGUI.php.

References ilTestSettingsGUI\formPropertyExists(), getAvailableTaxonomyIds(), ilPropertyFormGUI\getItemByPostVar(), ilTestSettingsGUI\isHiddenFormItem(), and ilUtil\sendInfo().

Referenced by performSaveForm().

{
// result filter taxonomies
if( $this->testQuestionSetConfigFactory->getQuestionSetConfig()->isResultTaxonomyFilterSupported() )
{
if( !$this->isHiddenFormItem('results_tax_filters') && count($this->getAvailableTaxonomyIds()) )
{
$this->testOBJ->setResultFilterTaxIds( array_intersect(
$this->getAvailableTaxonomyIds(), $form->getItemByPostVar('results_tax_filters')->getValue()
));
}
}
if( $this->formPropertyExists($form, 'anonymity') )
{
// anonymity setting
$this->testOBJ->setAnonymity($form->getItemByPostVar('anonymity')->getValue());
}
if( $this->formPropertyExists($form, 'enable_archiving') )
{
// Archiving
if($this->testOBJ->getAnonymity() == true &&
$form->getItemByPostVar('enable_archiving')->getChecked() == true)
{
$this->testOBJ->setEnableArchiving(false);
ilUtil::sendInfo($this->lng->txt('no_archive_on_anonymous'), true);
}
else
{
$this->testOBJ->setEnableArchiving($form->getItemByPostVar('enable_archiving')->getChecked());
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTestSettingsScoringResultsGUI::saveResultSummarySettings ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 485 of file class.ilObjTestSettingsScoringResultsGUI.php.

References ilTestSettingsGUI\formPropertyExists(), ilPropertyFormGUI\getItemByPostVar(), IL_CAL_FKT_DATE, and REPORT_AFTER_DATE.

Referenced by performSaveForm().

{
if( $this->formPropertyExists($form, 'results_access_enabled') )
{
if( $form->getItemByPostVar('results_access_enabled')->getChecked() )
{
$this->testOBJ->setScoreReporting($form->getItemByPostVar('results_access_setting')->getValue());
if( $this->testOBJ->getScoreReporting() == REPORT_AFTER_DATE )
{
$this->testOBJ->setReportingDate(
$form->getItemByPostVar('reporting_date')->getDate()->get(IL_CAL_FKT_DATE, 'YmdHis')
);
}
else
{
$this->testOBJ->setReportingDate('');
}
$this->testOBJ->setShowPassDetails($form->getItemByPostVar('pass_details')->getChecked());
}
else
{
$this->testOBJ->setScoreReporting(4); // never
$this->testOBJ->setShowPassDetails(false);
$this->testOBJ->setReportingDate('');
}
}
if( $this->formPropertyExists($form, 'grading_status') )
{
$this->testOBJ->setShowGradingStatusEnabled(
$form->getItemByPostVar('grading_status')->getChecked()
);
}
if( $this->formPropertyExists($form, 'grading_mark') )
{
$this->testOBJ->setShowGradingMarkEnabled(
(int)$form->getItemByPostVar('grading_mark')->getChecked()
);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTestSettingsScoringResultsGUI::saveScoringSettingsFormSection ( ilPropertyFormGUI  $form)
private
Parameters
ilPropertyFormGUI$form

Definition at line 391 of file class.ilObjTestSettingsScoringResultsGUI.php.

References areScoringSettingsWritable(), ilTestSettingsGUI\formPropertyExists(), and ilPropertyFormGUI\getItemByPostVar().

Referenced by performSaveForm().

{
{
if( $this->formPropertyExists($form, 'count_system') )
{
$this->testOBJ->setCountSystem($form->getItemByPostVar('count_system')->getValue());
}
if( $this->formPropertyExists($form, 'mc_scoring') )
{
$this->testOBJ->setMCScoring($form->getItemByPostVar('mc_scoring')->getValue());
}
if( $this->formPropertyExists($form, 'score_cutting') )
{
$this->testOBJ->setScoreCutting($form->getItemByPostVar('score_cutting')->getValue());
}
if( $this->formPropertyExists($form, 'pass_scoring') )
{
$this->testOBJ->setPassScoring($form->getItemByPostVar('pass_scoring')->getValue());
}
}
if( $this->formPropertyExists($form, 'pass_deletion_allowed') )
{
$this->testOBJ->setPassDeletionAllowed( (bool)$form->getItemByPostVar('pass_deletion_allowed')->getValue() );
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTestSettingsScoringResultsGUI::showConfirmation ( ilPropertyFormGUI  $form)
private

Definition at line 201 of file class.ilObjTestSettingsScoringResultsGUI.php.

References $d, CMD_CONFIRMED_SAVE_FORM, CMD_SHOW_FORM, ilPropertyFormGUI\getInputItemsRecursive(), IL_CAL_DATETIME, and ilDateTimeInputGUI\MODE_SELECT.

Referenced by saveFormCmd().

{
require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
$confirmation = new ilConfirmationGUI();
$confirmation->setHeaderText($this->lng->txt('tst_trigger_result_refreshing'));
$confirmation->setFormAction( $this->ctrl->getFormAction($this) );
$confirmation->setCancel($this->lng->txt('cancel'), self::CMD_SHOW_FORM);
$confirmation->setConfirm($this->lng->txt('confirm'), self::CMD_CONFIRMED_SAVE_FORM);
foreach ($form->getInputItemsRecursive() as $key => $item)
{
//vd("$key // {$item->getType()} // ".json_encode($_POST[$item->getPostVar()]));
switch( $item->getType() )
{
case 'section_header':
continue;
case 'datetime':
list($date, $time) = explode(' ', $item->getDate()->get(IL_CAL_DATETIME));
if( $item->getMode() == ilDateTimeInputGUI::MODE_SELECT )
{
list($y, $m, $d) = explode('-', $date);
$confirmation->addHiddenItem("{$item->getPostVar()}[date][y]", $y);
$confirmation->addHiddenItem("{$item->getPostVar()}[date][m]", $m);
$confirmation->addHiddenItem("{$item->getPostVar()}[date][d]", $d);
if( $item->getShowTime() )
{
list($h, $m, $s) = explode(':', $time);
$confirmation->addHiddenItem("{$item->getPostVar()}[time][h]", $h);
$confirmation->addHiddenItem("{$item->getPostVar()}[time][m]", $m);
$confirmation->addHiddenItem("{$item->getPostVar()}[time][s]", $s);
}
}
else
{
$confirmation->addHiddenItem("{$item->getPostVar()}[date]", $date);
$confirmation->addHiddenItem("{$item->getPostVar()}[time]", $time);
}
break;
case 'duration':
$confirmation->addHiddenItem("{$item->getPostVar()}[MM]", (int)$item->getMonths());
$confirmation->addHiddenItem("{$item->getPostVar()}[dd]", (int)$item->getDays());
$confirmation->addHiddenItem("{$item->getPostVar()}[hh]", (int)$item->getHours());
$confirmation->addHiddenItem("{$item->getPostVar()}[mm]", (int)$item->getMinutes());
$confirmation->addHiddenItem("{$item->getPostVar()}[ss]", (int)$item->getSeconds());
break;
case 'checkboxgroup':
if( is_array($item->getValue()) )
{
foreach( $item->getValue() as $option )
{
$confirmation->addHiddenItem("{$item->getPostVar()}[]", $option);
}
}
break;
case 'checkbox':
if( $item->getChecked() )
{
$confirmation->addHiddenItem($item->getPostVar(), 1);
}
break;
default:
$confirmation->addHiddenItem($item->getPostVar(), $item->getValue());
}
}
$this->tpl->setContent( $this->ctrl->getHTML($confirmation) );
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTestSettingsScoringResultsGUI::showFormCmd ( ilPropertyFormGUI  $form = null)
private

Definition at line 134 of file class.ilObjTestSettingsScoringResultsGUI.php.

References buildForm().

Referenced by saveFormCmd().

{
//$this->tpl->addJavascript("./Services/JavaScript/js/Basic.js");
if( $form === null )
{
$form = $this->buildForm();
}
$this->tpl->setContent( $this->ctrl->getHTML($form) );
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilObjTestSettingsScoringResultsGUI::$access = null
protected

Definition at line 30 of file class.ilObjTestSettingsScoringResultsGUI.php.

Referenced by __construct().

ilObjTestSettingsScoringResultsGUI::$availableTaxonomyIds = null
private
ilObjTestSettingsScoringResultsGUI::$ctrl = null
protected

Definition at line 27 of file class.ilObjTestSettingsScoringResultsGUI.php.

Referenced by __construct().

ilObjTestSettingsScoringResultsGUI::$db = null
protected

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

Referenced by __construct().

ilObjTestSettingsScoringResultsGUI::$lng = null
protected

Definition at line 33 of file class.ilObjTestSettingsScoringResultsGUI.php.

Referenced by __construct().

ilObjTestSettingsScoringResultsGUI::$pluginAdmin = null
protected

Definition at line 45 of file class.ilObjTestSettingsScoringResultsGUI.php.

Referenced by __construct().

ilObjTestSettingsScoringResultsGUI::$settingsTemplate = null
protected

Definition at line 61 of file class.ilObjTestSettingsScoringResultsGUI.php.

ilObjTestSettingsScoringResultsGUI::$testGUI = null
protected

Definition at line 51 of file class.ilObjTestSettingsScoringResultsGUI.php.

Referenced by __construct().

ilObjTestSettingsScoringResultsGUI::$testOBJ = null
protected

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

ilObjTestSettingsScoringResultsGUI::$testQuestionSetConfigFactory = null
private

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

ilObjTestSettingsScoringResultsGUI::$tpl = null
protected

Definition at line 36 of file class.ilObjTestSettingsScoringResultsGUI.php.

Referenced by __construct().

ilObjTestSettingsScoringResultsGUI::$tree = null
protected

Definition at line 39 of file class.ilObjTestSettingsScoringResultsGUI.php.

Referenced by __construct().

const ilObjTestSettingsScoringResultsGUI::CMD_CONFIRMED_SAVE_FORM = 'confirmedSaveForm'

Definition at line 24 of file class.ilObjTestSettingsScoringResultsGUI.php.

Referenced by showConfirmation().

const ilObjTestSettingsScoringResultsGUI::CMD_SAVE_FORM = 'saveForm'

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

const ilObjTestSettingsScoringResultsGUI::CMD_SHOW_FORM = 'showForm'

command constants

Definition at line 22 of file class.ilObjTestSettingsScoringResultsGUI.php.

Referenced by showConfirmation().


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