-
Notifications
You must be signed in to change notification settings - Fork 114
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
Rk unsw #615
base: rk-unsw
Are you sure you want to change the base?
Rk unsw #615
Changes from all commits
5363d83
fd66aff
84422ee
4cb6f3d
fa189e7
8814ec5
31fe33a
ea2327d
2ddfbb7
6877432
c902571
e140fc5
78e9661
bac9d5c
f1945f0
286ffaf
f5ccdf2
3c064f2
5f1965c
5667c3e
d335c82
f5ec2d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?xml version="1.0"?><h:html xmlns="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:jr="http://openrosa.org/javarosa" xmlns:odk="http://www.opendatakit.org/xforms" xmlns:orx="http://openrosa.org/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><h:head><h:title>20200420-01-trip-end-survey</h:title><model odk:xforms-version="1.0.0"><instance><data id="20200420-01-trip-end-survey" version="vDLb2u3LWnnoJMf6mXjhyt"><start/><end/><group_vs9ga59><d_purpose_main>go_home</d_purpose_main></group_vs9ga59><group_ee9rk21><travel_mode_main>vehicle_driver</travel_mode_main><Total_people_in_trip_party>1</Total_people_in_trip_party><Non_household_member_s_on_trip>0</Non_household_member_s_on_trip><Transit_fees_AUD/><Taxi_fees/></group_ee9rk21><group_bn3jd79><Vehicle_trip_Parking_location>1</Vehicle_trip_Parking_location><Parking_cost/><Total_toll_charges_p_ng_the_trip_AUD/></group_bn3jd79><__version__/><meta><instanceID/></meta></data></instance><bind jr:preload="timestamp" jr:preloadParams="start" nodeset="/data/start" type="dateTime"/><bind jr:preload="timestamp" jr:preloadParams="end" nodeset="/data/end" type="dateTime"/><bind nodeset="/data/group_vs9ga59" required="false()"/><bind nodeset="/data/group_vs9ga59/d_purpose_main" required="true()" type="string"/><bind nodeset="/data/group_ee9rk21" required="false()"/><bind nodeset="/data/group_ee9rk21/travel_mode_main" required="true()" type="string"/><bind nodeset="/data/group_ee9rk21/Total_people_in_trip_party" required="true()" type="string"/><bind nodeset="/data/group_ee9rk21/Non_household_member_s_on_trip" relevant=" /data/group_ee9rk21/Total_people_in_trip_party != '1'" required="true()" type="string"/><bind nodeset="/data/group_ee9rk21/Transit_fees_AUD" relevant=" /data/group_ee9rk21/travel_mode_main = 'bus' or /data/group_ee9rk21/travel_mode_main = 'train' or /data/group_ee9rk21/travel_mode_main = 'ferry'" required="true()" type="decimal"/><bind nodeset="/data/group_ee9rk21/Taxi_fees" relevant=" /data/group_ee9rk21/travel_mode_main = 'taxi_and_ride_'" required="true()" type="decimal"/><bind nodeset="/data/group_bn3jd79" required="false()"/><bind nodeset="/data/group_bn3jd79/Vehicle_trip_Parking_location" relevant=" /data/group_ee9rk21/travel_mode_main = 'vehicle_driver'" required="true()" type="string"/><bind nodeset="/data/group_bn3jd79/Parking_cost" relevant=" /data/group_bn3jd79/Vehicle_trip_Parking_location = '4' or /data/group_bn3jd79/Vehicle_trip_Parking_location = '3' or /data/group_bn3jd79/Vehicle_trip_Parking_location = '5' or /data/group_bn3jd79/Vehicle_trip_Parking_location = '997'" required="false()" type="decimal"/><bind nodeset="/data/group_bn3jd79/Total_toll_charges_p_ng_the_trip_AUD" relevant=" /data/group_ee9rk21/travel_mode_main = 'vehicle_driver'" required="false()" type="decimal"/><bind calculate="'vDLb2u3LWnnoJMf6mXjhyt'" nodeset="/data/__version__" type="string"/><bind jr:preload="uid" nodeset="/data/meta/instanceID" readonly="true()" type="string"/></model></h:head><h:body class="pages"><group ref="/data/group_vs9ga59"><label>Trip purpose</label><select1 ref="/data/group_vs9ga59/d_purpose_main"><label>What is the purpose of this trip?</label><item><label>Go home</label><value>go_home</value></item><item><label>Work</label><value>work</value></item><item><label>Work related</label><value>work_related</value></item><item><label>Education</label><value>education</value></item><item><label>Shopping</label><value>shopping</value></item><item><label>Social/recreation</label><value>social_recreation</value></item><item><label>Personal business/services</label><value>personal_business_services</value></item><item><label>Serve passenger (e.g. drop-off, taxi or Uber)</label><value>AUTOMATIC</value></item><item><label>Other</label><value>other</value></item></select1></group><group ref="/data/group_ee9rk21"><label>Mode choice</label><select1 ref="/data/group_ee9rk21/travel_mode_main"><label>What is your main mode of travel for this trip?</label><hint>Choose one that covers the longest distance</hint><item><label>Vehicle driver</label><value>vehicle_driver</value></item><item><label>Vehicle passenger</label><value>vehicle_passenger</value></item><item><label>Walk</label><value>walk</value></item><item><label>Bus</label><value>bus</value></item><item><label>Train or Tram</label><value>train</value></item><item><label>Ferry</label><value>ferry</value></item><item><label>Taxi and ride-sharing services (e.g. Uber)</label><value>taxi_and_ride_</value></item><item><label>Other</label><value>AUTOMATIC</value></item></select1><select1 ref="/data/group_ee9rk21/Total_people_in_trip_party"><label>Total people in trip party</label><hint>Including yourself</hint><item><label>Just me</label><value>1</value></item><item><label>2 Travelers</label><value>2</value></item><item><label>3 Travelers</label><value>3</value></item><item><label>4 Travelers</label><value>4</value></item><item><label>5 Travelers</label><value>5</value></item><item><label>6 Travelers</label><value>6</value></item><item><label>7 Travelers</label><value>7</value></item><item><label>8+ Travelers</label><value>8</value></item></select1><select1 ref="/data/group_ee9rk21/Non_household_member_s_on_trip"><label>Non-household member(s) on trip</label><item><label>Nobody (0 people)</label><value>0</value></item><item><label>1 person</label><value>1</value></item><item><label>2 people</label><value>2</value></item><item><label>3 people</label><value>3</value></item><item><label>4 people</label><value>4</value></item><item><label>5 or more people</label><value>5</value></item></select1><input ref="/data/group_ee9rk21/Transit_fees_AUD"><label>Transit fees ($AUD)</label><hint>Only for yourself</hint></input><input ref="/data/group_ee9rk21/Taxi_fees"><label>Taxi fees ($AUD)</label></input></group><group ref="/data/group_bn3jd79"><label>Vehicle</label><select1 ref="/data/group_bn3jd79/Vehicle_trip_Parking_location"><label>Vehicle trip: Parking location</label><item><label>Own driveway/garage</label><value>1</value></item><item><label>Someone else's driveway</label><value>2</value></item><item><label>Parking lot/garage</label><value>3</value></item><item><label>On street parking</label><value>4</value></item><item><label>Park & ride lot</label><value>5</value></item><item><label>Didn't park (waited, drop-off, drive-thru)</label><value>6</value></item><item><label>Other</label><value>997</value></item></select1><input ref="/data/group_bn3jd79/Parking_cost"><label>Parking cost ($AUD)</label><hint>(If none, put 0 or leave blank )</hint></input><input ref="/data/group_bn3jd79/Total_toll_charges_p_ng_the_trip_AUD"><label>Total toll charges paid during the trip? ($AUD)</label><hint>(If none, put 0 or leave blank )</hint></input></group></h:body></h:html> |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,15 @@ angular.module('emission.enketo-survey.service', [ | |
null; | ||
} | ||
|
||
function getFirstUserProfile(user_properties, answers) { | ||
const potentialCandidates = answers.filter(function(answer) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do you need to do this? you should not be able to retrieve profiles for other users anyway. You can argue that it doesn't hurt anything, but extra code = extra computation = slower response time. |
||
return answer.data.user_uuid = user_properties.uuid; | ||
}); | ||
return potentialCandidates.length ? | ||
potentialCandidates[potentialCandidates.length - 1] : | ||
null; | ||
} | ||
|
||
function _restoreAnswer(answers) { | ||
let answer = null; | ||
if (__trip) { | ||
|
@@ -170,6 +179,7 @@ angular.module('emission.enketo-survey.service', [ | |
getAllSurveyAnswers: getAllSurveyAnswers, | ||
getState: getState, | ||
getUserProfile: getUserProfile, | ||
getFirstUserProfile: getFirstUserProfile, | ||
populateLabels: populateLabels, | ||
makeAnswerFromAnswerData: makeAnswerFromAnswerData, | ||
}; | ||
|
Large diffs are not rendered by default.
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this is the problem? Because if this were the case, then the month would always be off by one (e.g. January would be 1 in the
local_dt
, converted to February by moment and displayed as such in the UI), and somebody would have noticed before this. Note thatgetLocalTimeString
is used in the master branch as well.Based on the screenshots, I believe that this fixes the immediate issue that you found, but I am concerned that if it is not based on a well-formed understanding of the underlying bug, it may lead to other regressions.
I would like to see screenshots showing that:
before I approve the change.