yunzi7's picture
merge
c90fe2b
raw
history blame
499 Bytes
from flask import Blueprint, render_template, redirect, url_for
import random
import time
bp = Blueprint("topic", __name__, url_prefix="topic")
topics = ["MBTI", ""]
@bp.route("/", methods=["GET"])
def topic() -> None:
if session.get("quiz_generated"):
return redirect(url_for("quiz.show_quiz"))
else:
selected_topic = random.choice(topics)
time.sleep(20) # 20์ดˆ ๋Œ€๊ธฐ ํ›„ ๋‹ค์Œ ์ฃผ์ œ๋กœ
return render_template("topic.html", topic=selected_topic)