Permalink
Browse files

SCORM Gradebook MDL-22332 add missing grade file to redirect to repor…

…t page - thanks to Valerian for report/patch merged from HEAD
  • Loading branch information...
danmarsden committed Jun 23, 2010
1 parent 9b312b9 commit da98ba3d73919ee20121288df7fc33b7ebab05a2
Showing with 25 additions and 0 deletions.
  1. +25 −0 mod/scorm/grade.php
View
@@ -0,0 +1,25 @@
+<?php
+
+ require_once("../../config.php");
+
+ $id = required_param('id', PARAM_INT); // Course module ID
+
+ if (! $cm = get_coursemodule_from_id('scorm', $id)) {
+ error('Course Module ID was incorrect');
+ }
+
+ if (! $scorm = get_record('scorm', 'id',$cm->instance)) {
+ error('scorm ID was incorrect');
+ }
+
+ if (! $course = get_record('course','id', $scorm->course)) {
+ error('Course is misconfigured');
+ }
+
+ require_login($course->id, false, $cm);
+
+ if (has_capability('mod/scorm:viewreport', get_context_instance(CONTEXT_MODULE, $cm->id))) {
+ redirect('report.php?id='.$cm->id);
+ } else {
+ redirect('view.php?id='.$cm->id);
+ }

0 comments on commit da98ba3

Please sign in to comment.