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

Fix #6210: Added an exploration whitelist #6255

Merged
merged 9 commits into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
made review change
  • Loading branch information
aks681 committed Feb 27, 2019
commit d1a5a93c37aa1f318d45a00e563227139099bf66
2 changes: 2 additions & 0 deletions assets/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ oppia.directive('outcomeDestinationEditor', [
var currentStateName = null;
$scope.canAddPrerequisiteSkill = (
constants.ENABLE_NEW_STRUCTURE_EDITORS &&
aks681 marked this conversation as resolved.
Show resolved Hide resolved
constants.ENABLE_PREREQUISITE_SKILLS &&
StateEditorService.isExplorationWhitelisted());

$scope.$on('saveOutcomeDestDetails', function() {
Expand Down
3 changes: 2 additions & 1 deletion core/templates/dev/head/components/OutcomeEditorDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ oppia.directive('outcomeEditor', [
$scope.isInQuestionMode = StateEditorService.isInQuestionMode;
$scope.canAddPrerequisiteSkill =
constants.ENABLE_NEW_STRUCTURE_EDITORS &&
StateEditorService.isExplorationWhitelisted();
constants.ENABLE_PREREQUISITE_SKILLS &&
StateEditorService.isExplorationWhitelisted();
$scope.feedbackEditorIsOpen = false;
$scope.destinationEditorIsOpen = false;
$scope.correctnessLabelEditorIsOpen = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<b>Refresher exploration ID (optional):</b>
<input type="text" name="refresherExplorationId" ng-model="outcome.refresherExplorationId" class="form-control protractor-test-add-refresher-exploration-id" tabindex="0" aria-invalid="false" ng-pattern="globalIdPattern">
</div>
<div style="margin-top: 12px;" ng-if="isSelfLoop() && canAddPrerequisiteSkill">
<div style="margin-top: 12px;" ng-if="canAddPrerequisiteSkill">
<b>Prerequisite skill ID (optional):&nbsp;</b>
<input type="text" name="missingPrerequisiteSkillId" ng-model="outcome.missingPrerequisiteSkillId" class="form-control" tabindex="0" aria-invalid="false" ng-model-options="{allowInvalid: true}" ng-pattern="explorationAndSkillIdPattern">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that a non-empty invalid string can still be saved? If so, that might be a problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it doesn't allow it to be saved. ng-model-options just makes sure the scope variable is never undefined, i.e even if it's invalid, the value will be stored in the scope variable, but the Save button will still be disabled and there is still a red outline around the text box (tested it locally). So, I don't think it will be an issue.

<p style="font-size: 0.8em;">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
(try again, with refresher exploration "<[outcome.refresherExplorationId]>")
</span>
</span>
<div style="margin-top: 1em;" ng-if="outcome.missingPrerequisiteSkillId && isSelfLoop(outcome) && canAddPrerequisiteSkill">
<div style="margin-top: 1em;" ng-if="outcome.missingPrerequisiteSkillId && canAddPrerequisiteSkill">
<strong> Attached prerequisite skill for the current state: </strong>
<[outcome.missingPrerequisiteSkillId]>
</div>
Expand Down