assignment.class.php is missing. Why?

assignment.class.php is missing. Why?

by webmaster final -
Number of replies: 2

Hello!

The cron script on a Moodle installation fails because of the following error. I don't know why this file isn't there, I didn't install Moodle on this server and the developer that did it isn't available. It's a very old version of Moodle - 1.9.11

How can this be fixed? We believe this error could have been there for years without the users knowing. Is it wise to get it fixed and have the cron script running properly?


Starting activity modules

Processing module function assignment_cron ...

Warning:  require_once(/var/www/html/gs/web/mod/assignment/type/_notes/assignment.class.php): failed to open stream: No such file or directory in /var/www/html/gs/web/mod/assignment/lib.php on line 2132

Fatal error:  require_once(): Failed opening required '/var/www/html/gs/web/mod/assignment/type/_notes/assignment.class.php' (include_path='/var/www/html/gs/web/lib/pear:.:/usr/share/php:/usr/share/pear') in /var/www/html/gs/web/mod/assignment/lib.php on line 2132


Average of ratings: -
In reply to webmaster final

Re: assignment.class.php is missing. Why?

by Joost Elshoff -
Picture of Particularly helpful Moodlers Picture of Testers
Hi!
A lot has changed in Moodle core code since version 1.9, and even the assignment activity module (mod_assignment) was replaced with a newer one (mod_assign). I doubt you'd be able to find the correct file or code for this bit of code to make it work anyway. Also, I'd recommend migrating to a more current version of Moodle. Updating from 1.9 to 3.9 directly doesn't make much sense, I doubt that's even possible.

Why would you still be running a Moodle instance this old?
In reply to webmaster final

Re: assignment.class.php is missing. Why?

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
As already noted, marching Moodle rel. 1.9 to current, 3.9/3.10, will be a challenge, if possible at all. Probably your current concern is to get the 1.9.11 running as it is.

The developer must have added his own code. (Probably that explains the reluctance to upgrade to the next generation, 2.x.) There is no mod/assignment/type/_notes/assignment.class.php in core Moodle 1.9. This is from 1.9.19:
$ ls -F mod/assignment/type/
offline/ online/ upload/ uploadsingle/

On the other hand, there is a mod/assignment/lib.php in 1.9:
$ ls -F mod/assignment/
backuplib.php icon.gif* restorelib.php type/
db/ index.php settings.php upload.php
delete.php lib.php styles.php version.php
grade.php mod_form.php submissions.php view.php

You can copy mod/assignment/lib.php from 1.9.11 and try. But there could be more missing or changed code. If the code under Git (.git directory in the top code directory), it will allow you to follow the code changes.

Are you sure that the system software all match: https://docs.moodle.org/19/en/Installing_Moodle#Software.

From the path names I assume your platform is Linux. What is the distribution? Which version? Are you the administrator, shell access with the password for the super user 'root'?