How does the Topics Course Format remember the last state per user?

How does the Topics Course Format remember the last state per user?

by Frankie Kam -
Number of replies: 7
Picture of Plugin developers

In the Topics Course format, when my students hit the "Show Topic N" icon, let's say Topic1, then only Topic1 content is shown. The problem is that on when a student logs on again later, Moodle somehow remembers which Topic was shown by itself from the previous user session. I want the student to be greeted by all topics, not just the one topic from the last user session. How to do this?

Frankie Kam

Average of ratings: -
In reply to Frankie Kam

Re: How does the Topics Course Format remember the last state per user?

by Itamar Tzadok -

Put the greeting in seciton 0? (This at least is how it used to work. Section 0 is static and visible on every page when not empty). smile

In reply to Itamar Tzadok

Re: How does the Topics Course Format remember the last state per user?

by Frankie Kam -
Picture of Plugin developers

Hi Itamar

Put the greeting in seciton 0?
>
What does this mean? 

I do know that adding &topic=0 to the url will cause all topics to open, but I'm afraid I don't understand your answer. You're too fast for me right now. tongueout My brain works in kilohertz, not on gigahertz, heh.

Frankie Kam

In reply to Frankie Kam

Re: How does the Topics Course Format remember the last state per user?

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Frankie,

To stop the persistance (for all Topics courses) you need to edit 'format.php' in the '/course/format/topics' folder and change the code (at the top) from:

if ($topic != -1) {
$displaysection = course_set_display($course->id, $topic);
} else {
$displaysection = course_get_display($course->id);
}

to

if ($topic != -1) {
$displaysection = $topic;
} else {
$displaysection = 0; 
}

Cheers,

Gareth

Average of ratings: Useful (2)
In reply to Gareth J Barnard

Re: How does the Topics Course Format remember the last state per user?

by Frankie Kam -
Picture of Plugin developers

Hi Gareth

Fantastic! It tried it and it works. Moodle 1.9.15. 
Much appreciated.

Frankie Kam

In reply to Frankie Kam

Re: How does the Topics Course Format remember the last state per user?

by Itamar Tzadok -

1.9.x!!! wink

In reply to Itamar Tzadok

Re: How does the Topics Course Format remember the last state per user?

by Frankie Kam -
Picture of Plugin developers

Hi Itamar

At the moment my computer is broken. It refuses to roundup decimals to the nearest single digit.

Frankie

In reply to Frankie Kam

Re: How does the Topics Course Format remember the last state per user?

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Frankie,

No worries, please mark my post 'useful' if it was smile.

Cheers,

Gareth