MDL-14198 "Make it clear which student attempt gives the final grade, if the scoring method is first, last or highest score" adding a message about the highlighting above the table.

This commit is contained in:
jamiesensei
2008-05-08 09:31:05 +00:00
parent 1a827abb0c
commit 18129bbfee
3 changed files with 31 additions and 4 deletions
+5
View File
@@ -3,11 +3,14 @@
$string['allattempts'] = 'Show all attempts';
$string['allattemptscontributetograde'] = 'All attempts contribute to final grade for user.';
$string['allstudents'] = 'Show all $a';
$string['attemptsonly'] = 'Show $a with attempts only';
$string['attemptsprepage'] = 'Attempts shown per page';
$string['deleteselected'] = 'Delete selected attempts';
$string['highlightinggraded'] = 'The user attempt that contributes to final grade is highlighted.';
$string['noattemptsonly'] = 'Show $a with no attempts only';
$string['onlyoneattemptallowed'] = 'Only one attempt per user allowed on this quiz.';
$string['optallattempts'] = 'all attempts';
$string['optallstudents'] = 'all \'$a\'';
$string['optattemptsonly'] = '\'$a\' with attempts only';
@@ -22,5 +25,7 @@ $string['preferencespage'] = 'Preferences just for this page';
$string['preferencessave'] = 'Save preferences';
$string['preferencesuser'] = 'Your preferences for this report';
$string['show'] = 'Show';
$string['showinggraded'] = 'Showing only the attempt graded for each user.';
$string['showinggradedandungraded'] = 'Showing graded and ungraded attempts for each user. The one attempt for each user that is graded is highlighted. The grading method for this quiz is $a.';
$string['showdetailedmarks'] = 'Show marks for each question';
?>
+9 -1
View File
@@ -65,7 +65,7 @@ class quiz_report extends quiz_default_report {
$pageoptions['mode'] = 'overview';
$reporturl = new moodle_url($CFG->wwwroot.'/mod/quiz/report.php', $pageoptions);
$qmsubselect = quiz_report_qm_filter_subselect($quiz->grademethod);
$qmsubselect = quiz_report_qm_filter_subselect($quiz);
$mform = new mod_quiz_report_overview_settings($reporturl, compact('qmsubselect'));
if ($fromform = $mform->get_data()){
$attemptsmode = $fromform->attemptsmode;
@@ -117,6 +117,14 @@ class quiz_report extends quiz_default_report {
}
}
// Print information on the grading method and whether we are displaying
//
if (!$download) { //do not print notices when downloading
if ($strattempthighlight = quiz_report_highlighting_grading_method($quiz, $qmsubselect, $qmfilter)) {
echo '<div class="quizattemptcounts">' . $strattempthighlight . '</div>';
}
}
// Now check if asked download of data
if ($download) {
$filename = clean_filename("$course->shortname ".format_string($quiz->name,true));
+17 -3
View File
@@ -78,10 +78,13 @@ function quiz_report_load_questions($quiz){
* one attempt that will be graded for each user. Or return
* empty string if all attempts contribute to final grade.
*/
function quiz_report_qm_filter_subselect($quizgrademethod){
function quiz_report_qm_filter_subselect($quiz){
global $CFG;
if ($quiz->attempts == 1) {//only one attempt allowed on this quiz
return '';
}
$qmfilterattempts = true;
switch ($quizgrademethod) {
switch ($quiz->grademethod) {
case QUIZ_GRADEHIGHEST :
$qmorderby = 'sumgrades DESC, timestart ASC';
break;
@@ -119,5 +122,16 @@ function quiz_report_grade_bands($bands, $quizid, $useridlist){
ksort($data);
return $data;
}
function quiz_report_highlighting_grading_method($quiz, $qmsubselect, $qmfilter){
if ($quiz->attempts == 1) {//only one attempt allowed on this quiz
return "<p>".get_string('onlyoneattemptallowed', "quiz_overview")."</p>";
} else if (!$qmsubselect){
return "<p>".get_string('allattemptscontributetograde', "quiz_overview")."</p>";
} else if ($qmfilter){
return "<p>".get_string('showinggraded', "quiz_overview")."</p>";
}else {
return "<p>".get_string('showinggradedandungraded', "quiz_overview",
('<span class="highlight">'.quiz_get_grading_option_name($quiz->grademethod).'</span>'))."</p>";
}
}
?>