$string['exportxml'] = 'Export XML';
$string['extracredit'] = 'Extra Credit';
$string['extracreditwarning'] = 'Note: Setting all items for a category to extra credit will effectively remove them from the grade calculation. Since there will be no point total';
+$string['feedback'] = 'Feedback';
+$string['feedbackedit'] = 'Edit feedback';
$string['forelementtypes'] = ' for the selected $a';
$string['forstudents'] = 'For Students';
+$string['grade'] = 'Grade';
$string['gradebook'] = 'Gradebook';
$string['gradebookhiddenerror'] = 'The gradebook is currently set to hide everything from students.';
$string['gradecategoryhelp'] = 'Grade Category Help';
$string['noselectedcategories'] = 'no categories were selected.';
$string['noselecteditems'] = 'no items were selected.';
$string['notteachererror'] = 'You must be a teacher to use this feature.';
+$string['onascaleof'] = ' on a scale of $a->grademin to $a->grademax';
$string['outcome'] = 'Outcome';
$string['pctoftotalgrade'] = '%% of total grade';
$string['percent'] = 'Percent';
define('GRADE_UPDATE_ITEM_DELETED', 3);
define('GRADE_UPDATE_ITEM_LOCKED', 4);
+// Set up constants for report preferences
+define('GRADER_REPORT_AGGREGATION_POSITION_LEFT', 0);
+define('GRADER_REPORT_AGGREGATION_POSITION_RIGHT', 1);
+define('GRADER_REPORT_AGGREGATION_VIEW_FULL', 0);
+define('GRADER_REPORT_AGGREGATION_VIEW_COMPACT', 1);
+define('GRADER_REPORT_GRADE_DISPLAY_TYPE_RAW', 0);
+define('GRADER_REPORT_GRADE_DISPLAY_TYPE_PERCENTAGE', 1);
+define('GRADER_REPORT_FEEDBACK_FORMAT_TEXT', 0);
+define('GRADER_REPORT_FEEDBACK_FORMAT_HTML', 1);
+
require_once($CFG->libdir . '/grade/grade_category.php');
require_once($CFG->libdir . '/grade/grade_item.php');
function grade_get_icons($element, $tree) {
global $CFG;
global $USER;
-
+
+ // Load language strings
$straddfeedback = get_string("addfeedback", 'grades');
$stredit = get_string("edit");
$streditfeedback = get_string("editfeedback", 'grades');
$strswitch_plus = get_string("expand", 'grades');
$strunlock = get_string("unlock", 'grades');
+ // Prepare container div
$html = '<div class="grade_icons">';
+ // Prepare reference variables
$eid = $element['eid'];
$object = $element['object'];
$type = $element['type'];
+ // Load user preferences
+ $aggregationview = get_user_preferences('grade_report_aggregationview', $CFG->grade_report_aggregationview);
+
// Icons shown when edit mode is on
if ($USER->gradeediting) {
// Edit icon (except for grade_grades)
if ($type != 'category' and $USER->gradefeedback) {
// Display Edit/Add feedback icon
if (empty($object->feedback)) {
- $html .= '<a href="report.php?report=grader&target='.$eid
- . "&action=addfeedback$tree->commonvars\">\n";
+ $html .= '<a href="report/grader/edit_feedback.php?id=' . $object->id
+ . "&action=add&courseid=$object->courseid\">\n";
$html .= '<img src="'.$CFG->pixpath.'/t/feedback_add.gif" class="iconsmall" alt="'.$straddfeedback.'" '
. 'title="'.$straddfeedback.'" /></a>'. "\n";
} else {
- $html .= '<a href="report.php?report=grader&target='.$eid
- . "&action=editfeedback$tree->commonvars\">\n";
+ $html .= '<a href="report/grader/edit_feedback.php?id=' . $object->id
+ . "&action=edit&courseid=$object->courseid\">\n";
$html .= '<img src="'.$CFG->pixpath.'/t/feedback.gif" class="iconsmall" alt="'.$streditfeedback.'" '
. 'title="'.$streditfeedback.'" onmouseover="return overlib(\''.$object->feedback.'\', CAPTION, \''
. $strfeedback.'\');" onmouseout="return nd();" /></a>'. "\n";
.${'str' . $lock_unlock}.'" title="'.${'str' . $lock_unlock}.'" /></a>'. "\n";
// If object is a category, display expand/contract icon
- if (get_class($object) == 'grade_category') {
+ if (get_class($object) == 'grade_category' && $aggregationview == GRADER_REPORT_AGGREGATION_VIEW_COMPACT) {
$expand_contract = 'switch_minus'; // Default: expanded
$state = get_user_preferences('grade_category_' . $object->id, GRADE_CATEGORY_EXPANDED);
if ($USER->gradefeedback) {
// Display Edit/Add feedback icon
if (!empty($object->feedback)) {
- $html .= '<a href="report.php?report=grader&target=' . $eid
- . "&action=viewfeedback$tree->commonvars\">\n";
+ $html .= '<a href="report/grader/edit_feedback.php?id=' . $object->id
+ . "&action=edit&courseid=$object->courseid\">\n";
$html .= '<img onmouseover="return overlib(\''.$object->feedback.'\', CAPTION, \''
. $strfeedback.'\');" onmouseout="return nd();" '
. 'src="'.$CFG->pixpath.'/t/feedback.gif" class="iconsmall" alt="" /></a>'. "\n";