Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added aptitude test extension #2444

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Aptitute Test Extension/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
90 changes: 90 additions & 0 deletions Aptitute Test Extension/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Apptitute Test</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="quiz-container">
<h1>Aptitute Test</h1>
<form id="quiz-form">
<div class="question">
<p>1. What is the next number in the series: 2, 6, 12, 20, 30?</p>
<input type="radio" name="q1" value="a" id="q1a"><label for="q1a">36</label><br>
<input type="radio" name="q1" value="b" id="q1b"><label for="q1b">40</label><br>
<input type="radio" name="q1" value="c" id="q1c"><label for="q1c">42</label><br>
<input type="radio" name="q1" value="d" id="q1d"><label for="q1d">46</label><br>
</div>
<div class="question">
<p>2. If the sum of three consecutive integers is 51, what is the middle number?</p>
<input type="radio" name="q2" value="a" id="q2a"><label for="q2a">16</label><br>
<input type="radio" name="q2" value="b" id="q2b"><label for="q2b">17</label><br>
<input type="radio" name="q2" value="c" id="q2c"><label for="q2c">18</label><br>
<input type="radio" name="q2" value="d" id="q2d"><label for="q2d">19</label><br>
</div>
<div class="question">
<p>3. A man walks 5 km north, then turns east and walks 3 km, then turns north and walks 2 km. How far is he from the starting point?</p>
<input type="radio" name="q3" value="a" id="q3a"><label for="q3a">7 km</label><br>
<input type="radio" name="q3" value="b" id="q3b"><label for="q3b">8 km</label><br>
<input type="radio" name="q3" value="c" id="q3c"><label for="q3c">9 km</label><br>
<input type="radio" name="q3" value="d" id="q3d"><label for="q3d">10 km</label><br>
</div>
<div class="question">
<p>4. If a train travels 60 km in 1 hour, how long will it take to travel 150 km at the same speed?</p>
<input type="radio" name="q4" value="a" id="q4a"><label for="q4a">2 hours</label><br>
<input type="radio" name="q4" value="b" id="q4b"><label for="q4b">2.5 hours</label><br>
<input type="radio" name="q4" value="c" id="q4c"><label for="q4c">3 hours</label><br>
<input type="radio" name="q4" value="d" id="q4d"><label for="q4d">3.5 hours</label><br>
</div>
<div class="question">
<p>5. A rectangle has a length of 10 cm and a width of 5 cm. What is its area?</p>
<input type="radio" name="q5" value="a" id="q5a"><label for="q5a">15 cm²</label><br>
<input type="radio" name="q5" value="b" id="q5b"><label for="q5b">30 cm²</label><br>
<input type="radio" name="q5" value="c" id="q5c"><label for="q5c">50 cm²</label><br>
<input type="radio" name="q5" value="d" id="q5d"><label for="q5d">100 cm²</label><br>
</div>
<div class="question">
<p>6. What is the average of the first five prime numbers?</p>
<input type="radio" name="q6" value="a" id="q6a"><label for="q6a">5</label><br>
<input type="radio" name="q6" value="b" id="q6b"><label for="q6b">5.6</label><br>
<input type="radio" name="q6" value="c" id="q6c"><label for="q6c">6</label><br>
<input type="radio" name="q6" value="d" id="q6d"><label for="q6d">6.2</label><br>
</div>
<div class="question">
<p>7. A shopkeeper buys an article for $50 and sells it for $70. What is the profit percentage?</p>
<input type="radio" name="q7" value="a" id="q7a"><label for="q7a">20%</label><br>
<input type="radio" name="q7" value="b" id="q7b"><label for="q7b">30%</label><br>
<input type="radio" name="q7" value="c" id="q7c"><label for="q7c">40%</label><br>
<input type="radio" name="q7" value="d" id="q7d"><label for="q7d">50%</label><br>
</div>
<div class="question">
<p>8. If the ratio of boys to girls in a class is 3:2 and there are 30 students, how many girls are there?</p>
<input type="radio" name="q8" value="a" id="q8a"><label for="q8a">10</label><br>
<input type="radio" name="q8" value="b" id="q8b"><label for="q8b">12</label><br>
<input type="radio" name="q8" value="c" id="q8c"><label for="q8c">15</label><br>
<input type="radio" name="q8" value="d" id="q8d"><label for="q8d">18</label><br>
</div>
<div class="question">
<p>9. A car travels 150 km in 3 hours. What is its average speed?</p>
<input type="radio" name="q9" value="a" id="q9a"><label for="q9a">40 km/h</label><br>
<input type="radio" name="q9" value="b" id="q9b"><label for="q9b">45 km/h</label><br>
<input type="radio" name="q9" value="c" id="q9c"><label for="q9c">50 km/h</label><br>
<input type="radio" name="q9" value="d" id="q9d"><label for="q9d">55 km/h</label><br>
</div>
<div class="question">
<p>10. What is the least common multiple (LCM) of 12 and 15?</p>
<input type="radio" name="q10" value="a" id="q10a"><label for="q10a">30</label><br>
<input type="radio" name="q10" value="b" id="q10b"><label for="q10b">45</label><br>
<input type="radio" name="q10" value="c" id="q10c"><label for="q10c">60</label><br>
<input type="radio" name="q10" value="d" id="q10d"><label for="q10d">75</label><br>
</div>

