Clean up, add navbar
This commit is contained in:
@@ -30,17 +30,12 @@ const getRandQuestion = async ({ response }) => {
|
|||||||
const checkRandQuestion = async ({ request, response }) => {
|
const checkRandQuestion = async ({ request, response }) => {
|
||||||
const body = await request.body();
|
const body = await request.body();
|
||||||
const data = await body.value;
|
const data = await body.value;
|
||||||
console.log(data);
|
|
||||||
const questionId = data.questionId;
|
const questionId = data.questionId;
|
||||||
const optionId = data.optionId;
|
const optionId = data.optionId;
|
||||||
console.log(questionId);
|
|
||||||
console.log(optionId);
|
|
||||||
const correctOptionIds = (
|
const correctOptionIds = (
|
||||||
await answerService.getCorrectOptionIds(questionId)
|
await answerService.getCorrectOptionIds(questionId)
|
||||||
).map((obj) => obj.id);
|
).map((obj) => obj.id);
|
||||||
console.log(correctOptionIds);
|
|
||||||
const correct = correctOptionIds.includes(Number(optionId));
|
const correct = correctOptionIds.includes(Number(optionId));
|
||||||
console.log(correct);
|
|
||||||
response.body = { correct: correct };
|
response.body = { correct: correct };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,31 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
<link rel="stylesheet" href="https://unpkg.com/papercss@1.8.2/dist/paper.min.css">
|
<link rel="stylesheet" href="https://unpkg.com/papercss@1.8.2/dist/paper.min.css">
|
||||||
<title>Quizzy Application</title>
|
<title>Quizzy</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<% if (it.user) { %>
|
||||||
|
<nav class="border fixed split-nav">
|
||||||
|
<div class="nav-brand">
|
||||||
|
<h3>Hello <%= it.user.name %>. You have <%= it.user.chorecoins %> chore coins.</a></h3>
|
||||||
|
</div>
|
||||||
|
<div class="collapsible">
|
||||||
|
<input id="collapsible1" type="checkbox" name="collapsible1">
|
||||||
|
<label for="collapsible1">
|
||||||
|
<div class="bar1"></div>
|
||||||
|
<div class="bar2"></div>
|
||||||
|
</label>
|
||||||
|
<div class="collapsible-body">
|
||||||
|
<ul class="inline">
|
||||||
|
<li><a href="/">Home</a></li>
|
||||||
|
<li><a href="/topics">Topics</a></li>
|
||||||
|
<li><a href="/quiz">Quiz</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
<% } %>
|
||||||
|
|
||||||
<div class="paper container">
|
<div class="paper container">
|
||||||
<%~ it.body %>
|
<%~ it.body %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<% layout("./layouts/layout.eta") %>
|
<% layout("./layouts/layout.eta") %>
|
||||||
|
|
||||||
<h1>MCQ Application</h1>
|
<h1>Quizzy Application</h1>
|
||||||
|
|
||||||
<P>This is a web application that is used for repeated practice of learned content. The application provides a list of topics and allows creating multiple-choice questions into those topics that are then answered by self and others.</p>
|
<P>This is a web application that is used for repeated practice of learned content. The application provides a list of topics and allows creating multiple-choice questions into those topics that are then answered by self and others.</p>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user