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

Implementation for the survey_response syncing. #830

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions bin/debug/extract_timeline_for_day_range_and_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# only needed to read the motion_activity
# https://github.com/e-mission/e-mission-docs/issues/356#issuecomment-520630934
import emission.export.export as eee
import emission.core.wrapper.user as ecwu

def export_timeline(user_id, start_day_str, end_day_str, timezone, file_name):
logging.info("Extracting timeline for user %s day %s -> %s and saving to file %s" %
Expand Down
2 changes: 2 additions & 0 deletions emission/core/wrapper/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def _getData2Wrapper():
"manual/mode_confirm": "userlabel",
# user confirmation of the travel purpose
"manual/purpose_confirm": "userlabel",
#user response to the survey questions
"manual/survey_response": "userlabel",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that @asiripanich uses manual/survey_confirm instead. Maybe we could come up with a standardized nomenclature. Also, should we have separate labels for the initial demographic survey and the trip-level surveys?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, so the current nomenclature follows the "statement_confirm" pattern? I can switch to that.
What do you mean by separate labels for this?

Copy link
Contributor

@shankari shankari Aug 9, 2021

Choose a reason for hiding this comment

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

@jruzekowicz don't change to it until we hear from @asiripanich

What do you mean by separate labels for this?

Right now, we are only displaying a survey when the user starts the onboarding process. We might want to have trip-level surveys, similar to https://nextcloud.damajash.org/s/CRZg4zQY2gKWMnF as well, in which case, we may want to have a different key for that.

You don't need to make that different key right now, but we may want to call this manual/demo_survey_confirm or something to leave open the door for the trip level updates in the future.

Copy link
Member

@asiripanich asiripanich Aug 13, 2021

Choose a reason for hiding this comment

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

Hi Shankari, personally I don't mind survery_response. We do the initial survey differently than you do. We use an in-app browser to open an online survey form instead of using Enketo. However, for the trip-level surveys, we use Enketo because it allows us to capture the responses and use them to display on the UI and the responses can be edited without internet. I do not see myself using Enketo for other things other than the trip-level surveys. Online forms such as Kobotoolbox and Qualtrics allows me to modify the form mid study without updating my UI channel.

Maybe, we can add the survey name to survey_response to allow us to later distinguish the responses of different surveys.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shankari Would it be better suited to call this something such as "Itinerum_survey_response"?

# user survey results. The survey results are a JSON blob
"manual/survey": "survey",
# user confirmation of the destination (unsure how this will
Expand Down
12 changes: 12 additions & 0 deletions emission/net/usercache/formatters/android/survey_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import *
import logging
import emission.net.usercache.formatters.generic.userlabel as fgl

def format(entry):
return fgl.format(entry)
12 changes: 12 additions & 0 deletions emission/net/usercache/formatters/ios/survey_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import *
import logging
import emission.net.usercache.formatters.generic.userlabel as fgl

def format(entry):
return fgl.format(entry)
1 change: 1 addition & 0 deletions emission/storage/timeseries/builtin_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def __init__(self, user_id):
"manual/incident": self.timeseries_db,
"manual/mode_confirm": self.timeseries_db,
"manual/purpose_confirm": self.timeseries_db,
"manual/survey_response": self.timeseries_db,
Copy link
Member

Choose a reason for hiding this comment

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

@atton16, it seems like @shankari's team is going with survey_response. Maybe it is what we should use as well for our Enketo plugin?

Copy link
Contributor

Choose a reason for hiding this comment

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

There is a "manual/survey" in gis-based-mode-detection branch though. So ???

Copy link
Contributor

Choose a reason for hiding this comment

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

But this one works for me anyways.

"manual/destination_confirm": self.timeseries_db,
"segmentation/raw_trip": self.analysis_timeseries_db,
"segmentation/raw_place": self.analysis_timeseries_db,
Expand Down