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
94b1cd57
Commit
94b1cd57
authored
May 31, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a few bugs from the complicated rebase.
parent
fef004f4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
48 deletions
+3
-48
djangoapps/courseware/grades.py
+1
-3
djangoapps/courseware/views.py
+1
-45
djangoapps/student/views.py
+1
-0
No files found.
djangoapps/courseware/grades.py
View file @
94b1cd57
...
...
@@ -88,9 +88,7 @@ def grade_sheet(student):
grade_summary
=
grader
.
grade
(
totaled_scores
)
letter_grade
=
grade_for_percentage
(
grade_summary
[
'percent'
])
_log
.
debug
(
"Final grade: "
+
str
(
letter_grade
))
return
{
'courseware_summary'
:
chapters
,
'grade_summary'
:
grade_summary
,
'grade'
:
letter_grade
}
...
...
djangoapps/courseware/views.py
View file @
94b1cd57
...
...
@@ -20,6 +20,7 @@ from django_future.csrf import ensure_csrf_cookie
from
lxml
import
etree
from
courseware
import
course_settings
from
module_render
import
render_module
,
modx_dispatch
from
certificates.models
import
GeneratedCertificate
from
models
import
StudentModule
...
...
@@ -218,51 +219,6 @@ def index(request, course="6.002 Spring 2012", chapter="Using the System", secti
result
=
render_to_response
(
'courseware.html'
,
context
)
return
result
def
modx_dispatch
(
request
,
module
=
None
,
dispatch
=
None
,
id
=
None
):
''' Generic view for extensions. '''
if
not
request
.
user
.
is_authenticated
():
return
redirect
(
'/'
)
# Grab the student information for the module from the database
s
=
StudentModule
.
objects
.
filter
(
student
=
request
.
user
,
module_id
=
id
)
#s = StudentModule.get_with_caching(request.user, id)
if
len
(
s
)
==
0
or
s
is
None
:
log
.
debug
(
"Couldnt find module for user and id "
+
str
(
module
)
+
" "
+
str
(
request
.
user
)
+
" "
+
str
(
id
))
raise
Http404
s
=
s
[
0
]
oldgrade
=
s
.
grade
oldstate
=
s
.
state
dispatch
=
dispatch
.
split
(
'?'
)[
0
]
ajax_url
=
settings
.
MITX_ROOT_URL
+
'/modx/'
+
module
+
'/'
+
id
+
'/'
# Grab the XML corresponding to the request from course.xml
xml
=
content_parser
.
module_xml
(
request
.
user
,
module
,
'id'
,
id
)
# Create the module
system
=
I4xSystem
(
track_function
=
make_track_function
(
request
),
render_function
=
None
,
ajax_url
=
ajax_url
,
filestore
=
None
)
instance
=
courseware
.
modules
.
get_module_class
(
module
)(
system
,
xml
,
id
,
state
=
oldstate
)
# Let the module handle the AJAX
ajax_return
=
instance
.
handle_ajax
(
dispatch
,
request
.
POST
)
# Save the state back to the database
s
.
state
=
instance
.
get_state
()
if
instance
.
get_score
():
s
.
grade
=
instance
.
get_score
()[
'score'
]
if
s
.
grade
!=
oldgrade
or
s
.
state
!=
oldstate
:
s
.
save
()
# Return whatever the module wanted to return to the client/caller
return
HttpResponse
(
ajax_return
)
def
certificate_request
(
request
):
''' Attempt to send a certificate. '''
...
...
djangoapps/student/views.py
View file @
94b1cd57
...
...
@@ -8,6 +8,7 @@ import uuid
from
django.conf
import
settings
from
django.contrib.auth
import
logout
,
authenticate
,
login
from
django.contrib.auth.decorators
import
login_required
from
django.contrib.auth.forms
import
PasswordResetForm
from
django.contrib.auth.models
import
User
from
django.core.context_processors
import
csrf
...
...
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