Repository: oppia/oppia

Issue:
Question editor does not indicate how many changes are about to be published, or the what the changes are
**Describe the bug**
When working on a skill, I noticed that changes to the skill are not reflected in the 'publish changes' button and clicking it does not yield any details as to what changed. This is at odds with the exploration editor, and feels largely missing.

**To Reproduce**
Steps to reproduce the behavior:
1. Create and publish a skill
2. Make a change to the skill without publishing

**Observed behavior**
The publish changes button lights up, but does not indicate how many changes were made or what they are when the button is clicked.

**Expected behavior**
Details need to be provided as to what the temporary saved state is to ensure that users are reminded what they are changing when they save their changes. This is especially important when working on a skill long enough to forget the earliest changes.

**Desktop (please complete the following information; delete this section if the issue does not arise on desktop):**
Chrome OS 72

**Additional context**
This was tested on Oppia test server as part of the pre-release testing of the skills and topics editors.
The rule headers for skill questions are non-intuitive
**Describe the bug**
When modifying a question for a skill, I find it non-intuitive that 'right answer' leads to 'Continue' but 'wrong answer' leads to 'Try Again'. This makes sense in the context of exploration states, but for questions could we more prominently call out which rules correspond to 'correct' and 'wrong'? We could indicate that wrong answers also are tried again for clarity.

Also: I noticed there are icons, but I'm not sure how clear these are with the additional branching text. Could we maybe specifically include the language 'Correct' and 'Wrong' next to those icons?

**To Reproduce**
Steps to reproduce the behavior:
1. Open question editor for a skill
2. Add a correct and wrong answer

**Observed behavior**
Observe the arrow and results for the wrong/right answers. These are confusing.

**Expected behavior**
The headers should clearly indicate what's right and wrong, and maybe indicate wrong answers are tried again. There are no states in questions, so we can format these in a more digestible way.

