Integrating the "AU Assignment type" into Moodle (which was based on
Upload&Review).
It's not tested and probably needs polishing, but people seem to love it
as it is.
http://moodle.org/mod/forum/discuss.php?d=46829
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
Athabasca University (AU) assignment type
|
||||
-----------------------------------------
|
||||
|
||||
INFORMATION
|
||||
-----------
|
||||
|
||||
This module has been successfully tested for Moodle versions:
|
||||
|
||||
- 1.5.3
|
||||
|
||||
- 1.5.4 (yes)
|
||||
|
||||
- 1.6 (yes, but not by me)
|
||||
|
||||
Information about this type can be found here http://webunit.cs.athabascau.ca/moodle/au_adb_functionality/
|
||||
|
||||
Zipped code can be found here
|
||||
http://webunit.cs.athabascau.ca/moodle/moodle_files_folder/AU_type.zip/file_view
|
||||
and on Moodle CVS
|
||||
|
||||
Additional thanks to the guys who developed "Upload&Review" and "Upload files" assignment types. Their code I was using as a base code for my assignment type.
|
||||
|
||||
-- Oksana Yasynska
|
||||
|
||||
|
||||
|
||||
INTEGRATION
|
||||
----------
|
||||
|
||||
This code was integrated into Moodle core distribution on 13th July, 2006.
|
||||
|
||||
All I've done is a search/replace to change the name from "AU" to "upload".
|
||||
|
||||
It probably still needs work ;-)
|
||||
|
||||
Thanks, Oksana!
|
||||
|
||||
-- Martin Dougiamas
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
require_once("../../../../config.php");
|
||||
require_once("../../lib.php");
|
||||
|
||||
$id = optional_param('id'); // Course module ID
|
||||
$a = optional_param('a'); // Assignment ID
|
||||
$userid = required_param('userid');
|
||||
$file = optional_param('file', '', PARAM_PATH);
|
||||
$name = optional_param('name', '', PARAM_FILE);
|
||||
$offset = optional_param('offset');
|
||||
$view = optional_param('view'); //teacher or student view
|
||||
|
||||
if ($id) {
|
||||
if (! $cm = get_record("course_modules", "id", $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
|
||||
if (! $assignment = get_record("assignment", "id", $cm->instance)) {
|
||||
error("assignment ID was incorrect");
|
||||
}
|
||||
|
||||
if (! $course = get_record("course", "id", $assignment->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
} else {
|
||||
if (!$assignment = get_record("assignment", "id", $a)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $assignment->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $cm = get_coursemodule_from_instance("assignment", $assignment->id, $course->id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
|
||||
/// Load up the required assignment code
|
||||
|
||||
require($CFG->dirroot.'/mod/assignment/type/'.$assignment->assignmenttype.'/assignment.class.php');
|
||||
$assignmentclass = 'assignment_'.$assignment->assignmenttype;
|
||||
$assignmentinstance = new $assignmentclass($cm->id, $assignment, $cm, $course);
|
||||
|
||||
$assignmentinstance->deleteonesubmission() // delete file
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
if (empty($form->resubmit)) {
|
||||
$form->resubmit = 0; //upload&rev: =1
|
||||
}
|
||||
if (empty($form->maxbytes)) {
|
||||
$form->maxbytes = $CFG->assignment_maxbytes;
|
||||
}
|
||||
if (empty($form->emailteachers)) {
|
||||
$form->emailteachers = '';
|
||||
}
|
||||
//allow multiple files (from new upload type)
|
||||
if (empty($form->var1)) {
|
||||
$form->var1 = 0;
|
||||
}
|
||||
//email to students (from upload&review)
|
||||
if (empty($form->var2)) {
|
||||
$form->var2 = '';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<table align="center" cellpadding="5" cellspacing="0">
|
||||
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string("maximumsize", "assignment") ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$choices = get_max_upload_sizes($CFG->maxbytes, $this->course->maxbytes);
|
||||
choose_from_menu ($choices, "maxbytes", $form->maxbytes, "");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string("allowmultiple", "assignment") ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options[0] = get_string("no"); $options[1] = get_string("yes");
|
||||
choose_from_menu($options, "var1", $form->var1, "");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string("allowresubmit", "assignment") ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options[0] = get_string("no"); $options[1] = get_string("yes");
|
||||
choose_from_menu($options, "resubmit", $form->resubmit, ""); //that's how it's un U&R
|
||||
// choose_from_menu($options, "var2", $form->var2, "");
|
||||
helpbutton("resubmit", get_string("allowresubmit", "assignment"), "assignment");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string("emailteachers", "assignment") ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options[0] = get_string("no"); $options[1] = get_string("yes");
|
||||
choose_from_menu($options, "emailteachers", $form->emailteachers, "");
|
||||
helpbutton("emailteachers", get_string("emailteachers", "assignment"), "assignment");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string("emailstudents", "assignment") ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options[0] = get_string("no"); $options[1] = get_string("yes");
|
||||
choose_from_menu($options, "var2", $form->var2, "");
|
||||
// choose_from_menu($options, "emailstudents", $form->emailstudents, "");
|
||||
helpbutton("emailstudents", get_string("emailstudents", "assignment"), "assignment");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<center>
|
||||
<br />
|
||||
<input type="submit" value="<?php print_string("continue") ?>" />
|
||||
</center>
|
||||
Reference in New Issue
Block a user