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
33807456
Commit
33807456
authored
Feb 04, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
About to trim some lines
parent
c6c89e42
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
10 deletions
+14
-10
common/lib/xmodule/xmodule/peer_grading_module.py
+1
-0
lms/djangoapps/courseware/module_render.py
+3
-2
lms/djangoapps/open_ended_grading/views.py
+10
-8
No files found.
common/lib/xmodule/xmodule/peer_grading_module.py
View file @
33807456
...
...
@@ -65,6 +65,7 @@ class PeerGradingModule(XModule):
#We need to set the location here so the child modules can use it
system
.
set
(
'location'
,
location
)
log
.
debug
(
"Location: {0}"
.
format
(
location
))
self
.
system
=
system
self
.
peer_gs
=
peer_grading_service
(
self
.
system
)
...
...
lms/djangoapps/courseware/module_render.py
View file @
33807456
...
...
@@ -140,12 +140,13 @@ def get_module(user, request, location, student_module_cache, course_id,
module. If there's an error, will try to return an instance of ErrorModule
if possible. If not possible, return None.
"""
try
:
#
try:
location
=
Location
(
location
)
descriptor
=
modulestore
()
.
get_instance
(
course_id
,
location
,
depth
=
depth
)
return
get_module_for_descriptor
(
user
,
request
,
descriptor
,
student_module_cache
,
course_id
,
position
=
position
,
not_found_ok
=
not_found_ok
,
wrap_xmodule_display
=
wrap_xmodule_display
)
"""
except ItemNotFoundError:
if not not_found_ok:
log.exception("Error in get_module")
...
...
@@ -154,7 +155,7 @@ def get_module(user, request, location, student_module_cache, course_id,
# Something has gone terribly wrong, but still not letting it turn into a 500.
log.exception("Error in get_module")
return None
"""
def
get_module_for_descriptor
(
user
,
request
,
descriptor
,
student_module_cache
,
course_id
,
position
=
None
,
not_found_ok
=
False
,
wrap_xmodule_display
=
True
):
...
...
lms/djangoapps/open_ended_grading/views.py
View file @
33807456
...
...
@@ -30,6 +30,7 @@ from xmodule import peer_grading_service
from
mitxmako.shortcuts
import
render_to_string
from
xmodule.x_module
import
ModuleSystem
from
courseware
import
module_render
from
xmodule.modulestore
import
Location
from
xmodule.modulestore.django
import
modulestore
from
courseware.models
import
StudentModule
,
StudentModuleCache
...
...
@@ -103,6 +104,11 @@ def peer_grading(request, course_id):
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
,
...
...
@@ -113,14 +119,10 @@ def peer_grading(request, course_id):
anonymous_student_id
=
anonymous_student_id
)
location
=
""
definition
=
"<peergrading use_for_single_location = 'False'></peergrading>"
descriptor
=
peer_grading_module
.
PeerGradingDescriptor
instance_state
=
None
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
)
descriptor
=
peer_grading_module
.
PeerGradingDescriptor
(
system
)
pg_module
=
peer_grading_module
.
PeerGradingModule
(
system
,
pg_location
,
definition
,
descriptor
,
instance_state
)
...
...
@@ -138,11 +140,11 @@ def peer_grading(request, course_id):
"""
student_module_cache
=
StudentModuleCache
(
course_id
,
request
.
user
,
descriptor
)
request
.
user
,
[
descriptor
]
)
pg_xmodule
=
module_render
.
get_module
(
request
.
user
,
request
,
pg_location
,
student_module_cache
,
course_id
)
pg_xmodule
=
module_render
.
get_module
(
request
.
user
,
request
,
Location
(
pg_location
)
,
student_module_cache
,
course_id
)
return
pg_xmodule
.
get_html
(
)
return
HttpResponse
(
pg_xmodule
.
get_html
()
)
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
def
peer_grading_ajax
(
request
,
course_id
):
...
...
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