Premise - merrillpaul/assess-cordova-proto GitHub Wiki

Premise:

  • Replace Assess ios ( iPad) project with pure javascript/html/scss and any custom plugins that need to be moved over
  • Reuse the existing content upgrade/update semantics , i.e updating the app without an app store deployment
  • Make changes in give-www code base to use cordova core and plugins ( standard and or our in-house developed/copied over )

Expectation:

  • Play Assess as Practitioner and Stim devices
  • Login with and without MFA and Offline
  • Download content , extract, reconcile content updates, check for updates, throw waring message if any
  • Run HomeUI ( per user locale )
  • Get Assessment/Batteries prepped from Central
  • Start testDirector ( per user locale )

Steps:

  • Setup Project Structure
    • Create config loaders for Branch and Config to get Content versions
    • SCSS/HTML/Template/i18n
    • Create qi-assess-cordova plugin location
      • This is to reuse those plugins already tried and tested into our cordova plugins, For eg TarPlugin
    • Assess-www folder to hold our new Assess code which replaces Ios
    • WWW folder which is a placeholder which gets updated with a build (grunt/webpack/whatever)
    • cordova build to generate single cordova.js with core and plugins with the —browserify and then publish that somewhere
      • to put that in give-www ( as opposed to give-www/libraries/phonegap.js)
      • The issue here is that when we build using cordova build we get various versions of cordova.js for each platform. For rex we can have them inside give-www folder but when we run within cordova, our Assess code should replace cordova.js with the one for the target platform
  • Authentication
    • call /sync/checkAuth
      • if mfa on , go to mfa credential collection /warning if mfa setup but not configured
    • call content query
  • Content Query
    • /content/queryVersions
      • Request params
        • First loads the previously extracted Versions hash and uses this is as a parameter
        • The github branch and the config ( release, release-QA etc )
        • Interface-manifest ( This is a json with the capabilities / plugins that are allowed in Assess. I am not even sure whether we need this anymore. That said, central uses that value to serve the non-stim-all.tar)
      • Responds with a list of urls to be downloaded
      • If no updates
        • if a previous content was there, this means Assess can show the homeUI . The show it
        • if not stop here and show a message
  • Content download
    • Recreate a tmp zip folder
    • Start downloading tars from the list of urls from 3.2 into zip folder
    • Once all downloads are done, show error if any or copy all the contents of tmpzip folder to ‘contentArchive’ folder
    • Extract all tars of contentArchive folder to the tmp zip folder
    • Copy give-www from the tmp zip folder to the content WWW folder (this where our give-www gets created which holds our entire assess js , homeui, test director etc
      • These processes are to be ready to avoid the main content WWW folder to be corrupted if there are any issues during the download or extract events
    • Update the lib/cordova.js from the extracted folder with contents that the cordova project will have
      • This is to future proof ourselves with the correct device version. We know at the moment we only have iOs, but we shouldnt hard code that anyhow right ?
    • If all Good, kick start our boot-up
  • Display Home UI or Stim
    • Figure out the locale
    • Decide whether this a practitioner or stim by checking the Settings tab
    • Load the appropriate html_.html from cdv://localhost/persistent/contentWWW into the web-view using location
⚠️ **GitHub.com Fallback** ⚠️