react-native-my-survey-sdk 2.2.22 → 2.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -366,11 +366,17 @@ export async function submitResponse(
|
|
|
366
366
|
if (meta.userData.city) customVariables.city = meta.userData.city;
|
|
367
367
|
}
|
|
368
368
|
|
|
369
|
+
// time_spent in whole seconds, derived from netTimeDuration (minutes)
|
|
370
|
+
const timeTakenSecs = meta?.qualityFlags
|
|
371
|
+
? Math.round(meta.qualityFlags.data.survey.netTimeDuration * 60)
|
|
372
|
+
: undefined;
|
|
373
|
+
|
|
369
374
|
const payload: Record<string, unknown> = {
|
|
370
375
|
collector_id: collectorUUID,
|
|
371
376
|
responses: [
|
|
372
377
|
{
|
|
373
378
|
response_status: 'complete',
|
|
379
|
+
...(timeTakenSecs !== undefined && { time_spent: timeTakenSecs }),
|
|
374
380
|
...(Object.keys(customVariables).length > 0 && { custom_variables: customVariables }),
|
|
375
381
|
questions: filteredAnswers.map(a => ({
|
|
376
382
|
uuid: a.questionId,
|