Moodle

Click to hide/click to reveal on the box around the course data.

Details

  • Type: Sub-task Sub-task
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 2.0
  • Fix Version/s: None
  • Component/s: Other
  • Labels:
    None
  • Database:
    Any
  • Affected Branches:
    MOODLE_20_STABLE

Description

We have also modified the course overview function to display a button which performs a click to hide/click to reveal on the box around the course data. The hiding and revealing of the section is done by using the standard JavaScript function elementToggleHide, in much the same way as is done for the content of blocks (see moodleblock.class.php). Please see the lower frame of the screenshot, in which the course "Parliament and the law" has now been hidden, but can be revealed by clicking on the "+" button at the left hand side.

If the user does not have JavaScript enabled on their browser, the sections will all be displayed by default, and the button will not work, but they will not see an obtrusive error if they click the button.

Note that Ray Lawrence has requested a config option to remove the ability to collapse sections, for consistency with blocks functionality.

Issue Links

Activity

Hide
Jenny Gray added a comment -

Here's a patch for this. It also includes the code in course/lib.php for MDL-13585 and 13586 so you can see more easily how the whole thing fits together. Once I've done everything I'll attach a single big patch at the top-level task that covers everything.

As with the other myMoodle patches, please review and let me know if they're OK to commit.

Show
Jenny Gray added a comment - Here's a patch for this. It also includes the code in course/lib.php for MDL-13585 and 13586 so you can see more easily how the whole thing fits together. Once I've done everything I'll attach a single big patch at the top-level task that covers everything. As with the other myMoodle patches, please review and let me know if they're OK to commit.
Hide
matt greenwolfe added a comment -

By adding the following four lines just before the loop that prints the box for each course, mymoodle will put the most recently visited course at the top. The order refreshes only after a new login. Changing the order of the courses was discussed as a desirable feature, but this accomlishes it automatically so the user is not required to edit the page.

$b = array();
foreach ($courses as $key => $course) { $b[$key] = $course->lastaccess; }
array_multisort($b,SORT_DESC,$courses);

For some reason the patch for the show/hide boxes is not working for me in 1.9. The boxes show and toggle from + to -, but the content is not hidden.

Show
matt greenwolfe added a comment - By adding the following four lines just before the loop that prints the box for each course, mymoodle will put the most recently visited course at the top. The order refreshes only after a new login. Changing the order of the courses was discussed as a desirable feature, but this accomlishes it automatically so the user is not required to edit the page. $b = array(); foreach ($courses as $key => $course) { $b[$key] = $course->lastaccess; } array_multisort($b,SORT_DESC,$courses); For some reason the patch for the show/hide boxes is not working for me in 1.9. The boxes show and toggle from + to -, but the content is not hidden.
Hide
Matt Gibson added a comment -

Jenny - is this patch against 1.9? I have spoken with my students and was about to hack together a similar thing as it is a big deal here that the courses seem to go on for ever. Could I add the suggestion for a show all/hide all toggle somewhere as well?

Show
Matt Gibson added a comment - Jenny - is this patch against 1.9? I have spoken with my students and was about to hack together a similar thing as it is a big deal here that the courses seem to go on for ever. Could I add the suggestion for a show all/hide all toggle somewhere as well?
Hide
Jenny Gray added a comment -

No, its against 2.0 because its too big a change for a 1.9.x commit. That said, I have it working on our 1.9 site (http://openlearn.open.ac.uk if you want to take a look), so you should be able to back-port it if you're desperate.

I've added a check box in admin settings that you can enable or disable the whole thing, but I don't think that's quite what you're after.

Show
Jenny Gray added a comment - No, its against 2.0 because its too big a change for a 1.9.x commit. That said, I have it working on our 1.9 site (http://openlearn.open.ac.uk if you want to take a look), so you should be able to back-port it if you're desperate. I've added a check box in admin settings that you can enable or disable the whole thing, but I don't think that's quite what you're after.
Hide
Jenny Gray added a comment -

updated patch attached to http://tracker.moodle.org/browse/MDL-13583, javascript now works properly (the style didn't exist in theme/standard)

Show
Jenny Gray added a comment - updated patch attached to http://tracker.moodle.org/browse/MDL-13583, javascript now works properly (the style didn't exist in theme/standard)
Hide
Tom Atkins added a comment -

We implemented a similar idea which looks like the attached screenshot.

The user clicks the link and the relevant details appear.

I haven't submitted any code as I'm new to CVS - I just tthought I'd submit the screenshot as a suggestion for implementation. Let me know if you'd like a copy of the code.

Show
Tom Atkins added a comment - We implemented a similar idea which looks like the attached screenshot. The user clicks the link and the relevant details appear. I haven't submitted any code as I'm new to CVS - I just tthought I'd submit the screenshot as a suggestion for implementation. Let me know if you'd like a copy of the code.

People

Vote (3)
Watch (8)

Dates

  • Created:
    Updated: