Update main.py

This commit is contained in:
bigJIU 2023-03-08 15:55:30 +08:00
parent 36d8ad73ed
commit 9a33697bc6

16
main.py
View File

@ -66,7 +66,7 @@ def gametutorial(id):
@app.route('/again') @app.route('/again')
def gamepreplayAgain(): def gamepreplayAgain():
return redirect(url_for('gameplay', getId)) return redirect(url_for('gameplay', getId()))
@app.route('/gametutorial/<id>/data') @app.route('/gametutorial/<id>/data')
@ -92,7 +92,7 @@ def getJSONData(id):
@app.route('/annotation') @app.route('/annotation')
def gamepreanno(): def gamepreanno():
return redirect(url_for('gameanno', getId)) return redirect(url_for('gameanno', getId()))
@app.route('/annotation/<id>') @app.route('/annotation/<id>')
@ -108,7 +108,7 @@ def gameanno(id):
@app.route('/annotation/radioresult', methods=['POST']) @app.route('/annotation/radioresult', methods=['POST'])
def getRadioData(): def getRadioData():
ip = idm.getId(request.remote_addr) ip = getId()
if request.method == 'POST': if request.method == 'POST':
print("POST Eval") print("POST Eval")
@ -125,7 +125,7 @@ def getRadioData():
@app.route('/gameplay2') @app.route('/gameplay2')
def gamepreplay2(): def gamepreplay2():
return redirect(url_for('gameplay2', getId)) return redirect(url_for('gameplay2', getId()))
@app.route('/gameplay2/<id>') @app.route('/gameplay2/<id>')
@ -146,7 +146,7 @@ def getJSONData2(id):
@app.route('/annotation2') @app.route('/annotation2')
def gamepreanno2(): def gamepreanno2():
return redirect(url_for('gameanno2', getId)) return redirect(url_for('gameanno2', getId()))
@app.route('/annotation2/<id>') @app.route('/annotation2/<id>')
@ -169,11 +169,11 @@ def gameannoresult2(id):
print("result: " + id) print("result: " + id)
resultList = list(request.form)[0].split(",") resultList = list(request.form)[0].split(",")
levelList = idm.getRecent(idm.getId(request.remote_addr)) levelList = idm.getRecent(getId())
idm.write_csv(annotationPath2, idm.write_csv(annotationPath2,
[idm.getId(request.remote_addr), resultList[0], resultList[1], resultList[2], levelList[0], levelList[1], [getId(), resultList[0], resultList[1], resultList[2], levelList[0], levelList[1],
levelList[2], levelList[2],
""]) ""])
@ -186,7 +186,7 @@ def gameannoresult2(id):
@app.route("/gameover") @app.route("/gameover")
def over(): def over():
finish = idm.getTimes(idm.getId(request.remote_addr)) finish = idm.getTimes(getId())
return render_template("GameOver.html", finish=1, stage=1) return render_template("GameOver.html", finish=1, stage=1)