cellule-tice / moodle-format_collapsibletopics

Clone of core topics format that adds collapsing behaviour to sections.
7 stars 6 forks source link

Hidden Topics Disable Proceeding Resources #19

Closed VOMCIT closed 4 years ago

VOMCIT commented 4 years ago

Hello,

I'm using Moodle 3.8.2 and the Collapsible Topics plugin 3.8.

When setting the "Hidden Sections" setting under a course whose "Course Format" is set to "Collapsible Topics format", the student is no longer able to collapse and uncollapse topics which are not hidden.

I have recorded a video of the behaviour and uploaded it in HD so you can see the behaviour: https://1drv.ms/u/s!AnxN-ismKeetgYtiX51Go3OUzNbtlA?e=oTkN7O

Since having this issue, I thought it might have to do with my installation or database. I full deleted the database and all files related to Moodle. I did a clean install and only installed the Collapsible Topics plugin 3.8. Before doing this, I purged all caches as well.

Since then, I have disabled Javascript caching and the problem is still present.

bdpz commented 4 years ago

Hello,

I have the same problem (same version of Moodle too). I will try to add some debug code in the module to check what happen.

By the way, thank you for your module ;)

bdpz commented 4 years ago

I think that the solution is here : https://github.com/gjb2048/moodle-format_topcoll/commit/444c3662c5c73bdf2eeb3fd457567010928be8d2#diff-25eb2cfd41b242f700f7c778c4416c17

jrm-unamur commented 4 years ago

Hi there, Sorry for the delay but our team is fully occupied with online exams at our University with confinement measures, so I haven't have the time yet to investigate the issue. I'll do that as soon as possible

jrm-unamur commented 4 years ago

Could you please check that javascript is cached in your configuration (Admin -> appearance -> cache javascript). I can reproduce sometimes the issue when javascript is not cached, but never when this option is activated

bdpz commented 4 years ago

Personnaly, Javascript is cached but I won't try to disable it in production (I have a lot of exams too...).

I will try to test it in dev.

I have checked my console. The error is : TypeError: c is null (first.js:342:6178) when I try to click on the last section that is before an hidden section.

jrm-unamur commented 4 years ago

I will try to reproduce with javascript cached then.

jrm-unamur commented 4 years ago

After various tests, I tried to reproduce and could get it when in student mode (not with a real student account). I fixed it, could your try the solution and keep me posted so that I can publish a fixed version: In renderer.php change data-parent="accordion" with data-parent=".accordion" at lines 269, 279, 305, 312 Make sure that Cache Javascript is activated Cheers

bdpz commented 4 years ago

Thanks, I have tested it and it works fine !

The state (collapsed or not) of the last section seems not saved for students, but it is not important for me.

I was searching for wrong classes / id in the code, I didn't notice than the first

bdpz commented 4 years ago

the missing word is <ul>

jrm-unamur commented 4 years ago

Fixed in last release on moodle plugins site