MDL-9268 Removing "turn feedback on" button in favour of the new user/cfg preference grade_report_shownotes; Re-displaying the calculation icons

This commit is contained in:
nicolasconnault
2007-07-09 11:58:24 +00:00
parent f535ea21fd
commit 27626e7147
5 changed files with 49 additions and 56 deletions
+12 -35
View File
@@ -25,7 +25,7 @@
require_once("../config.php");
require_once("../lib/gradelib.php");
$courseid = required_param('id'); // course id
$report = optional_param('report', 'user', PARAM_FILE); // course id
$edit = optional_param('edit', -1, PARAM_BOOL); // sticky editting mode
@@ -43,13 +43,13 @@
/// Now check what reports are available
if ($reports = get_list_of_plugins('grade/report', 'CVS')) { // Get all installed reports
foreach ($reports as $key => $plugin) { // Remove ones we can't see
if (!has_capability('gradereport/'.$plugin.':view', $context)) {
unset($reports[$key]);
}
}
}
}
if (!$reports) {
@@ -70,7 +70,7 @@
$reportnames = array();
if (count($reports) > 1) {
foreach ($reports as $plugin) {
foreach ($reports as $plugin) {
$reportnames[$plugin] = get_string('modulename', 'gradereport_'.$plugin);
}
}
@@ -84,11 +84,11 @@
$navlinks = array();
$navlinks[] = array('name' => $strgrades, 'link' => $CFG->wwwroot . '/grade/index.php?id='.$courseid, 'type' => 'misc');
$navlinks[] = array('name' => $reportnames[$report], 'link' => '', 'type' => 'misc');
$navigation = build_navigation($navlinks);
$navigation = build_navigation($navlinks);
// build buttons here
/// setting up editting mode
/// setting up editting mode
if (!isset($USER->gradeediting)) {
$USER->gradeediting = 0;
}
@@ -98,28 +98,17 @@
} else if (($edit == 0) and confirm_sesskey()) {
$USER->gradeediting = 0;
}
// Setup feedback mode
if (!isset($USER->gradefeedback)) {
$USER->gradefeedback = 0;
}
if (($feedback == 1) and confirm_sesskey()) {
$USER->gradefeedback = 1;
} else if (($feedback == 0) and confirm_sesskey()) {
$USER->gradefeedback = 0;
}
// params for the turn editting on and feedback buttons
$options['id'] = $courseid;
$options['report'] = $report;
if ($USER->gradeediting) {
$options['edit'] = 0;
$string = get_string('turneditingoff');
} else {
$options['edit'] = 1;
$string = get_string('turneditingon');
$string = get_string('turneditingon');
}
$options['sesskey'] = sesskey();
@@ -127,26 +116,14 @@
// turn editting on and off buttons
$buttons = print_single_button($link, $options, $string, 'get', '_self', true);
unset($options['edit']);
if ($USER->gradefeedback) {
$options['feedback'] = 0;
$string = get_string('turnfeedbackoff', 'grades');
} else {
$options['feedback'] = 1;
$string = get_string('turnfeedbackon', 'grades');
}
// turn editting on and off buttons
$buttons .= print_single_button($link, $options, $string, 'get', '_self', true);
print_header_simple($strgrades.':'.$reportnames[$report], ':'.$strgrades, $navigation,
print_header_simple($strgrades.':'.$reportnames[$report], ':'.$strgrades, $navigation,
'', '', true, $buttons, navmenu($course));
/// Print the report selector at the top if there is more than one report
if ($reportnames) {
popup_form($CFG->wwwroot.'/grade/report.php?id='.$course->id.'&report=', $reportnames,
popup_form($CFG->wwwroot.'/grade/report.php?id='.$course->id.'&report=', $reportnames,
'choosegradereport', $report, '', '', '', false, 'self', get_string('gradereports', 'grades').':');
}
+20 -6
View File
@@ -68,8 +68,14 @@ if ($perpageurl = optional_param('perpage', 0, PARAM_INT)) {
/// setting up groups
// Prepare language strings
$strsortasc = get_string('sortasc', 'grades');
$strsortdesc = get_string('sortdesc', 'grades');
$strsortasc = get_string('sortasc', 'grades');
$strsortdesc = get_string('sortdesc', 'grades');
$strshoweyecons = get_string('showeyecons', 'grades');
$strhideeyecons = get_string('hideeyecons', 'grades');
$strshowlocks = get_string('showlocks', 'grades');
$strhidelocks = get_string('hidelocks', 'grades');
$strshownotes = get_string('shownotes', 'grades');
$strhidenotes = get_string('hidenotes', 'grades');
// base url for sorting by first/last name
$baseurl = 'report.php?id='.$courseid.'&perpage='.$perpage.'&report=grader&page='.$page;
@@ -79,7 +85,9 @@ $pbarurl = 'report.php?id='.$courseid.'&perpage='.$perpage.'&report=grad
/// find out current groups mode
$course = get_record('course', 'id', $courseid);
$groupmode = $course->groupmode;
ob_start();
$currentgroup = setup_and_print_groups($course, $groupmode, $baseurl);
$group_selector = ob_get_clean();
// update paging after group
$baseurl .= 'group='.$currentgroup.'&';
@@ -299,6 +307,12 @@ print_heading('Grader Report');
$currenttab = 'graderreport';
include('tabs.php');
// Group selection drop-down
echo $group_selector;
// Show/hide toggles
// Paging bar
print_paging_bar($numusers, $page, $perpage, $pbarurl);
$items = array();
@@ -507,7 +521,7 @@ if ($currentgroup && ($displaygrouptotals || 1)) {
$groupsumhtml .= '<td>-</td>';
} else {
$sum = $groupsum[$item->id];
$groupsumhtml .= '<td>'.get_grade_clean($sum->sum).'</td>';
$groupsumhtml .= '<td>'.get_grade_clean(round($sum->sum, $decimals)).'</td>';
}
}
$groupsumhtml .= '</tr>';
@@ -515,8 +529,8 @@ if ($currentgroup && ($displaygrouptotals || 1)) {
$groupsumhtml = '';
}
// user preference not implemented yet
if ($displaytotals || 1) {
// Grand totals
if ($displaytotals) {
/** SQL for finding the SUM grades of all visible users ($CFG->gradebookroles) */
@@ -542,7 +556,7 @@ if ($displaytotals || 1) {
$gradesumhtml .= '<td>-</td>';
} else {
$sum = $classsum[$item->id];
$gradesumhtml .= '<td>'.get_grade_clean($sum->sum).'</td>';
$gradesumhtml .= '<td>'.get_grade_clean(round($sum->sum, $decimals)).'</td>';
}
}
$gradesumhtml .= '</tr>';
+4 -1
View File
@@ -1,4 +1,4 @@
<?PHP // $Id$
<?PHP // $Id$
// grades.php - created with Moodle 1.7 beta + (2006101003)
@@ -119,6 +119,9 @@ $string['gradeweighthelp'] = 'Grade Weight Help';
$string['grandtotalsdisplaytype'] = 'Grand totals display type';
$string['hideadvanced'] = 'Hide Advanced Features';
$string['hidecategory'] = 'Hidden';
$string['hideeyecons'] = 'Hide eyecons';
$string['hidelocks'] = 'Hide locks';
$string['hidenotes'] = 'Hide feedback';
$string['highgradeascending'] = 'Sort by high grade ascending';
$string['highgradedescending'] = 'Sort by high grade descending';
$string['highgradeletter'] = 'High';
+4 -7
View File
@@ -749,7 +749,7 @@ function grade_get_icons($element, $tree) {
$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);
$shownotes = get_user_preferences('grade_report_shownotes', $CFG->grade_report_shownotes);
$showcalculations = get_user_preferences('grade_report_showcalculations', $CFG->grade_report_showcalculations);
// Icons shown when edit mode is on
@@ -774,19 +774,16 @@ 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
if ($type != 'grade') {
if ($showcalculations && $type != 'grade') {
$html .= '<a href="report/grader/edit_calculation.php?courseid='.$object->courseid.'&amp;id='.$object->id.'">';
$html .= '<img src="'.$CFG->pixpath.'/t/calc.gif" class="iconsmall" alt="'
.$streditcalculation.'" title="'.$streditcalculation.'" /></a>'. "\n";
}
*/
if ($shownotes) {
// Setup object identifier and show feedback icon if applicable
if ($type == 'grade' and $USER->gradefeedback) {
if ($type == 'grade' and $shownotes) {
// Display Edit/Add feedback icon
if (empty($object->feedback)) {
$html .= '<a href="report/grader/edit_feedback.php?id=' . $object->id
@@ -847,7 +844,7 @@ function grade_get_icons($element, $tree) {
$html .= '<img src="'.$CFG->pixpath.'/t/'.$expand_contract.'.gif" class="iconsmall" alt="'
.${'str' . $expand_contract}.'" title="'.${'str' . $expand_contract}.'" /></a>'. "\n";
}
} else {
} else { // Editing mode is off
if ($shownotes) {
// Display view feedback icon
if (!empty($object->feedback)) {
+9 -7
View File
@@ -266,8 +266,8 @@ div.groupselector {
}
#participationreport .reporttable {
text-align: center;
margin-left:auto;
text-align: center;
margin-left:auto;
margin-right:auto;
}
@@ -722,9 +722,9 @@ table.navbar {
#navmenupopup option,
#navmenufooterpopup option {
padding: 2px 0 2px 20px;
background-repeat: no-repeat;
background-position: 1px 2px;
padding: 2px 0 2px 20px;
background-repeat: no-repeat;
background-position: 1px 2px;
vertical-align: middle;
}
@@ -2055,6 +2055,8 @@ body#grade-index .grades .weighted {
#grade-report table {
border-width:1px;
border-style:solid;
float: left;
margin-top: 20px;
}
#grade-report table td {
@@ -2369,7 +2371,7 @@ body#message-messages {
font-weight: bolder;
}
.notepost .header {
.notepost .header {
}
.notepost .user {
@@ -3471,7 +3473,7 @@ body#mod-quiz-report .controls {
}
.resourcecontent object {
height:480px;
height:480px;
width:600px;
}