File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 777
777
778
778
setDisabled (state ) {
779
779
this .disabled = state
780
+ },
781
+
782
+ reset () {
783
+ this .questionModels .forEach (question => question .resetAnswer ())
784
+ this .goToQuestion (0 )
780
785
}
781
786
},
782
787
Original file line number Diff line number Diff line change @@ -176,6 +176,8 @@ export default class QuestionModel {
176
176
if ( this . answer === optionValue || ( isArray && this . answer . indexOf ( optionValue ) !== - 1 ) ) {
177
177
o . selected = true
178
178
++ numSelected
179
+ } else {
180
+ o . selected = false
179
181
}
180
182
} )
181
183
@@ -197,6 +199,14 @@ export default class QuestionModel {
197
199
}
198
200
}
199
201
202
+ resetAnswer ( ) {
203
+ this . answered = false
204
+ this . answer = this . multiple ? [ ] : null
205
+ this . other = null
206
+
207
+ this . resetOptions ( )
208
+ }
209
+
200
210
isMultipleChoiceType ( ) {
201
211
return [ QuestionType . MultipleChoice , QuestionType . MultiplePictureChoice ] . includes ( this . type )
202
212
}
You can’t perform that action at this time.
0 commit comments