Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions btec.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@
$data = $DB->get_records_sql("SELECT gbf.id AS ggfid, crs.shortname AS course, asg.name AS assignment, gd.name AS btec,
gbc.shortname, gbf.score, gbf.remark, gbf.criterionid, marker.username AS grader,
stu.id AS userid, stu.idnumber AS idnumber, stu.firstname, stu.lastname,
stu.username AS student, gin.timemodified AS modified,ag.id, ag.grade,
afc.commenttext
stu.username AS student, gin.timemodified AS modified, ag.id, ag.grade AS grade, asg.grade AS maxgrade,
afc.commenttext AS feedback
FROM {course} crs
JOIN {course_modules} cm ON crs.id = cm.course
JOIN {assign} asg ON asg.id = cm.instance
JOIN {context} c ON cm.id = c.instanceid
JOIN {grading_areas} ga ON c.id=ga.contextid
JOIN {grading_areas} ga ON c.id = ga.contextid
JOIN {grading_definitions} gd ON ga.id = gd.areaid
JOIN {gradingform_btec_criteria} gbc ON (gbc.definitionid = gd.id)
JOIN {grading_instances} gin ON gin.definitionid = gd.id
JOIN {assign_grades} ag ON ag.id = gin.itemid
JOIN {assignfeedback_comments} afc on ag.id=afc.grade
JOIN {assignfeedback_comments} afc on ag.id = afc.grade
JOIN {user} stu ON stu.id = ag.userid
JOIN {user} marker ON marker.id = gin.raterid
JOIN {gradingform_btec_fillings} gbf ON (gbf.instanceid = gin.id)
Expand Down
10 changes: 7 additions & 3 deletions guide.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@
$filename = $course->shortname . ' - ' . $cm->name . '.xls';

$data = $DB->get_records_sql("SELECT ggf.id AS ggfid, crs.shortname AS course, asg.name AS assignment, gd.name AS guide,
ggc.shortname, ggf.score, ggf.remark, ggf.criterionid, rubm.username AS grader,
ggc.shortname, ggf.score, ggc.maxscore, ggf.remark, ggf.criterionid, rubm.username AS grader,
stu.id AS userid, stu.idnumber AS idnumber, stu.firstname, stu.lastname,
stu.username AS student, gin.timemodified AS modified
stu.username AS student, gin.timemodified AS modified, ag.grade AS grade, asg.grade AS maxgrade,
afc.commenttext AS feedback
FROM {course} crs
JOIN {course_modules} cm ON crs.id = cm.course
JOIN {assign} asg ON asg.id = cm.instance
Expand All @@ -69,6 +70,7 @@
JOIN {gradingform_guide_criteria} ggc ON (ggc.definitionid = gd.id)
JOIN {grading_instances} gin ON gin.definitionid = gd.id
JOIN {assign_grades} ag ON ag.id = gin.itemid
JOIN {assignfeedback_comments} AS afc ON ag.id = afc.grade
JOIN {user} stu ON stu.id = ag.userid
JOIN {user} rubm ON rubm.id = gin.raterid
JOIN {gradingform_guide_fillings} ggf ON (ggf.instanceid = gin.id)
Expand Down Expand Up @@ -100,9 +102,11 @@
break;
}
$sheet->write_string(TITLESROW, $pos, $line->shortname, $format);
$sheet->merge_cells(TITLESROW, $pos, 4, $pos + 1, $format);
$sheet->merge_cells(TITLESROW, $pos, 4, $pos + 2, $format);
$sheet->write_string(5, $pos, get_string('score', 'report_componentgrades'), $format2);
$sheet->set_column($pos, $pos++, 6); // Set column width to 6.
$sheet->write_string(5, $pos, get_string('outof', 'report_componentgrades'), $format2);
$sheet->set_column($pos, $pos++, 6); // Set column width to 6.
$sheet->write_string(5, $pos, get_string('feedback', 'report_componentgrades'), $format2);
$sheet->set_column($pos, $pos++, 10); // Set column widths to 10.
}
Expand Down
2 changes: 2 additions & 0 deletions lang/en/report_componentgrades.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
$string['score'] = 'Score';
$string['definition'] = 'Definition';
$string['feedback'] = 'Feedback';
$string['grade'] = 'Final grade';
$string['outof'] = 'Out of';
$string['nogradesenteredrubric'] = "No grades have been entered into this assignment's rubric.";
$string['nogradesenteredguide'] = "No grades have been entered into this assignment's marking guide.";
$string['nobtecgrades'] = "No grades have been entered into this assignment's BTEC marking.";
Expand Down
21 changes: 18 additions & 3 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,13 @@ function report_componentgrades_finish_colheaders($workbook, $sheet, $pos) {
$sheet->write_string(HEADINGSROW, $pos, get_string('gradedby', 'report_componentgrades'), $format2);
$sheet->set_column($pos, $pos++, 10); // Set column width to 10.
$sheet->write_string(HEADINGSROW, $pos, get_string('timegraded', 'report_componentgrades'), $format2);
$sheet->set_column($pos, $pos, 17.5); // Set column width to 17.5.
$sheet->set_column($pos, $pos++, 17.5); // Set column width to 17.5.
$sheet->write_string(5, $pos, get_string('grade', 'report_componentgrades'), $format2);
$sheet->set_column($pos, $pos++, 10); // Set column width to 10
$sheet->write_string(5, $pos, get_string('outof', 'report_componentgrades'), $format2);
$sheet->set_column($pos, $pos++, 6); // Set column width to 6
$sheet->write_string(5, $pos, get_string('feedback', 'report_componentgrades'), $format2);
$sheet->set_column($pos, $pos++, 17.5); // Set column width to 17.5
$sheet->merge_cells(4, $pos - 1, 4, $pos);

$sheet->set_row(4, 15, $format);
Expand Down Expand Up @@ -183,7 +189,7 @@ function report_componentgrades_add_data(MoodleExcelWorksheet $sheet, array $stu
$sheet->write_string($row, $col++, $student->idnumber);
}
if (get_config('report_componentgrades', 'showgroups')) {
if (!is_null($groups)) {
if (!empty($groups)) {
if (isset($groups[$student->userid])) {
$sheet->write_string($row, $col++, implode(', ', $groups[$student->userid]));
} else {
Expand All @@ -199,6 +205,9 @@ function report_componentgrades_add_data(MoodleExcelWorksheet $sheet, array $stu
/* if BTEC 0=N and 1=Y */
$sheet->write_string($row, $col++, $line->score);
}
if (is_numeric($line->maxscore)) {
$sheet->write_number($row, $col++, $line->maxscore);
}
if ($method == 'rubric') {
// Only rubrics have a "definition".
$sheet->write_string($row, $col++, $line->definition);
Expand All @@ -218,7 +227,13 @@ function report_componentgrades_add_data(MoodleExcelWorksheet $sheet, array $stu
$sheet->set_column($col, $col, 15);
$sheet->write_string($row, $col++, $line->grader);
$sheet->set_column($col, $col, 35);
$sheet->write_string($row, $col, userdate($line->modified));
$sheet->write_string($row, $col++, userdate($line->modified));
$sheet->set_column($col, $col, 13);
$sheet->write_number($row, $col++, round($line->grade, 2));
$sheet->set_column($col, $col, 8);
$sheet->write_number($row, $col++, $line->maxgrade);
$sheet->set_column($col, $col, 14);
$sheet->write_string($row, $col++, strip_tags($line->feedback));
}
}
}
Expand Down
11 changes: 8 additions & 3 deletions rubric.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@
$filename = $course->shortname . ' - ' . $cm->name . '.xls';

$data = $DB->get_records_sql("SELECT grf.id AS grfid, crs.shortname AS course, asg.name AS assignment, gd.name AS rubric,
grc.description, grl.definition, grl.score, grf.remark, grf.criterionid,
grc.description, grl.definition, grl.score, cms.max AS maxscore, grf.remark, grf.criterionid,
rubm.username AS grader, stu.id AS userid, stu.idnumber AS idnumber, stu.firstname,
stu.lastname, stu.username AS student, gin.timemodified AS modified
stu.lastname, stu.username AS student, gin.timemodified AS modified, ag.grade AS grade, asg.grade AS maxgrade,
afc.commenttext AS feedback
FROM {course} crs
JOIN {course_modules} cm ON crs.id = cm.course
JOIN {assign} asg ON asg.id = cm.instance
Expand All @@ -71,9 +72,11 @@
JOIN {gradingform_rubric_levels} grl ON (grl.criterionid = grc.id)
JOIN {grading_instances} gin ON gin.definitionid = gd.id
JOIN {assign_grades} ag ON ag.id = gin.itemid
JOIN {assignfeedback_comments} afc ON ag.id = afc.grade
JOIN {user} stu ON stu.id = ag.userid
JOIN {user} rubm ON rubm.id = gin.raterid
JOIN {gradingform_rubric_fillings} grf ON (grf.instanceid = gin.id)
JOIN (SELECT max(score), criterionid FROM mdl_gradingform_rubric_levels Group by criterionid) cms ON cms.criterionid = grc.id
AND (grf.criterionid = grc.id) AND (grf.levelid = grl.id)
WHERE cm.id = ? AND gin.status = 1
ORDER BY lastname ASC, firstname ASC, userid ASC, grc.sortorder ASC,
Expand Down Expand Up @@ -101,9 +104,11 @@
break;
}
$sheet->write_string(TITLESROW, $pos, $line->description, $format);
$sheet->merge_cells(TITLESROW, $pos, TITLESROW, $pos + 2, $format);
$sheet->merge_cells(TITLESROW, $pos, TITLESROW, $pos + 3, $format);
$sheet->write_string(HEADINGSROW, $pos, get_string('score', 'report_componentgrades'), $format2);
$sheet->set_column($pos, $pos++, 6); // Set column width to 6.
$sheet->write_string(HEADINGSROW, $pos, get_string('outof', 'report_componentgrades'), $format2);
$sheet->set_column($pos, $pos++, 6); // Set column width to 6.
$sheet->write_string(HEADINGSROW, $pos++, get_string('definition', 'report_componentgrades'), $format2);
$sheet->write_string(HEADINGSROW, $pos, get_string('feedback', 'report_componentgrades'), $format2);
$sheet->set_column($pos - 1, $pos++, 10); // Set column widths to 10.
Expand Down