Skip to content

Commit

Permalink
Fix part of #6482: button is disable until all requirements are fulfi…
Browse files Browse the repository at this point in the history
…lled - fixed \o/ (#7908)

* issue #6482 fixed - Skill editor, Questions, button Save and Publish Question is disable untill all requirements are fulfilled

* 2 errors that appeared on push fixerd

* max lenght error fixed

* space error fixed

* function name corrected and tooltip added
  • Loading branch information
discombobulateme authored and kevinlee12 committed Nov 7, 2019
1 parent f764f0c commit 950381d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ <h3>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" ng-click="cancel()"> Cancel </button>
<button class="btn btn-success protractor-test-save-question-button" ng-click="done()"> Save and Publish Question </button>
<button title="To Save please add: interaction, hint and solution" class="btn btn-success protractor-test-save-question-button" ng-click="done()" ng-disabled="isSaveButtonDisabled()"> Save and Publish Question </button>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ angular.module('oppia').directive('questionsList', [
ctrl.saveAndPublishQuestion = function() {
var validationErrors = ctrl.question.validate(
ctrl.misconceptionsBySkill);

if (validationErrors) {
AlertsService.addWarning(validationErrors);
return;
Expand Down Expand Up @@ -602,6 +603,12 @@ angular.module('oppia').directive('questionsList', [
}
$uibModalInstance.close();
};
// Checking if Question contains all requirement to enable
// Save and Publish Question
$scope.isSaveButtonDisabled = function() {
return $scope.question.validate(
$scope.misconceptionsBySkill);
};

$scope.cancel = function() {
if (QuestionUndoRedoService.hasChanges()) {
Expand Down

0 comments on commit 950381d

Please sign in to comment.