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
d20fc439
Commit
d20fc439
authored
Mar 06, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix peer grading boolean parsing
parent
3329af07
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py
+1
-1
common/lib/xmodule/xmodule/peer_grading_module.py
+13
-10
No files found.
common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py
View file @
d20fc439
...
...
@@ -138,7 +138,7 @@ class CombinedOpenEndedV1Module():
self
.
attempts
=
self
.
instance_state
.
get
(
'attempts'
,
MAX_ATTEMPTS
)
self
.
is_scored
=
self
.
instance_state
.
get
(
'is_graded'
,
IS_SCORED
)
in
TRUE_DICT
self
.
accept_file_upload
=
self
.
instance_state
.
get
(
'accept_file_upload'
,
ACCEPT_FILE_UPLOAD
)
in
TRUE_DICT
self
.
skip_basic_checks
=
self
.
instance_state
.
get
(
'skip_spelling_checks'
,
SKIP_BASIC_CHECKS
)
self
.
skip_basic_checks
=
self
.
instance_state
.
get
(
'skip_spelling_checks'
,
SKIP_BASIC_CHECKS
)
in
TRUE_DICT
display_due_date_string
=
self
.
instance_state
.
get
(
'due'
,
None
)
...
...
common/lib/xmodule/xmodule/peer_grading_module.py
View file @
d20fc439
...
...
@@ -58,16 +58,19 @@ class PeerGradingModule(XModule):
else
:
self
.
peer_gs
=
MockPeerGradingService
()
if
self
.
use_for_single_location
==
True
:
log
.
debug
(
self
.
use_for_single_location
)
log
.
debug
(
type
(
self
.
use_for_single_location
))
log
.
debug
(
self
.
use_for_single_location
==
True
)
if
self
.
use_for_single_location
in
TRUE_DICT
:
try
:
self
.
linked_problem
=
modulestore
()
.
get_instance
(
self
.
system
.
course_id
,
self
.
link_to_location
)
except
:
log
.
error
(
"Linked location {0} for peer grading module {1} does not exist"
.
format
(
self
.
link_to_location
,
self
.
location
))
raise
due_date
=
self
.
linked_problem
.
meta
data
.
get
(
'peer_grading_due'
,
None
)
due_date
=
self
.
linked_problem
.
_model_
data
.
get
(
'peer_grading_due'
,
None
)
if
due_date
:
self
.
meta
data
[
'due'
]
=
due_date
self
.
_model_
data
[
'due'
]
=
due_date
try
:
self
.
timeinfo
=
TimeInfo
(
self
.
display_due_date_string
,
self
.
grace_period_string
)
...
...
@@ -120,7 +123,7 @@ class PeerGradingModule(XModule):
"""
if
self
.
closed
():
return
self
.
peer_grading_closed
()
if
not
self
.
use_for_single_location
:
if
self
.
use_for_single_location
not
in
TRUE_DICT
:
return
self
.
peer_grading
()
else
:
return
self
.
peer_grading_problem
({
'location'
:
self
.
link_to_location
})[
'html'
]
...
...
@@ -171,7 +174,7 @@ class PeerGradingModule(XModule):
pass
def
get_score
(
self
):
if
not
self
.
use_for_single_location
or
not
self
.
is_graded
:
if
self
.
use_for_single_location
not
in
TRUE_DICT
or
self
.
is_graded
not
in
TRUE_DICT
:
return
None
try
:
...
...
@@ -204,7 +207,7 @@ class PeerGradingModule(XModule):
randomization, and 5/7 on another
'''
max_grade
=
None
if
self
.
use_for_single_location
and
self
.
is_graded
:
if
self
.
use_for_single_location
in
TRUE_DICT
and
self
.
is_graded
in
TRUE_DICT
:
max_grade
=
self
.
max_grade
return
max_grade
...
...
@@ -450,7 +453,6 @@ class PeerGradingModule(XModule):
error_text
=
problem_list_dict
[
'error'
]
problem_list
=
problem_list_dict
[
'problem_list'
]
except
GradingServiceError
:
#This is a student_facing_error
error_text
=
EXTERNAL_GRADER_NO_CONTACT_ERROR
...
...
@@ -480,8 +482,9 @@ class PeerGradingModule(XModule):
problem_location
=
problem
[
'location'
]
descriptor
=
_find_corresponding_module_for_location
(
problem_location
)
if
descriptor
:
problem
[
'due'
]
=
descriptor
.
metadata
.
get
(
'peer_grading_due'
,
None
)
grace_period_string
=
descriptor
.
metadata
.
get
(
'graceperiod'
,
None
)
log
.
debug
(
descriptor
.
__dict__
)
problem
[
'due'
]
=
descriptor
.
_model_data
.
get
(
'peer_grading_due'
,
None
)
grace_period_string
=
descriptor
.
_model_data
.
get
(
'graceperiod'
,
None
)
try
:
problem_timeinfo
=
TimeInfo
(
problem
[
'due'
],
grace_period_string
)
except
:
...
...
@@ -516,7 +519,7 @@ class PeerGradingModule(XModule):
Show individual problem interface
'''
if
get
is
None
or
get
.
get
(
'location'
)
is
None
:
if
not
self
.
use_for_single_location
:
if
self
.
use_for_single_location
not
in
TRUE_DICT
:
#This is an error case, because it must be set to use a single location to be called without get parameters
#This is a dev_facing_error
log
.
error
(
"Peer grading problem in peer_grading_module called with no get parameters, but use_for_single_location is False."
)
...
...
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