Skip to content
Open
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
62 changes: 62 additions & 0 deletions flask-quiz.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Flask QUIZ</title>
<link rel="stylesheet" href="styles.css" />
</head>

<body>
<div class="quiz-header">
<div class="timer-container">
<span>Time Left: </span><span id="timer">60</span>s
</div>
<div class="score-display">
<span>Score: </span><span id="scoree">0</span>
</div>
</div>

<div class="quiz-container">
<div class="progress-header">
<div style="display: flex; justify-content: space-between; align-items: center;">
<h2 style="margin: 0; color: #333;">Flask Quiz</h2>
<a href="index.html" class="back-button-icon" aria-label="Back to Home">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
<polyline points="9 22 9 12 15 12 15 22" />
</svg>
</a>
</div>

<div class="progress-container">
<div class="progress-info">
<span id="progress-text">Progress: 0 / 10</span>
<span id="progress-percentage">0%</span>
</div>
<div class="progress-bar">
<div class="progress-fill" id="progress-fill"></div>
</div>
</div>
</div>

<div class="quiz-section">
<div class="btnclass">
<button id="start-btn">Start</button>
<button id="restart-btn" style="display:none;">Restart</button>
</div>

<div class="questions-scroll-container">
<div id="flask-questions"></div>
</div>
</div>

<div id="result" class="result"></div>
</div>

<script src="script.js"></script>
</body>

</html>
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ <h1>Welcome to the Web Development Quiz</h1>
<li><a href="django-quiz.html" class="quiz-link quiz-item" tabindex="0">Django Quiz</a></li>
<li><a href="dsa-quiz.html" class="quiz-link quiz-item" tabindex="0">DSA Quiz</a></li>
<li><a href="dbms-quiz.html" class="quiz-link quiz-item" tabindex="0">DBMS Quiz</a></li>
<li><a href="flask-quiz.html" class="quiz-link quiz-item" tabindex="0">Flask Quiz</a></li>


</ul>
Expand Down
58 changes: 58 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,60 @@ const dbmsQuestions = [
answer: "DISTINCT"
}
];
//Flask Questions
const flaskQuestions=[
{
question: "Flask is a ____ framework?",
options: ["Frontend", "Backend", "Database", "Testing"],
answer: "Backend"
},
{
question: "Which language is Flask built with?",
options: ["Python", "JavaScript", "Java", "C#"],
answer: "Python"
},
{
question: "Which template engine does Flask commonly use?",
options: ["EJS", "Jinja2", "Pug", "Handlebars"],
answer: "Jinja2"
},
{
question: "Flask follows which type of architecture?",
options: ["MVC", "MVVM", "MVP", "None"],
answer: "MVC"
},
{
question: "Which command is used to run a Flask application?",
options: ["python app.py", "flask run", "npm start", "node server.js"],
answer: "flask run"
},
{
question: "What file is typically used to define routes in a Flask app?",
options: ["routes.py", "app.py", "index.html", "server.js"],
answer: "app.py"
},
{
question: "Which method is used to handle form submission in Flask?",
options: ["GET", "POST", "FETCH", "PUT"],
answer: "POST"
},
{
question: "Which decorator is used to define a route in Flask?",
options: ["@route", "@app.route", "@get", "@flask.route"],
answer: "@app.route"
},
{
question: "How do you render an HTML template in Flask?",
options: ["render_template()", "show_html()", "display_page()", "render_page()"],
answer: "render_template()"
},
{
question: "Which object is used to get form data in Flask?",
options: ["request", "form", "data", "input"],
answer: "request"
}
];




Expand Down Expand Up @@ -564,6 +618,10 @@ if (document.getElementById("html-questions")) {
questions = dsaQuestions;
sectionId = "dsa-questions";
}
else if (document.getElementById("flask-questions")) {
questions = flaskQuestions;
sectionId = "flask-questions";
}

// Render questions and attach event listeners only if a valid section is found
if (sectionId) {
Expand Down
54 changes: 54 additions & 0 deletions src/data/flask.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"questions": [
{
"question": "Flask is a ____ framework?",
"options": ["Frontend", "Backend", "Database", "Testing"],
"answer": "Backend"
},
{
"question": "Which language is Flask built with?",
" options": ["Python", "JavaScript", "Java", "C#"],
"answer": "Python"
},
{
"question": "Which template engine does Flask commonly use?",
"options": ["EJS", "Jinja2", "Pug", "Handlebars"],
"answer": "Jinja2"
},
{
"question": "Flask follows which type of architecture?",
"options": ["MVC", "MVVM", "MVP", "None"],
"answer": "MVC"
},
{
"question": "Which command is used to run a Flask application?",
"options": ["python app.py", "flask run", "npm start", "node server.js"],
"answer": "flask run"
},
{
"question": "What file is typically used to define routes in a Flask app?",
"options": ["routes.py", "app.py", "index.html", "server.js"],
"answer": "app.py"
},
{
"question": "Which method is used to handle form submission in Flask?",
"options": ["GET", "POST", "FETCH", "PUT"],
"answer": "POST"
},
{
"question": "Which decorator is used to define a route in Flask?",
"options": ["@route", "@app.route", "@get", "@flask.route"],
"answer": "@app.route"
},
{
"question": "How do you render an HTML template in Flask?",
"options": ["render_template()", "show_html()", "display_page()", "render_page()"],
"answer": "render_template()"
},
{
"question": "Which object is used to get form data in Flask?",
"options": ["request", "form", "data", "input"],
"answer": "request"
}
]
}
1 change: 1 addition & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ <h2>Select a Quiz Topic</h2>
<a href="quiz.html?topic=dsa" class="topic-card">DSA</a>
<a href="quiz.html?topic=django" class="topic-card">Django</a>
<a href="quiz.html?topic=cprogramming" class="topic-card">C(Programming)</a>
<a href="quiz.html?topic=flask" class="topic-card">Flask</a>
</div>
</section>
</main>
Expand Down