/// listing of all site outcomes + this course specific outcomes
$outcomes = get_records_sql('SELECT * FROM '.$CFG->prefix.'grade_outcomes
- WHERE courseid < 1');
-
+ WHERE ISNULL(courseid)');
+ // outcomes used in this course
$courseoutcomes = get_records_sql('SELECT go.id, go.fullname
FROM '.$CFG->prefix.'grade_outcomes_courses goc,
'.$CFG->prefix.'grade_outcomes go
} elseif ($mcourseoutcomes = get_records('grade_outcomes', 'courseid', $courseid)) {
$courseoutcomes += $mcourseoutcomes;
}
-
+
check_theme_arrows();
include_once('course.html');
$table->setup();
- foreach ($outcomes as $outcome) {
+ while ($outcome = rs_fetch_next_record($outcomes)) {
$data = array();
// full name of the outcome
- $data[] = $outcome['fullname'];
+ $data[] = $outcome->fullname;
// full name of the scale used by this outcomes
- $scale= get_record('scale', 'id', $outcome['scaleid']);
+ $scale= get_record('scale', 'id', $outcome->scaleid);
$data[] = $scale->name;
if (has_capability('gradereport/outcomes:manage', get_context_instance(CONTEXT_COURSE, $courseid))) {
// add operations
- $data[] = '<a href="editoutcomes.php?id='.$outcome['id'].'&courseid='.$courseid.'&sesskey='.sesskey().'"><img alt="Update" class="iconsmall" src="'.$CFG->wwwroot.'/pix/t/edit.gif"/></a>
- <a href="course.php?deleteid='.$outcome['id'].'&id='.$courseid.'&sesskey='.sesskey().'"><img alt="Delete" class="iconsmall" src="'.$CFG->wwwroot.'/pix/t/delete.gif"/></a>'; // icons and links
+ $data[] = '<a href="editoutcomes.php?id='.$outcome->id.'&courseid='.$courseid.'&sesskey='.sesskey().'"><img alt="Update" class="iconsmall" src="'.$CFG->wwwroot.'/pix/t/edit.gif"/></a>
+ <a href="course.php?deleteid='.$outcome->id.'&id='.$courseid.'&sesskey='.sesskey().'"><img alt="Delete" class="iconsmall" src="'.$CFG->wwwroot.'/pix/t/delete.gif"/></a>'; // icons and links
} else {
$data[] = '';
}
// num of gradeitems using this
- $num = count_records('grade_items', 'outcomeid' ,$outcome['id']);
+ $num = count_records('grade_items', 'outcomeid' ,$outcome->id);
$data[] = (int) $num;
// num of courses using this outcome
$table->setup();
- foreach ($outcomes as $outcome) {
+ while ($outcome = rs_fetch_next_record($outcomes)) {
$data = array();
// full name of the outcome
- $data[] = $outcome['fullname'];
+ $data[] = $outcome->fullname;
// full name of the scale used by this outcomes
- $scale= get_record('scale', 'id', $outcome['scaleid']);
+ $scale= get_record('scale', 'id', $outcome->scaleid);
$data[] = $scale->name;
// get course
- if ($outcome['courseid']) {
- $course = get_record('course', 'id', $outcome['courseid']);
+ if ($outcome->courseid) {
+ $course = get_record('course', 'id', $outcome->courseid);
$data[] = $course->shortname;
} else {
$data[] = get_string('site');
// add operations
if (has_capability('gradereport/outcomes:manage', get_context_instance(CONTEXT_SYSTEM))) {
- $data[] = '<a href="editoutcomes.php?id='.$outcome['id'].'&sesskey='.sesskey().'"><img alt="Update" class="iconsmall" src="'.$CFG->wwwroot.'/pix/t/edit.gif"/></a>
- <a href="site.php?deleteid='.$outcome['id'].'&sesskey='.sesskey().'"><img alt="Delete" class="iconsmall" src="'.$CFG->wwwroot.'/pix/t/delete.gif"/></a>'; // icons and links
+ $data[] = '<a href="editoutcomes.php?id='.$outcome->id.'&sesskey='.sesskey().'"><img alt="Update" class="iconsmall" src="'.$CFG->wwwroot.'/pix/t/edit.gif"/></a>
+ <a href="site.php?deleteid='.$outcome->id.'&sesskey='.sesskey().'"><img alt="Delete" class="iconsmall" src="'.$CFG->wwwroot.'/pix/t/delete.gif"/></a>'; // icons and links
} else {
$data[] = '';
}
// num of gradeitems using this
- $num = count_records('grade_items', 'outcomeid' ,$outcome['id']);
+ $num = count_records('grade_items', 'outcomeid' ,$outcome->id);
$data[] = (int) $num;
// num of courses using this outcome
- $num = count_records('grade_outcomes_courses', 'outcomeid', $outcome['id']);
+ $num = count_records('grade_outcomes_courses', 'outcomeid', $outcome->id);
$data[] = (int) $num;
$table->add_data($data);