mirror of
https://github.com/moodle/moodle.git
synced 2025-02-26 21:13:33 +01:00
============================ This new assignment module allows Plugin Assignment types. This should allow a whole lot of new stuff to easily be placed in Moodle without making the modules list longer for no good reason. This checkin is still a really rough version that needs work on it. Normally I would want it better than this to check in, but I need to collaborate with Shane on the remaining code and CVS is the best way. Give it a day or two to settle in. :-) This is the last thing I wanted to get into 1.5. Getting close now!! Cheers! Martin
41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?php // $Id$
|
|
// 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()) {
|
|
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);
|
|
}
|
|
|
|
/// Set up things for a HTML editor if it's needed
|
|
|
|
if ($usehtmleditor = can_use_html_editor()) {
|
|
$defaultformat = FORMAT_HTML;
|
|
$editorfields = '';
|
|
} else {
|
|
$defaultformat = FORMAT_MOODLE;
|
|
}
|
|
|
|
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
|
|
|
|
|
|
?>
|