From: tjhunt Date: Wed, 10 Dec 2008 09:11:30 +0000 (+0000) Subject: quiz manual grading: MDL-5517 manual grading pop-up is too small. HTML editor does... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e8f99abc68286c00f3aa27349af9f3ddeeaafef4;p=moodle.git quiz manual grading: MDL-5517 manual grading pop-up is too small. HTML editor does not fit. Merged from MOODLE_19_STABLE. Also MDL-17585 Improve layout of manual grading forms to make them look more like formslib forms. The standard trick of stealing the HTML and class names that formslib works, so the standard style rules apply to your form. --- diff --git a/lang/en_utf8/quiz_grading.php b/lang/en_utf8/quiz_grading.php index 02e6801068..87d9e6e3c9 100644 --- a/lang/en_utf8/quiz_grading.php +++ b/lang/en_utf8/quiz_grading.php @@ -14,7 +14,7 @@ $string['gradeungraded'] = 'Grade all $a ungraded attempts'; $string['gradenextungraded'] = 'Grade next $a ungraded attempts'; $string['gradinguser'] = 'Attempts for $a'; $string['gradingall'] = 'All $a attempts on this question.'; -$string['gradingattempt'] = 'Attempt number $a->attempt for $a->fullname.'; +$string['gradingattempt'] = 'Attempt number $a->attempt for $a->fullname'; $string['gradingnextungraded'] = 'Next $a ungraded attempts'; $string['gradingnotallowed'] = 'You do not have permission to manually grade responses in this quiz'; $string['gradingungraded'] = '$a ungraded attempts'; diff --git a/lib/questionlib.php b/lib/questionlib.php index a6e2ee51b8..1a16128807 100644 --- a/lib/questionlib.php +++ b/lib/questionlib.php @@ -1729,26 +1729,38 @@ function get_question_image($question) { return $img; } -function question_print_comment_fields($question, $state, $prefix, $cmoptions) { +function question_print_comment_fields($question, $state, $prefix, $cmoptions, $caption = '') { $idprefix = preg_replace('/[^-_a-zA-Z0-9]/', '', $prefix); $grade = question_format_grade($cmoptions, $state->last_graded->grade); $maxgrade = question_format_grade($cmoptions, $question->maxgrade); $fieldsize = strlen($maxgrade) - 1; - echo '' . "\n"; - echo '' . "\n"; - echo '\n"; - echo '\n"; - echo "\n"; - echo '' . "\n"; - echo '\n"; - echo '\n"; - echo "\n"; - echo "
'; - print_textarea(can_use_html_editor(), 15, 60, 630, 300, $prefix . '[comment]', - $state->manualcomment, 0, false, $idprefix . '_comment_box'); - echo "
/' . $maxgrade . "
\n"; + if (empty($caption)) { + $caption = format_string($question->name); + } + ?> +
+ + +
+ ensure_question_loaded($questionid); $this->ensure_state_loaded($questionid); + + /// Work out a nice title. + $student = $DB->get_record('user', array('id' => $this->get_userid())); + $a = new object(); + $a->fullname = fullname($student, true); + $a->attempt = $this->get_attempt_number(); + question_print_comment_fields($this->questions[$questionid], - $this->states[$questionid], $prefix, $this->quiz); + $this->states[$questionid], $prefix, $this->quiz, get_string('gradingattempt', 'quiz_grading', $a)); } // Private methods ===================================================================== diff --git a/mod/quiz/comment.php b/mod/quiz/comment.php index 1a68477865..49b585d637 100644 --- a/mod/quiz/comment.php +++ b/mod/quiz/comment.php @@ -10,8 +10,8 @@ require_once('../../config.php'); require_once('locallib.php'); - $attemptid =required_param('attempt', PARAM_INT); // attempt id - $questionid =required_param('question', PARAM_INT); // question id + $attemptid = required_param('attempt', PARAM_INT); // attempt id + $questionid = required_param('question', PARAM_INT); // question id $attemptobj = new quiz_attempt($attemptid); @@ -46,9 +46,7 @@ /// If success, notify and print a close button. if (!is_string($error)) { notify(get_string('changessaved'), 'notifysuccess'); - close_window_button('closewindow', false, true); - print_footer(); - exit; + close_window(2, true); } /// Otherwise, display the error and fall throug to re-display the form. @@ -56,14 +54,30 @@ } /// Print the comment form. - echo '
'; + echo ''; $attemptobj->question_print_comment_fields($questionid, 'response'); - echo ''; - echo ''; - echo ''; - echo ''; +?> +
+ + + +
+ +'; /// End of the page. - print_footer(); + print_footer('empty'); ?> diff --git a/mod/quiz/report/grading/report.php b/mod/quiz/report/grading/report.php index da9be0362f..88932c05a4 100644 --- a/mod/quiz/report/grading/report.php +++ b/mod/quiz/report/grading/report.php @@ -371,7 +371,7 @@ class quiz_grading_report extends quiz_default_report { // Display the form with one part for each selected attempt - echo ''. + echo ''. ''. ''. ''. @@ -390,10 +390,10 @@ class quiz_grading_report extends quiz_default_report { $options->readonly = 1; if (question_state_is_graded($state)) { - $gradedclass = ' class="highlightgraded" '; + $gradedclass = 'main highlightgraded'; $gradedstring = ' ' . get_string('graded','quiz_grading'); } else { - $gradedclass = ''; + $gradedclass = 'main'; $gradedstring = ''; } $a = new object(); @@ -402,8 +402,7 @@ class quiz_grading_report extends quiz_default_report { // print the user name, attempt count, the question, and some more hidden fields echo '
'; - echo "" . get_string('gradingattempt', 'quiz_grading', $a); - echo $gradedstring . ''; + print_heading(get_string('gradingattempt', 'quiz_grading', $a) . $gradedstring, '', 3, $gradedclass); // Print the question, without showing any previous comment. $copy = $state->manualcomment; @@ -413,8 +412,8 @@ class quiz_grading_report extends quiz_default_report { // The print the comment and grade fields, putting back the previous comment. $state->manualcomment = $copy; - question_print_comment_fields($question, $state, - 'manualgrades[' . $attempt->uniqueid . ']', $quiz); + question_print_comment_fields($question, $state, 'manualgrades[' . $attempt->uniqueid . ']', + $quiz, get_string('manualgrading', 'quiz')); echo '
'; } diff --git a/question/type/questiontype.php b/question/type/questiontype.php index 811e93d794..86a83d891b 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -935,7 +935,7 @@ class default_questiontype { $strcomment = get_string('commentorgrade', 'quiz'); $commentlink = link_to_popup_window($options->questioncommentlink . '?attempt=' . $state->attempt . '&question=' . $actualquestionid, - 'commentquestion', $strcomment, 450, 650, $strcomment, 'none', true); + 'commentquestion', $strcomment, 480, 750, $strcomment, 'none', true); $commentlink = ''; } diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index 731e6b7754..0f62c356bf 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -2978,7 +2978,16 @@ body.notes .notesgroup { margin-top: 10px; border-bottom: 1px solid #555; } - +#mod-quiz-comment #manualgradingform, +#mod-quiz-report #manualgradingform { + width: 100%; +} +#mod-quiz-report #manualgradingform .que { + margin-bottom: 0.7em; +} +.mform .que.comment .fitemtitle { + width: 20%; +} /*** *** Completion progress report ***/