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

solved #4874 and #4875 and #4870 #4876

Merged
merged 4 commits into from
Nov 10, 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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
│ │ ├── author.html
│ │ ├── autobiography.html
│ │ ├── biography.html
│ │ ├── blog-content.html
│ │ ├── blog.html
│ │ ├── book_recommend.html
│ │ ├── booking.html
Expand All @@ -184,6 +185,7 @@
│ │ ├── donate.html
│ │ ├── dystopian.html
│ │ ├── event.html
│ │ ├── exp.html
│ │ ├── experimental-fiction.html
│ │ ├── fairytale.html
│ │ ├── fantasy.html
Expand All @@ -193,6 +195,7 @@
│ │ ├── god.html
│ │ ├── googlece7a206a6cfbb7ed.html
│ │ ├── historical-fiction.html
│ │ ├── home.html
│ │ ├── horror.html
│ │ ├── image.png
│ │ ├── img.png
Expand Down Expand Up @@ -624,6 +627,8 @@
│ │ ├── silence.jpg
│ │ ├── silent.jpg
│ │ ├── silentp.jpg
│ │ ├── silver.cms
│ │ ├── silver.jpg
│ │ ├── sim.jpg
│ │ ├── sings.jpeg
│ │ ├── smoke.jpeg
Expand Down
158 changes: 158 additions & 0 deletions assets/html/exp.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>The Story of Experiments with Truth Quiz</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #ffd2d3; /* Changed to pink color */
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}

.quiz-container {
background: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: 300px;
text-align: center;
}

button {
padding: 10px 20px;
margin-top: 20px;
cursor: pointer;
background-color: #b00000;
color: white;
border: none;
border-radius: 5px;
display: block; /* Make buttons block elements for vertical display */
width: 100%; /* Make buttons full width */
}

button:hover {
background-color: #0056b3;
}

h4 {
margin: 10px 0;
}

.option {
margin: 5px 0; /* Space between options */
}

.solution {
margin-top: 10px;
text-align: left;
}

</style>
</head>
<body>

<div class="quiz-container">
<h1>The Story of Experiments with Truth Quiz</h1>
<div id="quiz-questions">
<!-- Questions will be inserted here -->
</div>
<button id="submit-button" onclick="submitQuiz()">Submit</button>
<div id="quiz-result" style="display: none;"></div>
<button id="home-button" style="display: none;" onclick="window.location.href='quizzes.html';">Return to Quizzes</button>
</div>

<script>
const quizData = [
{
question: "What is the full title of the autobiography written by Mahatma Gandhi?",
options: ["The Story of Experiments with Truth", "Truth and Non-Violence", "My Experiments with Truth", "Gandhi's Truth Journey"],
answer: "The Story of Experiments with Truth"
},
{
question: "Where was Mahatma Gandhi born?",
options: ["Pune", "Delhi", "Porbandar", "Mumbai"],
answer: "Porbandar"
},
{
question: "What was the name of the movement led by Gandhi to end British rule in India?",
options: ["Non-Cooperation Movement", "Salt March", "Quit India Movement", "Civil Disobedience Movement"],
answer: "Non-Cooperation Movement"
},
{
question: "What did Gandhi do to protest against the British Salt Tax?",
options: ["Fast until death", "Salt March", "Non-violent protests", "Boycott British goods"],
answer: "Salt March"
},
{
question: "What principle did Gandhi adopt for his political and social work?",
options: ["Satya (Truth)", "Ahimsa (Non-violence)", "Swaraj (Self-rule)", "All of the above"],
answer: "All of the above"
}
];

let currentQuestionIndex = 0;
let score = 0;

function loadQuestion() {
const questionElement = document.getElementById('quiz-questions');
questionElement.innerHTML = '';

const currentQuestion = quizData[currentQuestionIndex];
const questionText = document.createElement('h4');
questionText.innerText = currentQuestion.question;
questionElement.appendChild(questionText);

currentQuestion.options.forEach(option => {
const optionButton = document.createElement('button');
optionButton.classList.add('option');
optionButton.innerText = option;
optionButton.onclick = () => selectAnswer(option);
questionElement.appendChild(optionButton);
});
}

function selectAnswer(selectedOption) {
const currentQuestion = quizData[currentQuestionIndex];
if (selectedOption === currentQuestion.answer) {
score++;
}
currentQuestionIndex++;

if (currentQuestionIndex < quizData.length) {
loadQuestion();
} else {
showResult();
}
}

function showResult() {
const quizContainer = document.querySelector('.quiz-container');
quizContainer.innerHTML = `<h2>Your Score: ${score}/${quizData.length}</h2>`;

// Create the return home button
const homeButton = document.createElement('button');
homeButton.onclick = () => window.location.href = 'quizzes.html';
homeButton.innerText = 'Return to Quizzes';
quizContainer.appendChild(homeButton);
}

function submitQuiz() {
if (currentQuestionIndex < quizData.length) {
alert("Please answer all questions before submitting!");
} else {
showResult();
}
}

// Load the first question when the page is ready
document.addEventListener('DOMContentLoaded', loadQuestion);
</script>

