1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-23 09:23:09 +02:00

reverting last commit, expect new fixes soon

This commit is contained in:
skodak 2006-09-28 15:34:54 +00:00
parent b7b0afb87f
commit 8ba4cbd2a3
3 changed files with 1010 additions and 1001 deletions

File diff suppressed because it is too large Load Diff

@ -4,11 +4,11 @@
$id = optional_param('id'); // Course module ID
$a = optional_param('a'); // Assignment ID
$sesskey = required_param('sesskey', PARAM_ALPHANUM);
if (!confirm_sesskey()) {
error('Bad Session Key');
}
$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)) {
@ -33,12 +33,15 @@
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
$assignmentinstance->deleteonesubmission() // delete file
?>

@ -1,60 +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 = '';
}
//declaring $options[]
$options[0] = get_string("no");
$options[1] = get_string("yes");
?>
<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
choose_from_menu($options, "var1", $form->var1, "");
?>
</td>
</tr>
<tr>
<td align="right"><b><?php print_string("allowresubmit", "assignment") ?>:</b></td>
<td>
<?php
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>
</table>
<center>
<br />
<input type="submit" value="<?php print_string("continue") ?>" />
</center>
<?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>