Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -416,7 +416,7 @@ def view_quiz_score_endpoint():
|
|
416 |
if not connection:
|
417 |
return jsonify({"error": "Database connection failed."}), 500
|
418 |
|
419 |
-
cursor = connection.cursor(
|
420 |
|
421 |
|
422 |
cursor.execute("SELECT theme_quiz_table FROM themes WHERE theme = %s", (theme,))
|
@@ -494,7 +494,7 @@ def get_all_themes():
|
|
494 |
|
495 |
try:
|
496 |
connection = get_db_connection()
|
497 |
-
cursor = connection.cursor(
|
498 |
|
499 |
cursor.execute("SELECT theme FROM themes")
|
500 |
themes = cursor.fetchall()
|
@@ -537,7 +537,7 @@ def view_attempted_quiz_endpoint():
|
|
537 |
if not connection:
|
538 |
return jsonify({"error": "Database connection failed."}), 500
|
539 |
|
540 |
-
cursor = connection.cursor(
|
541 |
|
542 |
cursor.execute("SELECT theme_quiz_table, theme_bank FROM themes WHERE theme = %s", (theme,))
|
543 |
result = cursor.fetchone()
|
@@ -653,7 +653,7 @@ def user_theme_stats():
|
|
653 |
|
654 |
try:
|
655 |
connection = get_db_connection()
|
656 |
-
cursor = connection.cursor(
|
657 |
|
658 |
cursor.execute("""
|
659 |
SELECT quiz_id, score, time_taken
|
|
|
416 |
if not connection:
|
417 |
return jsonify({"error": "Database connection failed."}), 500
|
418 |
|
419 |
+
cursor = connection.cursor()
|
420 |
|
421 |
|
422 |
cursor.execute("SELECT theme_quiz_table FROM themes WHERE theme = %s", (theme,))
|
|
|
494 |
|
495 |
try:
|
496 |
connection = get_db_connection()
|
497 |
+
cursor = connection.cursor()
|
498 |
|
499 |
cursor.execute("SELECT theme FROM themes")
|
500 |
themes = cursor.fetchall()
|
|
|
537 |
if not connection:
|
538 |
return jsonify({"error": "Database connection failed."}), 500
|
539 |
|
540 |
+
cursor = connection.cursor()
|
541 |
|
542 |
cursor.execute("SELECT theme_quiz_table, theme_bank FROM themes WHERE theme = %s", (theme,))
|
543 |
result = cursor.fetchone()
|
|
|
653 |
|
654 |
try:
|
655 |
connection = get_db_connection()
|
656 |
+
cursor = connection.cursor()
|
657 |
|
658 |
cursor.execute("""
|
659 |
SELECT quiz_id, score, time_taken
|