<button type="button" onclick="submitQuiz()">Submit</button>
<div id="result"></div>
</form>
</div>
<script src="script.js"></script>
</body>
</html>
16 changes: 16 additions & 0 deletions Aptitute Test Extension/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"manifest_version": 3,
"name": "Aptitute Test",
"version": "1.0",
"description": "A simple aptitute test extension",
"action": {
"default_popup": "index.html",
"default_icon": "icon.png"
},
"icons": {
"16": "icon.png",
"48": "icon.png",
"128": "icon.png"
},
"permissions": []
}
21 changes: 21 additions & 0 deletions Aptitute Test Extension/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Function to handle quiz submission and scoring
function submitQuiz() {
const quizForm = document.getElementById('quiz-form'); // Get the quiz form element
const resultDiv = document.getElementById('result'); // Get the result display element
const correctAnswers = ['c', 'b', 'b', 'c', 'c', 'b', 'd', 'c', 'c', 'c']; // Array of correct answers
let score = 0; // Initialize score

// Loop through each question
for (let i = 0; i < correctAnswers.length; i++) {
const question = `q${i + 1}`; // Construct the name of each question input
const selectedAnswer = quizForm[question].value; // Get the selected answer

// Check if the selected answer matches the correct answer
if (selectedAnswer === correctAnswers[i]) {
score++; // Increment score if answer is correct
}
}

// Display the final score
resultDiv.textContent = `You scored ${score} out of ${correctAnswers.length}!`;
}
88 changes: 88 additions & 0 deletions Aptitute Test Extension/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/* Global styles */
body {
font-family: Arial, sans-serif;
background-color: #282c34;
color: #ffffff;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

.quiz-container {
background-color: #3c4043;
padding: 20px;
border-radius: 12px;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
width: 100%;
max-width: 600px;
height: 80vh;
overflow-y: auto;
box-sizing: border-box;
}

h1 {
text-align: center;
margin-bottom: 20px;
font-size: 24px;
color: #61dafb;
}

.question {
margin-bottom: 20px;
}

.question p {
margin: 0 0 10px;
font-size: 18px;
color: #61dafb;
}

label {
display: flex;
align-items: center;
margin-bottom: 10px;
padding: 10px;
border: 1px solid #888;
border-radius: 8px;
cursor: pointer;
background-color: #444;
transition: background-color 0.3s, transform 0.3s;
}

label:hover {
background-color: #555;
transform: scale(1.02);
}

input[type="radio"] {
margin-right: 10px;
}

button {
display: block;
width: 100%;
padding: 12px;
background-color: #61dafb;
color: #282c34;
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 16px;
margin-top: 20px;
transition: background-color 0.3s, transform 0.3s;
}

button:hover {
background-color: #21a1f1;
transform: scale(1.05);
}

#result {
margin-top: 20px;
font-size: 20px;
text-align: center;
color: #61dafb;
}
Loading