File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 1
1
// variables
2
- var answers = new Object ( ) ; // Store user's answers
2
+ var answers = new Object ( ) ; // Store user's answers
3
3
var qn = 0 ; // Current question order
4
4
5
5
6
6
// Populate questionsObject
7
7
let q_id_pop = 0 ;
8
- var questionsObject = new Object ( ) ; // Question objects with ID keys
8
+ var questionsObject = new Object ( ) ; // Question objects with ID keys
9
9
questions . forEach ( populateQO ) ;
10
10
function populateQO ( value ) {
11
11
questionsObject [ q_id_pop ] = value ;
@@ -72,12 +72,8 @@ function prev_question() {
72
72
73
73
// RESULTS
74
74
function results ( ) {
75
- // get from session storage
76
- window . sessionStorage . answers = JSON . stringify ( answers ) ;
77
-
78
75
// Calculate final results
79
76
pct = percentageCalculation ( ) ;
80
- window . sessionStorage . percentages = JSON . stringify ( pct ) ;
81
77
82
78
// prepare arguments
83
79
var args = '?' ;
@@ -114,7 +110,7 @@ function percentageCalculation() {
114
110
for ( const id in answers ) {
115
111
// dismiss "don't know"
116
112
if ( answers [ id ] !== null ) {
117
- for ( const effectName in questionsObject [ id ] . effects ) {
113
+ for ( const effectName in questionsObject [ id ] . effects ) {
118
114
max [ effectName ] += Math . abs ( questionsObject [ id ] . effects [ effectName ] ) ;
119
115
score [ effectName ] += answers [ id ] * questionsObject [ id ] . effects [ effectName ] ;
120
116
}
Original file line number Diff line number Diff line change @@ -24,11 +24,16 @@ <h1 class="title" app-details="name"></h1>
24
24
< section class ="focus_question ">
25
25
< h2 style ="text-align:center; " id ="question-number "> Loading...</ h2 >
26
26
< p class ="question " id ="question-text "> </ p >
27
- < button class ="button " onclick ="next_question(1.0); " style ="background-color: #1b5e20; "> Strongly Agree</ button > < br >
27
+ < button class ="button " onclick ="next_question(1.0); " style ="background-color: #1b5e20; "> Extremely Agree</ button > < br >
28
+ < button class ="button " onclick ="next_question(0.75); " style ="background-color: #26862d; "> Strongly Agree</ button > < br >
28
29
< button class ="button " onclick ="next_question(0.5); " style ="background-color: #4caf50; "> Agree</ button > < br >
30
+ < button class ="button " onclick ="next_question(0.25); " style ="background-color: #60dd65; "> Kinda Agree</ button > < br >
29
31
< button class ="button " onclick ="next_question(0); " style ="background-color: #333; "> Neutral / Unsure</ button > < br >
30
- < button class ="button " onclick ="next_question(-0.5); " style ="background-color: #f44336; "> Disagree</ button > < br >
31
- < button class ="button " onclick ="next_question(-1.0); " style ="background-color: #b71c1c; "> Strongly Disagree</ button > < br >
32
+ < button class ="button " onclick ="next_question(-0.25); " style ="background-color: #ff675c; "> Kinda Disagree</ button > < br >
33
+ < button class ="button " onclick ="next_question(-0.5); " style ="background-color: #df4035; "> Disagree</ button > < br >
34
+ < button class ="button " onclick ="next_question(-0.75); " style ="background-color: #b71c1c; "> Strongly Disagree</ button > < br >
35
+ < button class ="button " onclick ="next_question(-1.0); " style ="background-color: #741212; "> Extremely Disagree</ button > < br >
36
+ < button class ="button " onclick ="next_question(null); " style ="background-color: #6e6e6e; "> Don't Know / Don't Understand</ button > < br >
32
37
< button class ="small_button " onclick ="prev_question(); " id ="back_button " style ="background-color: #bbbbbb; color: #333; "> < < Back </ button >
33
38
</ section >
34
39
You can’t perform that action at this time.
0 commit comments