Portfolio: MDL-20884 - make assignment portfolio implementation use paths relative to dirroot

This commit is contained in:
Penny Leach 2009-11-18 09:37:33 +00:00
parent 6f5099eab4
commit b07e1666c0

View File

@ -3379,8 +3379,8 @@ class assignment_portfolio_caller extends portfolio_module_caller_base {
throw new portfolio_caller_exception('invalidid', 'assignment');
}
$this->assignmentfile = $CFG->dirroot . '/mod/assignment/type/' . $assignment->assignmenttype . '/assignment.class.php';
require_once($this->assignmentfile);
$this->assignmentfile = '/mod/assignment/type/' . $assignment->assignmenttype . '/assignment.class.php';
require_once($CFG->dirroot . $this->assignmentfile);
$assignmentclass = "assignment_$assignment->assignmenttype";
$this->assignment = new $assignmentclass($this->cm->id, $assignment, $this->cm);
@ -3428,7 +3428,7 @@ class assignment_portfolio_caller extends portfolio_module_caller_base {
if (empty($CFG)) {
return true; // too early yet
}
require_once($this->assignmentfile);
require_once($CFG->dirroot . $this->assignmentfile);
$this->assignment = unserialize(serialize($this->assignment));
}