How to modify data sent back to phone

8 views
Skip to first unread message

Alex Little

unread,
May 22, 2015, 4:49:38 PM5/22/15
to oppia...@googlegroups.com
Question from an email I received:

I wanted know how I can modify the data that is sent to the phone when a user logs in to oppia

And my reply:

For modifying the the data sent back to the phone after login, you can edit the UserResource API (see: https://github.com/DigitalCampus/django-oppia/blob/master/oppia/api/resources.py). Just to explain how this works for the points:
  • Add an extra field in the class (see line 56 of the above code link)
  • In the Meta section, under the "fields" list (line 66) add this new field
  • Add a 'dehydrate_points' method (lines 106-108) - this determines what actual data is going to be sent back.
You can change the TrackerResource in a similar way if there is data you'd like to return every time a tracking activity is sent back to the server (this class starts at line 279 - and also sends back the points so they can be updated on the phone display)

Am posting here in case this info is useful to others,
Cheers,
Alex
Reply all
Reply to author
Forward
0 new messages