Skip to content

Commit e45d3d4

Browse files
author
anchouls
committed
Set up a new scenario for Cognifire study
1 parent bc75d9d commit e45d3d4

File tree

6 files changed

+259
-8
lines changed

6 files changed

+259
-8
lines changed

ij-plugin/src/main/kotlin/org/jetbrains/research/tasktracker/config/survey/HtmlQuestion.kt

+29
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,32 @@ data class HtmlQuestionContainer(override val text: String) : HtmlQuestion() {
176176
}
177177
}
178178
}
179+
180+
@Serializable
181+
data class Labels(
182+
val min: String,
183+
val max: String
184+
)
185+
186+
@Serializable
187+
@SerialName("Slider")
188+
data class SliderHtmlQuestion(
189+
override val text: String,
190+
override val elementId: String,
191+
val min: Int,
192+
val max: Int,
193+
val step: Int = 1,
194+
val labels: Labels
195+
) : HtmlQuestion() {
196+
override fun toHtml(): String = buildString {
197+
append(htmlText())
198+
append("<input type=\"range\" id=\"$elementId\" name=\"$elementId\" ")
199+
append("min=\"$min\" max=\"$max\" step=\"$step\" ${isRequiredString()} ")
200+
append(" style=\"width: 100%; display: block; margin: 10px 0;\">")
201+
202+
append("<div style=\"display: flex; justify-content: space-between; font-size: 14px; color: white; margin-top: 5px;\">")
203+
append("<span>${labels.min}</span>")
204+
append("<span>${labels.max}</span>")
205+
append("</div>")
206+
}
207+
}

ij-plugin/src/main/kotlin/org/jetbrains/research/tasktracker/util/survey/SurveyParser.kt

+6
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,16 @@ class SurveyParser(private val mainWindow: MainPluginWindow, project: Project) :
3333
is HtmlQuestionContainer -> item.subQuestions.forEach {
3434
parseAndLog(it, id)
3535
}
36+
3637
is CheckboxHtmlQuestion -> item.infos.forEach { info ->
3738
val result = mainWindow.checkIfRadioButtonChecked(info.id).await()
3839
surveyLogger.log(item.text, result.toString(), option = info.id, questionId = id)
3940
}
41+
42+
is SliderHtmlQuestion -> {
43+
val result = mainWindow.getElementValue(item.elementId).await()
44+
surveyLogger.log(item.text, result, option = item.elementId, questionId = id)
45+
}
4046
}
4147
}
4248

Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
pluginName: "Name Example"
1+
pluginName: "Cognifire Research"
22
pluginDescription: "We want to track your progress through the course in order to collect data on file changes during the course completion. Please, when you are ready, press the next button."
3-
researchId: "Example"
3+
researchId: "Cognifire Research"
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
11
scenario:
22
steps:
33
- units:
4+
- !<Survey>
5+
id: "NASA_task_load_index_before_tasks"
6+
- !<Task>
7+
id: "tutorial"
8+
- !<Survey>
9+
id: "NASA_task_load_index"
10+
- !<Task>
11+
id: "the_first_date_with_programming"
12+
- !<Survey>
13+
id: "NASA_task_load_index"
14+
- !<Task>
15+
id: "warm_up_and_mastermind_advanced"
16+
- !<Survey>
17+
id: "NASA_task_load_index"
418
- !<Task>
5-
id: "main"
19+
id: "almost_done"
20+
- !<Survey>
21+
id: "NASA_task_load_index"
622
- !<Survey>
7-
id: "default"
23+
id: "final_survey"

ij-plugin/src/main/resources/org/jetbrains/research/tasktracker/config/survey_default.yaml

