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
87370096
Commit
87370096
authored
Jan 02, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into diana/peer-grading-views
parents
37f261f9
8bf393fb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
28 deletions
+38
-28
common/lib/xmodule/xmodule/course_module.py
+2
-1
common/lib/xmodule/xmodule/graders.py
+4
-2
lms/templates/courseware/progress.html
+1
-1
lms/templates/courseware/progress_graph.js
+31
-24
No files found.
common/lib/xmodule/xmodule/course_module.py
View file @
87370096
...
...
@@ -100,7 +100,8 @@ class CourseDescriptor(SequenceDescriptor):
"""Parse the policy specified in policy_str, and save it"""
try
:
self
.
_grading_policy
=
load_grading_policy
(
policy_str
)
except
:
except
Exception
,
err
:
log
.
exception
(
'Failed to load grading policy:'
)
self
.
system
.
error_tracker
(
"Failed to load grading policy"
)
# Setting this to an empty dictionary will lead to errors when
# grading needs to happen, but should allow course staff to see
...
...
common/lib/xmodule/xmodule/graders.py
View file @
87370096
...
...
@@ -316,7 +316,7 @@ class AssignmentFormatGrader(CourseGrader):
min_count = 2 would produce the labels "Assignment 3", "Assignment 4"
"""
def
__init__
(
self
,
type
,
min_count
,
drop_count
,
category
=
None
,
section_type
=
None
,
short_label
=
None
,
show_only_average
=
False
,
starting_index
=
1
):
def
__init__
(
self
,
type
,
min_count
,
drop_count
,
category
=
None
,
section_type
=
None
,
short_label
=
None
,
show_only_average
=
False
,
hide_average
=
False
,
starting_index
=
1
):
self
.
type
=
type
self
.
min_count
=
min_count
self
.
drop_count
=
drop_count
...
...
@@ -325,6 +325,7 @@ class AssignmentFormatGrader(CourseGrader):
self
.
short_label
=
short_label
or
self
.
type
self
.
show_only_average
=
show_only_average
self
.
starting_index
=
starting_index
self
.
hide_average
=
hide_average
def
grade
(
self
,
grade_sheet
,
generate_random_scores
=
False
):
def
totalWithDrops
(
breakdown
,
drop_count
):
...
...
@@ -385,7 +386,8 @@ class AssignmentFormatGrader(CourseGrader):
if
self
.
show_only_average
:
breakdown
=
[]
breakdown
.
append
({
'percent'
:
total_percent
,
'label'
:
total_label
,
'detail'
:
total_detail
,
'category'
:
self
.
category
,
'prominent'
:
True
})
if
not
self
.
hide_average
:
breakdown
.
append
({
'percent'
:
total_percent
,
'label'
:
total_label
,
'detail'
:
total_detail
,
'category'
:
self
.
category
,
'prominent'
:
True
})
return
{
'percent'
:
total_percent
,
'section_breakdown'
:
breakdown
,
...
...
lms/templates/courseware/progress.html
View file @
87370096
...
...
@@ -18,7 +18,7 @@
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/flot/jquery.flot.stack.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/flot/jquery.flot.symbol.js')}"
></script>
<script>
$
{
progress_graph
.
body
(
grade_summary
,
course
.
grade_cutoffs
,
"grade-detail-graph"
)}
$
{
progress_graph
.
body
(
grade_summary
,
course
.
grade_cutoffs
,
"grade-detail-graph"
,
not
course
.
metadata
.
get
(
"no_grade"
,
False
),
not
course
.
metadata
.
get
(
"no_grade"
,
False
)
)}
</script>
</
%
block>
...
...
lms/templates/courseware/progress_graph.js
View file @
87370096
<%
page
args
=
"grade_summary, grade_cutoffs, graph_div_id, **kwargs"
/>
<%
page
args
=
"grade_summary, grade_cutoffs, graph_div_id,
show_grade_breakdown = True, show_grade_cutoffs = True,
**kwargs"
/>
<%!
import
json
import
math
...
...
@@ -70,25 +70,26 @@ $(function () {
series
=
categories
.
values
()
overviewBarX
=
tickIndex
extraColorIndex
=
len
(
categories
)
#
Keeping
track
of
the
next
color
to
use
for
categories
not
in
categories
[]
for
section
in
grade_summary
[
'grade_breakdown'
]:
if
section
[
'percent'
]
>
0
:
if
section
[
'category'
]
in
categories
:
color
=
categories
[
section
[
'category'
]
][
'color'
]
else
:
color
=
colors
[
extraColorIndex
%
len
(
colors
)
]
extraColorIndex
+=
1
if
show_grade_breakdown
:
for
section
in
grade_summary
[
'grade_breakdown'
]:
if
section
[
'percent'
]
>
0
:
if
section
[
'category'
]
in
categories
:
color
=
categories
[
section
[
'category'
]
][
'color'
]
else
:
color
=
colors
[
extraColorIndex
%
len
(
colors
)
]
extraColorIndex
+=
1
series
.
append
({
'label'
:
section
[
'category'
]
+
"-grade_breakdown"
,
'data'
:
[
[
overviewBarX
,
section
[
'percent'
]]
],
'color'
:
color
})
series
.
append
({
'label'
:
section
[
'category'
]
+
"-grade_breakdown"
,
'data'
:
[
[
overviewBarX
,
section
[
'percent'
]]
],
'color'
:
color
})
detail_tooltips
[
section
[
'category'
]
+
"-grade_breakdown"
]
=
[
section
[
'detail'
]
]
detail_tooltips
[
section
[
'category'
]
+
"-grade_breakdown"
]
=
[
section
[
'detail'
]
]
ticks
+=
[
[
overviewBarX
,
"Total"
]
]
tickIndex
+=
1
+
sectionSpacer
ticks
+=
[
[
overviewBarX
,
"Total"
]
]
tickIndex
+=
1
+
sectionSpacer
totalScore
=
grade_summary
[
'percent'
]
detail_tooltips
[
'Dropped Scores'
]
=
dropped_score_tooltips
...
...
@@ -97,10 +98,14 @@ $(function () {
##
-----------------------------
Grade
cutoffs
-------------------------
##
grade_cutoff_ticks
=
[
[
1
,
"100%"
],
[
0
,
"0%"
]
]
descending_grades
=
sorted
(
grade_cutoffs
,
key
=
lambda
x
:
grade_cutoffs
[
x
],
reverse
=
True
)
for
grade
in
descending_grades
:
percent
=
grade_cutoffs
[
grade
]
grade_cutoff_ticks
.
append
(
[
percent
,
"{0} {1:.0%}"
.
format
(
grade
,
percent
)
]
)
if
show_grade_cutoffs
:
grade_cutoff_ticks
=
[
[
1
,
"100%"
],
[
0
,
"0%"
]
]
descending_grades
=
sorted
(
grade_cutoffs
,
key
=
lambda
x
:
grade_cutoffs
[
x
],
reverse
=
True
)
for
grade
in
descending_grades
:
percent
=
grade_cutoffs
[
grade
]
grade_cutoff_ticks
.
append
(
[
percent
,
"{0} {1:.0%}"
.
format
(
grade
,
percent
)
]
)
else
:
grade_cutoff_ticks
=
[
]
%>
var
series
=
$
{
json
.
dumps
(
series
)
};
...
...
@@ -135,9 +140,11 @@ $(function () {
var
$grade_detail_graph
=
$
(
"#${graph_div_id}"
);
if
(
$grade_detail_graph
.
length
>
0
)
{
var
plot
=
$
.
plot
(
$grade_detail_graph
,
series
,
options
);
//We need to put back the plotting of the percent here
var
o
=
plot
.
pointOffset
({
x
:
$
{
overviewBarX
}
,
y
:
$
{
totalScore
}});
$grade_detail_graph
.
append
(
'<div style="position:absolute;left:'
+
(
o
.
left
-
12
)
+
'px;top:'
+
(
o
.
top
-
20
)
+
'px">${"{totalscore:.0%}".format(totalscore=totalScore)}</div>'
);
%
if
show_grade_breakdown
:
var
o
=
plot
.
pointOffset
({
x
:
$
{
overviewBarX
}
,
y
:
$
{
totalScore
}});
$grade_detail_graph
.
append
(
'<div style="position:absolute;left:'
+
(
o
.
left
-
12
)
+
'px;top:'
+
(
o
.
top
-
20
)
+
'px">${"{totalscore:.0%}".format(totalscore=totalScore)}</div>'
);
%
endif
}
var
previousPoint
=
null
;
...
...
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