[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/mod/hotpot/ -> grade.php (source)

   1  <?php  // $Id: grade.php,v 1.1 2007/08/06 05:31:17 moodler Exp $
   2  
   3      require_once('../../config.php');
   4  
   5      $id   = required_param('id', PARAM_INT);          // Course module ID
   6  
   7      if (! $cm = get_coursemodule_from_id('hotpot', $id)) {
   8          error("Course Module ID was incorrect");
   9      }
  10  
  11      if (! $hotpot = get_record("hotpot", "id", $cm->instance)) {
  12          error("hotpot ID was incorrect");
  13      }
  14  
  15      if (! $course = get_record("course", "id", $hotpot->course)) {
  16          error("Course is misconfigured");
  17      }
  18  
  19      require_login($course->id, false);
  20  
  21      // mod/hotpot/lib.php is required for the "hotpot_is_visible" function
  22      // the "require_once" should come after "require_login", to ensure language strings are correct 
  23      require_once($CFG->dirroot.'/mod/hotpot/lib.php');
  24  
  25      // check user can access this hotpot activity
  26      if (!hotpot_is_visible($cm)) {
  27          print_error("activityiscurrentlyhidden");
  28      }
  29  
  30      if (has_capability('mod/hotpot:grade', get_context_instance(CONTEXT_MODULE, $cm->id))) {
  31          redirect('report.php?id='.$cm->id);
  32      } else {
  33          redirect('view.php?id='.$cm->id);
  34      }
  35  
  36  ?>


Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7