Tesneem commited on
Commit
9ba1a87
·
verified ·
1 Parent(s): e73844f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -257,6 +257,16 @@ STAGE_TO_SOURCE = {
257
  }
258
  SOURCE_TO_STAGE = {v: k for k, v in STAGE_TO_SOURCE.items()}
259
 
 
 
 
 
 
 
 
 
 
 
260
  def _responses_for_student_stage(uri, db, responses_coll, student: str, stage: str) -> list[dict]:
261
  """Return responses for a student at a stage (mapped to source) with non-empty answers."""
262
  if not (uri and student and stage):
 
257
  }
258
  SOURCE_TO_STAGE = {v: k for k, v in STAGE_TO_SOURCE.items()}
259
 
260
+ def _answer_total_score(resp: dict) -> float:
261
+ skills = resp.get("skills") or {}
262
+ total = 0.0
263
+ for v in skills.values():
264
+ try:
265
+ total += float(v)
266
+ except Exception:
267
+ pass
268
+ return total
269
+
270
  def _responses_for_student_stage(uri, db, responses_coll, student: str, stage: str) -> list[dict]:
271
  """Return responses for a student at a stage (mapped to source) with non-empty answers."""
272
  if not (uri and student and stage):