diff --git a/lib/weblib.php b/lib/weblib.php index 78375ee0161..df8c2cbc0d4 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -585,16 +585,24 @@ function link_to_popup_window ($url, $name='popup', $linkname='click here', * @uses $CFG */ function button_to_popup_window ($url, $name='popup', $linkname='click here', - $height=400, $width=500, $title='Popup window', $options='none', $return=false) { + $height=400, $width=500, $title='Popup window', $options='none', $return=false, + $id='', $class='') { global $CFG; if ($options == 'none') { $options = 'menubar=0,location=0,scrollbars,resizable,width='. $width .',height='. $height; } + + if ($id) { + $id = ' id="'.$id.'" '; + } + if ($class) { + $class = ' class="'.$class.'" '; + } $fullscreen = 0; - $button = '\n"; if ($return) { return $button; diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index 68a9a27501e..17ae21c2b22 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -305,6 +305,7 @@ class assignment_base { } if (empty($SESSION->flextable['mod-assignment-submissions']->collapse['status'])) { echo 'opener.document.getElementById("up'.$submission->userid.'").className="s1";'; + echo 'opener.document.getElementById("button'.$submission->userid.'").value="'.get_string('update').'";'; } echo "\n-->\n"; fflush(); @@ -329,7 +330,10 @@ class assignment_base { return '-'; } } - return $scalegrades[$grade]; + if (isset($scalegrades[$grade])) { + return $scalegrades[$grade]; + } + return ''; } } @@ -345,7 +349,7 @@ class assignment_base { error('No such user!'); } - if (!$submission = $this->get_submission($user->id)) { // Get or make one + if (!$submission = $this->get_submission($user->id, true)) { // Get one or make one error('Could not find submission!'); } @@ -567,10 +571,15 @@ class assignment_base { $comment = '