Remaining Lesson Timer

Blocks ::: block_remaining_lesson_timer
Maintained by Greg SmithGreg Smith
Block for displaying the elapsed and remaining time in a timed lesson
Latest release:
98 sites
19 downloads
12 fans
Current versions available: 1

For all schools where a minimum time spent on-line is required (as it is in a classroom) a "Require time spent" for "Activity completion" is provided by the lesson module in moodle.  This side block displays the elapsed and remaining time, to a tenth of a minute, in a lesson that uses "Require time spent".  It will display "Time Completed" after the time limit has been reached.  See printscreens.  

This side block will only run when called by  lesson/view.php  and only then, when the time limit is set [greater than 0].  In other words, it cannot be called directly nor even indirectly by any program other than lesson/view.php.

There is a "REFRESH TIMER" button with which students can refresh the page and update the timer if they wish (it is the same as clicking the browser's refresh button). 

The Remaining Lesson Timer code restricts its display to lesson/view.php therefore an administrator can simply have one instance that covers all courses ["Display throughout the entire site"] or a person can be more selective.  In either case, it will show up in and only in the lesson/view.php pages where the time limit is set [greater than 0].

If an admin or teacher calls up a timed lesson/view.php page for editing (for example), then there are no {lesson_timer} records but the timer will simply display the required time to be spent and 0 for the actual time spent.  See printscreen.

No records are ever written by this timer display nor is there any data entry.  This block is display only.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4
Screenshot #5
Screenshot #6
Screenshot #7
Screenshot #8

Contributors

Greg Smith
Greg Smith (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Greg Smith
    Mon, 29 Oct 2018, 12:54 PM
    ah, yes, it has to do with being visible on the "my" index page. Thanks.
  • Greg Smith
    Tue, 30 Oct 2018, 2:43 AM
    Travis-ci is happy again.
    Yes, the access.php needs the "myaddinstance" if the block is to be displayed on the "my" home/dashboard page. Mine is not.
  • Greg Smith
    Tue, 30 Oct 2018, 11:59 AM
    PS: With your help, I have learned a lot. Thank you.
  • Greg Smith
    Wed, 31 Oct 2018, 11:08 AM
    @Dan,
    Thank you for all your help;
    all that is left is the visibility declaration and
    "Warning Release name ($plugin->release) not found in version.php"
    when I first checked, the "init" and "get_content" functions etc.
    _ _ _ function init() {
    _ _ _ function get_content {
    I did not see any that were different from what I had; no "public" declaration anywhere.
    now I have seen a few (about 1 out of 3) but nothing they can call a mandate.
    In fact, Dougiamas has his name on 21 programs with those (2) functions [in mdl 3.5.2]
    and of the 21, he put the "public" declarations on only 2.
    That certainly implies that the wiser thing to do is to leave it off. [... until they are willing to comply with their own guidlines. (?) ]
  • Dan Marsden
    Wed, 7 Nov 2018, 5:16 AM
    yeah - there's a lot of existing code that doesn't follow the guidelines... We tend to fix those in core when we make other changes to the code around it. but there's a lot of old code! - Nice work on the improvements! - I've noticed one other issue that would be good to sort which I've reported to your github issues tracker, but the code looks good enough to approve here in the plugins db which I've just done - thanks for sharing your plugin and the improvements you have made!
  • Dámaso Velázquez Álvarez
    Wed, 27 Mar 2019, 3:44 PM
    Hello,

    Will be available to Moodle 3.6 this plugin? Because I installed 3.5 version on 3.6 but when I'm going to add a new block, this block isn't in the list to add.

    Best Regards.
  • Greg Smith
    Fri, 29 Mar 2019, 4:10 AM
    Damaso,
    This block was created before 3.6 came out however, this block continues to run on 3.6 and future versions of moodle indefinitely (as long as your database table {mdl}_modules has the lesson module listed in record 11. ~you started using moodle before version 3) Even this shortcoming will be overcome in the next release of the block.
    Thank you,
    Greg
  • Daniele Monchiero
    Thu, 10 Sept 2020, 11:04 PM
    Does it work for version 3.8?
    I'm looking for the block in the list but can't find it.
  • Wang Felix
    Wed, 23 June 2021, 9:30 AM
    Does it work for version 3.9? I could not find the block
  • Gabriel Rigg
    Fri, 6 Aug 2021, 8:39 PM
    If you change the SQL to use the {modules}.name LIKE "lesson" instead of a hard coded id, you may be able to make it work in 3.7+

    80 $querycml =
    81 "SELECT cm.id AS cmid, cm.module, cm.instance,
    82 cm.section, l.*
    83 FROM {modules} m, {course_modules} cm
    84 JOIN {lesson} l
    85 ON ( l.id = cm.instance AND cm.course = l.course )
    86 WHERE cm.id = :id
    87 AND cm.module = m.id
    88 AND m.name LIKE 'lesson' ";
  • Martin Turček
    Sun, 10 Oct 2021, 4:40 AM
    I have moodle 3.10 and I did everything as Gabriel Rigg wrote
    but the block is not on offer
  • Martin Turček
    Sun, 10 Oct 2021, 4:41 AM
    can anyone advise me if it can work in moodle 3.10 and how to install it.
    well thank you
  • V B
    Tue, 6 Sept 2022, 5:17 PM
    I Installed successfully on Moodle 4.0 but the block doesn't show up in lesson
  • V B
    Tue, 6 Sept 2022, 5:50 PM
    I opened an issue on Github, please comment for hints on debug and possible solutions https://github.com/alivin70/moodle-block_remaining_lesson_timer/issues/1
  • Josh Christian
    Fri, 6 Jan 2023, 7:55 AM
    I changed the query per the posted GitHub issue yet I still cannot get this to show up in Moodle 4. Any ideas of what else it could be?
1 2 3 4
Please login to post comments