Moodle

a new visual symbol on the "course grades overview" report that indicates that a student submitted an answer and is waiting for the grader to grade it

Details

  • Type: New Feature New Feature
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.9
  • Fix Version/s: None
  • Component/s: Gradebook
  • Labels:
    None
  • Difficulty:
    Easy
  • Affected Branches:
    MOODLE_19_STABLE

Description

teachers that looked on the course's "grade overview report" wished to know which
student has submitted an answer to an assignment and is waiting for the grader to grade it.
(it was only showing grades and no grades indications)

so i add a new symbol to indicate that the student submitted an answer
and that he/she is waiting for the grader to grade it.

to apply the patch, open moodle/grade/report/grader/lib.php line 877 and change :

$studentshtml .= '<span class="gradevalue'.$hidden.$gradepass.'">'.grade_format_gradevalue($gradeval, $item, true, $gradedisplaytype, null).'</span>';

to:

} else {
// who answered but did not get a grade + link for grading (nadavkav)
if ( $grade->get_datesubmitted() and empty($gradeval) ) { $gradershouldcheck = '<span style="font-size-adjust:0.6;font-weight:bold;">'. ' <a target="_new" href="'.$CFG->wwwroot.'/mod/assignment/submissions.php?id='. $item->idnumber.'&userid='.$userid.'&mode=single&offset='.($this->rowcount - 3).'">(?)</a> </span>'; } else { $gradershouldcheck = grade_format_gradevalue($gradeval, $item, true, $gradedisplaytype, null); }
$studentshtml .= '<span class="gradevalue'.$hidden.$gradepass.'">'.$gradershouldcheck.'</span>';
}

Activity

Hide
Nadav Kavalerchik added a comment -

It seems that the code changed a little bit for Moodle version 1.9.9

so here is an update, in case you wish to apply it to 1.9.9 version:

} else {
                      // who answered but did not get a grade + link for grading
                      if ( $grade->get_datesubmitted() and empty($gradeval) ) {
                        // get module id from module name
                        $whatmodule = get_record('modules','name',$item->itemmodule);
                        // get module instance id from course->id , module->instance and module->id
                        $submission = get_record('course_modules','course',$item->courseid,'instance',$item->iteminstance,'module',$whatmodule->id);
                        $gradershouldcheck = '<span style="font-size-adjust:0.6;font-weight:bold;">'. ' <a target="_new" href="'.$CFG->wwwroot.'/mod/assignment/submissions.php?id='. $submission->id.'&userid='.$userid.'&mode=single&offset='.($this->rowcount - 3).'">(?)</a> </span>';
                      } else {
                        $gradershouldcheck = grade_format_gradevalue($gradeval, $item, true, $gradedisplaytype, null);
                      }
                      $studentshtml .= '<span class="gradevalue'.$hidden.$gradepass.'">'.$gradershouldcheck.'</span>';
                    }
Show
Nadav Kavalerchik added a comment - It seems that the code changed a little bit for Moodle version 1.9.9 so here is an update, in case you wish to apply it to 1.9.9 version:
} else {
                      // who answered but did not get a grade + link for grading
                      if ( $grade->get_datesubmitted() and empty($gradeval) ) {
                        // get module id from module name
                        $whatmodule = get_record('modules','name',$item->itemmodule);
                        // get module instance id from course->id , module->instance and module->id
                        $submission = get_record('course_modules','course',$item->courseid,'instance',$item->iteminstance,'module',$whatmodule->id);
                        $gradershouldcheck = '<span style="font-size-adjust:0.6;font-weight:bold;">'. ' <a target="_new" href="'.$CFG->wwwroot.'/mod/assignment/submissions.php?id='. $submission->id.'&userid='.$userid.'&mode=single&offset='.($this->rowcount - 3).'">(?)</a> </span>';
                      } else {
                        $gradershouldcheck = grade_format_gradevalue($gradeval, $item, true, $gradedisplaytype, null);
                      }
                      $studentshtml .= '<span class="gradevalue'.$hidden.$gradepass.'">'.$gradershouldcheck.'</span>';
                    }