</body>
</html>
158 changes: 158 additions & 0 deletions assets/html/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Home and the World Quiz</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #ffd2d3; /* Changed to pink color */
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}

.quiz-container {
background: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: 300px;
text-align: center;
}

button {
padding: 10px 20px;
margin-top: 20px;
cursor: pointer;
background-color: #b00000;
color: white;
border: none;
border-radius: 5px;
display: block; /* Make buttons block elements for vertical display */
width: 100%; /* Make buttons full width */
}

button:hover {
background-color: #0056b3;
}

h4 {
margin: 10px 0;
}

.option {
margin: 5px 0; /* Space between options */
}

.solution {
margin-top: 10px;
text-align: left;
}

</style>
</head>
<body>

<div class="quiz-container">
<h1>Home and the World Quiz</h1>
<div id="quiz-questions">
<!-- Questions will be inserted here -->
</div>
<button id="submit-button" onclick="submitQuiz()">Submit</button>
<div id="quiz-result" style="display: none;"></div>
<button id="home-button" style="display: none;" onclick="window.location.href='quizzes.html';">Return to Quizzes</button>
</div>

<script>
const quizData = [
{
question: "Who is the author of the book 'Home and the World'?",
options: ["Rabindranath Tagore", "Mahatma Gandhi", "Sarojini Naidu", "Jawaharlal Nehru"],
answer: "Rabindranath Tagore"
},
{
question: "In 'Home and the World', what is the central theme of the novel?",
options: ["Independence Movement", "Social Reforms", "Nationalism and Modernity", "Cultural Heritage"],
answer: "Nationalism and Modernity"
},
{
question: "Which character in 'Home and the World' is a symbol of traditional Indian values?",
options: ["Bimala", "Nikhil", "Sandip", "Aunt"],
answer: "Bimala"
},
{
question: "What is the role of Nikhil in 'Home and the World'?",
options: ["A nationalist leader", "Bimala's husband", "A freedom fighter", "A spiritual guide"],
answer: "Bimala's husband"
},
{
question: "In the novel, which character represents the modern, nationalist ideology?",
options: ["Bimala", "Sandip", "Nikhil", "Aunt"],
answer: "Sandip"
}
];

let currentQuestionIndex = 0;
let score = 0;

function loadQuestion() {
const questionElement = document.getElementById('quiz-questions');
questionElement.innerHTML = '';

const currentQuestion = quizData[currentQuestionIndex];
const questionText = document.createElement('h4');
questionText.innerText = currentQuestion.question;
questionElement.appendChild(questionText);

currentQuestion.options.forEach(option => {
const optionButton = document.createElement('button');
optionButton.classList.add('option');
optionButton.innerText = option;
optionButton.onclick = () => selectAnswer(option);
questionElement.appendChild(optionButton);
});
}

function selectAnswer(selectedOption) {
const currentQuestion = quizData[currentQuestionIndex];
if (selectedOption === currentQuestion.answer) {
score++;
}
currentQuestionIndex++;

if (currentQuestionIndex < quizData.length) {
loadQuestion();
} else {
showResult();
}
}

function showResult() {
const quizContainer = document.querySelector('.quiz-container');
quizContainer.innerHTML = `<h2>Your Score: ${score}/${quizData.length}</h2>`;

// Create the return home button
const homeButton = document.createElement('button');
homeButton.onclick = () => window.location.href = 'quizzes.html';
homeButton.innerText = 'Return to Quizzes';
quizContainer.appendChild(homeButton);
}

function submitQuiz() {
if (currentQuestionIndex < quizData.length) {
alert("Please answer all questions before submitting!");
} else {
showResult();
}
}

// Load the first question when the page is ready
document.addEventListener('DOMContentLoaded', loadQuestion);
</script>

</body>
</html>
40 changes: 40 additions & 0 deletions assets/html/quizzes.html
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,46 @@ <h4>Quiz Questions:</h4>
</div>
</div>



<div class="card" onclick="this.classList.toggle('flip')">
<div class="card-inner">
<div class="card-front home">
<h1>Home and the World</h1>
</div>
<div class="card-back">
<button onclick="window.location.href='home.html';">Start Quiz</button>
<div class="quiz" style="display: none;">
<h4>Quiz Questions:</h4>
<div id="quiz-questions">
<!-- Questions will be inserted here -->
</div>
<button onclick="submitQuiz("#home.html")">Submit</button>
<div id="quiz-result" style="display: none;"></div>
</div>
</div>
</div>
</div>

<div class="card" onclick="this.classList.toggle('flip')">
<div class="card-inner">
<div class="card-front exp">
<h1>The Story Of My Experiments With Truth</h1>
</div>
<div class="card-back">
<button onclick="window.location.href='exp.html';">Start Quiz</button>
<div class="quiz" style="display: none;">
<h4>Quiz Questions:</h4>
<div id="quiz-questions">
<!-- Questions will be inserted here -->
</div>
<button onclick="submitQuiz("#exp.html")">Submit</button>
<div id="quiz-result" style="display: none;"></div>
</div>
</div>
</div>
</div>

<div class="card" onclick="this.classList.toggle('flip')">
<div class="card-inner">
<div class="card-front un">
Expand Down
Loading
Loading