File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed
Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change 1919 ref =" flowform"
2020 v-on:complete =" onComplete"
2121 v-on:submit =" onQuizSubmit"
22+ v-on:timer =" onTimer"
2223 v-bind:questions =" questions"
2324 v-bind:language =" language"
2425 v-bind:standalone =" true"
5556 v-html =" language.formatString(language.pressEnter)" >
5657 </a >
5758 </div >
58- <p class =" text-success" v-if =" submitted && timerOn() " >Your time: {{ formatTime(getTime()) }}</p >
59+ <p class =" text-success" v-if =" submitted && time " >Your time: {{ formattedTime }}</p >
5960 <p class =" text-success" v-if =" submitted && score < 4" >"You scored {{ score }} out of {{ total }}. There's a lot of room for improvement."</p >
6061 <p class =" text-success" v-else-if =" submitted && score < 7" >"You scored {{ score }} out of {{ total }}. Not bad at all!"</p >
6162 <p class =" text-success" v-else-if =" submitted && score <= total" >"You scored {{ score }} out of {{ total }}. Wow, that's impressive!"</p >
8889 completed: false ,
8990 score: 0 ,
9091 total: 8 ,
92+ time: 0 ,
93+ formattedTime: 0 ,
9194 answers: {
9295 html_1: [' 2' , ' 3' ],
9396 html_2: ' false' ,
340343 this .calculateScore ()
341344 },
342345
343- getTime () {
344- return this .$refs .flowform .time
345- },
346-
347- timerOn () {
348- return this .$refs .flowform .timer
349- },
350-
351- formatTime (seconds ) {
352- return this .$refs .flowform .formatTime (seconds)
353- }
346+ onTimer (time , formattedTime ) {
347+ this .time = formattedTime
348+ this .formattedTime = formattedTime
349+ }
354350 },
355351 }
356352 </script >
Original file line number Diff line number Diff line change 566566
567567 incrementTime () {
568568 ++ this .time
569+ this .$emit (' timer' , this .time , this .formatTime (this .time ))
569570 },
570571
571572 formatTime (seconds ) {
You can’t perform that action at this time.
0 commit comments