Returning from App to LMS

Using the empirical lib, I used the GrammarTagResult to queue up results in firebase keyed on my students session id.

When I deemed the student done with their activity, I use the ActivitySession.finish to save the grammar tag results. Along with that I submit a percentage. Currently just passing 1. but eventually will pass a true number 0 <= 1 to indicate percentage of correct answers.

The LMS is correctly setting our activity session to finished.

How does the current lessons app get to the results page?

Playing through a sentence writing set, I was able to see that on the last question it goes to a /final route.

Once it goes to final, the rails app does some calculations, https://github.com/empirical-org/Quill-Lessons/blob/develop/app/controllers/chapter/start_controller.rb#L10

Which makes a new model here, https://github.com/empirical-org/Quill-Lessons/blob/develop/app/models/score_finalizer.rb

https://github.com/empirical-org/Quill-Lessons/blob/develop/app/views/chapter/base/final.html.slim

When the final template is rendered, the javascript call, quill.finishActivity(sessionId) is called.

And then the iframe closes, and the browser is redirected here to see the output of the student’s activity session. The LMS is what knows to redirect.

http://www.quill.org/activity_sessions/R3Y-zVMZGL5JwjecJh-AAw