Skip to content

Commit

Permalink
fix: fix-forward revert of e2970b7 (#2148)
Browse files Browse the repository at this point in the history
  • Loading branch information
jansenk authored Dec 19, 2023
1 parent 01159ca commit 671bbc5
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 2 deletions.
2 changes: 1 addition & 1 deletion openassessment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Initialization Information for Open Assessment Module
"""

__version__ = '6.0.19'
__version__ = '6.0.20'
22 changes: 22 additions & 0 deletions openassessment/xblock/openassessmentblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,23 @@ def student_view(self, context=None): # pylint: disable=unused-argument
}
)

@property
def uses_default_assessment_order(self):
"""
Determine if our steps have been reordered (omission of steps is fine)
"""
mfe_supported_step_ordering = ['student-training', 'self-assessment', 'peer-assessment', 'staff-assessment']

last_step_index = 0
for assessment_step in self.assessment_steps:
step_index = mfe_supported_step_ordering.index(assessment_step)

if step_index < last_step_index:
return False
last_step_index = step_index

return True

@property
def mfe_views_supported(self):
"""
Expand All @@ -642,6 +659,7 @@ def mfe_views_supported(self):
1) Team assignments
2) ORAs with leaderboards
3) ORAs with LaTeX previews enabled
4) Assignments with reordered assessment steps
Returns:
- False if we are in one of these unsupported configurations.
Expand All @@ -660,6 +678,10 @@ def mfe_views_supported(self):
if self.allow_latex:
return False

# Assessment step reordering is currently unsupported
if not self.uses_default_assessment_order:
return False

return True

def ora_blocks_listing_view(self, context=None):
Expand Down
49 changes: 49 additions & 0 deletions openassessment/xblock/test/data/assessment_steps_reordered.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<openassessment>
<title>Open Assessment Test</title>
<prompts>
<prompt>
<description>Given the state of the world today, what do you think should be done to combat poverty?</description>
</prompt>
<prompt>
<description>Given the state of the world today, what do you think should be done to combat pollution?</description>
</prompt>
</prompts>
<rubric>
<criterion>
<name>𝓒𝓸𝓷𝓬𝓲𝓼𝓮</name>
<prompt>How concise is it?</prompt>
<option points="3">
<name>ﻉซƈﻉɭɭﻉกՇ</name>
<explanation>Extremely concise</explanation>
</option>
<option points="2">
<name>Ġööḋ</name>
<explanation>Concise</explanation>
</option>
<option points="1">
<name>ק๏๏г</name>
<explanation>Wordy</explanation>
</option>
</criterion>
<criterion>
<name>Form</name>
<prompt>How well-formed is it?</prompt>
<option points="3">
<name>Good</name>
<explanation>Good</explanation>
</option>
<option points="2">
<name>Fair</name>
<explanation>Fair</explanation>
</option>
<option points="1">
<name>Poor</name>
<explanation>Poor</explanation>
</option>
</criterion>
</rubric>
<assessments>
<assessment name="staff-assessment" required="true"/>
<assessment name="peer-assessment" must_grade="5" must_be_graded_by="3" />
</assessments>
</openassessment>
7 changes: 7 additions & 0 deletions openassessment/xblock/test/test_openassessment.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,13 @@ def test_mfe_views_supported__latex(self, xblock, mock_value, expected_supported
# Then they are unsupported for ORAs with leaderboards
self.assertEqual(xblock.mfe_views_supported, expected_supported)

@scenario('data/assessment_steps_reordered.xml')
def test_mfe_views_supported__rearranged_steps(self, xblock):
# Given this ORA has rearranged our assessment steps
# When I see if MFE views are supported
# Then they are unsupported for team assignments
self.assertFalse(xblock.mfe_views_supported)


class TestDates(XBlockHandlerTestCase):
""" Test Assessment Dates. """
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "edx-ora2",
"version": "6.0.19",
"version": "6.0.20",
"repository": "https://github.com/openedx/edx-ora2.git",
"dependencies": {
"@edx/frontend-build": "8.0.6",
Expand Down

0 comments on commit 671bbc5

Please sign in to comment.