**Screenshots**
![confusing_rule_titles_in_question_answers](https://user-images.githubusercontent.com/12983742/54720571-f69a8500-4b1c-11e9-8d4f-c6d003d5df24.png)

**Desktop (please complete the following information; delete this section if the issue does not arise on desktop):**
 - OS: Chrome OS
 - Browser: Chrome
 - Version: 72

**Additional context**
This was found on Oppia's test server since the skills/topics editors are in pre-release testing and not yet available to the public.



Discussion:
I think this was missed, will add the number to 'Publish Changes' button as well.
Yeah, this can be changed.

Resolving patch:
diff --git a/feconf.py b/feconf.py
--- a/feconf.py
+++ b/feconf.py
@@ -669,7 +669,7 @@ def get_empty_ratings():
 LIBRARY_SEARCH_URL = '/search/find'
 LIBRARY_SEARCH_DATA_URL = '/searchhandler/data'
 LIBRARY_TOP_RATED_URL = '/library/top_rated'
-MERGE_SKILL_URL = '/merge_skill'
+MERGE_SKILLS_URL = '/merge_skills_handler'
 NEW_COLLECTION_URL = '/collection_editor_handler/create_new'
 NEW_EXPLORATION_URL = '/contributehandler/create_new'
 NEW_QUESTION_URL = '/question_editor_handler/create_new'
diff --git a/main.py b/main.py
--- a/main.py
+++ b/main.py
@@ -273,7 +273,7 @@ def ui_access_wrapper(self, *args, **kwargs):
         r'%s' % feconf.TOPICS_AND_SKILLS_DASHBOARD_URL,
         topics_and_skills_dashboard.TopicsAndSkillsDashboardPage),
     get_redirect_route(
-        r'%s' % feconf.MERGE_SKILL_URL,
+        r'%s' % feconf.MERGE_SKILLS_URL,
         topics_and_skills_dashboard.MergeSkillHandler),
     get_redirect_route(
         r'%s' % feconf.TOPICS_AND_SKILLS_DASHBOARD_DATA_URL,


Test patch:
diff --git a/core/controllers/topics_and_skills_dashboard_test.py b/core/controllers/topics_and_skills_dashboard_test.py
--- a/core/controllers/topics_and_skills_dashboard_test.py
+++ b/core/controllers/topics_and_skills_dashboard_test.py
@@ -253,7 +253,7 @@ class MergeSkillHandlerTests(BaseTopicsAndSkillsDashboardTests):
 
     def setUp(self):
         super(MergeSkillHandlerTests, self).setUp()
-        self.url = feconf.MERGE_SKILL_URL
+        self.url = feconf.MERGE_SKILLS_URL
 
         self.question_id = question_services.get_new_question_id()
         self.question = self.save_new_question(
diff --git a/core/tests/protractor_desktop/topicsAndSkillsDashboard.js b/core/tests/protractor_desktop/topicsAndSkillsDashboard.js
--- a/core/tests/protractor_desktop/topicsAndSkillsDashboard.js
+++ b/core/tests/protractor_desktop/topicsAndSkillsDashboard.js
@@ -23,8 +23,10 @@ var waitFor = require('../protractor_utils/waitFor.js');
 var workflow = require('../protractor_utils/workflow.js');
 
 var AdminPage = require('../protractor_utils/AdminPage.js');
-var TopicsAndSkillsDashboardPage =
-  require('../protractor_utils/TopicsAndSkillsDashboardPage.js');
+var ExplorationEditorPage = require(
+  '../protractor_utils/ExplorationEditorPage.js');
+var TopicsAndSkillsDashboardPage = require(
+  '../protractor_utils/TopicsAndSkillsDashboardPage.js');
 var SkillEditorPage = require('../protractor_utils/SkillEditorPage.js');
 var TopicEditorPage = require('../protractor_utils/TopicEditorPage.js');
 
@@ -32,6 +34,8 @@ describe('Topics and skills dashboard functionality', function() {
   var topicsAndSkillsDashboardPage = null;
   var skillEditorPage = null;
   var topicEditorPage = null;
+  var explorationEditorPage = null;
+  var explorationEditorMainTab = null;
 
   beforeAll(function() {
     topicsAndSkillsDashboardPage =
@@ -40,6 +44,8 @@ describe('Topics and skills dashboard functionality', function() {
       new SkillEditorPage.SkillEditorPage();
     topicEditorPage =
       new TopicEditorPage.TopicEditorPage();
+    explorationEditorPage = new ExplorationEditorPage.ExplorationEditorPage();
+    explorationEditorMainTab = explorationEditorPage.getMainTab();
     users.createAdmin('creator@topicsAndSkillsDashboard.com',
       'creatorTopicsAndSkillsDashboard');
   });
@@ -87,6 +93,34 @@ describe('Topics and skills dashboard functionality', function() {
     topicEditorPage.expectNumberOfUncategorizedSkillsToBe(1);
   });
 
+  it('should merge an outside skill with one in a topic', function() {
+    topicsAndSkillsDashboardPage.createSkillWithDescription(
+      'Skill to be merged');
+    skillEditorPage.editConceptCard('Concept card explanation');
+    skillEditorPage.saveOrPublishSkill('Added review material.');
+    skillEditorPage.moveToQuestionsTab();
+    skillEditorPage.clickCreateQuestionButton();
+    explorationEditorMainTab.setContent(forms.toRichText('Question 1'));
+    explorationEditorMainTab.setInteraction('TextInput', 'Placeholder', 5);
+    explorationEditorMainTab.addResponse(
+      'TextInput', forms.toRichText('Correct Answer'), null, false,
+      'FuzzyEquals', 'correct');
+    explorationEditorMainTab.getResponseEditor(0).markAsCorrect();
+    explorationEditorMainTab.addHint('Hint 1');
+    explorationEditorMainTab.addSolution('TextInput', {
+      correctAnswer: 'correct',
+      explanation: 'It is correct'
+    });
+    skillEditorPage.saveQuestion();
+    skillEditorPage.firstTimePublishSkill();
+    topicsAndSkillsDashboardPage.get();
+    topicsAndSkillsDashboardPage.navigateToUnusedSkillsTab();
+    topicsAndSkillsDashboardPage.mergeSkillWithIndexToSkillWithIndex(0, 0);
+    topicsAndSkillsDashboardPage.navigateToTopicWithIndex(0);
+    topicEditorPage.moveToQuestionsTab();
+    topicEditorPage.expectNumberOfQuestionsToBe(1);
+  });
+
   it('should remove a skill from list once deleted', function() {
     topicsAndSkillsDashboardPage.navigateToUnpublishedSkillsTab();
     topicsAndSkillsDashboardPage.expectNumberOfSkillsToBe(1);
diff --git a/core/tests/protractor_utils/TopicsAndSkillsDashboardPage.js b/core/tests/protractor_utils/TopicsAndSkillsDashboardPage.js
--- a/core/tests/protractor_utils/TopicsAndSkillsDashboardPage.js
+++ b/core/tests/protractor_utils/TopicsAndSkillsDashboardPage.js
@@ -63,12 +63,26 @@ var TopicsAndSkillsDashboardPage = function() {
     by.css('.protractor-test-assign-skill-to-topic-button'));
   var confirmMoveButton = element(
     by.css('.protractor-test-confirm-move-button'));
+  var mergeSkillsButtons = element.all(
+    by.css('.protractor-test-merge-skills-button'));
+  var confirmSkillsMergeButton = element(
+    by.css('.protractor-test-confirm-skills-merge-button'));
 
   this.get = function() {
     browser.get(DASHBOARD_URL);
     waitFor.pageToFullyLoad();
   };
 
+  this.mergeSkillWithIndexToSkillWithIndex = function(oldSkillIndex, newSkillIndex) {
+    mergeSkillsButtons.then(function(elems) {
+      elems[oldSkillIndex].click();
+      skillsListItems.then(function(skills) {
+        skills[newSkillIndex].click();
+        confirmSkillsMergeButton.click();
+      });
+    });
+  };
+
   this.navigateToTopicWithIndex = function(index) {
     topicsListItems.then(function(elems) {
       elems[index].click();