mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
mod-assignment MDL-16706 Eliminated inline scripts to use PAGE methods
This commit is contained in:
parent
ddbeb7a7ec
commit
8f36c245ed
11
mod/assignment/assignment.js
Normal file
11
mod/assignment/assignment.js
Normal file
@ -0,0 +1,11 @@
|
||||
function setNext(){
|
||||
document.getElementById('submitform').mode.value = 'next';
|
||||
document.getElementById('submitform').userid.value = assignment.nextid;
|
||||
}
|
||||
|
||||
function saveNext(){
|
||||
document.getElementById('submitform').mode.value = 'saveandnext';
|
||||
document.getElementById('submitform').userid.value = assignment.nextid;
|
||||
document.getElementById('submitform').saveuserid.value = assignment.userid;
|
||||
document.getElementById('submitform').menuindex.value = document.getElementById('submitform').grade.selectedIndex;
|
||||
}
|
@ -847,7 +847,7 @@ class assignment_base {
|
||||
* @param string $extra_javascript
|
||||
*/
|
||||
function display_submission($extra_javascript = '') {
|
||||
global $CFG, $DB;
|
||||
global $CFG, $DB, $PAGE;
|
||||
require_once($CFG->libdir.'/gradelib.php');
|
||||
require_once($CFG->libdir.'/tablelib.php');
|
||||
|
||||
@ -919,22 +919,9 @@ class assignment_base {
|
||||
/// Print any extra javascript needed for saveandnext
|
||||
echo $extra_javascript;
|
||||
|
||||
///SOme javascript to help with setting up >.>
|
||||
echo $PAGE->requires->data_for_js('assignment', Array('nextid'=>$nextid, 'userid'=>$userid))->asap();
|
||||
echo $PAGE->requires->js('mod/assignment/assignment.js')->asap();
|
||||
|
||||
echo '<script type="text/javascript">'."\n";
|
||||
echo 'function setNext(){'."\n";
|
||||
echo 'document.getElementById(\'submitform\').mode.value=\'next\';'."\n";
|
||||
echo 'document.getElementById(\'submitform\').userid.value="'.$nextid.'";'."\n";
|
||||
echo '}'."\n";
|
||||
|
||||
echo 'function saveNext(){'."\n";
|
||||
echo 'document.getElementById(\'submitform\').mode.value=\'saveandnext\';'."\n";
|
||||
echo 'document.getElementById(\'submitform\').userid.value="'.$nextid.'";'."\n";
|
||||
echo 'document.getElementById(\'submitform\').saveuserid.value="'.$userid.'";'."\n";
|
||||
echo 'document.getElementById(\'submitform\').menuindex.value = document.getElementById(\'submitform\').grade.selectedIndex;'."\n";
|
||||
echo '}'."\n";
|
||||
|
||||
echo '</script>'."\n";
|
||||
echo '<table cellspacing="0" class="feedback '.$subtype.'" >';
|
||||
|
||||
///Start of teacher info row
|
||||
|
Loading…
x
Reference in New Issue
Block a user