+141-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,144 @@ surveys:
3030
text: Textarea question
3131
elementId: textarea
3232
rows: 5
33-
cols: 50
33+
cols: 50
34+
35+
- id: NASA_task_load_index_before_tasks
36+
htmlQuestions:
37+
- !<Slider>
38+
text: "How mentally demanding was your previous work or non work-related activities today?"
39+
elementId: mental_demand
40+
required: true
41+
min: 0
42+
max: 20
43+
step: 1
44+
labels:
45+
min: "Very Low"
46+
max: "Very High"
47+
- !<Slider>
48+
text: "How physically demanding was your previous work or non work-related activities today?"
49+
elementId: physical_demand
50+
required: true
51+
min: 0
52+
max: 20
53+
step: 1
54+
labels:
55+
min: "Very Low"
56+
max: "Very High"
57+
- !<Slider>
58+
text: "How hurried or rushed was the pace of your previous work or non work-related activities today?"
59+
elementId: temporal_demand
60+
required: true
61+
min: 0
62+
max: 20
63+
step: 1
64+
labels:
65+
min: "Very Low"
66+
max: "Very High"
67+
- !<Slider>
68+
text: "How successful were you in accomplishing what you were asked to do?"
69+
elementId: performance
70+
required: true
71+
min: 0
72+
max: 20
73+
step: 1
74+
labels:
75+
min: "Perfect"
76+
max: "Failure"
77+
- !<Slider>
78+
text: "How hard did you have to work to accomplish your level of performance?"
79+
elementId: effort
80+
required: true
81+
min: 0
82+
max: 20
83+
step: 1
84+
labels:
85+
min: "Very Low"
86+
max: "Very High"
87+
- !<Slider>
88+
text: "How insecure, discouraged, irritated, stressed, and annoyed were you?"
89+
elementId: frustration
90+
required: true
91+
min: 0
92+
max: 20
93+
step: 1
94+
labels:
95+
min: "Very Low"
96+
max: "Very High"
97+
98+
- id: NASA_task_load_index
99+
htmlQuestions:
100+
- !<Slider>
101+
text: "How mentally demanding was the task?"
102+
elementId: mental_demand
103+
required: true
104+
min: 0
105+
max: 20
106+
step: 1
107+
labels:
108+
min: "Very Low"
109+
max: "Very High"
110+
- !<Slider>
111+
text: "How physically demanding was the task?"
112+
elementId: physical_demand
113+
required: true
114+
min: 0
115+
max: 20
116+
step: 1
117+
labels:
118+
min: "Very Low"
119+
max: "Very High"
120+
- !<Slider>
121+
text: "How hurried or rushed was the pace of the task?"
122+
elementId: temporal_demand
123+
required: true
124+
min: 0
125+
max: 20
126+
step: 1
127+
labels:
128+
min: "Very Low"
129+
max: "Very High"
130+
- !<Slider>
131+
text: "How successful were you in accomplishing what you were asked to do?"
132+
elementId: performance
133+
required: true
134+
min: 0
135+
max: 20
136+
step: 1
137+
labels:
138+
min: "Perfect"
139+
max: "Failure"
140+
- !<Slider>
141+
text: "How hard did you have to work to accomplish your level of performance?"
142+
elementId: effort
143+
required: true
144+
min: 0
145+
max: 20
146+
step: 1
147+
labels:
148+
min: "Very Low"
149+
max: "Very High"
150+
- !<Slider>
151+
text: "How insecure, discouraged, irritated, stressed, and annoyed were you?"
152+
elementId: frustration
153+
required: true
154+
min: 0
155+
max: 20
156+
step: 1
157+
labels:
158+
min: "Very Low"
159+
max: "Very High"
160+
161+
- id: final_survey
162+
htmlQuestions:
163+
- !<Radio>
164+
text: Single choice question
165+
elementId: single
166+
required: true
167+
info:
168+
- id: single1
169+
value: 1
170+
- id: single2
171+
value: 2
172+
- id: single3
173+
value: 3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,64 @@
11
tasks:
2-
- description: "Description should be specified here"
3-
id: main
4-
name: "Name Example"
2+
- description: >
3+
Solve "Tutorial" lesson in the "Kotlin Onboarding: Introduction" course, and after that, press the "Next" button.
4+
files:
5+
- extension: KOTLIN
6+
filename: Main
7+
isInternal: false
8+
relativePath: Tutorial/task/src/main/kotlin/jetbrains/course/tutorial
9+
sourceSet: SRC
10+
id: tutorial
11+
name: "Cognifire Research"
12+
13+
- description: >
14+
Solve "The first date with programming" lesson, and after that, press the "Next" button.
15+
files:
16+
- extension: KOTLIN
17+
filename: Main
18+
isInternal: false
19+
relativePath: Introduction/task/src/main/kotlin/jetbrains/kotlin/course/welcome
20+
sourceSet: SRC
21+
- extension: KOTLIN
22+
filename: Main
23+
isInternal: false
24+
relativePath: TheFirstDateWithProgramming/task/src/main/kotlin/jetbrains/kotlin/course/first/date
25+
sourceSet: SRC
26+
- extension: KOTLIN
27+
filename: RealQuestions
28+
isInternal: false
29+
relativePath: TheFirstDateWithProgramming/task/src/main/kotlin/jetbrains/kotlin/course/first/date
30+
sourceSet: SRC
31+
id: the_first_date_with_programming
32+
name: "Cognifire Research"
33+
34+
- description: >
35+
Solve "Warm Up" and "Mastermind Advanced" lessons, and after that, press the "Next" button.
36+
files:
37+
- extension: KOTLIN
38+
filename: Main
39+
isInternal: false
40+
relativePath: WarmUp/task/src/main/kotlin/jetbrains/kotlin/course/warmup
41+
sourceSet: SRC
42+
- extension: KOTLIN
43+
filename: Main
44+
isInternal: false
45+
relativePath: MastermindAdvanced/task/src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced
46+
sourceSet: SRC
47+
- extension: KOTLIN
48+
filename: Util
49+
isInternal: false
50+
relativePath: WarmUp/task/src/main/kotlin/jetbrains/kotlin/course/warmup
51+
sourceSet: SRC
52+
id: warm_up_and_mastermind_advanced
53+
name: "Cognifire Research"
54+
55+
- description: >
56+
Solve "Almost Done" lesson, and after that, press the "Next" button.
57+
files:
58+
- extension: KOTLIN
59+
filename: Main
60+
isInternal: false
61+
relativePath: AlmostDone/task/src/main/kotlin/jetbrains/kotlin/course/almost/done
62+
sourceSet: SRC
63+
id: almost_done
64+
name: "Cognifire Research"

0 commit comments

Comments
 (0)