-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2450 from aditya-bhaumik/history
added indian history quiz extension
- Loading branch information
Showing
5 changed files
with
196 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>Indian History Quiz</title> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<div class="quiz-container"> | ||
<h1>Indian History Quiz</h1> | ||
<form id="quiz-form"> | ||
<div class="question"> | ||
<p>1. Who was the first Emperor of the Maurya Dynasty?</p> | ||
<input type="radio" name="q1" value="a" id="q1a"><label for="q1a">Chandragupta Maurya</label><br> | ||
<input type="radio" name="q1" value="b" id="q1b"><label for="q1b">Bindusara</label><br> | ||
<input type="radio" name="q1" value="c" id="q1c"><label for="q1c">Ashoka</label><br> | ||
<input type="radio" name="q1" value="d" id="q1d"><label for="q1d">Bimbisara</label><br> | ||
</div> | ||
<div class="question"> | ||
<p>2. In which year did India gain independence from British rule?</p> | ||
<input type="radio" name="q2" value="a" id="q2a"><label for="q2a">1945</label><br> | ||
<input type="radio" name="q2" value="b" id="q2b"><label for="q2b">1947</label><br> | ||
<input type="radio" name="q2" value="c" id="q2c"><label for="q2c">1950</label><br> | ||
<input type="radio" name="q2" value="d" id="q2d"><label for="q2d">1952</label><br> | ||
</div> | ||
<div class="question"> | ||
<p>3. Who was the founder of the Mughal Empire?</p> | ||
<input type="radio" name="q3" value="a" id="q3a"><label for="q3a">Akbar</label><br> | ||
<input type="radio" name="q3" value="b" id="q3b"><label for="q3b">Babur</label><br> | ||
<input type="radio" name="q3" value="c" id="q3c"><label for="q3c">Humayun</label><br> | ||
<input type="radio" name="q3" value="d" id="q3d"><label for="q3d">Shah Jahan</label><br> | ||
</div> | ||
<div class="question"> | ||
<p>4. Who wrote the Indian national anthem "Jana Gana Mana"?</p> | ||
<input type="radio" name="q4" value="a" id="q4a"><label for="q4a">Rabindranath Tagore</label><br> | ||
<input type="radio" name="q4" value="b" id="q4b"><label for="q4b">Bankim Chandra Chatterjee</label><br> | ||
<input type="radio" name="q4" value="c" id="q4c"><label for="q4c">Sarojini Naidu</label><br> | ||
<input type="radio" name="q4" value="d" id="q4d"><label for="q4d">Mahatma Gandhi</label><br> | ||
</div> | ||
<div class="question"> | ||
<p>5. Who was the first Prime Minister of independent India?</p> | ||
<input type="radio" name="q5" value="a" id="q5a"><label for="q5a">Mahatma Gandhi</label><br> | ||
<input type="radio" name="q5" value="b" id="q5b"><label for="q5b">Jawaharlal Nehru</label><br> | ||
<input type="radio" name="q5" value="c" id="q5c"><label for="q5c">Sardar Vallabhbhai Patel</label><br> | ||
<input type="radio" name="q5" value="d" id="q5d"><label for="q5d">Rajendra Prasad</label><br> | ||
</div> | ||
<div class="question"> | ||
<p>6. Who led the Salt March in 1930?</p> | ||
<input type="radio" name="q6" value="a" id="q6a"><label for="q6a">Mahatma Gandhi</label><br> | ||
<input type="radio" name="q6" value="b" id="q6b"><label for="q6b">Subhas Chandra Bose</label><br> | ||
<input type="radio" name="q6" value="c" id="q6c"><label for="q6c">Bhagat Singh</label><br> | ||
<input type="radio" name="q6" value="d" id="q6d"><label for="q6d">Bal Gangadhar Tilak</label><br> | ||
</div> | ||
<div class="question"> | ||
<p>7. In which year was the Battle of Plassey fought?</p> | ||
<input type="radio" name="q7" value="a" id="q7a"><label for="q7a">1757</label><br> | ||
<input type="radio" name="q7" value="b" id="q7b"><label for="q7b">1764</label><br> | ||
<input type="radio" name="q7" value="c" id="q7c"><label for="q7c">1784</label><br> | ||
<input type="radio" name="q7" value="d" id="q7d"><label for="q7d">1793</label><br> | ||
</div> | ||
<div class="question"> | ||
<p>8. Who was the last Governor-General of independent India?</p> | ||
<input type="radio" name="q8" value="a" id="q8a"><label for="q8a">Lord Mountbatten</label><br> | ||
<input type="radio" name="q8" value="b" id="q8b"><label for="q8b">C. Rajagopalachari</label><br> | ||
<input type="radio" name="q8" value="c" id="q8c"><label for="q8c">V.P. Menon</label><br> | ||
<input type="radio" name="q8" value="d" id="q8d"><label for="q8d">Rajendra Prasad</label><br> | ||
</div> | ||
<div class="question"> | ||
<p>9. Who was known as the 'Iron Man of India'?</p> | ||
<input type="radio" name="q9" value="a" id="q9a"><label for="q9a">Mahatma Gandhi</label><br> | ||
<input type="radio" name="q9" value="b" id="q9b"><label for="q9b">Sardar Vallabhbhai Patel</label><br> | ||
<input type="radio" name="q9" value="c" id="q9c"><label for="q9c">Jawaharlal Nehru</label><br> | ||
<input type="radio" name="q9" value="d" id="q9d"><label for="q9d">Subhas Chandra Bose</label><br> | ||
</div> | ||
<div class="question"> | ||
<p>10. Who was the first woman President of India?</p> | ||
<input type="radio" name="q10" value="a" id="q10a"><label for="q10a">Indira Gandhi</label><br> | ||
<input type="radio" name="q10" value="b" id="q10b"><label for="q10b">Pratibha Patil</label><br> | ||
<input type="radio" name="q10" value="c" id="q10c"><label for="q10c">Sonia Gandhi</label><br> | ||
<input type="radio" name="q10" value="d" id="q10d"><label for="q10d">Meira Kumar</label><br> | ||
</div> | ||
|
||
<button type="button" onclick="submitQuiz()">Submit</button> | ||
<div id="result"></div> | ||
</form> | ||
</div> | ||
<script src="script.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
function submitQuiz() { | ||
var totalQuestions = 10; | ||
var correctAnswers = 0; | ||
|
||
var answers = { | ||
q1: 'a', | ||
q2: 'b', | ||
q3: 'b', | ||
q4: 'a', | ||
q5: 'b', | ||
q6: 'a', | ||
q7: 'a', | ||
q8: 'b', | ||
q9: 'b', | ||
q10: 'b' | ||
}; | ||
|
||
for (var i = 1; i <= totalQuestions; i++) { | ||
var questionName = 'q' + i; | ||
var selectedOption = document.querySelector('input[name="' + questionName + '"]:checked'); | ||
|
||
if (selectedOption && selectedOption.value === answers[questionName]) { | ||
correctAnswers++; | ||
} | ||
} | ||
|
||
var result = document.getElementById('result'); | ||
result.textContent = 'You scored ' + correctAnswers + ' out of ' + totalQuestions; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* Global styles */ | ||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #e0f7fa; /* Light cyan background */ | ||
color: #000000; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
margin: 0; | ||
padding: 0; | ||
overflow: hidden; /* Prevent body from scrolling */ | ||
} | ||
|
||
/* Container styles */ | ||
.quiz-container { | ||
background-color: #b2ebf2; /* Light blue container background */ | ||
padding: 20px; | ||
border-radius: 10px; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
width: 80%; | ||
max-width: 600px; | ||
height: 80vh; /* Fixed height for the container */ | ||
overflow-y: auto; /* Enable vertical scroll */ | ||
text-align: center; | ||
} | ||
|
||
/* Heading styles */ | ||
.quiz-container h1 { | ||
font-size: 2em; | ||
margin-bottom: 20px; | ||
color: #00796b; | ||
} | ||
|
||
/* Question styles */ | ||
.question { | ||
margin-bottom: 20px; | ||
} | ||
|
||
/* Button styles */ | ||
button { | ||
background-color: #4CAF50; /* Green button */ | ||
color: white; | ||
padding: 10px 20px; | ||
border: none; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
font-size: 1em; | ||
} | ||
|
||
button:hover { | ||
background-color: #45a049; /* Darker green on hover */ | ||
} | ||
|
||
/* Result styles */ | ||
#result { | ||
margin-top: 20px; | ||
font-size: 1.2em; | ||
font-weight: bold; | ||
color: #333; | ||
} |