Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adapt-contrib-spoor: Reduce suspend data usage #2756

Closed
2 tasks done
olivermartinfoster opened this issue May 8, 2020 · 6 comments
Closed
2 tasks done

adapt-contrib-spoor: Reduce suspend data usage #2756

olivermartinfoster opened this issue May 8, 2020 · 6 comments
Assignees

Comments

@olivermartinfoster
Copy link
Contributor

olivermartinfoster commented May 8, 2020

Subject of the issue

Suspend data currently looks like this:
{"lang":"en","a11y":false,"completion":"11111111111110110111","questions":"CIhOiBYQHEA4MfCgITogWECBAODHwoEmqIFhAkQDgx8mQAAEAAFaIFhAoQDgx8SEIBTogWECxAODFwoSE6IFhAwQDgx8KA5SiBYQOEA4MfDgxBOiBYQPEA4MfCgMXogmIABEBAA4MfCgM","_isCourseComplete":false,"_isAssessmentPassed":true,"captions":"en","assessment":{"a-15":[1,1,4,4,0,{"c-120":true,"c-90":true,"c-140":true,"c-110":true}]}}

It is possible to combine and compress "completion", "_isCourseComplete": false" and "_isAssessmentPassed": true" into one value and change the name to "c" such that it comes out as "c":"oAOHgB7A".

"questions" can be shortened to "q".

"assessment" can be shortened to "a" and the section containing the bank id {"c-120":true,"c-90":true,"c-140":true,"c-110":true} can be combined and compressed with the score/attempts part 1,1,4,4,0, into "a":{"a-15":"hRfQAQQAQonqIEOIeQ0SCBAgQA"}} which when you consider AAT component ids are substantially longer than "c-120" can amount to a large saving.

Producing:
{"lang":"en","a11y":false,"captions":"en","c":"oALH//bA","q":"lw4noEHCAh/kQOJ6BCAgIf4yHE9AhIQEP8P7AAEAAA4noEKCAh/j9IAQ4noELCAhfh9QgOJ6BDAAIfxGDiegQ0ICH-VgUT0CHAAQABxPQIeEBD/IwcT0CIBAQ/yIFE9AiIAEAAA","a":{"a-15":"hRfQAQQAQonqIEOIeQ0SCBAgQA"}}

It is contingent on #2755 and #190 and some changes in spoor and assessment.

We could keep the legacy attribute formatting for "completion" such that Adapt.offlineStorage.get('completion') still produces the classic "11111111111110110111" completion string.

  • Spoor
  • Assessment
@loudoweb
Copy link
Contributor

A way of keeping the classic "11111111111110110111" could be good because it allows developers to quickly find some mistakes on completion by seeing the console log.

@oliverfoster
Copy link
Member

oliverfoster commented May 14, 2020

I'll see if I can get it to spit out as a console.log when it's changed. That'd probably be a better idea than keeping it raw in the suspend data.

Is that alright?

@loudoweb
Copy link
Contributor

Seems alright!

@oliverfoster
Copy link
Member

oliverfoster commented May 15, 2020

This will show in the console now:

INFO: CourseComplete: false, AssessmentPassed: false, BlockCompletion: 11100010000000000000000000

@moloko
Copy link
Contributor

moloko commented Jun 17, 2020

If we have a bit more space available it would be nice to look into having an option to store the state of presentation components as well.

A couple of times it has been flagged by a client as odd that the question components remember their state but the presentation components don't.

In particular it would be nice to have the media component remember where you were in the video, like YouTube does, esp. for when you have a course where the client insists on including really long videos... appreciate this one might need to wait until we replace the existing media component though!

@oliverfoster
Copy link
Member

oliverfoster commented Jun 17, 2020

That should be fine. I'll look at the ItemsComponentModel presentation components first as they are closest to the ItemsQuestionComponent behaviour and their model is in the core already. Narrative, hotgraphic and accordion I think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants