Hi Santi,
You will need to make your own course format: https://docs.moodle.org/dev/Course_Format that utilises the user preference code: https://docs.moodle.org/dev/User_preferences_for_plug-ins so that the user section will be remembered and therefore used to display the right section when the user comes back. For example use of such code in a course format, Collapsed Topics uses it to store and remember the state of the toggles.
Gareth