Fix frankenstyle naming violations for Moodle plugin database approval #116
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses the frankenstyle naming violations that were preventing the plugin from being approved for the Moodle plugin database. The changes ensure full compliance with Moodle's frankenstyle naming conventions while maintaining backward compatibility.
Changes Made
1. Class Naming Compliance
onlinejudge_exception
→\local_onlinejudge\exception
judge_base
→\local_onlinejudge\judge\base
judge_sandbox
→\local_onlinejudge\judge\sandbox
judge_sphere_engine
→\local_onlinejudge\judge\sphere_engine
onlinejudge_task_judged
→task_judged
(with proper namespace)2. File Location Compliance
exceptions.php
→classes/exception.php
judgelib.php
(judge_base class) →classes/judge/base.php
judge/sandbox/lib.php
(judge_sandbox class) →classes/judge/sandbox.php
judge/sphere_engine/lib.php
(judge_sphere_engine class) →classes/judge/sphere_engine.php
classes/event/onlinejudge_task_judged.php
→classes/event/task_judged.php
3. Namespace Compliance
All classes now use proper
\local_onlinejudge\*
namespace structure and follow Moodle's autoloading conventions.4. Backward Compatibility
To ensure existing code continues to work, backward compatibility aliases have been added:
File Structure
The new frankenstyle-compliant structure:
Testing
Benefits
Migration Guide
For New Code
For Existing Code
No changes required - old class names continue to work through backward compatibility aliases.
Documentation
FRANKENSTYLE_CHANGES.md
with detailed migration guideverify_frankenstyle.php
verification scriptFixes #113.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.