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

Surveys info and surveys data for Configs #8

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

sebastianbarry
Copy link
Contributor

ONLY WORKS FOR DEV_PROGRAM AND DEV_STUDY, to incorporate this into the existing studies/programs we will need to add the survey_info.buttons fields for all the others as well

This is the new refactored format for the dynamic configs that contains:

  1. The survey-resources directory (originally from e-mission-phone)
  2. The new "library" style file for the list of available surveys under configs/surveys/surveys.json
  3. The new survey_info field in the configs json for dev-emulator-program and dev-emulator-study
  4. 2 new variants for the dev-emulator-program/study called dev-emulator-program-tripconfirm and dev-emulator-study-tripconfirm

Because this is a new PR, let's close the original dynamic surveys pr #7 because it is old, not exactly what we want, and has some problems in terms of incorrect commits and confusion

Added the survey-resources folder from e-mission-phone and all the associated survey json/xml/xls files
Added the surveys.json folder which contains the info about each survey that may be used on e-mission-phone (formPath, version number, compatibleWith, and dataKey)

These surveys will be used by the configs, under survey_info.buttons.[button name here].survey-name ( which = "UserProfileSurvey" for example)
We are doing these changes for now only on the Devapp study/program, for testing

- dev-emulator-program will contain the TimeUseSurvey buttons for trip-notes and place-notes
- dev-emulator-study will NOT contain any button info because we will not be using the trip-notes or place-notes buttons. This will be the "control" version without the changes for the TimeUseSurvey
…or-study

Added variants to the original dev-emulator-program/study. Adding onto the concept that program is the trip-notes and place-notes button for TimeUseSurvey and the study is the "control".

These new variants introduce the "trip-labels" button which **if filled in** (with "TripConfirmSurvey") will display a trip confirm survey button instead of the typical Multilabel format of Mode: ??? Purpose: ???
@sebastianbarry
Copy link
Contributor Author

@shankari and @JGreenlee

Adding you both for visibility

So that we can join the newly added dev-emulator-program-tripconfirm and dev-emulator-study-tripconfirm, added them to index.html
@sebastianbarry sebastianbarry mentioned this pull request Dec 27, 2022
@sebastianbarry
Copy link
Contributor Author

sebastianbarry commented Dec 27, 2022

Here are the generated QR codes if you would rather just scan them/copy paste them from here:
image

Devapp Study Tripconfirm emission://join_study?label=dev-emulator-study-tripconfirm&source=github
Devapp Program Tripconfirm emission://join_study?label=dev-emulator-program-tripconfirm&source=github

Copy link
Contributor

@shankari shankari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One fundamental change + some additional minor ones.

Comment on lines 47 to 105
"trip-labels": {
"survey-name": "TripConfirmSurvey",
"not-filled-in-label": {
"en": "Add trip details",
"es": "Agregar detalles del viaje"
},
"filled-in-label": {
"en": "Submitted",
"es": "Enviado"
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be here, at least at this point. The trip confirm survey and the user profile survey are "special".

  • trip confirm: there is only one per trip
  • user profile: there is only one per user

This is also a regression wrt the TripConfirmSurvey because it is not using the more sophisticated filled-in-label from LABEL_FUNCTIONS.

That's why we decided to have different types of surveys in the first place.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I indicated in that really long meeting today morning, there are two separate versions of the trip label survey (MULTILABEL and ENKETO). The dynamic config should simply state which one we use. If we choose ENKETO, it will always be the TripConfirmSurvey defined in surveys.json

docs/index.html Outdated
@@ -61,6 +61,8 @@ <h3>Join your NREL OpenPATH-powered study!</h3>
$scope.currStudies = [
{name: "Devapp Program", joinurl: "emission://join_study?label=dev-emulator-program&source=github" },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change this to indicate that is uses TimeUse + Buttons

Comment on lines +1 to +4
# xform-transformer

Complementary xform transformer for e-mission-phone

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you make sure to get the commit history of these changes while moving them over? it makes it much easier to review in the future and understand the context of changes.

Removed the trip-labels button and replaced it with a global one-line config named "trip-labels" which will be either ENKETO for TripConfirmSurvey or MUTLILABEL for the typical Mode: ??? Purpose: ???
- dev-emulator-program
- dev-emulator-study
- dev-emulator-program-tripconfirm
- dev-emulator-study-tripconfirm

index.html
- Changed the devapp study names to indicate which is using Tripconfirm/Multilabel and TimeUseSurvey
For the sake of having to load in an entirely new config file (and to save time on this change) we will move the surveys field back into the dynamic config files PER study/program

This makes loading the "formPath" much easier from the implementation on e-mission-phone
@shankari
Copy link
Contributor

shankari commented Dec 28, 2022

@sebastianbarry wrt bacd4ff, did you and @JGreenlee decide to go with the simple but verbose version since it is already implemented?

I am fine with that decision, and I'm glad to see that we are focusing on getting the code to work, but just want to understand the reasons.

@JGreenlee
Copy link
Collaborator

@shankari @sebastianbarry Yes, given our time constraints we are trying to just get it working, so we decided to roll back to the more verbose version at least for now.
We can revisit the dynamic surveys.json later if necessary - but we would need to write the logic to load in the surveys.json file by URL and would want your input before we made those decisions

sebastianbarry and others added 3 commits January 7, 2023 10:42
I used Jack's version of TripConfirmSurvey and made sure it matches!

For UserProfileSurvey, I just added blank labelVars since we don't need any that I know of, and I included labelTemplate to say "Answered"

For TimeUseSurvey I made it print out the result from every category that it can (so if the user chose Sleeping as Personal Care Activities then it would print out only "Sleeping")
remove extraneous fields when not in use
- filled-in-label no longer needed
- datakey not needed for timeuse survey
- labelVars not needed on demographic survey
- 'buttons' not needed if not present
Employment_related_and_educati was getting cut off and needed to be Employment_related_a_Education_activities

Voluntary_work_and_care_activi was getting cut off and needed to be Voluntary_work_and_care_activities

Confirmed that the other fields work properly
Copy link
Contributor

@shankari shankari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spec changes look fine and consistent with the current implementation.
Please make sure to include commit history of the survey-resources, or make the case for why the history is not important.

@shankari shankari changed the base branch from main to surveys-info-and-surveys-data January 17, 2023 21:00
@shankari shankari changed the base branch from surveys-info-and-surveys-data to main January 17, 2023 21:01
The new version of the survey replaces the old one at the same filepath, `time-use-survey-form-v9`. The previous version has been renamed to `time-use-survey-form-v9-old`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants