@@ -24,11 +24,11 @@ <h1>8values</h1>
24
24
< hr >
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 >
28
- < button class ="button " onclick ="next_question( 0.5) " style ="background-color: #4caf50; "> Agree </ button > < br >
29
- < button class ="button " onclick ="next_question( 0.0) " style ="background-color: #bbbbbb; "> 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 >
27
+ < button class ="button " onclick ="next_question( 1.0) " style ="background-color: #1b5e20; " id =" strongly_agree " > </ button > < br >
28
+ < button class ="button " onclick ="next_question( 0.5) " style ="background-color: #4caf50; " id =" agree " > </ button > < br >
29
+ < button class ="button " onclick ="next_question( 0.0) " style ="background-color: #bbbbbb; " id =" neutral " > </ button > < br >
30
+ < button class ="button " onclick ="next_question(-0.5) " style ="background-color: #f44336; " id =" disagree " > </ button > < br >
31
+ < button class ="button " onclick ="next_question(-1.0) " style ="background-color: #b71c1c; " id =" strongly_disagree " > </ button > < br >
32
32
< button class ="small_button " onclick ="prev_question() " id ="back_button "> Back</ button >
33
33
< button class ="small_button_off " id ="back_button_off "> Back</ button > < br >
34
34
@@ -55,10 +55,10 @@ <h2 style="text-align:center;" id="question-number">Loading...</h2>
55
55
. use ( window . i18nextXHRBackend )
56
56
. init ( {
57
57
"fallbackLng" : "en" ,
58
- "ns" : [ "questions" ]
58
+ "ns" : [ "questions" , "quiz" ]
59
59
} , ready )
60
60
61
- var qs ;
61
+ var qs , qz ;
62
62
var max_econ , max_dipl , max_govt , max_scty ; // Max possible scores
63
63
max_econ = max_dipl = max_govt = max_scty = 0 ;
64
64
var econ , dipl , govt , scty ; // User's scores
@@ -74,11 +74,16 @@ <h2 style="text-align:center;" id="question-number">Loading...</h2>
74
74
}
75
75
function ready ( ) {
76
76
qs = i18next . getFixedT ( null , 'questions' )
77
+ qz = i18next . getFixedT ( null , 'quiz' )
78
+
79
+ for ( i of [ "strongly_agree" , "agree" , "neutral" , "disagree" , "strongly_disagree" ] ) {
80
+ document . getElementById ( i ) . innerHTML = qz ( i )
81
+ }
77
82
display_progress ( )
78
83
}
79
84
function display_progress ( ) {
80
85
document . getElementById ( "question-text" ) . innerHTML = qs ( questions [ qn ] . question )
81
- document . getElementById ( "question-number" ) . innerHTML = "Question " + ( qn + 1 ) + " of " + ( questions . length ) ;
86
+ document . getElementById ( "question-number" ) . innerHTML = qz ( "question_no" , { current : qn + 1 , total : questions . length } )
82
87
if ( prev_answer == null ) {
83
88
document . getElementById ( "back_button" ) . style . display = 'none' ;
84
89
document . getElementById ( "back_button_off" ) . style . display = 'block' ;
0 commit comments