Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
assignment statistics
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Bohn
assignment statistics
Commits
12581d59
Commit
12581d59
authored
3 years ago
by
Christopher Bohn
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+2
-0
2 additions, 0 deletions
README.md
api/canvas_classes.py
+5
-2
5 additions, 2 deletions
api/canvas_classes.py
with
7 additions
and
2 deletions
README.md
+
2
−
0
View file @
12581d59
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
api/canvas_classes.py
+
5
−
2
View file @
12581d59
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment