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
b5786874
Commit
b5786874
authored
Mar 04, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wiring through some changes
parent
77ed9216
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
47 deletions
+9
-47
common/lib/xmodule/xmodule/peer_grading_module.py
+4
-43
lms/djangoapps/open_ended_grading/tests.py
+5
-4
No files found.
common/lib/xmodule/xmodule/peer_grading_module.py
View file @
b5786874
...
...
@@ -6,10 +6,9 @@ from lxml import etree
from
datetime
import
datetime
from
pkg_resources
import
resource_string
from
.capa_module
import
ComplexEncoder
from
.editing_module
import
EditingDescriptor
from
.stringify
import
stringify_children
from
.x_module
import
XModule
from
.xml_module
import
Xml
Descriptor
from
xmodule.raw_module
import
Raw
Descriptor
from
xmodule.modulestore
import
Location
from
xmodule.modulestore.django
import
modulestore
from
timeinfo
import
TimeInfo
...
...
@@ -83,7 +82,7 @@ class PeerGradingModule(XModule):
raise
self
.
display_due_date
=
self
.
timeinfo
.
display_due_date
try
:
self
.
student_data_for_location
=
json
.
loads
(
self
.
student_data_for_location
)
except
:
...
...
@@ -558,9 +557,9 @@ class PeerGradingModule(XModule):
return
json
.
dumps
(
state
)
class
PeerGradingDescriptor
(
XmlDescriptor
,
Editing
Descriptor
):
class
PeerGradingDescriptor
(
Raw
Descriptor
):
"""
Module for adding
combined open ended
questions
Module for adding
peer grading
questions
"""
mako_template
=
"widgets/raw-edit.html"
module_class
=
PeerGradingModule
...
...
@@ -569,41 +568,3 @@ class PeerGradingDescriptor(XmlDescriptor, EditingDescriptor):
stores_state
=
True
has_score
=
True
template_dir_name
=
"peer_grading"
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/html/edit.coffee'
)]}
js_module_name
=
"HTMLEditingDescriptor"
@classmethod
def
definition_from_xml
(
cls
,
xml_object
,
system
):
"""
Pull out the individual tasks, the rubric, and the prompt, and parse
Returns:
{
'rubric': 'some-html',
'prompt': 'some-html',
'task_xml': dictionary of xml strings,
}
"""
log
.
debug
(
"In definition"
)
expected_children
=
[]
for
child
in
expected_children
:
if
len
(
xml_object
.
xpath
(
child
))
==
0
:
#This is a staff_facing_error
raise
ValueError
(
"Peer grading definition must include at least one '{0}' tag. Contact the learning sciences group for assistance."
.
format
(
child
))
def
parse_task
(
k
):
"""Assumes that xml_object has child k"""
return
[
stringify_children
(
xml_object
.
xpath
(
k
)[
i
])
for
i
in
xrange
(
0
,
len
(
xml_object
.
xpath
(
k
)))]
def
parse
(
k
):
"""Assumes that xml_object has child k"""
return
xml_object
.
xpath
(
k
)[
0
]
return
{},
[]
def
definition_to_xml
(
self
,
resource_fs
):
'''Return an xml element representing this definition.'''
elt
=
etree
.
Element
(
'peergrading'
)
return
elt
lms/djangoapps/open_ended_grading/tests.py
View file @
b5786874
...
...
@@ -145,14 +145,15 @@ class TestPeerGradingService(ct.PageLoader):
self
.
course_id
=
"edX/toy/2012_Fall"
self
.
toy
=
modulestore
()
.
get_course
(
self
.
course_id
)
location
=
"i4x://edX/toy/peergrading/init"
model_data
=
{}
self
.
mock_service
=
peer_grading_service
.
MockPeerGradingService
()
self
.
system
=
ModuleSystem
(
location
,
None
,
None
,
render_to_string
,
None
,
self
.
system
=
ModuleSystem
(
location
,
None
,
None
,
render_to_string
,
None
,
model_data
,
s3_interface
=
test_util_open_ended
.
S3_INTERFACE
,
open_ended_grading_interface
=
test_util_open_ended
.
OPEN_ENDED_GRADING_INTERFACE
)
self
.
descriptor
=
peer_grading_module
.
PeerGradingDescriptor
(
self
.
system
)
self
.
peer_module
=
peer_grading_module
.
PeerGradingModule
(
self
.
system
,
location
,
"<peergrading/>"
,
self
.
descriptor
)
self
.
descriptor
=
peer_grading_module
.
PeerGradingDescriptor
(
self
.
system
,
location
,
model_data
)
model_data
=
{}
self
.
peer_module
=
peer_grading_module
.
PeerGradingModule
(
self
.
system
,
location
,
"<peergrading/>"
,
self
.
descriptor
,
model_data
)
self
.
peer_module
.
peer_gs
=
self
.
mock_service
self
.
logout
()
...
...
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