From 0e3aee13bdfa49d5a001ce68523c143f70f428a3 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 14 Jan 2019 21:19:06 +0100 Subject: [PATCH] Display survey responses --- .../Export.html | 23 ++++++++++++++- .../assets/js/categories/survey.js | 28 +++++++++++++++++++ .../assets/js/main.js | 1 + 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 assets/zip/personnal-data-export-navigator/assets/js/categories/survey.js diff --git a/assets/zip/personnal-data-export-navigator/Export.html b/assets/zip/personnal-data-export-navigator/Export.html index 5f1221e2..0c6c3bc3 100644 --- a/assets/zip/personnal-data-export-navigator/Export.html +++ b/assets/zip/personnal-data-export-navigator/Export.html @@ -145,8 +145,28 @@ +
- Loading survey responses + +

All your responses to surveys

+ + + + + + + + + + + + + + + + +
Response numberSurvey NumberChoice numberDate
+
@@ -172,6 +192,7 @@ + \ No newline at end of file diff --git a/assets/zip/personnal-data-export-navigator/assets/js/categories/survey.js b/assets/zip/personnal-data-export-navigator/assets/js/categories/survey.js new file mode 100644 index 00000000..4916b1ee --- /dev/null +++ b/assets/zip/personnal-data-export-navigator/assets/js/categories/survey.js @@ -0,0 +1,28 @@ +/** + * Surveys category + * + * @author Pierre HUBERT + */ + +/** + * Apply all survey responses + */ +function ApplySurveyResponses(){ + + let target = document.querySelector("#all-survey-responses tbody"); + + data.survey_responses.forEach(response => { + + createElem2({ + appendTo: target, + type: "tr", + innerHTML: + ""+response.id+"" + + ""+response.surveyID+"" + + ""+response.choiceID+"" + + ""+timeToStr(response.time_sent)+"" + }) + + }); + +} \ No newline at end of file diff --git a/assets/zip/personnal-data-export-navigator/assets/js/main.js b/assets/zip/personnal-data-export-navigator/assets/js/main.js index d46a06fb..a809a061 100644 --- a/assets/zip/personnal-data-export-navigator/assets/js/main.js +++ b/assets/zip/personnal-data-export-navigator/assets/js/main.js @@ -78,6 +78,7 @@ xhr.onload = function(){ ApplyPosts(); ApplyCommentsList(); ApplyUserLikes(); + ApplySurveyResponses(); } xhr.send(null); \ No newline at end of file