-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathClassicChallenge.vue
More file actions
96 lines (90 loc) · 2.13 KB
/
ClassicChallenge.vue
File metadata and controls
96 lines (90 loc) · 2.13 KB
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
<template>
<div class="container">
<challenge-header />
<div class="challenge-container flex column justify-between align-center">
<classic-question id="question" :question="question" />
<classic-input />
</div>
</div>
</template>
<script lang="ts">
import ClassicInput from "./ClassicInput.vue";
import ClassicQuestion from "./ClassicQuestion.vue";
import ChallengeStreak from "./ChallengeStreak.vue";
import ChallengeHeader from "./ChallengeHeader.vue";
import {
PracticeActions,
PracticeGetters,
PracticeOptions
} from "../store/practice/practice";
import { Operator } from "../engine/math_questions/expression/models";
import { ChallengeType } from "../engine/models/math_question";
import { mapActions, mapGetters } from "vuex";
import Vue from "vue";
export default Vue.extend({
components: {
ClassicInput,
ClassicQuestion,
ChallengeStreak,
ChallengeHeader
},
props: {
challengeTypes: Array as () => Array<ChallengeType>,
operators: Array as () => Array<Operator>,
difficulty: String
},
mounted() {
this.initializePractice({
operators: this.operators,
difficulty: this.difficulty,
challengeTypes: this.challengeTypes
} as PracticeOptions);
this.newQuestion();
},
methods: {
...mapActions({
newQuestion: PracticeActions.NEW_QUESTION,
initializePractice: PracticeActions.INIT
}),
myProperty(): boolean {
// <- Here
return true;
}
},
computed: {
...mapGetters({
question: PracticeGetters.QUESTION_LATEX,
practiceSessionActive: PracticeGetters.PRACTICE_SESSION_ACTIVE
})
},
watch: {
practiceSessionActive(newValue) {
if (newValue == false) this.$router.push("/");
}
}
});
</script>
<style scoped>
.container {
width: 420px;
background-color: #114489;
}
#question {
margin-bottom: 72px;
max-height: 72px;
}
#input {
flex: auto;
}
@media (max-width: 599px) {
.container {
width: 100%;
min-height: 100vh;
min-height: -webkit-fill-available;
display: flex;
flex-direction: column;
background-color: #114489;
justify-content: space-between;
}
}
</style>