concord-consortium / lab-interactives-site

Set of interactives built using the Lab Framework from the Concord Consortium
lab.concord.org
Other
14 stars 28 forks source link

Download Offline Version button #64

Closed pjanik closed 4 years ago

pjanik commented 7 years ago

Demo: http://lab.concord.org/branch/offline/interactives.html#interactives/samples/1-oil-and-water-shake.json

API code and repository: https://github.com/concord-consortium/lab-offline

It replaces previous standalone page. There's a small refactoring of embeddable.js file so it's a bit more useful for standalone page.

birbilis commented 7 years ago

it would be best if it was producing a .zip (an archive format supported even natively by some systems) instead of a .tar.gz which is something more exotic (a gzipped tarball, of UNIX world)

btw, maybe should contain some metadata too (e.g. SCORM - see https://en.wikipedia.org/wiki/Learning_object - or maybe even contain metadata in multiple formats). A problem with metadata I think is that currently people don't localize the category/subcategory in interactives, but keep it in English (not sure if something would break if those two fields were translated too), so if user selected another language and then exported, the metadata for title etc. would be localized, but for category/subcategory would be still in English. Another thing is if one would like to export all languages together with a remembered setting in a single export of what language the user had selected before exporting the interactive

also, will it be producing something (doesn't this have some computing cost?) for download everytime it is clicked, or is that something cached till the content changes to produce again? (how does it detect changes then?)

another thing is that two clicks seem to be needed, one to produce the download and another to do the download, not very intuitive for some users probably

birbilis commented 7 years ago

also, will it be producing something (doesn't this have some computing cost?) for download everytime it is clicked, or is that something cached till the content changes to produce again? (how does it detect changes then?)

regarding that comment quoted above, at first I though it was for downloading an offline copy of the interactive on the server, but I am now wondering if it could submit the changed interactive+model to the server to some temp storage (assuming syntax is checked first [and maybe rechecked on the server to avoid misuse for injecting stuff to the produced offline archive] and some quote applied to not send something huge) and then produce offline copy for it. Would be very helpful for people translating interactives who also need to have them in offline form.


another thing I see is that the interactive's json is inside the HTML in the produced archive (is it to bypass some CORS issue? I had trouble when I tried myself to use Lab engine offline and try to load a local .json file from same local folder). I see the embedded JSON data of the interactive has also embedded in it the model data. A problem is that if one uses the online authoring page of lab (interactives.html instead of embeddable.html) to translate an interactive they get a separate interactive and model json (not sure if that page has some way to combine them in one text, so it may be harder for them to put inside the HTML if they have to do it manually by editing the/some english offline package. However if you make it so that the user can save an offline package for the stuff they have in the editor or better in the player - assuming they pressed "update interactive" that is so that syntax checking also occured), then it will be more straightforward indeed (hope this is what offline button does, with other samples I tried it said it failed, only with your sample it succeeded and haven't tried editing it yet in the browser and repeating the generation to see if the offline one contains my changes or not)

birbilis commented 7 years ago

regading the SCORM metadata I mentioned above, see https://en.wikipedia.org/wiki/Content_package https://en.wikipedia.org/wiki/Sharable_Content_Object_Reference_Model and http://adlnet.gov/adl-research/scorm/

also see notes about SCORM support in Moodle for embedding learning objects: https://en.wikipedia.org/wiki/Moodle

btw, there is also xAPI (or "Tin Can API") from the makers of SCORM (aka ADL), that is a protocol for tracking usage and storing progress of a user and probably a superset of SCORM or something http://experienceapi.com/ http://adlnet.gov/adl-research/performance-tracking-analysis/experience-api/ https://github.com/adlnet/xAPI-Spec but guess that one could be a next step, since it's very recent (it is supposed to help track content usage and user progress even when they move between sites and mobile apps etc.)

birbilis commented 7 years ago

I notice that when I have say selected Greek version of an online interactive (e.g. from 5-amino-acids that is the only one currently online - lots of other Greek ones are pending at a big pull request btw), and use the download offline button, I get an offline archive with English version, not Greek one as I expected. Nor does it allow me to change languages on the fly at the offline version. I believe the easiest way is to just spit out the localized version that the user is viewing at the time they press the offline button.

If they change language that button should reset its state though so that they can produce a new offline copy for download for the newly selected language

btw, as I said before, a .zip should be produced, not a .tar.gz

also for consistency with learning objects I think index.html should be the entry point to the interactive, not have another filename for the .html everytime

ideally Learning Object metadata XML file could also be inserted in the .zip (say follow the older SCORM 1.2 which is established format). That would allow easy use of an offline version with Interactive Boards, Moodle etc. (especially if the offline download button could use the Interactive+Model files that are in the user's editor panes that would be handy since there isn't some copy online of the user's work to show via iframe instead).

scytacki commented 5 years ago

@pjanik I'm finally looking at this. It looks good to me, but since it changes embeddable.html I think we need to have QA do a run through this to make sure nothing has broken.

@kevinsantos-cc or @eireland can you work in some time to test this branch?
I'd guess the snapshot based testing would need some configuration change to test this instead of staging?

@birbilis I agree with most of your points, but we don't have active funding for this project. Probably we won't making any additional changes unless some new funding comes in.

scytacki commented 5 years ago

Here is the PT story for this work: https://www.pivotaltracker.com/story/show/143329205

kevinsantos-cc commented 4 years ago

Looks good from a manual QA standpoint. Evangeline has been fixing some automated tests that have been having some issues running as expected. Maybe this is related to the recent changes? I am not sure on her progress since she is on vacation.