mou3az commited on
Commit
f136572
·
verified ·
1 Parent(s): fb3b240

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -51,6 +51,9 @@ def generate_quiz_page():
51
  if "error" in response:
52
  response = generate_quiz(context)
53
 
 
 
 
54
  quiz_html = f"""
55
  <!DOCTYPE html>
56
  <html lang="en">
 
51
  if "error" in response:
52
  response = generate_quiz(context)
53
 
54
+ if request.headers.get('Content-Type') == 'application/json':
55
+ return jsonify({"quiz": response})
56
+
57
  quiz_html = f"""
58
  <!DOCTYPE html>
59
  <html lang="en">