diff --git a/Physics Quiz/icon.png b/Physics Quiz/icon.png new file mode 100644 index 00000000..a1d3b470 Binary files /dev/null and b/Physics Quiz/icon.png differ diff --git a/Physics Quiz/index.html b/Physics Quiz/index.html new file mode 100644 index 00000000..f80d7cc5 --- /dev/null +++ b/Physics Quiz/index.html @@ -0,0 +1,89 @@ + + + + + + Cricket Quiz + + + +
+

Physics Quiz

+
+
+

1. What is the speed of light in a vacuum?

+
+
+
+
+
+
+

2. Who formulated the theory of general relativity?

+
+
+
+
+
+
+

3. What is the unit of force?

+
+
+
+
+
+
+

4. What is the first law of thermodynamics?

+
+
+
+
+
+
+

5. What is the main principle of quantum mechanics?

+
+
+
+
+
+
+

6. Who discovered the electron?

+
+
+
+
+
+
+

7. What is the value of gravitational acceleration on Earth?

+
+
+
+
+
+
+

8. What is the primary difference between AC and DC current?

+
+
+
+
+
+
+

9. What does E=mc2 represent?

+
+
+
+
+
+
+

10. What is the name of the hypothetical particle associated with the Higgs field?

+
+
+
+
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/Physics Quiz/manifest.json b/Physics Quiz/manifest.json new file mode 100644 index 00000000..70695489 --- /dev/null +++ b/Physics Quiz/manifest.json @@ -0,0 +1,16 @@ +{ + "manifest_version": 3, + "name": "Chemistry Quiz", + "version": "1.0", + "description": "A simple Chemistry quiz extension", + "action": { + "default_popup": "index.html", + "default_icon": "icon.png" + }, + "icons": { + "16": "icon.png", + "48": "icon.png", + "128": "icon.png" + }, + "permissions": [] +} \ No newline at end of file diff --git a/Physics Quiz/script.js b/Physics Quiz/script.js new file mode 100644 index 00000000..b97b3257 --- /dev/null +++ b/Physics Quiz/script.js @@ -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', 'a', 'd', 'c', 'b', 'a', 'd', 'a', 'd']; // 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}!`; +} \ No newline at end of file diff --git a/Physics Quiz/styles.css b/Physics Quiz/styles.css new file mode 100644 index 00000000..db338456 --- /dev/null +++ b/Physics Quiz/styles.css @@ -0,0 +1,81 @@ +/* Global styles */ +body { + font-family: Arial, sans-serif; + background-color: #f5f5f5; + color: #333; + margin: 0; + padding: 0; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} + +.quiz-container { + background-color: #fff; + padding: 20px; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + width: 100%; + max-width: 600px; + height: 80vh; + overflow-y: auto; + box-sizing: border-box; +} + +h1 { + text-align: center; + margin-bottom: 20px; + font-size: 24px; +} + +.question { + margin-bottom: 20px; +} + +.question p { + margin: 0 0 10px; + font-size: 18px; +} + +label { + display: block; + margin-bottom: 10px; + padding: 10px; + border: 1px solid #ddd; + border-radius: 4px; + cursor: pointer; + background-color: #f9f9f9; + transition: background-color 0.3s; +} + +label:hover { + background-color: #f1f1f1; +} + +input[type="radio"] { + margin-right: 10px; +} + +button { + display: block; + width: 100%; + padding: 10px; + background-color: #007bff; + color: white; + border: none; + border-radius: 5px; + cursor: pointer; + font-size: 16px; + margin-top: 20px; +} + +button:hover { + background-color: #0056b3; +} + +#result { + margin-top: 20px; + font-size: 20px; + text-align: center; +} \ No newline at end of file