File: details.php

package info (click to toggle)
moodle 1.6.3-2%2Betch3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 37,172 kB
  • ctags: 51,688
  • sloc: php: 231,916; sql: 5,631; xml: 2,688; sh: 1,185; perl: 638; makefile: 48; pascal: 36
file content (33 lines) | stat: -rw-r--r-- 1,037 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php // $Id: details.php,v 1.5 2005/07/05 05:49:13 skodak Exp $
      // This script prints the setup screen for any assignment
      // It does this by calling the setup method in the appropriate class

    require_once("../../config.php");
    require_once("lib.php");

    if (!$form = data_submitted($CFG->wwwroot.'/course/mod.php')) {
        error("This script was called wrongly");
    }

    if (!$course = get_record('course', 'id', $form->course)) {
        error("Non-existent course!");
    }

    require_login($course->id);

    if (!isteacheredit($course->id)) {
        redirect($CFG->wwwroot.'/course/view.php?id='.$course->id);
    }

    $form->assignmenttype = clean_param($form->assignmenttype, PARAM_SAFEDIR);

    require_once("$CFG->dirroot/mod/assignment/type/$form->assignmenttype/assignment.class.php");

    $assignmentclass = "assignment_$form->assignmenttype";

    $assignmentinstance = new $assignmentclass();

    echo $assignmentinstance->setup($form);     /// The actual form is all printed here


?>