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
00b1bad3
Commit
00b1bad3
authored
Feb 02, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Got grade overview graph drawing
--HG-- branch : profiledev
parent
5a752dff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
8 deletions
+32
-8
courseware/views.py
+32
-8
No files found.
courseware/views.py
View file @
00b1bad3
...
...
@@ -135,7 +135,38 @@ def profile(request):
lab_total
,
lab_dropped_indices
=
totalWithDrops
(
lab_percentages
,
2
)
midterm_score
=
(
130
,
150
)
midterm_percentage
=
midterm_score
[
0
]
/
float
(
midterm_score
[
1
])
final_score
=
(
225
,
300
)
final_percentage
=
final_score
[
0
]
/
float
(
final_score
[
1
])
grade_summary
=
[
{
'category'
:
'Homework'
,
'subscores'
:
homework_percentages
,
'dropped_indices'
:
homework_dropped_indices
,
'totalscore'
:
{
'score'
:
homework_total
,
'summary'
:
"Homework Average - {:.0
%
}"
.
format
(
homework_total
)},
'weight'
:
0.15
,
},
{
'category'
:
'Labs'
,
'subscores'
:
lab_percentages
,
'dropped_indices'
:
lab_dropped_indices
,
'totalscore'
:
{
'score'
:
lab_total
,
'summary'
:
"Lab Average - {:.0
%
}"
.
format
(
lab_total
)},
'weight'
:
0.15
,
},
{
'category'
:
'Midterm'
,
'totalscore'
:
{
'score'
:
midterm_percentage
,
'summary'
:
"Midterm - {:.0
%
} ({}/{})"
.
format
(
midterm_percentage
,
midterm_score
[
0
],
midterm_score
[
1
])},
'weight'
:
0.30
,
},
{
'category'
:
'Final'
,
'totalscore'
:
{
'score'
:
final_percentage
,
'summary'
:
"Final - {:.0
%
} ({}/{})"
.
format
(
final_percentage
,
final_score
[
0
],
final_score
[
1
])},
'weight'
:
0.40
,
}
]
user_info
=
UserProfile
.
objects
.
get
(
user
=
request
.
user
)
context
=
{
'name'
:
user_info
.
name
,
...
...
@@ -144,14 +175,7 @@ def profile(request):
'language'
:
user_info
.
language
,
'email'
:
request
.
user
.
email
,
'homeworks'
:
hw
,
'homework_percentages'
:
homework_percentages
,
'homework_total'
:
homework_total
,
'homework_dropped_indices'
:
homework_dropped_indices
,
'lab_percentages'
:
lab_percentages
,
'lab_total'
:
lab_total
,
'lab_dropped_indices'
:
lab_dropped_indices
,
'midterm_score'
:
midterm_score
,
'final_score'
:
final_score
,
'grade_summary'
:
grade_summary
,
'csrf'
:
csrf
(
request
)[
'csrf_token'
]
}
return
render_to_response
(
'profile.html'
,
context
)
...
...
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