Error: Course module is incorrect

Error: Course module is incorrect

by Mike Lee -
Number of replies: 4
I am working on moodle 1.5.4 and have been trying to implement the new upload assignment from 1.7 into our version of moodle.  The implementation is going pretty well, my only major problem is that I get this error: Course module is incorrect  everytime I go to delete a file or when I go to submit a file(s) for final submission.  Any clues to why this is happening?  TIA.
Average of ratings: -
In reply to Mike Lee

Re: Error: Course module is incorrect

by Eduardo Hernandez -
Hi Mike,

Yes, there's a reason why. From Moodle 1.6 the functions used for retreiving parameteres were changed.

From Moodle 1.6 you must use optional_param and required_param functions  , such as

$id = optional_param('id',0, PARAM_INT);

In Moodle 1.5 they were optional_variable and required_variable

optional_variable($destiny);

So, in the files you could try by changing these functions
 
Eduardo
In reply to Mike Lee

Re: Error: Course module is incorrect

by Mike Lee -
Problem fixed.  I added the accesslib.php file and the weblib.php file into the libdir of moodle. 1.5.4 and was able to submit and delete files.  This also allows for the use of has_capability function and the require_capability function that has replaced the permission functions like isteacher(), isadmin(), isstudent(), etc, for moodle 1.7.  There are still some issues regarding response file uploading such as not being able to see the upload response file option, unlike that of 1.7 beta.
In reply to Mike Lee

Re: Error: Course module is incorrect

by Mike Lee -
I noticed that the course module id is incorrect in the database. This is what I did...

$here = $this->cm->id; //here is just a variable I chose to use.
print_object($here);

I got the cm->id == 11, but in the database I get the id == 10. I am not sure how this is happening? Also, when I checked the database, I noticed that data1 no longer hold the submission status of the assignment; It now holds the notes written by the students or instructor. Is there a reason to why this is?
In reply to Mike Lee

Re: Error: Course module is incorrect

by Mike Lee -
I now know why I can't get this to work. The function notice_yesno is the culprit here. In moodle 1.5 notice_yesno has only three parameters. In moodle 1.7 notice_yesno has seven parameters. Could I somehow overload this function so that I can make this work in modle 1.5? Thanks.