Repository: oppia/oppia

Issue:
30 characters seems too short for misconception name
**Describe the bug**
When creating a misconception, I find that 30 characters is not sufficient to describe it. I was trying to create a misconception about students sometimes combining the denominators of fractions rather than finding a common denominator, and had difficult finding a succinct, yet sufficiently descriptive, name which fit within that limit (see screenshot).

**To Reproduce**
Steps to reproduce the behavior:
1. Open skill/topics dashboard
2. Create new skill
3. Create new misconception
4. Type in a name longer than 30 characters

**Observed behavior**
An error is presented and no more than 30 characters can be added.

**Expected behavior**
Either allow more than 30 characters, or make it a warning that often 30 characters is sufficient for misconception names (though I suspect it should actually be longer than this). Alternatively, could we use number of words? I suspect 4-5 words should be sufficient for misconception names, regardless of how many characters that corresponds to (consider that some languages are more verbose than English and may be even more challenging to fit sufficiently descriptive names within 30 characters).

**Screenshots**
![misconception_title_does_not_fit](https://user-images.githubusercontent.com/12983742/54719248-a0781280-4b19-11e9-9f7f-e654c1041abd.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 tested on oppia test server rather than production since this feature is currently in pre-release testing.
30 characters seems too short for misconception name
**Describe the bug**
When creating a misconception, I find that 30 characters is not sufficient to describe it. I was trying to create a misconception about students sometimes combining the denominators of fractions rather than finding a common denominator, and had difficult finding a succinct, yet sufficiently descriptive, name which fit within that limit (see screenshot).

**To Reproduce**
Steps to reproduce the behavior:
1. Open skill/topics dashboard
2. Create new skill
3. Create new misconception
4. Type in a name longer than 30 characters

**Observed behavior**
An error is presented and no more than 30 characters can be added.

**Expected behavior**
Either allow more than 30 characters, or make it a warning that often 30 characters is sufficient for misconception names (though I suspect it should actually be longer than this). Alternatively, could we use number of words? I suspect 4-5 words should be sufficient for misconception names, regardless of how many characters that corresponds to (consider that some languages are more verbose than English and may be even more challenging to fit sufficiently descriptive names within 30 characters).

**Screenshots**
![misconception_title_does_not_fit](https://user-images.githubusercontent.com/12983742/54719248-a0781280-4b19-11e9-9f7f-e654c1041abd.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 tested on oppia test server rather than production since this feature is currently in pre-release testing.


Discussion:
I'll work on this.
@BenHenning Hey I can help with this. The alternate you suggested is also doable. So which one should i try to implement? Increasing the limit of 30 chars or by number of words? 
@vojtechjelinek Do you have any suggestions on this?
Thanks!
Let's do 60 characters for now. Thanks @Showtim3! 
I'll work on this.
@BenHenning Hey I can help with this. The alternate you suggested is also doable. So which one should i try to implement? Increasing the limit of 30 chars or by number of words? 
@vojtechjelinek Do you have any suggestions on this?
Thanks!
Let's do 60 characters for now. Thanks @Showtim3! 

Resolving patch:
diff --git a/core/domain/skill_domain.py b/core/domain/skill_domain.py
--- a/core/domain/skill_domain.py
+++ b/core/domain/skill_domain.py
@@ -212,6 +212,9 @@ def validate(self):
             raise utils.ValidationError(
                 'Expected misconception name to be a string, received %s' %
                 self.name)
+        utils.require_valid_name(
+            self.name, 'misconception_name', allow_empty=False)
+
         if not isinstance(self.notes, basestring):
             raise utils.ValidationError(
                 'Expected misconception notes to be a string, received %s' %


Test patch:
diff --git a/core/domain/skill_domain_test.py b/core/domain/skill_domain_test.py
--- a/core/domain/skill_domain_test.py
+++ b/core/domain/skill_domain_test.py
@@ -71,6 +71,18 @@ def test_valid_misconception_id(self):
         self._assert_validation_error(
             'Expected misconception ID to be an integer')
 
+    def test_valid_misconception_name(self):
+        misconception_name = 'This string is smaller than 50'
+        self.skill.update_misconception_name(0, misconception_name)
+        self.skill.validate()
+        misconception_name = ('This string is a larger string'
+                              'and it is greater than 50 chars.')
+        self.skill.update_misconception_name(0, misconception_name)
+        self._assert_validation_error(
+            'The length of misconception_name should '
+            'be between 1 and 50 characters'
+        )
+
     def test_description_validation(self):
         self.skill.description = 0
         self._assert_validation_error('Description should be a string')