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 777777
778778 setDisabled (state ) {
779779 this .disabled = state
780+ },
781+
782+ reset () {
783+ this .questionModels .forEach (question => question .resetAnswer ())
784+ this .goToQuestion (0 )
780785 }
781786 },
782787
Original file line number Diff line number Diff line change @@ -176,6 +176,8 @@ export default class QuestionModel {
176176 if ( this . answer === optionValue || ( isArray && this . answer . indexOf ( optionValue ) !== - 1 ) ) {
177177 o . selected = true
178178 ++ numSelected
179+ } else {
180+ o . selected = false
179181 }
180182 } )
181183
@@ -197,6 +199,14 @@ export default class QuestionModel {
197199 }
198200 }
199201
202+ resetAnswer ( ) {
203+ this . answered = false
204+ this . answer = this . multiple ? [ ] : null
205+ this . other = null
206+
207+ this . resetOptions ( )
208+ }
209+
200210 isMultipleChoiceType ( ) {
201211 return [ QuestionType . MultipleChoice , QuestionType . MultiplePictureChoice ] . includes ( this . type )
202212 }
You can’t perform that action at this time.
0 commit comments