From 4df1325b574ae433189bf7eb2e9cdc4f2bcbc8cc Mon Sep 17 00:00:00 2001 From: Ian Wootten Date: Wed, 15 May 2019 16:15:42 +0100 Subject: [PATCH] Add questionnaire id --- launch.go | 1 + templates/launch.html | 31 ++++++++++++++++++++----------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/launch.go b/launch.go index bbfc1311..ede65033 100644 --- a/launch.go +++ b/launch.go @@ -148,6 +148,7 @@ func quickLauncherHandler(w http.ResponseWriter, r *http.Request) { urlValues.Add("ru_ref", authentication.GetDefaultValues()["ru_ref"]) urlValues.Add("collection_exercise_sid", uuid.NewV4().String()) urlValues.Add("case_id", uuid.NewV4().String()) + urlValues.Add("questionnaire_id", randomNumericString(16)) urlValues.Add("response_id", randomNumericString(16)) token, err := authentication.GenerateTokenFromDefaults(surveyURL, accountServiceURL, AccountServiceLogOutURL, urlValues) diff --git a/templates/launch.html b/templates/launch.html index 54e69f94..7d50b66b 100644 --- a/templates/launch.html +++ b/templates/launch.html @@ -54,26 +54,34 @@

Required Data

- + - - + +
- + - - + +
- + - - + + + +
+ +
+ + + +
@@ -196,7 +204,7 @@

Runner Data

document.getElementById(el_id).value = uuidv4(); } - function responseId(el_id) { + function numericId(el_id) { var result = ''; var chars = '0123456789'; for (var i = 16; i > 0; --i) { @@ -217,7 +225,8 @@

Runner Data

uuid('collection_exercise_sid'); uuid('case_id'); ruref('ru_ref'); - responseId('response_id'); + numericId('response_id'); + numericId('questionnaire_id');