diff --git a/openassessment/__init__.py b/openassessment/__init__.py index c43f9c9e3f..5413861a57 100644 --- a/openassessment/__init__.py +++ b/openassessment/__init__.py @@ -2,4 +2,4 @@ Initialization Information for Open Assessment Module """ -__version__ = '6.6.1' +__version__ = '6.6.2' diff --git a/openassessment/templates/legacy/staff_area/oa_staff_area.html b/openassessment/templates/legacy/staff_area/oa_staff_area.html index ba8364190b..55c352ffe7 100644 --- a/openassessment/templates/legacy/staff_area/oa_staff_area.html +++ b/openassessment/templates/legacy/staff_area/oa_staff_area.html @@ -12,12 +12,12 @@ {% if staff_assessment_required %} - {% if is_enhanced_staff_grader_enabled %} + {% if is_enhanced_staff_grader_enabled and enhanced_staff_grader_url %} {% else %} {% comment %} Remove if block in AU-617 {% endcomment %} - {% if not is_team_assignment %} + {% if not is_team_assignment and enhanced_staff_grader_url %} {% endif %} {% endif %} diff --git a/openassessment/xblock/staff_area_mixin.py b/openassessment/xblock/staff_area_mixin.py index 2fb599453b..79a7300543 100644 --- a/openassessment/xblock/staff_area_mixin.py +++ b/openassessment/xblock/staff_area_mixin.py @@ -145,10 +145,9 @@ def get_staff_path_and_context(self): context['is_enhanced_staff_grader_enabled'] = False else: context['is_enhanced_staff_grader_enabled'] = self.is_enhanced_staff_grader_enabled - context['enhanced_staff_grader_url'] = '{esg_url}/{block_id}'.format( - esg_url=getattr(settings, 'ORA_GRADING_MICROFRONTEND_URL', ''), - block_id=str(self.get_xblock_id()) - ) + + esg_url = getattr(settings, 'ORA_GRADING_MICROFRONTEND_URL', None) + context['enhanced_staff_grader_url'] = f'{esg_url}/{str(self.get_xblock_id())}' if esg_url else None context.update( self.get_staff_assessment_statistics_context(student_item["course_id"], student_item["item_id"]) diff --git a/openassessment/xblock/static/js/fixtures/templates.json b/openassessment/xblock/static/js/fixtures/templates.json index 38e661b8c7..f4d4b08f63 100644 --- a/openassessment/xblock/static/js/fixtures/templates.json +++ b/openassessment/xblock/static/js/fixtures/templates.json @@ -781,6 +781,7 @@ "template": "legacy/staff_area/oa_staff_area.html", "context": { "is_enhanced_staff_grader_enabled": false, + "enhanced_staff_grader_url": null, "staff_assessment_required": true, "staff_assessment_ungraded": 5, "staff_assessment_in_progress": 2, @@ -816,6 +817,7 @@ "template": "legacy/staff_area/oa_staff_area.html", "context": { "is_enhanced_staff_grader_enabled": true, + "enhanced_staff_grader_url": "esg_url", "staff_assessment_required": true, "staff_assessment_ungraded": 5, "staff_assessment_in_progress": 2, diff --git a/openassessment/xblock/static/js/spec/lms/oa_staff_area.js b/openassessment/xblock/static/js/spec/lms/oa_staff_area.js index ffd613f698..afe6891e1f 100644 --- a/openassessment/xblock/static/js/spec/lms/oa_staff_area.js +++ b/openassessment/xblock/static/js/spec/lms/oa_staff_area.js @@ -368,13 +368,12 @@ describe('OpenAssessment.StaffAreaView', function() { it('when ora staff grader is disabled', function() { var view = createStaffArea({}, 'oa_staff_area_full_grading_esg_disabled.html'), $buttons = $('.ui-staff__button', view.element); - expect($buttons.length).toBe(5); + expect($buttons.length).toBe(4); expect($buttons).toHaveAttr('aria-expanded', 'false'); expect($($buttons[0]).text().trim()).toEqual('Manage Individual Learners'); expect($($buttons[1]).text().trim()).toEqual('View Assignment Statistics'); expect($($buttons[2]).text().trim()).toEqual('Grade Available Responses'); - expect($($buttons[3]).text().trim()).toEqual('Demo the new Grading Experience'); - expect($($buttons[4]).text().trim()).toEqual('View ORA in Studio'); + expect($($buttons[3]).text().trim()).toEqual('View ORA in Studio'); }); }); diff --git a/openassessment/xblock/test/test_staff_area.py b/openassessment/xblock/test/test_staff_area.py index 4526ca2b77..dcd9924bcd 100644 --- a/openassessment/xblock/test/test_staff_area.py +++ b/openassessment/xblock/test/test_staff_area.py @@ -1338,6 +1338,25 @@ def test_staff_area_esg(self, xblock, is_esg_enabled, mock_esg_flag): block_id=context['xblock_id'] )) + @override_settings( + ORA_GRADING_MICROFRONTEND_URL=None + ) + @patch( + 'openassessment.xblock.config_mixin.ConfigMixin.is_enhanced_staff_grader_enabled', + new_callable=PropertyMock + ) + @scenario('data/staff_grade_scenario.xml', user_id='Bob') + def test_staff_area_esg_no_url(self, xblock, mock_esg_flag): + """ + If there is a staff step, enhanced_staff_grader_url should be None + if ORA_GRADING_MICROFRONTEND_URL is not set + """ + mock_esg_flag.return_value = True + _, context = xblock.get_staff_path_and_context() + self._verify_staff_assessment_context(context, True, 0, 0) + self.assertEqual(context['is_enhanced_staff_grader_enabled'], True) + self.assertIsNone(context['enhanced_staff_grader_url']) + @log_capture() @patch('openassessment.xblock.config_mixin.ConfigMixin.user_state_upload_data_enabled') @scenario('data/file_upload_missing_scenario.xml', user_id='Bob') diff --git a/package-lock.json b/package-lock.json index 5ab0df5104..20cdb2fd9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "edx-ora2", - "version": "6.5.1", + "version": "6.6.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "edx-ora2", - "version": "6.4.0", + "version": "6.6.2", "dependencies": { "@edx/frontend-build": "8.0.6", "@openedx/paragon": "^21.5.7", diff --git a/package.json b/package.json index 683716b385..bc837b861d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "edx-ora2", - "version": "6.5.1", + "version": "6.6.2", "repository": "https://github.com/openedx/edx-ora2.git", "dependencies": { "@edx/frontend-build": "8.0.6",