mirror of
https://github.com/th30d4y/OpenLearnX.git
synced 2026-05-26 19:26:33 +00:00
33 lines
900 B
Python
33 lines
900 B
Python
from flask import Blueprint, jsonify
|
|
|
|
bp = Blueprint('quizzes', __name__)
|
|
|
|
# Handle both with and without trailing slash
|
|
@bp.route("/", methods=["GET"])
|
|
@bp.route("", methods=["GET"]) # Add this line
|
|
def list_quizzes():
|
|
quizzes = [
|
|
{
|
|
"id": "python-quiz",
|
|
"title": "Python Fundamentals Quiz",
|
|
"topic": "Programming",
|
|
"difficulty": "Easy",
|
|
"recent_performance": 85
|
|
},
|
|
{
|
|
"id": "java-quiz",
|
|
"title": "Java OOP Concepts Quiz",
|
|
"topic": "Programming",
|
|
"difficulty": "Medium",
|
|
"recent_performance": 78
|
|
},
|
|
{
|
|
"id": "security-quiz",
|
|
"title": "Cybersecurity Basics Quiz",
|
|
"topic": "Security",
|
|
"difficulty": "Hard",
|
|
"recent_performance": 72
|
|
}
|
|
]
|
|
return jsonify(quizzes)
|