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
d45c539c
Commit
d45c539c
authored
Feb 12, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the peer grading due date a property of the problem
metadata, not the peer grading module metadata.
parent
cab9bfcd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
18 deletions
+8
-18
common/lib/xmodule/xmodule/peer_grading_module.py
+8
-18
No files found.
common/lib/xmodule/xmodule/peer_grading_module.py
View file @
d45c539c
...
@@ -96,8 +96,11 @@ class PeerGradingModule(XModule):
...
@@ -96,8 +96,11 @@ class PeerGradingModule(XModule):
self
.
link_to_location
=
self
.
metadata
.
get
(
'link_to_location'
,
USE_FOR_SINGLE_LOCATION
)
self
.
link_to_location
=
self
.
metadata
.
get
(
'link_to_location'
,
USE_FOR_SINGLE_LOCATION
)
if
self
.
use_for_single_location
==
True
:
if
self
.
use_for_single_location
==
True
:
#This will raise an exception if the location is invalid
self
.
linked_problem
=
modulestore
()
.
get_instance
(
self
.
system
.
course_id
,
self
.
link_to_location
)
link_to_location_object
=
Location
(
self
.
link_to_location
)
log
.
debug
(
"problem metadata: {0}"
.
format
(
self
.
linked_problem
.
metadata
))
due_date
=
self
.
linked_problem
.
metadata
.
get
(
'peer_grading_due'
,
None
)
if
due_date
:
self
.
metadata
[
'due'
]
=
due_date
self
.
ajax_url
=
self
.
system
.
ajax_url
self
.
ajax_url
=
self
.
system
.
ajax_url
if
not
self
.
ajax_url
.
endswith
(
"/"
):
if
not
self
.
ajax_url
.
endswith
(
"/"
):
...
@@ -462,31 +465,18 @@ class PeerGradingModule(XModule):
...
@@ -462,31 +465,18 @@ class PeerGradingModule(XModule):
success
=
False
success
=
False
# grab all peer grading module descriptors for this course
peer_grading_modules
=
modulestore
()
.
get_items
(
[
'i4x'
,
self
.
location
.
org
,
self
.
location
.
course
,
'peergrading'
,
None
],
self
.
system
.
course_id
)
# construct a dictionary for fast lookups
module_dict
=
{}
for
module
in
peer_grading_modules
:
linked_location
=
module
.
metadata
.
get
(
"link_to_location"
,
None
)
if
linked_location
:
module_dict
[
linked_location
]
=
module
def
_find_corresponding_module_for_location
(
location
):
def
_find_corresponding_module_for_location
(
location
):
'''
'''
find the peer grading module that links to the given location
find the peer grading module that links to the given location
'''
'''
if
location
in
module_dict
:
return
modulestore
()
.
get_instance
(
self
.
system
.
course_id
,
location
)
return
module_dict
[
location
]
else
:
return
None
for
problem
in
problem_list
:
for
problem
in
problem_list
:
problem_location
=
problem
[
'location'
]
problem_location
=
problem
[
'location'
]
descriptor
=
_find_corresponding_module_for_location
(
problem_location
)
descriptor
=
_find_corresponding_module_for_location
(
problem_location
)
if
descriptor
:
if
descriptor
:
problem
[
'due'
]
=
descriptor
.
metadata
.
get
(
'due'
,
None
)
problem
[
'due'
]
=
descriptor
.
metadata
.
get
(
'
peer_grading_
due'
,
None
)
grace_period_string
=
descriptor
.
metadata
.
get
(
'graceperiod'
,
None
)
grace_period_string
=
descriptor
.
metadata
.
get
(
'graceperiod'
,
None
)
try
:
try
:
problem_timeinfo
=
TimeInfo
(
problem
[
'due'
],
grace_period_string
)
problem_timeinfo
=
TimeInfo
(
problem
[
'due'
],
grace_period_string
)
...
...
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