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
aa092fa3
Commit
aa092fa3
authored
Jul 29, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a bug that caused example-based assessments to stop being displayed in the authoring GUI.
parent
49d9213f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
openassessment/xblock/studio_mixin.py
+10
-3
openassessment/xblock/test/test_studio.py
+1
-1
No files found.
openassessment/xblock/studio_mixin.py
View file @
aa092fa3
...
...
@@ -293,22 +293,29 @@ class StudioMixin(object):
"""
order
=
copy
.
deepcopy
(
self
.
editor_assessments_order
)
used_assessments
=
[
asmnt
[
'name'
]
for
asmnt
in
self
.
valid_assessments
]
default_editor_order
=
copy
.
deepcopy
(
DEFAULT_EDITOR_ASSESSMENTS_ORDER
)
# Backwards compatibility:
# If the problem already contains example-based assessment
# then allow the editor to display example-based assessments.
if
'example-based-assessment'
in
used_assessments
:
default_editor_order
.
insert
(
0
,
'example-based-assessment'
)
# Backwards compatibility:
# If the editor assessments order doesn't match the problem order,
# fall back to the problem order.
# This handles the migration of problems created pre-authoring,
# which will have the default editor order.
used_assessments
=
[
asmnt
[
'name'
]
for
asmnt
in
self
.
valid_assessments
]
problem_order_indices
=
[
order
.
index
(
asmnt_name
)
for
asmnt_name
in
used_assessments
if
asmnt_name
in
order
]
if
problem_order_indices
!=
sorted
(
problem_order_indices
):
unused_assessments
=
list
(
set
(
DEFAULT_EDITOR_ASSESSMENTS_ORDER
)
-
set
(
used_assessments
))
unused_assessments
=
list
(
set
(
default_editor_order
)
-
set
(
used_assessments
))
return
sorted
(
unused_assessments
)
+
used_assessments
# Forwards compatibility:
# Include any additional assessments that may have been added since the problem was created.
else
:
return
order
+
list
(
set
(
DEFAULT_EDITOR_ASSESSMENTS_ORDER
)
-
set
(
order
))
return
order
+
list
(
set
(
default_editor_order
)
-
set
(
order
))
openassessment/xblock/test/test_studio.py
View file @
aa092fa3
...
...
@@ -117,7 +117,7 @@ class StudioViewTest(XBlockHandlerTestCase):
@scenario
(
'data/example_based_only.xml'
)
def
test_render_studio_with_ai
(
self
,
xblock
):
frag
=
self
.
runtime
.
render
(
xblock
,
'studio_view'
)
self
.
assertTrue
(
frag
.
body_html
()
.
find
(
'openassessment-edit'
))
self
.
assertTrue
(
'ai_assessment_settings_editor'
in
frag
.
body_html
(
))
@file_data
(
'data/update_xblock.json'
)
@scenario
(
'data/basic_scenario.xml'
)
...
...
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