From 83008da9bf7b601ccc3e95494437112f9db5e22e Mon Sep 17 00:00:00 2001 From: Peter Edmond Date: Sat, 31 May 2025 18:01:54 +0100 Subject: [PATCH] Added index.html with user instructions --- getQuestionsData.php | 22 ++++++---- index.html | 99 ++++++++++++-------------------------------- 2 files changed, 40 insertions(+), 81 deletions(-) diff --git a/getQuestionsData.php b/getQuestionsData.php index 065a716..7ecdc2f 100644 --- a/getQuestionsData.php +++ b/getQuestionsData.php @@ -14,8 +14,6 @@ function insertOption($surveyId, $question, $option, $text, $pdo) { } - - // Load config $config = require 'config.php'; $apiToken = $config['api_token']; @@ -71,7 +69,13 @@ $stmt->execute([ ]); if ($stmt->fetch()) { - echo "Site already exists. Skipping insert.\n"; + echo "Custom user qualifiers already exported for this particular survey ({$surveyId}) .
".PHP_EOL; + echo "This process only ever needs to be carried out once for each survey.
".PHP_EOL; + echo "Skipping data export.
".PHP_EOL; + echo "

"; + echo "You now need to go and export the answer data before you can get the survey reports"; + + return; } @@ -80,10 +84,10 @@ if (isset($data['result']['elements']) && is_array($data['result']['elements'])) foreach ($data['result']['elements'] as $element) { if (isset($element['QuestionID'])) { - if (isset($element['QuestionID']) && $element['QuestionID'] === "QID70") { - + /* if (isset($element['QuestionID']) && $element['QuestionID'] === "QID70") { //echo json_encode($element, JSON_PRETTY_PRINT) . PHP_EOL; - } + }*/ + if (isset($element['QuestionID']) && $element['QuestionID'] === "QID68") { echo "Survey: {$surveyId}, QuestionID: {$element['QuestionID']} : Description: {$element['QuestionDescription']} : 0 ". PHP_EOL; insertOption($surveyId, 1, 0, $element['QuestionDescription'], $pdo); @@ -93,7 +97,8 @@ if (isset($data['result']['elements']) && is_array($data['result']['elements'])) } } if (isset($element['QuestionID']) && $element['QuestionID'] === "QID69") { - echo "Survey: {$surveyId}, QuestionID: {$element['QuestionID']} : Description: {$element['QuestionDescription']} : 0 ". PHP_EOL; + echo "Survey: {$surveyId}, QuestionID: {$element['QuestionID']} : "; + echo "Description: {$element['QuestionDescription']} : 0 ". PHP_EOL; insertOption($surveyId, 2, 0, $element['QuestionDescription'], $pdo); foreach ($element['Choices'] as $index => $choice) { insertOption($surveyId, 2, $index, $choice['Display'], $pdo); @@ -101,7 +106,8 @@ if (isset($data['result']['elements']) && is_array($data['result']['elements'])) } } if (isset($element['QuestionID']) && $element['QuestionID'] === "QID70") { - echo "Survey: {$surveyId}, QuestionID: {$element['QuestionID']} : Description: {$element['QuestionDescription']} : 0 ". PHP_EOL; + echo "Survey: {$surveyId}, QuestionID: {$element['QuestionID']} : "; + echo "Description: {$element['QuestionDescription']} : 0 ". PHP_EOL; insertOption($surveyId, 3, 0, $element['QuestionDescription'], $pdo); foreach ($element['Choices'] as $index => $choice) { insertOption($surveyId, 3, $index, $choice['Display'], $pdo); diff --git a/index.html b/index.html index fca2271..c0588f4 100644 --- a/index.html +++ b/index.html @@ -1,82 +1,35 @@ - - Triangle and Inverted Triangle Spider Graphs - - - - + + + QUALTRICS DATA ANALYSIS CONTROL PANEL - -

Single Triangle

- -

Pyramid

- - - +

Data in the database is then manipulated to produce the graphics using a custom graphics + library using d3.js to produce the visualisations that you see in the reportTemplate.html file. +

- - - + \ No newline at end of file