Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ import os
|
|
7 |
# Load the datasets
|
8 |
SCORES_DATASET = "agents-course/unit4-students-scores"
|
9 |
CERTIFICATES_DATASET = "agents-course/course-certificates-of-excellence"
|
10 |
-
|
11 |
|
12 |
# Check the score based on username
|
13 |
def check_user_score(username):
|
@@ -52,8 +52,8 @@ def handle_certificate(name, request: gr.Request):
|
|
52 |
|
53 |
score = user_score["score"]
|
54 |
|
55 |
-
if score <
|
56 |
-
return f"Your score is {score}. You need at least
|
57 |
|
58 |
# Passed: check if already in certificate dataset
|
59 |
if not has_certificate_entry(username):
|
|
|
7 |
# Load the datasets
|
8 |
SCORES_DATASET = "agents-course/unit4-students-scores"
|
9 |
CERTIFICATES_DATASET = "agents-course/course-certificates-of-excellence"
|
10 |
+
THRESOLD_SCORE = 45
|
11 |
|
12 |
# Check the score based on username
|
13 |
def check_user_score(username):
|
|
|
52 |
|
53 |
score = user_score["score"]
|
54 |
|
55 |
+
if score < THRESOLD_SCORE:
|
56 |
+
return f"Your score is {score}. You need at least {THRESOLD_SCORE} to pass.", None
|
57 |
|
58 |
# Passed: check if already in certificate dataset
|
59 |
if not has_certificate_entry(username):
|