Developer Notes
Notes for For Purpose developers, in the event of future developments.
#Introduction Panel
The Introduction Panel content comes from "z_module_sat_panel_intro.html". This is made up of hardcoded content, with the start survey button at the bottom.
Results Panel
The Results Panel content comes from "z_module_sat_panel_results". Content blocks are shown or hidden dependent on the user answers.
The JavaScript controlling this is all down the bottom of the file, and there is quite a lot of custom logic and content depending on the state of the form.
The content of this panel is used to build the PDF Export in "z_module_pdf". Some test data is provided, commented out as "satPDFTestData", for reference for what usually comes out of this process. Much of the data for the PDF is pulled off the DOM for the Results Panel.
When you update the Results Panel, particularly the logic of the panel, make sure you also update the PDF export code and the PDFMonkey setup to match.
Survey Questions
Survey questions are made up of z_module_sat_slide blocks. All Self Assessment Tool questions are defined in z_module_sat_survey, which builds these modules. There are two variants of slides, "question" and "interstage". The variant of slide is dependent on the data passed into it and the "slide_type" value.
All slides are given a "progress_percent" value, which changes the display of the progress bar on the slide. As such, survey progress is manually set, so you'll need to keep an eye on this if changes are made to the question order or number. Note that this only affects the display of the progress bar, not anything functional.
Question Slides
All Question Slides have the option to be skipped if "can_skip" is set to true. By default, the skip behaviour will add an "I don't know" radio option beneath the input area. If a button to skip is needed instead, set "skip_via_radio" to false.
Question slides can display textarea inputs or radio inputs.
Textarea inputs display a basic textarea.
Radio inputs display a list of radio options.
- Radio options are passed in via "radio_options"
- The "radio_options" list uses the data structure of "Label;Next_Slide_ID_When_Selected|Label..."
- An example of this is "Yes;basic-01-a|No|I don't know"
- The "Next_Slide_ID_When_Selected" value changes the slide that will be shown when the "Next" button is clicked on the slide if the user has selected that radio option. If no value is given here, or the user has selected a different radio option, then the Next button will use the "default_next_slide_id" value.
Note that there is some residual code for "percent" inputs as a range selector. This isn't used right now but may be useful for future reference.
Interstage Slides
"Interstage" slides do not contain a question, and only display text and buttons.
On launch, there are two interstage slides; one after basic questions are answered and another shown before the results panel is displayed. The interstage slide after basic questions will only be shown if the user answers enough of the basic questions positively.