Hide
Nadav Kavalerchik added a comment -

support for Quiz and Assignment modules

if ( empty($gradeval) and $item->itemtype == 'mod') {

    if ($item->itemmodule == 'quiz') {
	$quizgrade = get_record('quiz_grades','userid',$userid);
	$quizattempt = get_record('quiz_attempts','userid',$userid);
	if (empty($quizgrade) and !empty($quizattempt)) {
	    $gradershouldcheck = '<span style="font-size-adjust:0.6;font-weight:bold;">'.
		    ' <a target="_new" href="'.$CFG->wwwroot.'/mod/'.$item->itemmodule.'/review.php?q='.$item->iteminstance.'&attempt='.$quizattempt->id.'">(?)</a> </span>';
	} else if ($quizgrade) {
	    $gradershouldcheck = '<span style="font-size-adjust:0.6;font-weight:bold;"> '.$quizgrade->grade.' </span>';
	}
    }

    if ($item->itemmodule == 'assignment') {
	// get module id from module name
	$whatmodule = get_record('modules','name',$item->itemmodule);
	// get module instance id from course->id , module->instance and module->id
	$submission = get_record('course_modules','course',$item->courseid,'instance',$item->iteminstance,'module',$whatmodule->id);
	$gradershouldcheck = '<span style="font-size-adjust:0.6;font-weight:bold;">'.
		' <a target="_new" href="'.$CFG->wwwroot.'/mod/'.$item->itemmodule.'/submissions.php?id='.$submission->id.'&userid='.$userid.'&mode=single&offset='.($this->rowcount - 3).'">(?)</a> </span>';
    }

  } else {
    $gradershouldcheck = grade_format_gradevalue($gradeval, $item, true, $gradedisplaytype, null);
  }
  $studentshtml .= '<span class="gradevalue'.$hidden.$gradepass.'">'.$gradershouldcheck.'</span>';
Show
Nadav Kavalerchik added a comment - support for Quiz and Assignment modules
if ( empty($gradeval) and $item->itemtype == 'mod') {

    if ($item->itemmodule == 'quiz') {
	$quizgrade = get_record('quiz_grades','userid',$userid);
	$quizattempt = get_record('quiz_attempts','userid',$userid);
	if (empty($quizgrade) and !empty($quizattempt)) {
	    $gradershouldcheck = '<span style="font-size-adjust:0.6;font-weight:bold;">'.
		    ' <a target="_new" href="'.$CFG->wwwroot.'/mod/'.$item->itemmodule.'/review.php?q='.$item->iteminstance.'&attempt='.$quizattempt->id.'">(?)</a> </span>';
	} else if ($quizgrade) {
	    $gradershouldcheck = '<span style="font-size-adjust:0.6;font-weight:bold;"> '.$quizgrade->grade.' </span>';
	}
    }

    if ($item->itemmodule == 'assignment') {
	// get module id from module name
	$whatmodule = get_record('modules','name',$item->itemmodule);
	// get module instance id from course->id , module->instance and module->id
	$submission = get_record('course_modules','course',$item->courseid,'instance',$item->iteminstance,'module',$whatmodule->id);
	$gradershouldcheck = '<span style="font-size-adjust:0.6;font-weight:bold;">'.
		' <a target="_new" href="'.$CFG->wwwroot.'/mod/'.$item->itemmodule.'/submissions.php?id='.$submission->id.'&userid='.$userid.'&mode=single&offset='.($this->rowcount - 3).'">(?)</a> </span>';
    }

  } else {
    $gradershouldcheck = grade_format_gradevalue($gradeval, $item, true, $gradedisplaytype, null);
  }
  $studentshtml .= '<span class="gradevalue'.$hidden.$gradepass.'">'.$gradershouldcheck.'</span>';

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: