Applied removal of gradebook options when gradebook is disabled, to assessment tool - refs #5034

skala
Yannick Warnier 13 years ago
parent cd11f321f4
commit 98e6047119
  1. 26
      main/attendance/attendance_add.php
  2. 33
      main/attendance/attendance_edit.php

@ -35,22 +35,24 @@ $form->add_html_editor('description', get_lang('Description'), false, false, arr
// Adavanced Parameters // Adavanced Parameters
$advanced = '<a href="javascript://" class = "advanced_parameters" ><span id="img_plus_and_minus">&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').'</span></a>'; $advanced = '<a href="javascript://" class = "advanced_parameters" ><span id="img_plus_and_minus">&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').'</span></a>';
$form -> addElement('advanced_settings',$advanced); if (Gradebook::is_active()) {
$form -> addElement('advanced_settings',$advanced);
$form->addElement('html','<div id="id_qualify" style="display:none">'); $form->addElement('html','<div id="id_qualify" style="display:none">');
// Qualify Attendance for gradebook option // Qualify Attendance for gradebook option
$form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'),'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"'); $form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'),'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"');
$form->addElement('html','<div id="options_field" style="display:none">'); $form->addElement('html','<div id="options_field" style="display:none">');
load_gradebook_select_in_tool($form); load_gradebook_select_in_tool($form);
$form->addElement('text', 'attendance_qualify_title', get_lang('TitleColumnGradebook')); $form->addElement('text', 'attendance_qualify_title', get_lang('TitleColumnGradebook'));
$form->applyFilter('attendance_qualify_title', 'html_filter'); $form->applyFilter('attendance_qualify_title', 'html_filter');
$form->addElement('text', 'attendance_weight', get_lang('QualifyWeight'),'value="0.00" Style="width:40px" onfocus="javascript: this.select();"'); $form->addElement('text', 'attendance_weight', get_lang('QualifyWeight'),'value="0.00" Style="width:40px" onfocus="javascript: this.select();"');
$form->applyFilter('attendance_weight', 'html_filter'); $form->applyFilter('attendance_weight', 'html_filter');
$form->addElement('html','</div>'); $form->addElement('html','</div>');
$form->addElement('html','</div>'); $form->addElement('html','</div>');
}
$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"'); $form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
$form->display(); $form->display();

@ -38,29 +38,30 @@ $form->add_html_editor('description', get_lang('Description'), false, false, arr
// Adavanced Parameters // Adavanced Parameters
if (!empty($attendance_qualify_title) || !empty($attendance_weight)) { if (Gradebook::is_active()) {
$advanced = '<a href="javascript://" class="advanced_parameters"><span id="img_plus_and_minus">&nbsp;'.Display::return_icon('div_hide.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').'</span></a>'; if (!empty($attendance_qualify_title) || !empty($attendance_weight)) {
$form -> addElement('advanced_settings',$advanced); $advanced = '<a href="javascript://" class="advanced_parameters"><span id="img_plus_and_minus">&nbsp;'.Display::return_icon('div_hide.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').'</span></a>';
$form->addElement('advanced_settings',$advanced);
$form->addElement('html','<div id="id_qualify" style="display:block">'); $form->addElement('html','<div id="id_qualify" style="display:block">');
$form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'),array('checked'=>'true','onclick'=>'javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}')); $form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'),array('checked'=>'true','onclick'=>'javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}'));
$form -> addElement('html','<div id="options_field" style="display:block">'); $form->addElement('html','<div id="options_field" style="display:block">');
} else { } else {
$advanced = '<a href="javascript://" class="advanced_parameters"><span id="img_plus_and_minus">&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').'</span></a>'; $advanced = '<a href="javascript://" class="advanced_parameters"><span id="img_plus_and_minus">&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').'</span></a>';
$form -> addElement('advanced_settings',$advanced); $form->addElement('advanced_settings',$advanced);
$form->addElement('html','<div id="id_qualify" style="display:none">'); $form->addElement('html','<div id="id_qualify" style="display:none">');
$form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'),'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"'); $form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'),'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"');
$form -> addElement('html','<div id="options_field" style="display:none">'); $form->addElement('html','<div id="options_field" style="display:none">');
} }
load_gradebook_select_in_tool($form); load_gradebook_select_in_tool($form);
$form->addElement('text', 'attendance_qualify_title', get_lang('TitleColumnGradebook')); $form->addElement('text', 'attendance_qualify_title', get_lang('TitleColumnGradebook'));
$form->applyFilter('attendance_qualify_title', 'html_filter'); $form->applyFilter('attendance_qualify_title', 'html_filter');
$form->addElement('text', 'attendance_weight', get_lang('QualifyWeight'),'value="0.00" Style="width:40px" onfocus="javascript: this.select();"'); $form->addElement('text', 'attendance_weight', get_lang('QualifyWeight'),'value="0.00" Style="width:40px" onfocus="javascript: this.select();"');
$form->applyFilter('attendance_weight', 'html_filter'); $form->applyFilter('attendance_weight', 'html_filter');
$form->addElement('html','</div>'); $form->addElement('html','</div>');
$form->addElement('html','</div>');
$form->addElement('html','</div>');
}
$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"'); $form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
// set default values // set default values

Loading…
Cancel
Save