Skip to content
Snippets Groups Projects
Commit 12581d59 authored by Christopher Bohn's avatar Christopher Bohn :thinking:
Browse files

Catches ValueError reported in #1 -- now results in "no stats"

parent b1724530
No related branches found
No related tags found
No related merge requests found
...@@ -38,6 +38,8 @@ To interface with Canvas, you need a Canvas API Key. ...@@ -38,6 +38,8 @@ To interface with Canvas, you need a Canvas API Key.
![Copy/Paste your Canvas API Key into config.py](README-images/abet_oat-json.png) ![Copy/Paste your Canvas API Key into config.py](README-images/abet_oat-json.png)
- [ ] Override the default file permissions: `chmod 600 ~/.abet_oat.json`
### You no longer need to... ### You no longer need to...
You no longer need to manually retrieve students' majors from MyRed. The program You no longer need to manually retrieve students' majors from MyRed. The program
......
...@@ -518,9 +518,12 @@ class CanvasAssignment: ...@@ -518,9 +518,12 @@ class CanvasAssignment:
def is_quiz(self) -> bool: def is_quiz(self) -> bool:
return 'online_quiz' in self.canvas_assignment.submission_types return 'online_quiz' in self.canvas_assignment.submission_types
def get_score(self, canvas_user: CanvasUser) -> float: # TODO: add get_score and get_points_possible to original def get_score(self, canvas_user: CanvasUser) -> Optional[float]: # TODO: add get_score & get_points_possible to original
submission: Submission = self.canvas_assignment.get_submission(canvas_user.get_canvas_id()) submission: Submission = self.canvas_assignment.get_submission(canvas_user.get_canvas_id())
try:
return float(submission.grade) if submission.grade is not None else None return float(submission.grade) if submission.grade is not None else None
except ValueError:
return None
def get_points_possible(self) -> float: def get_points_possible(self) -> float:
return self.canvas_assignment.points_possible return self.canvas_assignment.points_possible
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment