<!DOCTYPE html>2+<html lang="en">3+<head>4+ <meta charset="UTF-8">5+ <title>Halachah Quiz</title>6+</head>7+<body>8+9+<h1>Welcome to the Halachah Quiz!</h1>10+11+<?php12+// Define questions, options, and correct answers in an array13+$questions = [14+ ["What does 'Halachah' (הלכה) literally mean in Hebrew?", ["A) The Path (הדרך)", "B) Commandment (מצוה)", "C) Custom (מנהג)", "D) Prayer (תפילה)"], "A"],15+ ["How many main types of work are prohibited on Shabbat?", ["A) 25", "B) 39", "C) 52", "D) 18"], "B"],16+ ["Which of these activities is generally permitted on Shabbat?", ["A) Turning on a light", "B) Writing", "C) Praying", "D) Cooking"], "C"],17+ ["Which holiday requires Jews to refrain from eating bread and instead eat matzah?", ["A) Purim", "B) Yom Kippur", "C) Sukkot", "D) Passover"], "D"],18+ ["How many days do we sit in a Sukkah during Sukkot?", ["A) 3", "B) 7", "C) 10", "D) 8"], "B"]19+];20+21+// Display questions in an HTML form22+echo '<form action="" method="post">';23+foreach ($questions as $index => $q) {24+ echo "<p>" . ($index + 1) . ". " . $q[0] . "</p>";25+ foreach ($q[1] as $option) {26+ echo "<label><input type='radio' name='question$index' value='" . substr($option, 0, 1) . "'> $option</label><br>";27+ }28+}29+echo '<input type="submit" name="submit" value="Submit Quiz">';30+echo '</form>';31+32+// Check answers after form submission33+if (isset($_POST['submit'])) {34+ $score = 0;35+ foreach ($questions as $index => $q) {36+ if (isset($_POST["question$index"]) && $_POST["question$index"] == $q[2]) {37+ $score++;38+ }39+ }40+ echo "<p>You scored $score out of " . count($questions) . ".</p>";41+}42+?>43+44+</body>45+</html>
Files coming soon.
We use cookies to analyze website traffic and optimize your website experience. By accepting our use of cookies, your data will be aggregated with all other user data.