From b6bba5e14f36d4af41df20a12d95342729d40fcd Mon Sep 17 00:00:00 2001 From: Sally Guthrie Date: Tue, 26 Feb 2019 17:04:22 -0500 Subject: [PATCH] question answer options are separated using semicolons, so using semicolons to sanitize commas causes a bug further down the line in analysis: https://github.com/onnela-lab/beiwe-backend/issues/53. Since question answer options are already separated using semicolons and commas are no longer converted to semicolons, separate multiple checkbox answers with semicolons instead of commas. --- .../main/java/org/beiwe/app/survey/SurveyAnswersRecorder.java | 2 +- .../main/java/org/beiwe/app/survey/SurveyTimingsRecorder.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/beiwe/app/survey/SurveyAnswersRecorder.java b/app/src/main/java/org/beiwe/app/survey/SurveyAnswersRecorder.java index afc2ebd7..8790b566 100644 --- a/app/src/main/java/org/beiwe/app/survey/SurveyAnswersRecorder.java +++ b/app/src/main/java/org/beiwe/app/survey/SurveyAnswersRecorder.java @@ -178,7 +178,7 @@ public static String getSelectedCheckboxes(LinearLayout checkboxesList) { // If this CheckBox is selected, add it to the list of selected answers if (checkBox.isChecked()) { - answersList += checkBox.getText().toString() + ", "; + answersList += checkBox.getText().toString() + "; "; } } } diff --git a/app/src/main/java/org/beiwe/app/survey/SurveyTimingsRecorder.java b/app/src/main/java/org/beiwe/app/survey/SurveyTimingsRecorder.java index 3291b267..54c0595f 100644 --- a/app/src/main/java/org/beiwe/app/survey/SurveyTimingsRecorder.java +++ b/app/src/main/java/org/beiwe/app/survey/SurveyTimingsRecorder.java @@ -77,7 +77,7 @@ private static void appendLineToLogFile(String message) { public static String sanitizeString(String input) { input = input.replaceAll("[\t\n\r]", " "); // Replace all commas in the text with semicolons, because commas are the delimiters - input = input.replaceAll(",", ";"); + input = input.replaceAll(",", "."); return input; }