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
14676d1c
Commit
14676d1c
authored
Feb 04, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Untrack dev.py, add in redirect code for peer grading
parent
33807456
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
69 deletions
+14
-69
lms/djangoapps/open_ended_grading/views.py
+14
-67
lms/urls.py
+0
-2
No files found.
lms/djangoapps/open_ended_grading/views.py
View file @
14676d1c
...
@@ -34,7 +34,7 @@ from xmodule.modulestore import Location
...
@@ -34,7 +34,7 @@ from xmodule.modulestore import Location
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
modulestore
from
courseware.models
import
StudentModule
,
StudentModuleCache
from
courseware.models
import
StudentModule
,
StudentModuleCache
from
django.http
import
HttpResponse
,
Http404
from
django.http
import
HttpResponse
,
Http404
,
HttpResponseRedirect
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
...
@@ -95,75 +95,22 @@ def peer_grading(request, course_id):
...
@@ -95,75 +95,22 @@ def peer_grading(request, course_id):
'''
'''
Show a peer grading interface
Show a peer grading interface
'''
'''
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'load'
)
ajax_url
=
_reverse_with_slash
(
'peer_grading_ajax'
,
course_id
)
track_function
=
None
get_module
=
None
render_template
=
render_to_string
replace_urls
=
None
anonymous_student_id
=
unique_id_for_user
(
request
.
user
)
pg_ajax
=
_reverse_with_slash
(
'peer_grading'
,
course_id
)
pg_url
=
re
.
sub
(
"/courses"
,
"i4x:/"
,
pg_ajax
)[:
-
1
]
pg_location
=
request
.
GET
.
get
(
'location'
,
pg_url
)
pg_location
=
"i4x://MITx/oe101x/peergrading/init"
system
=
ModuleSystem
(
ajax_url
,
track_function
,
get_module
,
render_template
,
replace_urls
,
course_id
=
course_id
,
anonymous_student_id
=
anonymous_student_id
)
definition
=
"<peergrading use_for_single_location = 'False'></peergrading>"
instance_state
=
None
descriptor
=
peer_grading_module
.
PeerGradingDescriptor
(
system
)
pg_module
=
peer_grading_module
.
PeerGradingModule
(
system
,
pg_location
,
definition
,
descriptor
,
instance_state
)
"""
return_html = pg_module.get_html()
log.debug(return_html)
response = render_to_response('peer_grading/peer_grading_notifications.html', {
'peer_grading_html' : return_html,
'course': course,
'problem_location': pg_location,
'course_id': course_id,
'ajax_url': ajax_url,
'staff_access': False,
})
"""
student_module_cache
=
StudentModuleCache
(
course_id
,
request
.
user
,
[
descriptor
])
pg_xmodule
=
module_render
.
get_module
(
request
.
user
,
request
,
Location
(
pg_location
),
student_module_cache
,
course_id
)
return
HttpResponse
(
pg_xmodule
.
get_html
())
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
def
peer_grading_ajax
(
request
,
course_id
):
'''
Show individual problem interface
'''
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'load'
)
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'load'
)
problem_location
=
request
.
GET
.
get
(
"location"
)
log
.
debug
(
course_id
)
pg_location
=
"i4x://"
+
"MITx/oe101x/"
+
"peergrading/init"
ajax_url
=
_reverse_with_slash
(
'peer_grading'
,
course_id
)
return
render_to_response
(
'peer_grading/peer_grading_problem.html'
,
{
base_course_url
=
reverse
(
'courses'
)
'view_html'
:
''
,
problem_url_parts
=
search
.
path_to_location
(
modulestore
(),
course
.
id
,
pg_location
)
'course'
:
course
,
problem_url
=
base_course_url
+
"/"
'problem_location'
:
problem_location
,
for
z
in
xrange
(
0
,
len
(
problem_url_parts
)):
'course_id'
:
course_id
,
part
=
problem_url_parts
[
z
]
'ajax_url'
:
ajax_url
,
if
part
is
not
None
:
# Checked above
if
z
==
1
:
'staff_access'
:
False
,
})
problem_url
+=
"courseware/"
problem_url
+=
part
+
"/"
return
HttpResponseRedirect
(
problem_url
)
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
def
student_problem_list
(
request
,
course_id
):
def
student_problem_list
(
request
,
course_id
):
...
...
lms/urls.py
View file @
14676d1c
...
@@ -300,8 +300,6 @@ if settings.COURSEWARE_ENABLED:
...
@@ -300,8 +300,6 @@ if settings.COURSEWARE_ENABLED:
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/peer_grading$'
,
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/peer_grading$'
,
'open_ended_grading.views.peer_grading'
,
name
=
'peer_grading'
),
'open_ended_grading.views.peer_grading'
,
name
=
'peer_grading'
),
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/peer_grading_ajax$'
,
'open_ended_grading.views.peer_grading_ajax'
,
name
=
'peer_grading_ajax'
),
)
)
# discussion forums live within courseware, so courseware must be enabled first
# discussion forums live within courseware, so courseware must be enabled first
...
...
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