learningequality/ka-lite — pull request #641 by bcipolli (2013-09-06 05:05:53+00:00)
Title: Set ex:attempts and vid:total_seconds_watched directly, not incrementally

Issue:
* Under load, saving exercise or video log data can fail (due to broken pipes from a timeout or browsing away from the page). In that case, any properties updated incrementally within the Python API code will become out of sync with data that is stored on the client and set directly on each save request.

Changes:
* Save all properties directly, mitigating the effect of failed saves. Now, all properties will stay in sync (however the threat of failing to store progress continues).
* This affects exercises and videos.

Testing:
* Tested total_seconds_watched while watching a video (saved properly), including browsing away and coming back later.
* Tested attempts while doing an exercise, including browsing away and resuming. Seemed to work..