Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Quiz depends on ctools.module, which provide very nice object cache functionality. We should use this feature instead of access $_SESSION variable directly.
Proposed resolution
Make use of ctools's object cache.
Remaining tasks
…
User interface changes
…
API changes
Add 3 new functions:
- quiz_get_taking_object($quiz_vid, $uid)
- quiz_set_taking_object($quiz_vid, $uid, $object)
- quiz_det_taking_object($quiz_vid, $uid)
Comments
Comment #1
djdevinThere's nothing wrong with using $_SESSION, I feel like if we move it to cache, we are just duplicating what we already have (the quiz_result entity).
I suppose you could do some more advanced logic to pull the most recently started result, compare the user's login time vs. the result start, to not break the allow/disallow resume functionality.
It's still a "session" any way we do it.
Comment #2
djdevin