Adding some js validations when editing the exercise feedback option

skala
Julio Montoya 14 years ago
parent faa9bd0268
commit 1116d07f1c
  1. 8
      main/exercice/exercise.class.php
  2. 14
      main/exercice/exercise_admin.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();

@ -112,8 +112,7 @@ $htmlHeadXtra[] = '<script>
}
}
function check_per_page_all()
{
function check_per_page_all() {
if (document.getElementById(\'divtimecontrol\').style.display==\'block\')
{
document.getElementById(\'divtimecontrol\').style.display=\'none\';
@ -121,6 +120,17 @@ $htmlHeadXtra[] = '<script>
}
}
function check_feedback() {
document.getElementById(\'result_disabled_0\').checked = true;
}
function check_results_disabled() {
document.getElementById(\'exerciseType_2\').checked = true;
}
</script>';
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery

Loading…
Cancel
Save