trailing whitespace cleanup again

This commit is contained in:
skodak 2007-07-05 21:42:34 +00:00
parent f943f4fd00
commit eda77debe3
7 changed files with 49 additions and 49 deletions

View File

@ -46,11 +46,11 @@ if ($mform->is_cancelled()) {
}
// Get extra data related to this feedback
$query = "SELECT a.id AS userid, a.firstname, a.lastname,
$query = "SELECT a.id AS userid, a.firstname, a.lastname,
b.id AS itemid, b.itemname, b.grademin, b.grademax, b.iteminstance, b.itemmodule, b.scaleid,
c.finalgrade
FROM {$CFG->prefix}user a,
{$CFG->prefix}grade_items b,
c.finalgrade
FROM {$CFG->prefix}user a,
{$CFG->prefix}grade_items b,
{$CFG->prefix}grade_grades c
WHERE c.id = $id
AND b.id = c.itemid
@ -87,7 +87,7 @@ $navigation = build_navigation($nav);
/*********** BEGIN OUTPUT *************/
print_header_simple($strgrades . ': ' . $strgraderreport . ': ' . $heading,
print_header_simple($strgrades . ': ' . $strgraderreport . ': ' . $heading,
': ' . $heading , $navigation, '', '', true, '', navmenu($course));
print_heading($heading);
@ -95,11 +95,11 @@ print_heading($heading);
print_simple_box_start("center");
// Student name and link
echo "<p><strong>$strstudent:</strong> <a href=\"" . $CFG->wwwroot . '/user/view.php?id='
echo "<p><strong>$strstudent:</strong> <a href=\"" . $CFG->wwwroot . '/user/view.php?id='
. $extra_info->userid . '">' . fullname($extra_info) . "</a></p>";
// Grade item name and link
echo "<p><strong>$strgradeitem:</strong> <a href=\"" . $CFG->wwwroot . '/mod/' . $extra_info->itemmodule
// Grade item name and link
echo "<p><strong>$strgradeitem:</strong> <a href=\"" . $CFG->wwwroot . '/mod/' . $extra_info->itemmodule
. '/view.php?id=' . $extra_info->course_module->id . "&amp;courseid=$courseid\">$extra_info->itemname</a></p>";
// Final grade and link to scale if applicable
@ -108,7 +108,7 @@ if (!empty($extra_info->finalgrade)) {
$closelink = '';
if (!empty($extra_info->scaleid)) {
$openlink = '<a href="' . $CFG->wwwroot . '/course/scales.php?id=' . $courseid . '&amp;scaleid='
$openlink = '<a href="' . $CFG->wwwroot . '/course/scales.php?id=' . $courseid . '&amp;scaleid='
. $extra_info->scaleid . '">';
$closelink = '</a>';
}

View File

@ -6,13 +6,13 @@ class edit_feedback_form extends moodleform {
function definition() {
global $CFG, $USER;
$mform =& $this->_form;
$feedbackformat = get_user_preferences('grade_report_feedbackformat', $CFG->grade_report_feedbackformat);
// visible elements
// User preference determines the format
if ($CFG->htmleditor && $USER->htmleditor && $feedbackformat == GRADER_REPORT_FEEDBACK_FORMAT_HTML) {
$mform->addElement('htmleditor', 'feedback', get_string('feedback', 'grades'),
$mform->addElement('htmleditor', 'feedback', get_string('feedback', 'grades'),
array('rows'=> '15', 'course' => optional_param('courseid', PARAM_INT), 'cols'=>'45'));
} else {
$mform->addElement('textarea', 'feedback', get_string('feedback', 'grades'));

View File

@ -9,11 +9,11 @@ include_once($CFG->libdir.'/gradelib.php');
if ($data = data_submitted()) {
foreach ($data as $varname => $postedgrade) {
// clean posted values
$postedgrade = clean_param($postedgrade, PARAM_NUMBER);
$postedgrade = clean_param($postedgrade, PARAM_NUMBER);
$varname = clean_param($varname, PARAM_RAW);
// skip, not a grade
if (!strstr($varname, 'grade')) {
continue;
@ -170,13 +170,13 @@ grade_update_final_grades($courseid);
// roles to be displaye in the gradebook
$gradebookroles = $CFG->gradebookroles;
/*
/*
* pulls out the userids of the users to be display, and sort them
* the right outer join is needed because potentially, it is possible not
* to have the corresponding entry in grade_grades table for some users
* this is check for user roles because there could be some users with grades
* but not supposed to be displayed
*/
*/
if (is_numeric($sortitemid)) {
$sql = "SELECT u.id, u.firstname, u.lastname
FROM {$CFG->prefix}grade_grades g RIGHT OUTER JOIN
@ -320,7 +320,7 @@ foreach ($gtree->levels as $key=>$row) {
// Print icons
if ($USER->gradeediting) {
$headerhtml .= grade_get_icons($element, $gtree);
$headerhtml .= grade_get_icons($element, $gtree);
}
$headerhtml .= '</td>';
@ -365,37 +365,37 @@ foreach ($gtree->levels as $key=>$row) {
}
// Prepare Table Rows
$studentshtml = '';
$studentshtml = '';
foreach ($users as $userid => $user) {
// Student name and link
$studentshtml .= '<tr><th class="user"><a href="' . $CFG->wwwroot . '/user/view.php?id='
$studentshtml .= '<tr><th class="user"><a href="' . $CFG->wwwroot . '/user/view.php?id='
. $user->id . '">' . fullname($user) . '</a></th>';
foreach ($items as $item) {
$studentshtml .= '<td>';
if (isset($finalgrades[$userid][$item->id])) {
$gradeval = $finalgrades[$userid][$item->id]->finalgrade;
// trim trailing "0"s
if (isset($gradeval)) {
if ($gradeval != 0) {
$gradeval = trim($gradeval, ".0");
$gradeval = trim($gradeval, ".0");
} else {
$gradeval = 0;
}
}
$grade = new grade_grades($finalgrades[$userid][$item->id], false);
$grade->feedback = $finalgrades[$userid][$item->id]->feedback;
} else {
// if itemtype is course or category, the grades in this item is not directly editable
// if itemtype is course or category, the grades in this item is not directly editable
if ($USER->gradeediting && $item->itemtype != 'course' && $item->itemtype != 'category') {
$gradeval ='';
} else {
} else {
$gradeval = '-';
}
$grade = new grade_grades(array('userid' => $userid, 'itemid' => $item->id), false);
@ -403,7 +403,7 @@ foreach ($users as $userid => $user) {
// if in editting mode, we need to print either a text box
// or a drop down (for scales)
// grades in item of type grade category or course are not directly editable
if ($USER->gradeediting && $item->itemtype != 'course' && $item->itemtype != 'category') {
// We need to retrieve each grade_grade object from DB in order to

View File

@ -39,7 +39,7 @@ require_login($course->id);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
require_capability('gradereport/grader:manage', $context);
// If data submitted, then process and store.
// If data submitted, then process and store.
if ($form = data_submitted()) {
foreach ($form as $preference => $value) {
switch ($preference) {

View File

@ -40,36 +40,36 @@ class grader_report_preferences_form extends moodleform {
false, get_string('configstudentsperpage', 'grades')));
$mform->setDefault('grade_report_studentsperpage', $prefs->studentsperpage);
$mform->setType('grade_report_studentsperpage', PARAM_INT);
$mform->addElement('select','grade_report_aggregationposition', get_string('aggregationposition', 'grades'),
$mform->addElement('select','grade_report_aggregationposition', get_string('aggregationposition', 'grades'),
array(get_string('left', 'grades'), get_string('right', 'grades')));
$mform->setHelpButton('grade_report_aggregationposition', array(false, get_string('aggregationposition', 'grades'), false, true,
false, get_string('configaggregationposition', 'grades')));
$mform->setDefault('grade_report_aggregationposition', $prefs->aggregationposition);
$mform->setType('grade_report_aggregationposition', PARAM_INT);
$mform->addElement('select','grade_report_aggregationview', get_string('aggregationview', 'grades'),
$mform->addElement('select','grade_report_aggregationview', get_string('aggregationview', 'grades'),
array(get_string('full', 'grades'), get_string('compact', 'grades')));
$mform->setHelpButton('grade_report_aggregationview', array(false, get_string('aggregationview', 'grades'), false, true,
false, get_string('configaggregationview', 'grades')));
$mform->setDefault('grade_report_aggregationview', $prefs->aggregationview);
$mform->setType('grade_report_aggregationview', PARAM_INT);
$mform->addElement('select','grade_report_gradedisplaytype', get_string('gradedisplaytype', 'grades'),
$mform->addElement('select','grade_report_gradedisplaytype', get_string('gradedisplaytype', 'grades'),
array(get_string('raw', 'grades'), get_string('percentage', 'grades')));
$mform->setHelpButton('grade_report_gradedisplaytype', array(false, get_string('gradedisplaytype', 'grades'), false, true,
false, get_string('configgradedisplaytype', 'grades')));
$mform->setDefault('grade_report_gradedisplaytype', $prefs->gradedisplaytype);
$mform->setType('grade_report_gradedisplaytype', PARAM_INT);
$mform->addElement('select','grade_report_feedbackformat', get_string('feedbackformat', 'grades'),
$mform->addElement('select','grade_report_feedbackformat', get_string('feedbackformat', 'grades'),
array(get_string('text', 'grades'), get_string('html', 'grades')));
$mform->setHelpButton('grade_report_feedbackformat', array(false, get_string('feedbackformat', 'grades'), false, true,
false, get_string('configfeedbackformat', 'grades')));
$mform->setDefault('grade_report_feedbackformat', $prefs->feedbackformat);
$mform->setType('grade_report_feedbackformat', PARAM_INT);
$mform->addElement('select','grade_report_decimalpoints', get_string('decimalpoints', 'grades'),
$mform->addElement('select','grade_report_decimalpoints', get_string('decimalpoints', 'grades'),
array(0, 1, 2, 3, 4, 5));
$mform->setHelpButton('grade_report_decimalpoints', array(false, get_string('decimalpoints', 'grades'), false, true,
false, get_string('configdecimalpoints', 'grades')));
@ -116,12 +116,12 @@ class grader_report_preferences_form extends moodleform {
$mform->setHelpButton('grade_report_showscales', array(false, get_string('showscales', 'grades'), false, true,
false, get_string('configshowscales', 'grades')));
$mform->setDefault('grade_report_showscales', $prefs->showscales);
$mform->setType('grade_report_showscales', PARAM_INT);
$mform->setType('grade_report_showscales', PARAM_INT);
$mform->addElement('hidden', 'id');
$mform->setDefault('id', $course->id);
$this->add_action_buttons();
$this->add_action_buttons();
}

View File

@ -2,20 +2,20 @@
/// Add settings for this module to the $settings object (it's already defined)
$settings->add(new admin_setting_configselect('grade_report_aggregationposition', get_string('aggregationposition', 'grades'),
get_string('configaggregationposition', 'grades'), false,
array( '0' => 'left',
get_string('configaggregationposition', 'grades'), false,
array( '0' => 'left',
'1' => 'right')));
$settings->add(new admin_setting_configselect('grade_report_aggregationview', get_string('aggregationview', 'grades'),
get_string('configaggregationview', 'grades'), false,
array( '0' => 'full',
get_string('configaggregationview', 'grades'), false,
array( '0' => 'full',
'1' => 'compact')));
$settings->add(new admin_setting_configcheckbox('grade_report_bulkcheckboxes', get_string('bulkcheckboxes', 'grades'),
get_string('configbulkcheckboxes', 'grades'), 0));
$settings->add(new admin_setting_configcheckbox('grade_report_enableajax', get_string('enableajax', 'grades'),
get_string('configenableajax', 'grades'), 0));
$settings->add(new admin_setting_configselect('grade_report_gradedisplaytype', get_string('gradedisplaytype', 'grades'),
get_string('configgradedisplaytype', 'grades'), false,
array( '0' => 'raw',
get_string('configgradedisplaytype', 'grades'), false,
array( '0' => 'raw',
'1' => 'percentage')));
$settings->add(new admin_setting_configcheckbox('grade_report_showeyecons', get_string('showeyecons', 'grades'),
get_string('configshoweyecons', 'grades'), 0));
@ -30,16 +30,16 @@ $settings->add(new admin_setting_configcheckbox('grade_report_showscales', get_s
$settings->add(new admin_setting_configtext('grade_report_studentsperpage', get_string('studentsperpage', 'grades'),
get_string('configstudentsperpage', 'grades'), 20));
$settings->add(new admin_setting_configselect('grade_report_feedbackformat', get_string('feedbackformat', 'grades'),
get_string('configfeedbackformat', 'grades'), false,
array( '0' => 'text',
get_string('configfeedbackformat', 'grades'), false,
array( '0' => 'text',
'1' => 'html')));
$settings->add(new admin_setting_configselect('grade_report_decimalpoints', get_string('decimalpoints', 'grades'),
get_string('configdecimalpoints', 'grades'), 2,
array( '0' => '0',
get_string('configdecimalpoints', 'grades'), 2,
array( '0' => '0',
'1' => '1',
'2' => '2',
'3' => '3',
'4' => '4',
'5' => '5')));
'5' => '5')));
?>

View File

@ -53,7 +53,7 @@ $numusers = count(get_role_users(@implode(',', $CFG->gradebookroles), $context))
));
$table->setup();
// print the page
print_heading(get_string('userreport', 'grades'). " - ".fullname($user));