|
@@ -2067,22 +2067,27 @@ class iassign {
|
|
|
$str .= '"' . $iassign->name . '",';
|
|
|
|
|
|
$student_submissions = $DB->get_record("iassign_submission", array('iassign_statementid' => $iassign->id, 'userid' => $student->userid));
|
|
|
- $str .= $student_submissions->experiment . ',';
|
|
|
- $str .= $student_submissions->grade . ',';
|
|
|
- switch ($student_submissions->status) {
|
|
|
- case 3:
|
|
|
- $str .= '"correct",';
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- $str .= '"incorrect",';
|
|
|
- break;
|
|
|
- case 1:
|
|
|
- $str .= '"post",';
|
|
|
- break;
|
|
|
- case 0:
|
|
|
- $str .= '"not_post",';
|
|
|
- break;
|
|
|
+ if ($student_submissions) {
|
|
|
+ $str .= $student_submissions->experiment . ',';
|
|
|
+ $str .= $student_submissions->grade . ',';
|
|
|
+ switch ($student_submissions->status) {
|
|
|
+ case 3:
|
|
|
+ $str .= '"correct",';
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ $str .= '"incorrect",';
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ $str .= '"post",';
|
|
|
+ break;
|
|
|
+ case 0:
|
|
|
+ $str .= '"not_post",';
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $str .= ',,"not_post",';
|
|
|
}
|
|
|
+
|
|
|
$str .= $iassign->iassign_ilmid . ',';
|
|
|
|
|
|
$ilm_activity = $DB->get_record("iassign_ilm", array('id' => $iassign->iassign_ilmid));
|
|
@@ -2091,6 +2096,7 @@ class iassign {
|
|
|
$str .= "\n";
|
|
|
}
|
|
|
$str = $fields . "\n" . $str;
|
|
|
+ header("Content-type: text/csv");
|
|
|
header("Content-disposition: attachment; filename=report.csv");
|
|
|
header("Pragma: no-cache");
|
|
|
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
|