At the request of one of my teachers I have written a little bit of javascript that allows the setting of all grades at once when quickgrading is on (ours is only marked out of 1 to correspond to did the work/didn't do the work so they can set everyone to 1 then just change the few who didn't bother).
The script is:
<script language="JavaScript" type="text/javascript">
<!--
function ChangeAllGrades(){
master = document.getElementById("masterdropdown");
dropdowns=document.getElementsByTagName("select");
for(i=2;dropdowns.length;i++){dropdowns[i].selectedIndex=master.selectedIndex;}
}
//-->
</script>
In the head, plus:
<select id="masterdropdown" name="changeall" onchange='ChangeAllGrades()'>
<option value="-1">No grade</option>
<option value="1">1 / 1</option>
<option value="0">0 / 1</option>
</select>
In the grade table header cell.
The problem I'm having is how do I get this into the pages which are generated? I cant find it anywhere
Thanks,
Mike
Found the solution:
diff -r moodle/mod/assignment/lib.php moodle-clean/moodle/mod/assignment/lib.php
1050,1058c1050
< '', '<script language="JavaScript" type="text/javascript">
< <!--
< function ChangeAllGrades(){
< master = document.getElementById("masterdropdown");
< dropdowns=document.getElementsByTagName("select");
< for(i=2;dropdowns.length;i++){dropdowns[i].selectedIndex=master.selectedIndex;}}
< //-->
< </script>
< ', true, update_module_button($cm->id, $course->id, $this->strassignment), navmenu($course, $cm));
---
> '', '', true, update_module_button($cm->id, $course->id, $this->strassignment), navmenu($course, $cm));
1096,1102d1087
<
<
< if($quickgrade){
< $changeallselect = choose_from_menu(make_grades_menu($this->assignment->grade),
< 'menu['.$auser->id.']', $auser->grade,
< get_string('nograde'),'ChangeAllGrades()',-1,true,false,$tabindex++,"masterdropdown");
< }
1105c1090
< get_string('grade').'</a><br>'.$changeallselect,
---
> get_string('grade'),
Mike
diff -r moodle/mod/assignment/lib.php moodle-clean/moodle/mod/assignment/lib.php
1050,1058c1050
< '', '<script language="JavaScript" type="text/javascript">
< <!--
< function ChangeAllGrades(){
< master = document.getElementById("masterdropdown");
< dropdowns=document.getElementsByTagName("select");
< for(i=2;dropdowns.length;i++){dropdowns[i].selectedIndex=master.selectedIndex;}}
< //-->
< </script>
< ', true, update_module_button($cm->id, $course->id, $this->strassignment), navmenu($course, $cm));
---
> '', '', true, update_module_button($cm->id, $course->id, $this->strassignment), navmenu($course, $cm));
1096,1102d1087
<
<
< if($quickgrade){
< $changeallselect = choose_from_menu(make_grades_menu($this->assignment->grade),
< 'menu['.$auser->id.']', $auser->grade,
< get_string('nograde'),'ChangeAllGrades()',-1,true,false,$tabindex++,"masterdropdown");
< }
1105c1090
< get_string('grade').'</a><br>'.$changeallselect,
---
> get_string('grade'),
Mike