mou3az commited on
Commit
cc1add1
1 Parent(s): 6c6a5e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -1,6 +1,7 @@
1
  from flask import Flask, request, jsonify, render_template
2
  from huggingface_hub import InferenceClient
3
  from requests.exceptions import RequestException
 
4
 
5
  app = Flask(__name__)
6
 
@@ -62,8 +63,8 @@ def generate_quiz_page():
62
  if request.content_type == 'application/json':
63
  return jsonify(response)
64
 
65
- # Pass the entire response to the HTML template
66
- return render_template('quiz.html', textWithAnswers=response)
67
 
68
  return render_template('index.html')
69
 
 
1
  from flask import Flask, request, jsonify, render_template
2
  from huggingface_hub import InferenceClient
3
  from requests.exceptions import RequestException
4
+ import json
5
 
6
  app = Flask(__name__)
7
 
 
63
  if request.content_type == 'application/json':
64
  return jsonify(response)
65
 
66
+ response_json = json.dumps(response)
67
+ return render_template('quiz.html', response_json=response_json)
68
 
69
  return render_template('index.html')
70