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
812810a6
Commit
812810a6
authored
Apr 13, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted gradebook to refactored grading format.
parent
245a3d97
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
20 deletions
+11
-20
djangoapps/courseware/grades.py
+1
-1
templates/gradebook.html
+10
-19
No files found.
djangoapps/courseware/grades.py
View file @
812810a6
...
...
@@ -16,7 +16,7 @@ Score = namedtuple("Score", "earned possible graded section")
SectionPercentage
=
namedtuple
(
"SectionPercentage"
,
"percentage label summary"
)
class
CourseGrader
:
class
CourseGrader
(
object
)
:
def
grade
(
self
,
grade_sheet
):
raise
NotImplementedError
...
...
templates/gradebook.html
View file @
812810a6
...
...
@@ -8,7 +8,8 @@
<style
type=
"text/css"
>
.grade_a
{
color
:
green
;}
.grade_b
{
color
:
Chocolate
;}
.grade_c
{
color
:
DimGray
;}
.grade_c
{
color
:
DarkSlateGray
;}
.grade_f
{
color
:
DimGray
;}
.grade_none
{
color
:
LightGray
;}
</style>
...
...
@@ -29,16 +30,10 @@
<tr>
<!-- Header Row -->
<th>
Student
</th>
%for section in templateSummary:
%if 'subscores' in section:
%for subsection in section['subscores']:
<th>
${subsection['label']}
</th>
%endfor
<th>
${section['totallabel']}
</th>
%else:
<th>
${section['category']}
</th>
%endif
%for section in templateSummary['section_breakdown']:
<th>
${section['label']}
</th>
%endfor
<th>
Total
</th>
</tr>
<
%
def
name=
"percent_data(percentage)"
>
...
...
@@ -50,6 +45,8 @@
data_class = "grade_b"
elif percentage > .6:
data_class = "grade_c"
elif percentage > 0:
data_class = "grade_f"
%>
<td
class=
"${data_class}"
>
${ "{0:.0%}".format( percentage ) }
</td>
</
%
def>
...
...
@@ -57,16 +54,10 @@
%for student in students:
<tr>
<td><a
href=
"/profile/${student['id']}/"
>
${student['username']}
</a></td>
%for section in student['grade_info']['grade_summary']:
%if 'subscores' in section:
%for subsection in section['subscores']:
${percent_data( subsection['percentage'] )}
%endfor
${percent_data( section['totalscore'] )}
%else:
${percent_data( section['totalscore'] )}
%endif
%for section in student['grade_info']['grade_summary']['section_breakdown']:
${percent_data( section['percent'] )}
%endfor
<th>
${percent_data( student['grade_info']['grade_summary']['percent'])}
</th>
</tr>
%endfor
</table>
...
...
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