Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cleaning as assignment types SC#182 continued; merged from MOODLE_15_…

…STABLE
  • Loading branch information...
commit 200c19fb8ce36e7d13027915ddee0b95596ac2c4 1 parent de4564e
skodak authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 mod/assignment/lib.php
View
8 mod/assignment/lib.php
@@ -322,8 +322,6 @@ function add_instance($assignment) {
// will create a new instance and return the id number
// of the new instance.
- $assignment->assignmenttype = clean_param($assignment->assignmenttype, PARAM_SAFEDIR);
-
$assignment->timemodified = time();
if (empty($assignment->dueenable)) {
$assignment->timedue = 0;
@@ -387,8 +385,6 @@ function update_instance($assignment) {
// will create a new instance and return the id number
// of the new instance.
- $assignment->assignmenttype = clean_param($assignment->assignmenttype, PARAM_SAFEDIR);
-
$assignment->timemodified = time();
$assignment->timemodified = time();
if (empty($assignment->dueenable)) {
@@ -1415,6 +1411,8 @@ function assignment_delete_instance($id){
function assignment_update_instance($assignment){
global $CFG;
+ $assignment->assignmenttype = clean_param($assignment->assignmenttype, PARAM_SAFEDIR);
+
require_once("$CFG->dirroot/mod/assignment/type/$assignment->assignmenttype/assignment.class.php");
$assignmentclass = "assignment_$assignment->assignmenttype";
$ass = new $assignmentclass();
@@ -1425,6 +1423,8 @@ function assignment_update_instance($assignment){
function assignment_add_instance($assignment) {
global $CFG;
+ $assignment->assignmenttype = clean_param($assignment->assignmenttype, PARAM_SAFEDIR);
+
require_once("$CFG->dirroot/mod/assignment/type/$assignment->assignmenttype/assignment.class.php");
$assignmentclass = "assignment_$assignment->assignmenttype";
$ass = new $assignmentclass();
Please sign in to comment.
Something went wrong with that request. Please try again.