mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-9268
This commit is contained in:
parent
a9b24e489b
commit
9aa1e44853
2 changed files with 72 additions and 57 deletions
|
@ -53,11 +53,12 @@ $type = optional_param('type', 0, PARAM_ALPHA);
|
||||||
$target = optional_param('target', 0, PARAM_ALPHANUM);
|
$target = optional_param('target', 0, PARAM_ALPHANUM);
|
||||||
|
|
||||||
// Get the user preferences
|
// Get the user preferences
|
||||||
$perpage = get_user_preferences('grade_report_studentsperpage', $CFG->grade_report_studentsperpage); // number of users on a page
|
$perpage = get_user_preferences('grade_report_studentsperpage', $CFG->grade_report_studentsperpage); // number of users on a page
|
||||||
$decimals = get_user_preferences('grade_report_decimalpoints', $CFG->grade_report_decimalpoints); // decimals in grades
|
$decimals = get_user_preferences('grade_report_decimalpoints', $CFG->grade_report_decimalpoints); // decimals in grades
|
||||||
$displaytotals = get_user_preferences('grade_report_showgrandtotals', $CFG->grade_report_showgrandtotals);
|
$displaytotals = get_user_preferences('grade_report_showgrandtotals', $CFG->grade_report_showgrandtotals);
|
||||||
$displaygrouptotals = get_user_preferences('grade_report_showgroups', $CFG->grade_report_showgroups);
|
$displaygrouptotals = get_user_preferences('grade_report_showgroups', $CFG->grade_report_showgroups);
|
||||||
$aggregation_position = get_user_preferences('grade_report_aggregationposition', $CFG->grade_report_aggregationposition);
|
$aggregation_position = get_user_preferences('grade_report_aggregationposition', $CFG->grade_report_aggregationposition);
|
||||||
|
$showscales = get_user_preferences('grade_report_showscales', $CFG->grade_report_showscales);
|
||||||
|
|
||||||
// Override perpage if set in URL
|
// Override perpage if set in URL
|
||||||
if ($perpageurl = optional_param('perpage', 0, PARAM_INT)) {
|
if ($perpageurl = optional_param('perpage', 0, PARAM_INT)) {
|
||||||
|
|
|
@ -755,7 +755,11 @@ function grade_get_icons($element, $tree) {
|
||||||
$type = $element['type'];
|
$type = $element['type'];
|
||||||
|
|
||||||
// Load user preferences
|
// Load user preferences
|
||||||
$aggregationview = get_user_preferences('grade_report_aggregationview', $CFG->grade_report_aggregationview);
|
$aggregationview = get_user_preferences('grade_report_aggregationview', $CFG->grade_report_aggregationview);
|
||||||
|
$showeyecons = get_user_preferences('grade_report_showeyecons', $CFG->grade_report_showeyecons);
|
||||||
|
$showlocks = get_user_preferences('grade_report_showlocks', $CFG->grade_report_showlocks);
|
||||||
|
$shownotes = get_user_preferences('grade_report_notes', $CFG->grade_report_notes);
|
||||||
|
$showcalculations = get_user_preferences('grade_report_showcalculations', $CFG->grade_report_showcalculations);
|
||||||
|
|
||||||
// Icons shown when edit mode is on
|
// Icons shown when edit mode is on
|
||||||
if ($USER->gradeediting) {
|
if ($USER->gradeediting) {
|
||||||
|
@ -779,53 +783,63 @@ function grade_get_icons($element, $tree) {
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Not sure if there is a good reason to have a calculation icon: the calculation field is in the grade_edit form */
|
||||||
|
/*
|
||||||
// Calculation icon for items and categories
|
// Calculation icon for items and categories
|
||||||
if ($type != 'grade') {
|
if ($type != 'grade') {
|
||||||
$html .= '<a href="report/grader/edit_calculation.php?courseid='.$object->courseid.'&id='.$object->id.'">';
|
$html .= '<a href="report/grader/edit_calculation.php?courseid='.$object->courseid.'&id='.$object->id.'">';
|
||||||
$html .= '<img src="'.$CFG->pixpath.'/t/calc.gif" class="iconsmall" alt="'
|
$html .= '<img src="'.$CFG->pixpath.'/t/calc.gif" class="iconsmall" alt="'
|
||||||
.$streditcalculation.'" title="'.$streditcalculation.'" /></a>'. "\n";
|
.$streditcalculation.'" title="'.$streditcalculation.'" /></a>'. "\n";
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Prepare Hide/Show icon state
|
if ($shownotes) {
|
||||||
$hide_show = 'hide';
|
// Setup object identifier and show feedback icon if applicable
|
||||||
if ($object->is_hidden()) {
|
if ($type == 'grade' and $USER->gradefeedback) {
|
||||||
$hide_show = 'show';
|
// Display Edit/Add feedback icon
|
||||||
}
|
if (empty($object->feedback)) {
|
||||||
|
$html .= '<a href="report/grader/edit_feedback.php?id=' . $object->id
|
||||||
// Setup object identifier and show feedback icon if applicable
|
. "&action=add&courseid=$object->courseid\">\n";
|
||||||
if ($type == 'grade' and $USER->gradefeedback) {
|
$html .= '<img src="'.$CFG->pixpath.'/t/feedback_add.gif" class="iconsmall" alt="'.$straddfeedback.'" '
|
||||||
// Display Edit/Add feedback icon
|
. 'title="'.$straddfeedback.'" /></a>'. "\n";
|
||||||
if (empty($object->feedback)) {
|
} else {
|
||||||
$html .= '<a href="report/grader/edit_feedback.php?id=' . $object->id
|
$html .= '<a href="report/grader/edit_feedback.php?id=' . $object->id
|
||||||
. "&action=add&courseid=$object->courseid\">\n";
|
. "&action=edit&courseid=$object->courseid\">\n";
|
||||||
$html .= '<img src="'.$CFG->pixpath.'/t/feedback_add.gif" class="iconsmall" alt="'.$straddfeedback.'" '
|
$html .= '<img src="'.$CFG->pixpath.'/t/feedback.gif" class="iconsmall" alt="'.$streditfeedback.'" '
|
||||||
. 'title="'.$straddfeedback.'" /></a>'. "\n";
|
. 'title="'.$streditfeedback.'" onmouseover="return overlib(\''.$object->feedback.'\', CAPTION, \''
|
||||||
} else {
|
. $strfeedback.'\');" onmouseout="return nd();" /></a>'. "\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";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Display Hide/Show icon
|
if ($showeyecons) {
|
||||||
$html .= '<a href="report.php?report=grader&target='.$eid
|
|
||||||
. "&action=$hide_show$tree->commonvars\">\n";
|
|
||||||
$html .= '<img src="'.$CFG->pixpath.'/t/'.$hide_show.'.gif" class="iconsmall" alt="'
|
|
||||||
.${'str' . $hide_show}.'" title="'.${'str' . $hide_show}.'" /></a>'. "\n";
|
|
||||||
|
|
||||||
// Prepare lock/unlock string
|
// Prepare Hide/Show icon state
|
||||||
$lock_unlock = 'lock';
|
$hide_show = 'hide';
|
||||||
if ($object->is_locked()) {
|
if ($object->is_hidden()) {
|
||||||
$lock_unlock = 'unlock';
|
$hide_show = 'show';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Display Hide/Show icon
|
||||||
|
$html .= '<a href="report.php?report=grader&target='.$eid
|
||||||
|
. "&action=$hide_show$tree->commonvars\">\n";
|
||||||
|
$html .= '<img src="'.$CFG->pixpath.'/t/'.$hide_show.'.gif" class="iconsmall" alt="'
|
||||||
|
.${'str' . $hide_show}.'" title="'.${'str' . $hide_show}.'" /></a>'. "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print lock/unlock icon
|
if ($showlocks) {
|
||||||
$html .= '<a href="report.php?report=grader&target='.$eid
|
// Prepare lock/unlock string
|
||||||
. "&action=$lock_unlock$tree->commonvars\">\n";
|
$lock_unlock = 'lock';
|
||||||
$html .= '<img src="'.$CFG->pixpath.'/t/'.$lock_unlock.'.gif" class="iconsmall" alt="'
|
if ($object->is_locked()) {
|
||||||
.${'str' . $lock_unlock}.'" title="'.${'str' . $lock_unlock}.'" /></a>'. "\n";
|
$lock_unlock = 'unlock';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Print lock/unlock icon
|
||||||
|
$html .= '<a href="report.php?report=grader&target='.$eid
|
||||||
|
. "&action=$lock_unlock$tree->commonvars\">\n";
|
||||||
|
$html .= '<img src="'.$CFG->pixpath.'/t/'.$lock_unlock.'.gif" class="iconsmall" alt="'
|
||||||
|
.${'str' . $lock_unlock}.'" title="'.${'str' . $lock_unlock}.'" /></a>'. "\n";
|
||||||
|
}
|
||||||
|
|
||||||
// If object is a category, display expand/contract icon
|
// If object is a category, display expand/contract icon
|
||||||
if (get_class($object) == 'grade_category' && $aggregationview == GRADER_REPORT_AGGREGATION_VIEW_COMPACT) {
|
if (get_class($object) == 'grade_category' && $aggregationview == GRADER_REPORT_AGGREGATION_VIEW_COMPACT) {
|
||||||
|
@ -843,7 +857,7 @@ function grade_get_icons($element, $tree) {
|
||||||
.${'str' . $expand_contract}.'" title="'.${'str' . $expand_contract}.'" /></a>'. "\n";
|
.${'str' . $expand_contract}.'" title="'.${'str' . $expand_contract}.'" /></a>'. "\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($USER->gradefeedback) {
|
if ($shownotes) {
|
||||||
// Display view feedback icon
|
// Display view feedback icon
|
||||||
if (!empty($object->feedback)) {
|
if (!empty($object->feedback)) {
|
||||||
$html .= '<a href="report/grader/edit_feedback.php?id=' . $object->id
|
$html .= '<a href="report/grader/edit_feedback.php?id=' . $object->id
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue