diff --git a/assets/constants.js b/assets/constants.js index cb9ab2572e62..b56d1b5cca4d 100644 --- a/assets/constants.js +++ b/assets/constants.js @@ -456,6 +456,8 @@ var constants = { "ENABLE_NEW_STRUCTURE_EDITORS": true, + "ENABLE_PREREQUISITE_SKILLS": false, + "ENABLE_NEW_STRUCTURE_PLAYERS": false, "NUM_QUESTIONS_PER_PAGE": 10, diff --git a/core/controllers/features.py b/core/controllers/features.py index 2d674f36eb80..3909a1444ec5 100644 --- a/core/controllers/features.py +++ b/core/controllers/features.py @@ -37,6 +37,6 @@ def get(self, exploration_id): self.render_json({ 'is_improvements_tab_enabled': config_domain.IS_IMPROVEMENTS_TAB_ENABLED.value, - 'is_playthrough_recording_enabled': - exploration_id in whitelisted_exploration_ids_for_playthroughs, + 'is_exploration_whitelisted': + exploration_id in whitelisted_exploration_ids_for_playthroughs }) diff --git a/core/controllers/features_test.py b/core/controllers/features_test.py index ca28ccab27b2..1fb41d073a03 100644 --- a/core/controllers/features_test.py +++ b/core/controllers/features_test.py @@ -51,7 +51,7 @@ def test_can_record_playthroughs_in_whitelisted_explorations(self): json_response = self.get_json(exploration_features_url(self.EXP_ID)) - self.assertTrue(json_response['is_playthrough_recording_enabled']) + self.assertTrue(json_response['is_exploration_whitelisted']) def test_can_not_record_playthroughs_with_empty_whitelist(self): self.set_config_property( @@ -60,7 +60,7 @@ def test_can_not_record_playthroughs_with_empty_whitelist(self): json_response = self.get_json(exploration_features_url(self.EXP_ID)) - self.assertFalse(json_response['is_playthrough_recording_enabled']) + self.assertFalse(json_response['is_exploration_whitelisted']) def test_can_not_record_playthroughs_for_exploration_not_in_whitelist(self): self.set_config_property( @@ -69,7 +69,7 @@ def test_can_not_record_playthroughs_for_exploration_not_in_whitelist(self): json_response = self.get_json(exploration_features_url(self.EXP_ID)) - self.assertFalse(json_response['is_playthrough_recording_enabled']) + self.assertFalse(json_response['is_exploration_whitelisted']) class ExplorationImprovementsTabFeatureTest(ExplorationFeaturesTestBase): diff --git a/core/templates/dev/head/components/OutcomeDestinationEditorDirective.js b/core/templates/dev/head/components/OutcomeDestinationEditorDirective.js index 0ef1ed00c15a..88d0fa00135b 100644 --- a/core/templates/dev/head/components/OutcomeDestinationEditorDirective.js +++ b/core/templates/dev/head/components/OutcomeDestinationEditorDirective.js @@ -36,8 +36,10 @@ oppia.directive('outcomeDestinationEditor', [ StateEditorService, StateGraphLayoutService, UserService, EXPLORATION_AND_SKILL_ID_PATTERN, PLACEHOLDER_OUTCOME_DEST) { var currentStateName = null; - $scope.canAddPrerequisiteSkill = - constants.ENABLE_NEW_STRUCTURE_EDITORS; + $scope.canAddPrerequisiteSkill = ( + constants.ENABLE_NEW_STRUCTURE_EDITORS && + constants.ENABLE_PREREQUISITE_SKILLS && + StateEditorService.isExplorationWhitelisted()); $scope.$on('saveOutcomeDestDetails', function() { // Create new state if specified. diff --git a/core/templates/dev/head/components/OutcomeEditorDirective.js b/core/templates/dev/head/components/OutcomeEditorDirective.js index c3418308bcf7..7efa46396ff9 100644 --- a/core/templates/dev/head/components/OutcomeEditorDirective.js +++ b/core/templates/dev/head/components/OutcomeEditorDirective.js @@ -42,7 +42,9 @@ oppia.directive('outcomeEditor', [ $scope.editOutcomeForm = {}; $scope.isInQuestionMode = StateEditorService.isInQuestionMode; $scope.canAddPrerequisiteSkill = - constants.ENABLE_NEW_STRUCTURE_EDITORS; + constants.ENABLE_NEW_STRUCTURE_EDITORS && + constants.ENABLE_PREREQUISITE_SKILLS && + StateEditorService.isExplorationWhitelisted(); $scope.feedbackEditorIsOpen = false; $scope.destinationEditorIsOpen = false; $scope.correctnessLabelEditorIsOpen = false; diff --git a/core/templates/dev/head/components/outcome_destination_editor_directive.html b/core/templates/dev/head/components/outcome_destination_editor_directive.html index 689e246ccd21..5816de92d155 100644 --- a/core/templates/dev/head/components/outcome_destination_editor_directive.html +++ b/core/templates/dev/head/components/outcome_destination_editor_directive.html @@ -20,9 +20,9 @@ Refresher exploration ID (optional): -
Mention the skill that this state requires so that a learner who is stuck in the state can quickly learn the required material and continue with the exploration. diff --git a/core/templates/dev/head/pages/exploration_editor/ExplorationEditor.js b/core/templates/dev/head/pages/exploration_editor/ExplorationEditor.js index d84d2b360be0..a3e47db79e3a 100644 --- a/core/templates/dev/head/pages/exploration_editor/ExplorationEditor.js +++ b/core/templates/dev/head/pages/exploration_editor/ExplorationEditor.js @@ -182,6 +182,9 @@ oppia.controller('ExplorationEditor', [ EditabilityService.markTranslatable(); } + StateEditorService.updateExplorationWhitelistedStatus( + featuresData.is_exploration_whitelisted); + GraphDataService.recompute(); if (!StateEditorService.getActiveStateName() || diff --git a/core/templates/dev/head/pages/state_editor/StateEditorService.js b/core/templates/dev/head/pages/state_editor/StateEditorService.js index 2ca3c59fd086..3df72df781f7 100644 --- a/core/templates/dev/head/pages/state_editor/StateEditorService.js +++ b/core/templates/dev/head/pages/state_editor/StateEditorService.js @@ -31,6 +31,7 @@ oppia.factory('StateEditorService', [ // interaction. var interaction = null; var misconceptions = []; + var explorationIsWhitelisted = false; return { getActiveStateName: function() { @@ -43,6 +44,12 @@ oppia.factory('StateEditorService', [ } activeStateName = newActiveStateName; }, + isExplorationWhitelisted: function() { + return explorationIsWhitelisted; + }, + updateExplorationWhitelistedStatus: function(value) { + explorationIsWhitelisted = value; + }, setMisconceptions: function(newMisconceptions) { misconceptions = newMisconceptions; }, diff --git a/core/templates/dev/head/pages/state_editor/StateResponsesDirective.js b/core/templates/dev/head/pages/state_editor/StateResponsesDirective.js index 1237fb2cc896..2f248adb9657 100644 --- a/core/templates/dev/head/pages/state_editor/StateResponsesDirective.js +++ b/core/templates/dev/head/pages/state_editor/StateResponsesDirective.js @@ -322,7 +322,6 @@ oppia.directive('stateResponses', [ $scope.$broadcast('saveOutcomeDestDetails'); EditorFirstTimeEventsService.registerFirstSaveRuleEvent(); - // Close the modal and save it afterwards. $uibModalInstance.close({ tmpRule: angular.copy($scope.tmpRule), diff --git a/core/templates/dev/head/services/ExplorationFeaturesService.js b/core/templates/dev/head/services/ExplorationFeaturesService.js index a3f3135c3f2b..bf92ce17ce78 100644 --- a/core/templates/dev/head/services/ExplorationFeaturesService.js +++ b/core/templates/dev/head/services/ExplorationFeaturesService.js @@ -29,7 +29,7 @@ oppia.factory('ExplorationFeaturesService', [function() { settings.isImprovementsTabEnabled = featuresData.is_improvements_tab_enabled; settings.isPlaythroughRecordingEnabled = - featuresData.is_playthrough_recording_enabled; + featuresData.is_exploration_whitelisted; if (explorationData.param_changes && explorationData.param_changes.length > 0) { this.enableParameters();