-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquiz.vue
74 lines (71 loc) · 1.43 KB
/
quiz.vue
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
<template>
<v-layout>
<v-flex text-xs-center>
<img
src="/v.png"
alt="Vuetify.js"
class="mb-5"
>
<v-btn
color="primary"
flat
nuxt
@click="getQuizBundle"
>
Multi Chose Quiz
</v-btn>
<v-container fluid grid-list-lg>
<Bundle v-if="quizItems.length != 0" v-bind:propsdata="quizItems"></Bundle>
</v-container>
</v-flex>
</v-layout>
</template>
<script>
import Vue from 'vue'
import axios from 'axios'
Vue.prototype.$http = axios
import Bundle from '../layouts/quiz/bundle';
export default {
data(){
return{
quizItems: [],
type: '',
ans: []
}
},
methods: {
getQuizBundle: function() {
const act = 'getQuizBundle'
const obj = {
act,
'id':1 //시험 고유 번호
}
this.type = act
// using JSONPlaceholder
this.$http.post('/quizBundle',obj)
.then((result) => {
console.log(result.data);
this.quizItems = result.data.bundle
}).catch( error => {
console.log('error',error)
});
},
checkAnswer: function() {
const act = 'checkAnswer'
const obj = {
type,
act
}
this.$http.post('/chkAns',obj)
.then((result) => {
//success
}).catch( error => {
console.log('error',error)
});
}
},
components: {
Bundle: Bundle
}
}
</script>