Exercise module add-on: Fatal error: Cannot redeclare exercise_add_custom_scales...

Exercise module add-on: Fatal error: Cannot redeclare exercise_add_custom_scales...

by MC Otake -
Number of replies: 4

Thank you for creating this module and sharing it with the Moodle Community.

I've installed your module. The tables are set up correctly, but when I access the configuration page and press Save I get the following message:

Fatal error: Cannot redeclare exercise_add_custom_scales() (previously declared in c:\archivos de programa\easyphp1-8\www\moodle_15\mod\exercise\locallib.php:80) in c:\archivos de programa\easyphp1-8\www\moodle_15\mod\exercise\locallib.php on line 80

Do you know how I can fix it before I upload it to my production site?

Thanks for your help.

Average of ratings: -
In reply to MC Otake

Re: Exercise module add-on: Fatal error: Cannot redeclare exercise_add_custom_scales...

by Alexandre Belousov -
Hello!
I've got the same error with all the latest dev-versions of this module, so I had to rollback to version 20050310, which works a bit more stable. I attach my version in this post, cause I failed to locate it "as is" in the repository (Generally the problem is with 2 files: lib.php and locallib.php sad )
Hope that helps.
In reply to Alexandre Belousov

Re: Exercise module add-on: Fatal error: Cannot redeclare exercise_add_custom_scales...

by MC Otake -

Thanks, I'll give it a try and let you know. smile

In reply to Alexandre Belousov

Re: Exercise module add-on: Fatal error: Cannot redeclare exercise_add_custom_scales...

by MC Otake -

I think it's working. Thank you! Thank you! Thank you!

In reply to MC Otake

Re: Exercise module add-on: Fatal error: Cannot redeclare exercise_add_custom_scales...

by Alexandre Belousov -
Glad it helped smile
p.s. The problem is caused by a require_once(locallib.php) function in lib.php.
No idea why.