-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
32 lines (21 loc) · 744 Bytes
/
main.py
File metadata and controls
32 lines (21 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/questionstart-page')
def input():
return render_template('index.html')
@app.route('/questionstart-page', methods=['POST', 'GET'])
def output():
if request.method == 'POST':
answer = request.form.get('Answer')
q1answers = {
'print("Hello World!")',
'print("Hello world!")',
'print("hello world!")',
'print("hello World!")'
}
if answer in q1answers:
return {'response': "Correct!")
else:
return {'response': "Sorry, try again!")
if __name__ == '__main__':
app.run(host='0.0.0.0', debug='true')