ChildMindInstitute / mindlogger-backend

Browser-based interface for administering MindLogger's back-end
https://mindlogger.org
Other
8 stars 4 forks source link

Schema compliance: preamble ⟶ infoScreen on app && Sections/sub-activities #329

Closed binarybottle closed 4 years ago

binarybottle commented 4 years ago

There are 2 major parts to this:

  1. In the schema at the activity level, we have a "preamble" key which gives the user context for answering the individual items (e.g. see https://github.com/ReproNim/schema-standardization/blob/master/activities/PHQ-9/phq9_schema)

If the preamble is short, it would be nice to show it at the top of a screen in a small but bold font (e.g PHQ-9). If its a long preamble, it should be rendered as a markdown screen before the set of questions (e.g. Pediatric Screener).

  1. Destructure the sub-activity/Section part of the schema.

In pediatric screener, the 2 activities each consist of sub-activities, which consist of items. Destructure here so that it renders as a normal activity with the preamble/info screen

To get started:

  1. create an applet by adding the activity set URL in https://admin.mindlogger.org (see wiki for more information on this)
  2. decide where to input this logic:
    • the json-ld is parsed in the app/models/json-ld.js file is where the initial parsing happens. This makes the structure more workable for downstream components. Probably destructure the sub-activity here.
    • in app/components/ActivityScreens.js the activity gets rendered into a set of screens that slide in. Maybe some logic can happen here based on the activity's preamble?
    • in app/components/screen is the code for showing a single screen. If the preamble is short, it should probably be inserted about the question here.

https://github.com/ChildMindInstitute/MATTER-spec-docs/blob/master/active/MindLogger/MindLogger-app/preamble.md

binarybottle commented 4 years ago

➤ Adam commented:

Part 1 ready in https://github.com/ChildMindInstitute/mindlogger-app/pull/278. Part 2 pending further development on backend and additional parsing on the app-side.

binarybottle commented 4 years ago

➤ Jon Clucas commented:

Unclear if part 2 is done. To close this issue, we need some tests on both the backend and the frontend to make sure all this parsing happens as expected

binarybottle commented 4 years ago

➤ Eden2016 commented:

Please clarify what is left to be done on the front-end in order to finish the task? What behavior is expected from the changes?