Skip to content
This repository was archived by the owner on Dec 8, 2022. It is now read-only.

Commit 2e09b1f

Browse files
authored
Merge pull request #135 from codewizardshq/finalfinalfinal
adds final question cutoff
2 parents 0cd4788 + 2665dbe commit 2e09b1f

File tree

4 files changed

+89
-0
lines changed

4 files changed

+89
-0
lines changed

src/plugins/router.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ const routes = [
151151
return import("@/views/Quiz/QuizFinished");
152152
}
153153

154+
// User did not make the cut
155+
if (
156+
store.state.Quiz.rankToday == store.state.Quiz.maxRank &&
157+
store.state.User.rank != store.state.Quiz.rankToday
158+
) {
159+
return import("@/views/Quiz/QuizFinishedFail");
160+
}
161+
154162
// MUST WAIT FOR NEXT QUESTION
155163
if (store.state.Quiz.awaitNextQuestion) {
156164
return import("@/views/Quiz/QuizCountdown");

src/store/quiz.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ function getDefaultState() {
5959
question: "",
6060
asset: "",
6161
rank: 0,
62+
rankToday: 0,
6263
maxRank: 0,
6364
isLastQuestion: false,
6465
hints: ["", ""],
@@ -92,6 +93,7 @@ const actions = {
9293
// get current rank and see if quiz has started
9394
try {
9495
const rank = await quiz.getRank();
96+
commit("rankToday", rank.rank);
9597
commit("maxRank", rank.maxRank);
9698
commit(
9799
"quizStartedMoment",
@@ -185,6 +187,9 @@ const mutations = {
185187
maxRank(state, value) {
186188
state.maxRank = value;
187189
},
190+
rankToday(state, value) {
191+
state.rankToday = value;
192+
},
188193
isLastQuestion(state, value) {
189194
state.isLastQuestion = value;
190195
},

src/views/Quiz/QuizFinished.vue

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,27 @@
1818
The player with the highest number of votes will be crowned the
1919
champion on May 1. Will you be the champion …
2020
<br /><br />Good luck! <br /><br />
21+
<v-btn :to="{ name: 'voting' }" color="white" light
22+
>Cast Your Votes Here</v-btn
23+
><br />
24+
<v-btn
25+
class="mr-3 mt-5"
26+
:style="{ backgroundColor: 'white !important' }"
27+
x-large
28+
color="blue"
29+
href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fcodewizardshq.com%2Fchallenge%2F&amp;src=sdkpreparse"
30+
icon
31+
><v-icon>mdi-facebook</v-icon></v-btn
32+
>
33+
<v-btn
34+
class="mt-5"
35+
:style="{ backgroundColor: 'white !important' }"
36+
x-large
37+
color="blue"
38+
href="https://twitter.com/intent/tweet?text=The%20Dragon%20Quest%20%E2%80%93%20Code%20Challenge&url=https%3A%2F%2Fcodewizardshq.com%2Fchallenge%2F&original_referer="
39+
icon
40+
><v-icon>mdi-twitter</v-icon></v-btn
41+
>
2142
</div>
2243
</template>
2344
</quiz-scroll>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<template>
2+
<div class="mt-6">
3+
<v-row justify="center">
4+
<quiz-scroll>
5+
<template v-slot:title>It's Over!</template>
6+
<template v-slot:default>
7+
<div style="padding-left:130px; padding-right: 130px;">
8+
Sorry my young pilgrim, your quest has ended.
9+
<br />
10+
<br />
11+
Be proud of the work you did!
12+
<br />
13+
<br />
14+
Brush up on your coding skills and follow us on Facebook and Twitter
15+
to compete again next year. You can still vote on The Dragon Quest
16+
winner starting 5 PM CT On Sunday, April 26.
17+
<br /><br />
18+
<v-btn :to="{ name: 'voting' }" color="white" light
19+
>Cast Your Votes Here</v-btn
20+
><br />
21+
<v-btn
22+
class="mr-3 mt-5"
23+
:style="{ backgroundColor: 'white !important' }"
24+
x-large
25+
color="blue"
26+
href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fcodewizardshq.com%2Fchallenge%2F&amp;src=sdkpreparse"
27+
icon
28+
><v-icon>mdi-facebook</v-icon></v-btn
29+
>
30+
<v-btn
31+
class="mt-5"
32+
:style="{ backgroundColor: 'white !important' }"
33+
x-large
34+
color="blue"
35+
href="https://twitter.com/intent/tweet?text=The%20Dragon%20Quest%20%E2%80%93%20Code%20Challenge&url=https%3A%2F%2Fcodewizardshq.com%2Fchallenge%2F&original_referer="
36+
icon
37+
><v-icon>mdi-twitter</v-icon></v-btn
38+
>
39+
</div>
40+
</template>
41+
</quiz-scroll>
42+
</v-row>
43+
</div>
44+
</template>
45+
46+
<script>
47+
import QuizScroll from "@/components/QuizScroll";
48+
export default {
49+
name: "quiz-finished-fail",
50+
components: {
51+
QuizScroll
52+
},
53+
mounted() {}
54+
};
55+
</script>

0 commit comments

Comments
 (0)