-
New Feature
-
Resolution: Fixed
-
Major
-
3.1.2
Check if a module has been updated since the given timestamp.
Parameters:
- array of cmid and timestamp
Returns:
- array of the type of elements that were updated: configuration, files, posts (for forum), pages (for wiki), entries (for glossary), etc..
This won't return the element ids of additional information, just a boolean indicating if something was updated since the given time.
Why do we need this information:
The mobile app allows to download both resources and activities for offline access/usage.
Right now, for calculating if a resource or activity needs update (so we can show a button to allow the user to update the downloaded module) we must perform several "heavy" web services requests. This is because we need to retrieve the module information and associated files and data to compare with the local information stored and see if something was updated.
For example:
- For a quiz we must retrieve the quiz attempts to see if there is a new attempt.
- For forums, we must download discussions/posts.
- For assignment, we need to download the recent submissions to check if there is any change.
For a normal course we could end up doing lots of requests to display the modules needing update.
This is the reason we'd need a simple Web Service able to return some basic information about the modules status since a given date.
This Web Service will receive a list of cmids and timestamps and we'll ask every module type to calculate if there has been any update affecting the user since the given time.
Please, note that we must specify a different timestamp for each module, because maybe the user updated manually some modules of the course but not all of them.
These changes can help us also to "mark/display" in the app the modules with updates since the last visit of the user. So basically with these changes we will be able to:
- Check if the already downloaded modules (if any) needs to be updated.
- Every time the user open a course, check for updates to display using badges (red filled circles with a number inside)
Implementation
This WS will do multiple request for retrieve all the required information for all the modules, but this will have a lower performance impact that the current requests we are doing (right now to calculate the status we perform multiple request) so this will be a performance improvement for both sites using 3.2 and the app.
Another implementation approach could have been implement an event observer in a plugin and store the update information in a new database table.
Or not an event observer and using direct calls (a new subsystem) or whatever available in lib/ so any component or plugin could report updates.
I think that this is the simplest way, and right now it will reduce the amount of request that the app needs to do.
- blocks
-
MOBILE-1872 Calculate course modules status in courses via core_course_check_updates
- Closed
- caused a regression
-
MDL-58440 We now have (more) duplicate, incomplete, confusing APIs for recent activity
- Closed
-
MDL-57054 core_course_check_updates is not returning the ids of the questions updated
- Closed
- Testing discovered
-
MDL-56575 theme_boost: checkboxes in forms are badly aligned.
- Closed