Enrolment Timer
Maintained by
Learning Works, Mathew May 🇳🇿, Jeremy FitzPatrick, Zander Potgieter
Block to show the user their remaining time enrolled in a course with live countdown and lots of settings to customise the display of this timer.
Comments
Comments are no longer open for new posts. Existing comments remain available to read.
Thanks for reviewing this plugin, I have now made the fixes as outlined above.
The background image on the countdown timer uses the [[pix:block_enrolmenttimer|background]] css rule which will not error when the moodle instance is not installed at the root of the domain.
I have also applied the fix for the php undefined error. Thanks for pointing out the exact issue.
Finally I have applied the frankenstyle coding method to the functions I declare in 'lib.php'
As far as I'm aware this resolves all the issues that have been outlined above.
I will be installing codechecker this evening and fixing up the code, then I will commit to GITHUB and upload the latest version.
Thankyou for reviewing this plugin
Regards
Aaron
not work quite well yet.
The PHP notice mentioned by Anthony (undefined property $text in block_enrolmenttimer.php on line 196) does not seem to be fixed in
the new version you submitted. Your fix in the commit c73133 initialized the property at the wrong place as you are setting the
$this->content to an empty stdClass below again. Please use the DEBUG_DEVELOPER mode at your development machine and make sure you
have the debug messages displayed on screen to catch these things prior commiting.
Using the default Clean theme in Moodle 2.6, I can second Anthony observation. The digits in the counter are still white, making
them very difficult to read - or even spot. It is caused by the background-url property in your CSS file. Your current one works only
on sites where the Moodle is installed in the root of the web server. Please refer to
http://docs.moodle.org/dev/Using_images_in_a_theme#Using_images_within_CSS for details.
I noticed that you create functions in the global PHP scope without the valid frankenstyle prefix. This is strongly discouraged in
order to prevent collisions with (current and/or future) core code or some other
plugin. See http://docs.moodle.org/dev/Coding_style#Functions_and_Methods for details.
I found that all the blocks at the site share the same setting. So there is no way to have per-course configuration. Was that
intentional? For the future development, you may consider switching over to the messaging API. This would give your users greater
control over how they receive the message.
Thanks for reviewing this plugin,
I have made the suggested changes and additions, bar the code checker which I am about to complete now.
I investigated the White text on black background. As per the images attached, the default setting is to have a black background. In the css it had been added with a URL based link eg '/blocks/enrolmenttimer/pix/xxx.xxx' wich has now been updated to a relative link, finxing the issue you had.
I have also repaired the undefined $text php error you where getting. Was a silly check I had not completed when adding to a string with .=
I will install the codechecker plugin soon and will re-upload the new code once it has been cleaned.
Thanks for your helpful input
Regards
Aaron
Many thanks for sharing this plugin with the Moodle community.
Please review http://docs.moodle.org/dev/Plugin_validation#Recommended_URLs and then edit the plugin entry to provide the source, tracker, and documentation URLs that will enable others in the community to more actively participate in using and maintaining this plugin.
I noticed that you did not specify an issue tracker for your plugin. Providing a place for users of your plugin to report issues encourages participation and provides a way for users to report bugs, make feature requests, or suggest other types of improvements. There are a couple of options. You are welcome to request that a component be created in the Moodle Tracker. This will allow for you to become more familiar with how issues are managed in Moodle core but may take a little more time to setup. Alternatively, for folks who are using Github.com, you can use the issues feature of Github to handle such requests. Kindly let me know which of these two options seems best for you.
Please provide a documentation URL. You are welcome to create your documentation in Moodle Docs, See http://docs.moodle.org/dev/Plugin_documentation for more information.
I was successfully able to install the plugin and it appears to function as expected. I did notice a PHP notice:
Notice: Undefined property: stdClass::$text in /var/www/m26/blocks/enrolmenttimer/block_enrolmenttimer.php on line 196
It is encouraged to follow Moodle's coding style as outlined in:
http://docs.moodle.org/dev/Coding_style
http://docs.moodle.org/dev/Coding
The code checker plugin can be quite helpful in fine tuning your code and can be found at:
https://moodle.org/plugins/view.php?plugin=local_codechecker
You may wish to consider using that tool to further improve your plugin. Below, are the initial results:
Files found: 9
blocks/enrolmenttimer/locallib.php - 154 error(s) and 9 warning(s)
blocks/enrolmenttimer/block_enrolmenttimer.php - 515 error(s) and 67 warning(s)
blocks/enrolmenttimer/lang/en/block_enrolmenttimer.php - 1 error(s) and 0 warning(s)
blocks/enrolmenttimer/styles.css - 1 error(s) and 0 warning(s)
blocks/enrolmenttimer/edit_form.php - 9 error(s) and 33 warning(s)
blocks/enrolmenttimer/db/access.php - 7 error(s) and 3 warning(s)
blocks/enrolmenttimer/version.php - 3 error(s) and 1 warning(s)
blocks/enrolmenttimer/settings.php - 29 error(s) and 3 warning(s)
blocks/enrolmenttimer/README.txt - 2 error(s) and 1 warning(s)
Total: 721 error(s) and 117 warning(s)
For now, I am going to mark this plugin as needing more work until we get these issues resolved (mostly the URLs - the code checker stuff is certainly not a blocker for approval). Thanks for your patience with the review and approval process. Overall, things look pretty good. Please do not hesitate to let me know if there is anything I can do to be supportive of your efforts. Peace - Anthony