-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
89 lines (70 loc) · 2.74 KB
/
app.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
from flask import Flask, render_template, redirect, url_for, request
total_q = 0
correct_q = 0
app = Flask(__name__) #creating the Flask class object
@app.route('/')
def mainpage():
return render_template('mainpage.html')
@app.route('/donate' , methods=['GET', 'POST'])
def log_don():
if request.method == 'POST':
user = request.form['emaildon']
password = request.form['passdon']
if user == 'recep@engenius.com' and password == 'ryilkici1':
return render_template("donator.html")
else:
return render_template("mainpage.html")
@app.route('/packages' , methods=['GET', 'POST'])
def log_stu():
if request.method == 'POST':
user = request.form['emailstu']
password = request.form['passstu']
if user == 'engenius@insider.com' and password == 'engenius1':
return render_template("packages.html")
else:
return render_template("mainpage.html")
@app.route('/aims' , methods=['GET', 'POST'])
def aim():
if request.method == 'POST':
return render_template("surd.html")
@app.route('/video' , methods=['GET', 'POST'])
def video():
return render_template("video.html", correct_q=correct_q, total_q=total_q)
@app.route('/temp' , methods=['GET', 'POST'])
def temp():
return redirect(url_for("video"))
@app.route('/video/<float:timeq1>/<int:correct_q>/<int:total_q>')
def videoq1(timeq1, correct_q, total_q):
return render_template("video.html", timeq1 = timeq1, correct_q = correct_q, total_q = total_q)
@app.route('/videoq1', methods = ["POST", "GET"])
def login():
global total_q, correct_q
total_q += 1
print(request.form)
if request.form["q1"] == "second":
correct_q += 1
return redirect(url_for("videoq1", timeq1 = 3.251, correct_q = correct_q, total_q = total_q))
@app.route('/videoq2', methods = ["POST", "GET"])
def login2():
global total_q, correct_q
total_q += 1
print(request.form)
if request.form["q2"] == "first":
correct_q += 1
return redirect(url_for("videoq1", timeq1 = 8.251, correct_q = correct_q, total_q = total_q))
@app.route('/videoq3', methods = ["POST", "GET"])
def login3():
global total_q, correct_q
total_q += 1
print(request.form)
if request.form["q3"] == "second":
correct_q += 1
return redirect(url_for("videoq1", timeq1 = 12.251, correct_q = correct_q, total_q = total_q))
@app.route('/videoq4', methods = ["POST", "GET"])
def login4():
global total_q, correct_q
total_q += 1
correct_q += 1
return redirect(url_for("videoq1", timeq1 = 16.251, correct_q = correct_q, total_q = total_q))
if __name__ =='__main__':
app.run(debug = True)