Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
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-ora2
Commits
e7a6992a
Commit
e7a6992a
authored
Jul 28, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix key error that can occur if course staff create assessments before releasing a problem
parent
45c53fba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
2 deletions
+31
-2
openassessment/xblock/grade_mixin.py
+9
-2
openassessment/xblock/test/test_grade.py
+22
-0
No files found.
openassessment/xblock/grade_mixin.py
View file @
e7a6992a
...
...
@@ -147,8 +147,15 @@ class GradeMixin(object):
if
median_scores
is
not
None
and
max_scores
is
not
None
:
for
criterion
in
context
[
"rubric_criteria"
]:
criterion
[
"median_score"
]
=
median_scores
[
criterion
[
"name"
]]
criterion
[
"total_value"
]
=
max_scores
[
criterion
[
"name"
]]
# Although we prevent course authors from modifying criteria post-release,
# it's still possible for assessments created by course staff to
# have criteria that differ from the current problem definition.
# It's also possible to circumvent the post-release restriction
# if course authors directly import a course into Studio.
# If this happens, we simply leave the score blank so that the grade
# section can render without error.
criterion
[
"median_score"
]
=
median_scores
.
get
(
criterion
[
"name"
],
''
)
criterion
[
"total_value"
]
=
max_scores
.
get
(
criterion
[
"name"
],
''
)
return
(
'openassessmentblock/grade/oa_grade_complete.html'
,
context
)
...
...
openassessment/xblock/test/test_grade.py
View file @
e7a6992a
...
...
@@ -202,6 +202,28 @@ class TestGrade(XBlockHandlerTestCase):
self
.
assertIn
(
u'Peer 2: ฝﻉɭɭ ɗѻกﻉ!'
,
resp
.
decode
(
'utf-8'
))
self
.
assertIn
(
u'Peer 2: ƒαιя נσв'
,
resp
.
decode
(
'utf-8'
))
@scenario
(
'data/grade_scenario.xml'
,
user_id
=
'Bob'
)
def
test_assessment_does_not_match_rubric
(
self
,
xblock
):
# Get to the grade complete section
self
.
_create_submission_and_assessments
(
xblock
,
self
.
SUBMISSION
,
self
.
PEERS
,
self
.
ASSESSMENTS
,
self
.
ASSESSMENTS
[
0
]
)
# Change the problem definition so it no longer
# matches the assessments. This should never happen
# for a student (since we prevent authors from doing this post-release),
# but it may happen if a course author has submitted
# an assessment for a problem before it was published,
# or if course authors mess around with course import.
xblock
.
rubric_criteria
[
0
][
"name"
]
=
"CHANGED NAME!"
# Expect that the page renders without an error
# It won't show the assessment criterion that changed
# (since it's not part of the original assessment),
# but at least it won't display an error.
resp
=
self
.
request
(
xblock
,
'render_grade'
,
json
.
dumps
({}))
self
.
assertGreater
(
resp
,
0
)
@ddt.file_data
(
'data/waiting_scenarios.json'
)
@scenario
(
'data/grade_waiting_scenario.xml'
,
user_id
=
'Omar'
)
def
test_grade_waiting
(
self
,
xblock
,
data
):
...
...
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