Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
8ba85044
Commit
8ba85044
authored
Sep 28, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added option to only show average of a section format grader.
parent
55d7d2bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
common/lib/xmodule/xmodule/graders.py
+8
-3
No files found.
common/lib/xmodule/xmodule/graders.py
View file @
8ba85044
...
...
@@ -285,13 +285,14 @@ class AssignmentFormatGrader(CourseGrader):
"HW".
"""
def
__init__
(
self
,
type
,
min_count
,
drop_count
,
category
=
None
,
section_type
=
None
,
short_label
=
None
):
def
__init__
(
self
,
type
,
min_count
,
drop_count
,
category
=
None
,
section_type
=
None
,
short_label
=
None
,
show_only_average
=
False
):
self
.
type
=
type
self
.
min_count
=
min_count
self
.
drop_count
=
drop_count
self
.
category
=
category
or
self
.
type
self
.
section_type
=
section_type
or
self
.
type
self
.
short_label
=
short_label
or
self
.
type
self
.
show_only_average
=
show_only_average
def
grade
(
self
,
grade_sheet
):
def
totalWithDrops
(
breakdown
,
drop_count
):
...
...
@@ -328,7 +329,7 @@ class AssignmentFormatGrader(CourseGrader):
summary
=
"{section_type} {index} Unreleased - 0
%
(?/?)"
.
format
(
index
=
i
+
1
,
section_type
=
self
.
section_type
)
short_label
=
"{short_label} {index:02d}"
.
format
(
index
=
i
+
1
,
short_label
=
self
.
short_label
)
breakdown
.
append
({
'percent'
:
percentage
,
'label'
:
short_label
,
'detail'
:
summary
,
'category'
:
self
.
category
})
total_percent
,
dropped_indices
=
totalWithDrops
(
breakdown
,
self
.
drop_count
)
...
...
@@ -338,8 +339,12 @@ class AssignmentFormatGrader(CourseGrader):
total_detail
=
"{section_type} Average = {percent:.0
%
}"
.
format
(
percent
=
total_percent
,
section_type
=
self
.
section_type
)
total_label
=
"{short_label} Avg"
.
format
(
short_label
=
self
.
short_label
)
if
self
.
show_only_average
:
breakdown
=
[]
breakdown
.
append
({
'percent'
:
total_percent
,
'label'
:
total_label
,
'detail'
:
total_detail
,
'category'
:
self
.
category
,
'prominent'
:
True
})
return
{
'percent'
:
total_percent
,
'section_breakdown'
:
breakdown
,
#No grade_breakdown here
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment