-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
180 lines (177 loc) · 8.29 KB
/
index.html
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE html>
<html lang="en" class="bg-near-white">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<title>Crackbowl</title>
<script src="lib/vue.js"></script>
<script src="https://cdn.jsdelivr.net/vue.resource/0.9.3/vue-resource.min.js"></script>
<script src="lib/vue-focus.min.js"></script>
<link rel="stylesheet" href="css/main.css">
<script src="https://www.gstatic.com/firebasejs/3.1.0/firebase.js"></script>
<script src="lib/hammer.min.js"></script>
<script src="lib/vue-touch.min.js"></script>
<script src="lib/progressbar.min.js"></script>
<script src="lib/events.js"></script>
<script src="lib/sweetalert2.min.js"></script>
<link rel="stylesheet" href="css/sweetalert2.min.css">
<script src="lib/chartist.min.js"></script>
<script src="lib/lodash.min.js"></script>
<script src="lib/chartist-vue.js"></script>
</head>
<body>
<div id="wrapper">
<header class="bg-black white-90 dt w-100 f5">
<nav class="container b bb b--black-10">
<div class="nowrap overflow-x-auto">
<span class="dib pv3 pl3 pl0-ns pr4 dim" @click="currentView = 'questionview'">Home</span>
<span class="dib pv3 pr4 dim" @click="info">About</span>
<span class="dib pv3 pr4 dim" v-if="user" @click="currentView='statview'">Stats</span>
<span class="dib pv3 dim" v-if="!user " @click="logIn">Sign In</span>
<span class="dib pv3 dim" v-if="user" @click="logOut">Sign Out</span>
</div>
</nav>
</header>
<div class="container">
<component :is="currentView"></component>
</div>
</div>
<template id="questionView">
<div v-touch:swipeleft="nextQuestion" v-touch:swiperight="buzz" v-touch:press="toggleBuffer">
<div class="mv3">
<input v-if="canBuzz" class="u-full-width" placeholder="Type" type="text" v-model="input" @keyup.enter="submit" v-focus-model="focused">
</div>
<div>
<a class="button" @click="buzz">Buzz</a>
<a class="button" @click="nextQuestion">Next</a>
<a class="button" v-if="!pause" @click="pauseBuffer">Pause</a>
<a class="button" v-if="pause" @click="playBuffer">Play</a>
</div>
<div class="row mv2">
<alert v-for="item in $root.alerts" class="animated" transition="bounce" :data="item"></alert>
</div>
<div class="row">
<div class="eight columns br2 bg-white ph4-ns ph3 pv2">
<div v-show="timerBuffer > -1" id="timer" class="u-full-width">
<p class="tc f2 mb2 fw3">{{timerBuffer/10}} </p>
</div>
<h1 class="f4 mv2">{{currentQuestion.heading}}</h1>
<p class="f5 lh-copy">{{textBuffer}}</p>
</div>
<div class="four columns tc pa3 pb4 ph4 br2 bg-white">
<h2 class="f3">Score</h2>
<p class="f2 ">{{score}}</p>
<hr>
<h2 class="f3">Level</h2>
<select v-model="selected.level">
<option value="HS">High School</option>
</select>
<hr>
<h2 class="f3">Topics</h2>
<select v-model="selected.subject">
<option value="All">All</option>
<option v-for="option in $root.subjects" v-bind:value="option">
{{ option }}
</option>
</select>
</div>
</div>
</div>
</template>
<template id="statView">
<div class="mt4">
<div class="bg-white pa3 pb3 br2">
<h1 class="f4">Mode</h1>
<label for="one">
<input type="radio" id="one" value="graphs" v-model="mode">
<span class="label-body">Graphs</span>
</label>
<label for="two">
<input type="radio" id="two" value="questions" v-model="mode">
<span class="label-body">Questions</span>
</label>
<br>
<div class="row mb3">
<div class="four columns">
<h1 class="f4">Number of Questions</h1>
<input type="number" class="u-full-width mb2" v-model="number" v-model="input" @keyup.enter="submit" min="1" max="500">
</div>
<div class="four columns">
<h1 class="f4">Topics</h1>
<select class="u-full-width" v-model="topic">
<option value="All">All</option>
<option v-for="option in $root.subjects" v-bind:value="option">
{{ option }}
</option>
</select>
</div>
<div class="four columns" v-show="mode=='questions'">
<h1 class="f4">Filter</h1>
<select class="u-full-width" v-model="correct">
<option value="All">All</option>
<option value="true">Correct</option>
<option value="false">Incorrect</option>
</select>
</div>
</div>
<a class="button" @click="submit">Submit</a>
</div>
<div v-if="mode=='graphs' && show">
<hr>
<div class="row mb5">
<div class="six tc columns">
<p class="f4">Correct</p>
<chartist class="ct-chart" ratio="ct-major-second" type="Pie" :data="charts.correct"></chartist>
</div>
<div class="six tc columns">
<p class="f4">Subjects Answered</p>
<chartist class="ct-chart" ratio="ct-major-second" type="Pie" :data="charts.subjects"></chartist>
</div>
</div>
<div class="row mb5" v-for="arr in charts.eachSubject">
<div class="six tc columns" v-for="data in arr">
<p class="f4">{{data.title}}</p>
<chartist class="ct-chart" ratio="ct-major-second" type="Pie" :data="data"></chartist>
</div>
</div>
</div>
<div v-if="mode=='questions'">
<hr>
<div v-for="question in questions">
<question :data="question"></question>
</div>
</div>
<hr>
<p>Select the topics that you would like to run the analysis on. "None" means that the question hasn't been classified yet. Number of Questions is simply the amount of questions last answered that you would like to run through. Running it on all questions can be slow and inaccurate of a player's current skill level.
</p>
</div>
</template>
<template id="question">
<div class="pv1 ph3 white mv2" v-bind:class="{ 'bg-green': data.correct, 'bg-red': !data.correct }" @click="popup">
<h4 class="truncate mb2 mt3">{{data.heading}}</h4>
<p class="truncate">Answer: {{data.answerText}}</p>
</div>
</template>
</body>
<script>
firebase.initializeApp({
apiKey: "AIzaSyAcG7nNgaJdArS9PDZwXMZmiTej7HQitGo",
authDomain: "crackbowl-3dd7d.firebaseapp.com",
databaseURL: "https://crackbowl-3dd7d.firebaseio.com",
storageBucket: "crackbowl-3dd7d.appspot.com",
});
var db = firebase.database()
VueTouch.config.swipe = {
direction: 'horizontal'
}
Vue.use(VueTouch)
</script>
<script src="lib/util.js"></script>
<script src="views/alert.js"></script>
<script src="views/stats/question.js"></script>
<script src="views/question/root.js"></script>
<script src="views/stats/root.js"></script>
<script src="views/main.js"></script>
</html>