Skip to content

Commit

Permalink
almost there... finishing
Browse files Browse the repository at this point in the history
  • Loading branch information
TechDudie committed Mar 7, 2022
1 parent 84fd632 commit 3f6815b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
13 changes: 2 additions & 11 deletions js/wait.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,15 @@ function check() {
request.send(null);
request.onreadystatechange = function() {
if (request.readyState == 4) {
console.log(current);
console.log(typeof current);
console.log(request.responseText);
console.log(typeof request.responseText);
console.log(current !== request.responeText);
currint = parseInt(current);
text = parseInt(request.responseText);
console.log(currint);
console.log(typeof currint);
console.log(text);
console.log(typeof text);
console.log(currint !== text);
if (typeof request.responseText == "undefined") {
return null;
}
if ((parseInt(current) - parseInt(request.reponseText)) === 0) {
console.log("YAY OMGOMGOMGMGOM");
//window.location.replace("game.html");
if (currint !== text) {
window.location.replace("game.html");
}
}
};
Expand Down
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
db = DB()
@app.route('/')
def root():
return '<h1>Hello, World!</h1>'
return '<h1>Hello, World!</h1>\n<p>I think you\'re looking for <a href=\'https://flaskprojc.technologydev.repl.co/index.html\'>this</a>!'

@app.route('/css/<path:path>')
def css_(path):
Expand Down Expand Up @@ -58,15 +58,15 @@ def receive():
if q[qid]["answer"] == request.form["ans"].upper():
db.store(plyr, pts + point(request.form["t"]))
print(db.db)
return load("redirect.html")
return load("wait.html")
else:
return load("redirect.html")

@app.route('/dashboard.html', methods=["GET","POST"])
def dashboard():
global qid
if request.method == 'POST':
qid = request.form["qid"]
qid = int(request.form["qid"])
return dashboardui(players, db.db, qid)
else:
return dashboardui(players, db.db, qid)
Expand Down

0 comments on commit 3f6815b

Please sign in to comment.