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
3a515bfd
Commit
3a515bfd
authored
Feb 15, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Plain Diff
Merged in profilecleanup
parents
a8bcd38b
fd7f229a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
courseware/views.py
+12
-9
No files found.
courseware/views.py
View file @
3a515bfd
...
@@ -41,9 +41,8 @@ def profile(request):
...
@@ -41,9 +41,8 @@ def profile(request):
return
redirect
(
'/'
)
return
redirect
(
'/'
)
dom
=
content_parser
.
course_file
(
request
.
user
)
dom
=
content_parser
.
course_file
(
request
.
user
)
hw
=
[]
course
=
dom
.
xpath
(
'//course/@name'
)[
0
]
course
=
dom
.
xpath
(
'//course/@name'
)[
0
]
c
hapters
=
dom
.
xpath
(
'//course[@name=$course]/chapter'
,
course
=
course
)
xmlC
hapters
=
dom
.
xpath
(
'//course[@name=$course]/chapter'
,
course
=
course
)
responses
=
StudentModule
.
objects
.
filter
(
student
=
request
.
user
)
responses
=
StudentModule
.
objects
.
filter
(
student
=
request
.
user
)
response_by_id
=
{}
response_by_id
=
{}
...
@@ -52,8 +51,9 @@ def profile(request):
...
@@ -52,8 +51,9 @@ def profile(request):
total_scores
=
{}
total_scores
=
{}
chapters
=
[]
for
c
in
chapters
:
for
c
in
xmlChapters
:
sections
=
[]
chname
=
c
.
get
(
'name'
)
chname
=
c
.
get
(
'name'
)
for
s
in
dom
.
xpath
(
'//course[@name=$course]/chapter[@name=$chname]/section'
,
for
s
in
dom
.
xpath
(
'//course[@name=$course]/chapter[@name=$chname]/section'
,
course
=
course
,
chname
=
chname
):
course
=
course
,
chname
=
chname
):
...
@@ -89,9 +89,7 @@ def profile(request):
...
@@ -89,9 +89,7 @@ def profile(request):
format_scores
.
append
(
graded_total
)
format_scores
.
append
(
graded_total
)
total_scores
[
format
]
=
format_scores
total_scores
[
format
]
=
format_scores
score
=
{
'course'
:
course
,
score
=
{
'section'
:
s
.
get
(
"name"
),
'section'
:
s
.
get
(
"name"
),
'chapter'
:
c
.
get
(
"name"
),
'scores'
:
scores
,
'scores'
:
scores
,
'section_total'
:
section_total
,
'section_total'
:
section_total
,
'format'
:
format
,
'format'
:
format
,
...
@@ -99,7 +97,12 @@ def profile(request):
...
@@ -99,7 +97,12 @@ def profile(request):
'due'
:
s
.
get
(
"due"
)
or
""
,
'due'
:
s
.
get
(
"due"
)
or
""
,
'graded'
:
graded
,
'graded'
:
graded
,
}
}
hw
.
append
(
score
)
sections
.
append
(
score
)
chapters
.
append
({
'course'
:
course
,
'chapter'
:
c
.
get
(
"name"
),
'sections'
:
sections
,})
def
totalWithDrops
(
scores
,
drop_count
):
def
totalWithDrops
(
scores
,
drop_count
):
#Note that this key will sort the list descending
#Note that this key will sort the list descending
...
@@ -186,7 +189,7 @@ def profile(request):
...
@@ -186,7 +189,7 @@ def profile(request):
'location'
:
user_info
.
location
,
'location'
:
user_info
.
location
,
'language'
:
user_info
.
language
,
'language'
:
user_info
.
language
,
'email'
:
request
.
user
.
email
,
'email'
:
request
.
user
.
email
,
'
homeworks'
:
hw
,
'
chapters'
:
chapters
,
'format_url_params'
:
format_url_params
,
'format_url_params'
:
format_url_params
,
'grade_summary'
:
grade_summary
,
'grade_summary'
:
grade_summary
,
'csrf'
:
csrf
(
request
)[
'csrf_token'
]
'csrf'
:
csrf
(
request
)[
'csrf_token'
]
...
...
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