-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexplicits.js
120 lines (109 loc) · 3.93 KB
/
explicits.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
define(['questAPI'], function(Quest){
let API = new Quest();
let isTouch = API.getGlobal().$isTouch;
/**
* Page prototype
*/
API.addPagesSet('basicPage',{
noSubmit:false, //Change to true if you don't want to show the submit button.
header: 'Questionnaire',
decline: true,
declineText: isTouch ? 'Decline' : 'Decline to Answer',
autoFocus:true,
progressBar: 'Page <%= pagesMeta.number %> out of 3'
});
/**
* Question prototypes
*/
API.addQuestionsSet('basicQ',{
decline: 'true',
required : true,
errorMsg: {
required: isTouch
? 'Please select an answer, or click \'Decline\''
: 'Please select an answer, or click \'Decline to Answer\''
},
autoSubmit:'true',
numericValues:'true',
help: '<%= pagesMeta.number < 3 %>',
helpText: 'Tip: For quick response, click to select your answer, and then click again to submit.'
});
API.addQuestionsSet('basicSelect',{
inherit :'basicQ',
type: 'selectOne'
});
API.addQuestionsSet('basicDropdown',{
inherit :'basicQ',
type : 'dropdown',
autoSubmit:false
});
API.addQuestionsSet('therm',{
inherit: 'basicSelect',
answers: [
{text:'10 - Extremely warm', value:10},
{text:'9 - Very warm', value:9},
{text:'8 - Moderately warm', value:8},
{text:'7 - Somewhat warm', value:7},
{text:'6 - Slightly warm', value:6},
{text:'5 - Neither warm nor cold', value:5},
{text:'4 - Slightly cold', value:4},
{text:'3 - Somewhat cold', value:3},
{text:'2 - Moderately cold', value:2},
{text:'1 - Very cold', value:1},
{text:'0 - Extremely cold', value:0}
]
});
/**
*Specific questions
*/
API.addQuestionsSet('attributes7',{
inherit : 'basicSelect',
name: 'attributes7',
stem: 'Which statement best describes you?',
answers: [
{text:'I strongly prefer <%= global.whiteLabels %> to <%= global.blackLabels %>.',value:7},
{text:'I moderately prefer <%= global.whiteLabels %> to <%= global.blackLabels %>.',value:6},
{text:'I slightly prefer <%= global.whiteLabels %> to <%= global.blackLabels %>.',value:5},
{text:'I like <%= global.whiteLabels %> and <%= global.blackLabels %> equally.',value:4},
{text:'I slightly prefer <%= global.blackLabels %> to <%= global.whiteLabels %>.',value:3},
{text:'I moderately prefer <%= global.blackLabels %> to <%= global.whiteLabels %>.',value:2},
{text:'I strongly prefer <%= global.blackLabels %> to <%= global.whiteLabels %>.',value:1}
]
});
API.addQuestionsSet('thermBlack',{
inherit : 'therm',
name: 'Tblack_0to10',
stem: 'How warm or cold do you feel towards <b><%= global.blackLabels %></b>?'
});
API.addQuestionsSet('thermWhite',{
inherit : 'therm',
name: 'Twhite_0to10',
stem: 'How warm or cold do you feel towards <b><%= global.whiteLabels %></b>?'
});
API.addSequence([
{
mixer : 'random',
data : [
{
mixer : 'random',
wrapper:true,
data : [
{
inherit:'basicPage',
questions: {inherit:'thermBlack'}
},
{
inherit:'basicPage',
questions: {inherit:'thermWhite'}
}
]
},
{
inherit:'basicPage',
questions: {inherit:'attributes7'}
}
]
}
]);
return API.script;
});