MDL-15758: fixing regressions i introduced in lib.php v 1.359

This commit is contained in:
mjollnir_ 2008-09-09 21:06:19 +00:00
parent 53aa4841c4
commit a97bcd684c
3 changed files with 11 additions and 3 deletions

View file

@ -89,6 +89,7 @@ $string['itemstocount'] = 'Count';
$string['invalidid'] = 'assignment ID was incorrect';
$string['invalidassignment'] = 'incorrect assignment';
$string['invalidtype']= 'Incorrect assignment type';
$string['invaliduserid'] = 'Invalid user ID';
$string['late'] = '$a late';
$string['maximumgrade'] = 'Maximum grade';
$string['maximumsize'] = 'Maximum size';

View file

@ -1707,6 +1707,7 @@ class assignment_base {
if ($files = $fs->get_area_files($this->context->id, 'assignment_submission', $userid, "timemodified", false)) {
$p = array(
'assignmentid' => $this->cm->id,
'userid' => $USER->id,
);
foreach ($files as $file) {
$filename = $file->get_filename();
@ -3145,7 +3146,6 @@ class assignment_portfolio_caller extends portfolio_module_caller_base {
private $assignment;
private $assignmentfile;
private $userid;
private $file;
private $files;
@ -3160,6 +3160,12 @@ class assignment_portfolio_caller extends portfolio_module_caller_base {
throw new portfolio_caller_exception('invalidid', 'assignment');
}
if (!array_key_exists('userid', $callbackargs)) {
throw new portfolio_caller_exception('invaliduserid', 'assignment');
}
if (!$this->user = $DB->get_record('user', array('id' => $callbackargs['userid']))) {
throw new portfolio_caller_exception('invaliduserid', 'assignment');
}
$this->assignmentfile = $CFG->dirroot . '/mod/assignment/type/' . $assignment->assignmenttype . '/assignment.class.php';
require_once($this->assignmentfile);
$assignmentclass = "assignment_$assignment->assignmenttype";
@ -3211,7 +3217,7 @@ class assignment_portfolio_caller extends portfolio_module_caller_base {
}
public function expected_time() {
if (is_callable(array($this->assignmnet, 'portfolio_get_expected_time'))) {
if (is_callable(array($this->assignment, 'portfolio_get_expected_time'))) {
return $this->assignment->portfolio_get_expected_time();
}
if (is_array($this->files)) {

View file

@ -344,6 +344,7 @@ class assignment_upload extends assignment_base {
if ($files = $fs->get_area_files($this->context->id, 'assignment_submission', $userid, "timemodified", false)) {
$p = array(
'assignmentid' => $this->cm->id,
'userid' => $USER->id,
);
foreach ($files as $file) {
$filename = $file->get_filename();