From 1116d07f1c1fc9280243bbff8252bdd93514e056 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 4 Feb 2011 17:41:17 +0100 Subject: [PATCH] Adding some js validations when editing the exercise feedback option --- main/exercice/exercise.class.php | 8 ++++---- main/exercice/exercise_admin.php | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/main/exercice/exercise.class.php b/main/exercice/exercise.class.php index fd45128b80..f40b25d6f9 100755 --- a/main/exercice/exercise.class.php +++ b/main/exercice/exercise.class.php @@ -871,8 +871,8 @@ class Exercise { if($type=='full') { // feedback type $radios_feedback = array(); - $radios_feedback[] = FormValidator :: createElement ('radio', 'exerciseFeedbackType', null, get_lang('ExerciseAtTheEndOfTheTest'),'0'); - $radios_feedback[] = FormValidator :: createElement ('radio', 'exerciseFeedbackType', null, get_lang('NoFeedback'),'2'); + $radios_feedback[] = FormValidator :: createElement ('radio', 'exerciseFeedbackType', null, get_lang('ExerciseAtTheEndOfTheTest'),'0',array('id' =>'exerciseType_1','onclick' => 'check_feedback()')); + $radios_feedback[] = FormValidator :: createElement ('radio', 'exerciseFeedbackType', null, get_lang('NoFeedback'),'2',array('id' =>'exerciseType_2')); $form -> addGroup($radios_feedback, null, get_lang('FeedbackType')); $feedback_option[0]=get_lang('ExerciseAtTheEndOfTheTest'); @@ -906,8 +906,8 @@ class Exercise { } $radios_results_disabled = array(); - $radios_results_disabled[] = FormValidator :: createElement ('radio', 'results_disabled', null, get_lang('Yes'),'0'); - $radios_results_disabled[] = FormValidator :: createElement ('radio', 'results_disabled', null, get_lang('No'),'1'); + $radios_results_disabled[] = FormValidator :: createElement ('radio', 'results_disabled', null, get_lang('Yes'), '0', array('id'=>'result_disabled_0')); + $radios_results_disabled[] = FormValidator :: createElement ('radio', 'results_disabled', null, get_lang('No'), '1',array('id'=>'result_disabled_1','onclick' => 'check_results_disabled()')); $form -> addGroup($radios_results_disabled, null, get_lang('ShowResultsToStudents')); $random = array(); diff --git a/main/exercice/exercise_admin.php b/main/exercice/exercise_admin.php index 742c6c75d6..3f331a2e73 100755 --- a/main/exercice/exercise_admin.php +++ b/main/exercice/exercise_admin.php @@ -112,14 +112,24 @@ $htmlHeadXtra[] = '';