Update
Update server data recieve
This commit is contained in:
parent
9abe49c321
commit
d4602283eb
1
.idea/.name
generated
Normal file
1
.idea/.name
generated
Normal file
@ -0,0 +1 @@
|
|||||||
|
main.py
|
2
.idea/MarioWeb.iml
generated
2
.idea/MarioWeb.iml
generated
@ -5,7 +5,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="NewModuleRootManager">
|
<component name="NewModuleRootManager">
|
||||||
<content url="file://$MODULE_DIR$" />
|
<content url="file://$MODULE_DIR$" />
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="jdk" jdkName="VisMOO" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
<component name="TemplatesService">
|
<component name="TemplatesService">
|
||||||
|
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
|
<component name="ProjectRootManager" version="2" project-jdk-name="VisMOO" project-jdk-type="Python SDK" />
|
||||||
</project>
|
</project>
|
18
main.py
18
main.py
@ -193,21 +193,27 @@ def gameannoresult2(id):
|
|||||||
return redirect(url_for("gameplay2", id=id))
|
return redirect(url_for("gameplay2", id=id))
|
||||||
|
|
||||||
|
|
||||||
@app.route("/gameover")
|
@app.route("/gameover",methods=['POST','GET'])
|
||||||
def over():
|
def over():
|
||||||
finish = idm.getTimes(getId())
|
finish = idm.getTimes(getId())
|
||||||
return render_template("GameOver.html", finish=1, stage=1)
|
|
||||||
|
|
||||||
|
|
||||||
@app.route("/gameover/<id>/feedback", methods=['POST'])
|
|
||||||
def overa():
|
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
resultList = list(request.form)[0].split(",")
|
resultList = list(request.form)[0].split(",")
|
||||||
idm.write_csv(feedbackPath,
|
idm.write_csv(feedbackPath,
|
||||||
[getId(), resultList[0],
|
[getId(), resultList[0],
|
||||||
""])
|
""])
|
||||||
|
|
||||||
|
return render_template("GameOver.html", finish=1, stage=1)
|
||||||
|
|
||||||
|
|
||||||
|
# @app.route('/feedback', methods=['POST'])
|
||||||
|
# def overa():
|
||||||
|
# if request.method == 'POST':
|
||||||
|
# resultList = list(request.form)[0].split(",")
|
||||||
|
# idm.write_csv(feedbackPath,
|
||||||
|
# [getId(), resultList[0],
|
||||||
|
# ""])
|
||||||
|
|
||||||
|
# return redirect(url_for("over", id=id))
|
||||||
def saveFile(path, filename, content):
|
def saveFile(path, filename, content):
|
||||||
cp = list(map(int, content))
|
cp = list(map(int, content))
|
||||||
file_dir = os.path.join(os.getcwd(), path)
|
file_dir = os.path.join(os.getcwd(), path)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<script
|
<script
|
||||||
id="allow-copy_script">(function t() { var t = !1; document.addEventListener("allow_copy", (function (n) { t = n.detail.unlock })); var n = ["copy", "cut", "contextmenu", "selectstart", "mousedown", "mouseup", "mousemove", "keydown", "keypress", "keyup"], e = function (n) { t && (n.stopPropagation(), n.stopImmediatePropagation && n.stopImmediatePropagation()) }; n.forEach((function (t) { document.documentElement.addEventListener(t, e, { capture: !0 }) })) })()</script>
|
id="allow-copy_script">(function t() { var t = !1; document.addEventListener("allow_copy", (function (n) { t = n.detail.unlock })); var n = ["copy", "cut", "contextmenu", "selectstart", "mousedown", "mouseup", "mousemove", "keydown", "keypress", "keyup"], e = function (n) { t && (n.stopPropagation(), n.stopImmediatePropagation && n.stopImmediatePropagation()) }; n.forEach((function (t) { document.documentElement.addEventListener(t, e, { capture: !0 }) })) })()</script>
|
||||||
|
<script src="../templates/Web/jquery.min.js"></script>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<script src="https://cjrtnc.leaningtech.com/2.3/loader.js"></script>
|
<script src="https://cjrtnc.leaningtech.com/2.3/loader.js"></script>
|
||||||
@ -189,9 +189,10 @@
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
<form id="ajaxform">
|
||||||
<h3>Do you have any feedback?</h3>
|
<h3>Do you have any feedback?</h3>
|
||||||
<br>
|
<br>
|
||||||
<form method="POST" action="feedback">
|
|
||||||
<textarea
|
<textarea
|
||||||
id="message"
|
id="message"
|
||||||
cols="60"
|
cols="60"
|
||||||
@ -200,7 +201,7 @@
|
|||||||
|
|
||||||
></textarea>
|
></textarea>
|
||||||
<br><br>
|
<br><br>
|
||||||
<input type="submit" value="Submit" class="cirButton">
|
<input type="submit" value="Submit" class="cirButton" onclick="submit_it()">
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
document.getElementById("hideButton").addEventListener("click", function () {
|
document.getElementById("hideButton").addEventListener("click", function () {
|
||||||
@ -217,6 +218,32 @@
|
|||||||
// var newWindow = window.open("", "_self");
|
// var newWindow = window.open("", "_self");
|
||||||
// newWindow.close();
|
// newWindow.close();
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
function submit_it() {
|
||||||
|
$("#ajaxform").hide()
|
||||||
|
$("#ajaxform").submit(function(e)
|
||||||
|
{
|
||||||
|
|
||||||
|
var postData = JSON.stringify($("#message").val());
|
||||||
|
{#var formURL = $(this).attr("action");#}
|
||||||
|
$.ajax(
|
||||||
|
{
|
||||||
|
url : "gameover",
|
||||||
|
type: "POST",
|
||||||
|
data : postData,
|
||||||
|
success:function(data)
|
||||||
|
{
|
||||||
|
|
||||||
|
//data: return data from server
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
e.preventDefault(); //STOP default action
|
||||||
|
{#e.unbind(); //unbind. to stop multiple form submit.#}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -250,7 +277,7 @@
|
|||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<!-- Bootstrap core JavaScript -->
|
<!-- Bootstrap core JavaScript -->
|
||||||
<script src="../templates/Web/jquery.min.js"></script>
|
|
||||||
<script src="../templates/Web/bootstrap.bundle.min.js"></script>
|
<script src="../templates/Web/bootstrap.bundle.min.js"></script>
|
||||||
|
|
||||||
<!-- Plugin JavaScript -->
|
<!-- Plugin JavaScript -->
|
||||||
|
Loading…
Reference in New Issue
Block a user