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
c6c89e42
Commit
c6c89e42
authored
Feb 04, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make peer grading xmodule work with notifications
parent
7263cbfc
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
10 deletions
+65
-10
common/djangoapps/xmodule_modifiers.py
+0
-1
lms/djangoapps/open_ended_grading/views.py
+29
-7
lms/envs/dev.py
+16
-2
lms/templates/peer_grading/peer_grading_notifications.html
+18
-0
lms/urls.py
+2
-0
No files found.
common/djangoapps/xmodule_modifiers.py
View file @
c6c89e42
...
...
@@ -64,7 +64,6 @@ def replace_static_urls(get_html, prefix, course_namespace=None):
return
replace_urls
(
get_html
(),
staticfiles_prefix
=
prefix
,
course_namespace
=
course_namespace
)
return
_get_html
def
grade_histogram
(
module_id
):
''' Print out a histogram of grades on a given problem.
Part of staff member debug info.
...
...
lms/djangoapps/open_ended_grading/views.py
View file @
c6c89e42
...
...
@@ -29,6 +29,9 @@ from xmodule import peer_grading_module
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.django
import
modulestore
from
courseware.models
import
StudentModule
,
StudentModuleCache
from
django.http
import
HttpResponse
,
Http404
...
...
@@ -86,14 +89,14 @@ def staff_grading(request, course_id):
# Checked above
'staff_access'
:
True
,
})
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
def
peer_grading
(
request
,
course_id
):
'''
Show a peer grading interface
'''
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'load'
)
ajax_url
=
ajax_url
=
_reverse_with_slash
(
'peer_grading
'
,
course_id
)
ajax_url
=
_reverse_with_slash
(
'peer_grading_ajax
'
,
course_id
)
track_function
=
None
get_module
=
None
render_template
=
render_to_string
...
...
@@ -114,16 +117,35 @@ def peer_grading(request, course_id):
definition
=
"<peergrading use_for_single_location = 'False'></peergrading>"
descriptor
=
peer_grading_module
.
PeerGradingDescriptor
instance_state
=
None
pg_url
=
re
.
sub
(
"/courses"
,
"i4x:/"
,
ajax_url
)[:
-
1
]
pg_module
=
peer_grading_module
.
PeerGradingModule
(
system
,
pg_url
,
definition
,
descriptor
,
instance_state
)
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
)
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'load'
)
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
,
pg_location
,
student_module_cache
,
course_id
)
return
pg_module
.
get_html
()
return
pg_
x
module
.
get_html
()
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
def
peer_grading_
problem
(
request
,
course_id
):
def
peer_grading_
ajax
(
request
,
course_id
):
'''
Show individual problem interface
'''
...
...
lms/envs/dev.py
View file @
c6c89e42
...
...
@@ -52,6 +52,14 @@ CACHES = {
# We set it to be a DummyCache to force reloading of course.xml in dev.
# In staging environments, we would grab VERSION from data uploaded by the
# push process.
#'general': {
# 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
# 'KEY_PREFIX': 'general',
# 'VERSION': 4,
# 'LOCATION': 'mitx_loc_mem_cache_general',
# 'KEY_FUNCTION': 'util.memcache.safe_key',
#}
'general'
:
{
'BACKEND'
:
'django.core.cache.backends.dummy.DummyCache'
,
'KEY_PREFIX'
:
'general'
,
...
...
@@ -62,10 +70,10 @@ CACHES = {
XQUEUE_INTERFACE
=
{
"url"
:
"http
s://sandbox-xqueue.edx.org
"
,
"url"
:
"http
://127.0.0.1:3032
"
,
"django_auth"
:
{
"username"
:
"lms"
,
"password"
:
"
***REMOVED***
"
"password"
:
"
abcd
"
},
"basic_auth"
:
(
'anant'
,
'agarwal'
),
}
...
...
@@ -198,3 +206,9 @@ PIPELINE_SASS_ARGUMENTS = '-r {proj_dir}/static/sass/bourbon/lib/bourbon.rb'.for
MITX_FEATURES
[
'ENABLE_PEARSON_HACK_TEST'
]
=
True
PEARSON_TEST_USER
=
"pearsontest"
PEARSON_TEST_PASSWORD
=
"12345"
#AWS upload stuff for local file testing
AWS_ACCESS_KEY_ID
=
"***REMOVED***"
AWS_SECRET_ACCESS_KEY
=
"***REMOVED***"
AWS_STORAGE_BUCKET_NAME
=
'edxuploads'
lms/templates/peer_grading/peer_grading_notifications.html
0 → 100644
View file @
c6c89e42
<
%
inherit
file=
"/main.html"
/>
<
%
block
name=
"bodyclass"
>
${course.css_class}
</
%
block>
<
%
namespace
name=
'static'
file=
'/static_content.html'
/>
<
%
block
name=
"headextra"
>
<
%
static:css
group=
'course'
/>
</
%
block>
<
%
block
name=
"title"
><title>
${course.number} Peer Grading
</title></
%
block>
<
%
include
file=
"/courseware/course_navigation.html"
args=
"active_page='peer_grading'"
/>
<
%
block
name=
"js_extra"
>
<
%
static:js
group=
'peer_grading'
/>
</
%
block>
${peer_grading_html|n}
\ No newline at end of file
lms/urls.py
View file @
c6c89e42
...
...
@@ -300,6 +300,8 @@ if settings.COURSEWARE_ENABLED:
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/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
...
...
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