diff --git a/.github/workflows/code-quality-checks.yml b/.github/workflows/code-quality-checks.yml index af8680a..120dad7 100644 --- a/.github/workflows/code-quality-checks.yml +++ b/.github/workflows/code-quality-checks.yml @@ -25,7 +25,7 @@ jobs: npm install -g yarn yarn install - name: Install MySQL Client - run: sudo apt install default-libmysqlclient-dev + run: sudo apt update && sudo apt install default-libmysqlclient-dev - name: Install Python dependencies run: | python -m pip install --upgrade pip diff --git a/package.json b/package.json index e24211d..3924856 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "serialize-javascript": "^2.1.2", "vue": "^2.6.10", "vue-codemirror": "^4.0.6", + "vue-marquee-text-component": "^1.1.1", "vue-moment": "^4.1.0", "vue-router": "^3.1.3", "vue-the-mask": "^0.11.1", diff --git a/public/images/blue-answer-box-bg.png b/public/images/blue-answer-box-bg.png new file mode 100644 index 0000000..16007e9 Binary files /dev/null and b/public/images/blue-answer-box-bg.png differ diff --git a/public/images/book.png b/public/images/book.png new file mode 100644 index 0000000..09e1a08 Binary files /dev/null and b/public/images/book.png differ diff --git a/public/images/shield-background.png b/public/images/shield-background.png index 534f3e1..fbad9b5 100644 Binary files a/public/images/shield-background.png and b/public/images/shield-background.png differ diff --git a/public/index.html b/public/index.html index bb32131..b5e4b1d 100644 --- a/public/index.html +++ b/public/index.html @@ -5,6 +5,7 @@ + diff --git a/src/App.vue b/src/App.vue index 28cd905..e56e576 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,10 +1,14 @@ @@ -13,13 +17,17 @@ import AppBar from "@/components/AppBar"; import QuizBar from "@/components/QuizBar"; import Snackbar from "@/components/Snackbar"; +import CWHQBar from "@/components/CWHQBar"; +import LeaderboardBar from "@/components/LeaderboardBar"; export default { name: "App", components: { AppBar, QuizBar, - Snackbar + Snackbar, + CWHQBar, + LeaderboardBar } }; diff --git a/src/api/auth.js b/src/api/auth.js index 897d4ce..23a5c90 100644 --- a/src/api/auth.js +++ b/src/api/auth.js @@ -12,7 +12,7 @@ let state = { displayName: null, firstName: null, lastName: null, - rank: 0 + rank: -1 }; async function setState(newState) { @@ -71,7 +71,7 @@ async function autoLogin() { async function logout() { await request(routes.userapi_logout, {}, false); - await setState({ auth: false }); + await setState({ auth: false, rank: -1 }); } function currentUser() { diff --git a/src/api/index.js b/src/api/index.js index f7b3ca4..972e297 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,2 +1,3 @@ export { default as auth } from "./auth"; export { default as quiz } from "./quiz"; +export { default as voting } from "./voting"; diff --git a/src/api/quiz.js b/src/api/quiz.js index a36d99c..4ac30d4 100644 --- a/src/api/quiz.js +++ b/src/api/quiz.js @@ -22,6 +22,10 @@ async function submit(answer) { return result.correct; } +async function getLeaderboard() { + return request(routes.questionsapi_leaderboard, { per: 1000000 }); +} + async function submitFinal(answer, language, checkOnly) { const result = await request(routes.questionsapi_answer_final_question, { data: { @@ -38,5 +42,6 @@ export default { submit, submitFinal, getRank, - resetRank + resetRank, + getLeaderboard }; diff --git a/src/api/routes.js b/src/api/routes.js index 10f2a1f..cfc35dc 100644 --- a/src/api/routes.js +++ b/src/api/routes.js @@ -19,7 +19,14 @@ export default { questionsapi_answer_next_question: route("/api/v1/questions/answer", "POST"), questionsapi_answer_final_question: route("/api/v1/questions/final", "POST"), questionsapi_get_rank: route("/api/v1/questions/rank", "GET"), - questions_api_next_question: route("/api/v1/questions/next", "GET") + questionsapi_leaderboard: route("/api/v1/questions/leaderboard", "GET"), + questions_api_next_question: route("/api/v1/questions/next", "GET"), + voting_check: route("/api/v1/vote/check", "GET"), + voting_ballot: route("/api/v1/vote/ballot", "GET"), + voting_cast: id => { + return route(`/api/v1/vote/${id}/cast`, "POST"); + }, + voting_confirm: route("/api/v1/vote/confirm", "POST") }; // export default { diff --git a/src/api/voting.js b/src/api/voting.js new file mode 100644 index 0000000..340f1da --- /dev/null +++ b/src/api/voting.js @@ -0,0 +1,10 @@ +import routes from "./routes"; +import request from "./request"; + +async function getBallot() { + return request(routes.voting_ballot); +} + +export default { + getBallot +}; diff --git a/src/components/AppBar.vue b/src/components/AppBar.vue index c4c22b1..74cbe50 100644 --- a/src/components/AppBar.vue +++ b/src/components/AppBar.vue @@ -3,81 +3,31 @@ color="dark" flat dark - :height="100" - :max-height="100" + :height="height" + :max-height="height" class="pl-4" > -
+
- +
- - - - - - - Quiz - - - - Sign In - Create Account - Sign Out diff --git a/src/components/CWHQBar.vue b/src/components/CWHQBar.vue new file mode 100644 index 0000000..f2e1a48 --- /dev/null +++ b/src/components/CWHQBar.vue @@ -0,0 +1,20 @@ + + + diff --git a/src/components/FormAlert.vue b/src/components/FormAlert.vue new file mode 100644 index 0000000..ca07fcf --- /dev/null +++ b/src/components/FormAlert.vue @@ -0,0 +1,16 @@ + + + diff --git a/src/components/LeaderboardBar.vue b/src/components/LeaderboardBar.vue new file mode 100644 index 0000000..b0a04f9 --- /dev/null +++ b/src/components/LeaderboardBar.vue @@ -0,0 +1,58 @@ + + + diff --git a/src/components/PageCard.vue b/src/components/PageCard.vue new file mode 100644 index 0000000..e084ab9 --- /dev/null +++ b/src/components/PageCard.vue @@ -0,0 +1,14 @@ + + + diff --git a/src/components/QuizBar.vue b/src/components/QuizBar.vue index 67f047f..7786ed3 100644 --- a/src/components/QuizBar.vue +++ b/src/components/QuizBar.vue @@ -1,64 +1,77 @@ + + diff --git a/src/components/QuizNeedHelp.vue b/src/components/QuizNeedHelp.vue index 06da896..1d6a236 100644 --- a/src/components/QuizNeedHelp.vue +++ b/src/components/QuizNeedHelp.vue @@ -1,13 +1,61 @@ + + diff --git a/src/components/QuizScroll.vue b/src/components/QuizScroll.vue index 820866a..eb5b164 100644 --- a/src/components/QuizScroll.vue +++ b/src/components/QuizScroll.vue @@ -1,11 +1,12 @@