Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: disable new ORA experience for leaderboards #2140

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.13'
__version__ = '6.0.14'
5 changes: 5 additions & 0 deletions openassessment/xblock/openassessmentblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ def mfe_views_supported(self):
Unsupported use-cases:
1) Team assignments
2) Assignments with reordered assessment steps
3) ORAs with leaderboards

Returns:
- False if we are in one of these unsupported configurations.
Expand All @@ -672,6 +673,10 @@ def mfe_views_supported(self):
if not self.uses_default_assessment_order:
return False

# We currently don't support leaderboards
if self.leaderboard_show != 0:
return False

return True

def ora_blocks_listing_view(self, context=None):
Expand Down
12 changes: 12 additions & 0 deletions openassessment/xblock/test/test_openassessment.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,18 @@ def test_mfe_views_supported__rearranged_steps(self, xblock):
# Then they are unsupported for team assignments
self.assertFalse(xblock.mfe_views_supported)

@ddt.unpack
@ddt.data((0, True), (5, False))
@patch.object(openassessmentblock.OpenAssessmentBlock, 'leaderboard_show', new_callable=PropertyMock)
@scenario('data/simple_self_staff_scenario.xml')
def test_mfe_views_supported__leaderboard(self, xblock, mock_value, expected_supported, mock_leaderboard_show):
# Given I'm on / not on an ORA with a leaderboard
mock_leaderboard_show.return_value = mock_value

# When I see if MFE views are supported
# Then they are unsupported for ORAs with leaderboards
self.assertEqual(xblock.mfe_views_supported, expected_supported)


class TestDates(XBlockHandlerTestCase):
""" Test Assessment Dates. """
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.13",
"version": "6.0.14",
"repository": "https://github.com/openedx/edx-ora2.git",
"dependencies": {
"@edx/frontend-build": "8.0.6",
Expand Down
Loading