Repository: oppia/oppia

Issue:
'Root Linear Coefficient Theorem' Default Exploration 'PageNotFoundException'
<!--
  - Thanks for taking the time to report a bug in the Oppia project.
  - Before filing a new issue, please do a quick search to check that it hasn't
  - already been filed on the [issue tracker](https://github.com/oppia/oppia/issues)._
  -->

**Describe the bug**
One of the urls that is used by the 'Root Linear Coefficient Theorem' exploration is not valid. Namely:
"http://localhost:8181/assetsdevhandler/exploration/3/assets/image/" 

**To Reproduce**
Steps to reproduce the behavior:
 1. Go to the admin page after logging in as admin.
 2. Click on 'Reload All Explorations' under 'Activities' at the bottom of the **Reload a single exploration** box.
 3. Go back to the 'Learner Dashboard'
 4. Click on the 'Root Linear Coefficient Theorem' Exploration.
 5. See error.

**Observed behavior**
When we load into the exploration, the exploration crashes.

**Expected behavior**
It shouldn't crash but instead load the correct asset image:
 http://localhost:8181/assetsdevhandler/exploration/3/assets/image/
**Screenshots**
<img width="1087" alt="Screen Shot 2020-09-03 at 12 31 12 PM" src="https://user-images.githubusercontent.com/7833572/92159311-0d509c80-ede2-11ea-85d7-7a518187a5a1.png">

**Desktop (please complete the following information; delete this section if the issue does not arise on desktop):**
 - Browser Safari 
 - Version 13.1.1




Discussion:
@seanlip This error has been puzzling me since yesterday and I thought it was a problem with NDB since it kept on manifesting on my branch but then I checked out develop and it is still happening. I'm not sure who to assign for this problem.
Hi @donosco98 -- could you please look into this? I think this is due to the math svg migration -- not sure whether you took the demo explorations into account. Could you please coordinate with @DubeySandeep to find an appropriate fix?

Thanks @kevjumba for reporting!
Yeah, I can confirm this is error caused because the Math images for demo explorations don't exist.
The fix for this would be manually adding the required images in the particular exploration's assets/image folder(similar to how we handle normal images in demo exploration). 
Thanks

Resolving patch:
diff --git a/feconf.py b/feconf.py
--- a/feconf.py
+++ b/feconf.py
@@ -629,10 +629,10 @@ def get_empty_ratings():
 # either a YAML file or a directory (depending on whether it ends in .yaml).
 # These explorations can be found under data/explorations.
 DEMO_EXPLORATIONS = {
-    u'0': 'welcome.yaml',
+    u'0': 'welcome',
     u'1': 'multiples.yaml',
     u'2': 'binary_search',
-    u'3': 'root_linear_coefficient_theorem.yaml',
+    u'3': 'root_linear_coefficient_theorem',
     u'4': 'three_balls',
     # TODO(bhenning): Replace demo exploration '5' with a new exploration
     # described in #1376.


Test patch:
diff --git a/data/explorations/test_interactions/Test of expressions and interactions.yaml b/data/explorations/test_interactions/Test of expressions and interactions.yaml
--- a/data/explorations/test_interactions/Test of expressions and interactions.yaml	
+++ b/data/explorations/test_interactions/Test of expressions and interactions.yaml	
@@ -14,17 +14,13 @@ param_specs:
     obj_type: UnicodeString
   c:
     obj_type: UnicodeString
-schema_version: 30
+schema_version: 43
 states:
   Code REPL:
     classifier_model_id: null
     content:
       content_id: content
       html: <p>Write a program the prints 12.<br></p>
-    content_ids_to_audio_translations:
-      content: {}
-      default_outcome: {}
-      feedback_1: {}
     interaction:
       answer_groups:
       - outcome:
@@ -40,7 +36,7 @@ states:
         - inputs:
             x: '12'
           rule_type: OutputEquals
-        tagged_misconception_id: null
+        tagged_skill_misconception_id: null
         training_data: []
       confirmed_unclassified_answers: []
       customization_args:
@@ -64,7 +60,19 @@ states:
       hints: []
       id: CodeRepl
       solution: null
+    next_content_id_index: 2
     param_changes: []
+    recorded_voiceovers:
+      voiceovers_mapping:
+        content: {}
+        default_outcome: {}
+        feedback_1: {}
+    solicit_answer_details: false
+    written_translations:
+      translations_mapping:
+        content: {}
+        default_outcome: {}
+        feedback_1: {}
   Continue:
     classifier_model_id: null
     content:
@@ -80,15 +88,14 @@ states:
         \ 4}} should be true.</p><p>{{4 &gt;= 3}} should be true.</p><p>&lt; should\
         \ be an unescaped 'less-than' sign.</p><p>&gt; should be an unescaped 'greater-than'\
         \ sign.</p>"
-    content_ids_to_audio_translations:
-      content: {}
-      default_outcome: {}
     interaction:
       answer_groups: []
       confirmed_unclassified_answers: []
       customization_args:
         buttonText:
-          value: Continue
+          value:
+            content_id: ca_buttonText_0
+            unicode_str: Continue
       default_outcome:
         dest: Multiple choice input
         feedback:
@@ -101,6 +108,7 @@ states:
       hints: []
       id: Continue
       solution: null
+    next_content_id_index: 1
     param_changes:
     - customization_args:
         parse_with_jinja: false
@@ -122,13 +130,22 @@ states:
         value: '{{b/c}}'
       generator_id: Copier
       name: b
+    recorded_voiceovers:
+      voiceovers_mapping:
+        ca_buttonText_0: {}
+        content: {}
+        default_outcome: {}
+    solicit_answer_details: false
+    written_translations:
+      translations_mapping:
+        ca_buttonText_0: {}
+        content: {}
+        default_outcome: {}
   END:
     classifier_model_id: null
     content:
       content_id: content
       html: <p>Congratulations, you have finished!</p>
-    content_ids_to_audio_translations:
-      content: {}
     interaction:
       answer_groups: []
       confirmed_unclassified_answers: []
@@ -139,7 +156,15 @@ states:
       hints: []
       id: EndExploration
       solution: null
+    next_content_id_index: 0
     param_changes: []
+    recorded_voiceovers:
+      voiceovers_mapping:
+        content: {}
+    solicit_answer_details: false
+    written_translations:
+      translations_mapping:
+        content: {}
   Multiple choice input:
     classifier_model_id: null
     content:
@@ -147,10 +172,6 @@ states:
       html: "<p>Choose option B.<br></p><p>\_</p><p><strong>Parameters</strong></p><p>{{a}}\
         \ should be 1.</p><p>{{b}} should be 3.<br></p><p>{{c}} should be 2.</p><p>{{a*b}}\
         \ should be 3.</p>"
-    content_ids_to_audio_translations:
-      content: {}
-      default_outcome: {}
-      feedback_1: {}
     interaction:
       answer_groups:
       - outcome:
@@ -166,17 +187,25 @@ states:
         - inputs:
             x: 1
           rule_type: Equals
-        tagged_misconception_id: null
+        tagged_skill_misconception_id: null
         training_data: []
       confirmed_unclassified_answers: []
       customization_args:
         choices:
           value:
-          - "<oppia-noninteractive-image caption-with-value=\"&amp;quot;&amp;quot;\"\
-            \ filepath-with-value=\"&amp;quot;A_height_24_width_24.png&amp;quot;\"\
-            \ alt-with-value=\"&amp;quot;&amp;quot;\"></oppia-noninteractive-image><p>\_</p>"
-          - <p>Option B<br></p>
-          - <p><oppia-noninteractive-math raw_latex-with-value="&amp;quot;\\frac{x}{y}&amp;quot;"></oppia-noninteractive-math><br></p>
+          - content_id: ca_choices_2
+            html: "<oppia-noninteractive-image alt-with-value=\"&amp;quot;&amp;quot;\"\
+              \ caption-with-value=\"&amp;quot;&amp;quot;\" filepath-with-value=\"\
+              &amp;quot;A_height_24_width_24.png&amp;quot;\"></oppia-noninteractive-image><p>\_\
+              </p>"
+          - content_id: ca_choices_3
+            html: <p>Option B<br></p>
+          - content_id: ca_choices_4
+            html: '<p><oppia-noninteractive-math math_content-with-value="{&amp;quot;raw_latex&amp;quot;:
+              &amp;quot;\\frac{x}{y}&amp;quot;, &amp;quot;svg_filename&amp;quot;:
+              &amp;quot;mathImg_20200904_152727_0lz7a7ui3f_height_3d205_width_1d784_vertical_1d306.svg&amp;quot;}"></oppia-noninteractive-math><br></p>'
+        showChoicesInShuffledOrder:
+          value: false
       default_outcome:
         dest: Multiple choice input
         feedback:
@@ -189,21 +218,35 @@ states:
       hints: []
       id: MultipleChoiceInput
       solution: null
+    next_content_id_index: 5
     param_changes:
     - customization_args:
         parse_with_jinja: true
         value: '{{a+c}}'
       generator_id: Copier
       name: b
+    recorded_voiceovers:
+      voiceovers_mapping:
+        ca_choices_2: {}
+        ca_choices_3: {}
+        ca_choices_4: {}
+        content: {}
+        default_outcome: {}
+        feedback_1: {}
+    solicit_answer_details: false
+    written_translations:
+      translations_mapping:
+        ca_choices_2: {}
+        ca_choices_3: {}
+        ca_choices_4: {}
+        content: {}
+        default_outcome: {}
+        feedback_1: {}
   Music notes input:
     classifier_model_id: null
     content:
       content_id: content
       html: <p>Enter two E4 notes (bottom line).<br></p>
-    content_ids_to_audio_translations:
-      content: {}
-      default_outcome: {}
-      feedback_1: {}
     interaction:
       answer_groups:
       - outcome:
@@ -227,7 +270,7 @@ states:
                 num: 1
               readableNoteName: E4
           rule_type: Equals
-        tagged_misconception_id: null
+        tagged_skill_misconception_id: null
         training_data: []
       confirmed_unclassified_answers: []
       customization_args:
@@ -255,7 +298,19 @@ states:
       hints: []
       id: MusicNotesInput
       solution: null
+    next_content_id_index: 2
     param_changes: []
+    recorded_voiceovers:
+      voiceovers_mapping:
+        content: {}
+        default_outcome: {}
+        feedback_1: {}
+    solicit_answer_details: false
+    written_translations:
+      translations_mapping:
+        content: {}
+        default_outcome: {}
+        feedback_1: {}
   Network Graph:
     classifier_model_id: null
     content:
@@ -263,10 +318,6 @@ states:
       html: <p>Do the following step by step:<br><br>1. Delete Node labelled B</p><p>2.
         Add Node labelled Z</p><p>3. Add Edge of weight 150 connecting A to Z</p><p>4.
         Delete Edge between A and F</p>
-    content_ids_to_audio_translations:
-      content: {}
-      default_outcome: {}
-      feedback_1: {}
     interaction:
       answer_groups:
       - outcome:
@@ -299,7 +350,7 @@ states:
                 x: 155.0
                 y: 125.0
           rule_type: IsIsomorphicTo
-        tagged_misconception_id: null
+        tagged_skill_misconception_id: null
         training_data: []
       confirmed_unclassified_answers: []
       customization_args:
@@ -348,16 +399,24 @@ states:
       hints: []
       id: GraphInput
       solution: null
+    next_content_id_index: 2
     param_changes: []
+    recorded_voiceovers:
+      voiceovers_mapping:
+        content: {}
+        default_outcome: {}
+        feedback_1: {}
+    solicit_answer_details: false
+    written_translations:
+      translations_mapping:
+        content: {}
+        default_outcome: {}
+        feedback_1: {}
   Numeric input:
     classifier_model_id: null
     content:
       content_id: content
       html: <p>Enter a number larger than 6.<br></p>
-    content_ids_to_audio_translations:
-      content: {}
-      default_outcome: {}
-      feedback_1: {}
     interaction:
       answer_groups:
       - outcome:
@@ -373,7 +432,7 @@ states:
         - inputs:
             x: 6.0
           rule_type: IsGreaterThan
-        tagged_misconception_id: null
+        tagged_skill_misconception_id: null
         training_data: []
       confirmed_unclassified_answers: []
       customization_args: {}
@@ -389,16 +448,24 @@ states:
       hints: []
       id: NumericInput
       solution: null
+    next_content_id_index: 2
     param_changes: []
+    recorded_voiceovers:
+      voiceovers_mapping:
+        content: {}
+        default_outcome: {}
+        feedback_1: {}
+    solicit_answer_details: false
+    written_translations:
+      translations_mapping:
+        content: {}
+        default_outcome: {}
+        feedback_1: {}
   Set input:
     classifier_model_id: null
     content:
       content_id: content
       html: <p>Enter the set {abc, xyz}<br></p>
-    content_ids_to_audio_translations:
-      content: {}
-      default_outcome: {}
-      feedback_1: {}
     interaction:
       answer_groups:
       - outcome:
@@ -416,10 +483,14 @@ states:
             - abc
             - xyz
           rule_type: Equals
-        tagged_misconception_id: null
+        tagged_skill_misconception_id: null
         training_data: []
       confirmed_unclassified_answers: []
-      customization_args: {}
+      customization_args:
+        buttonText:
+          value:
+            content_id: ca_buttonText_2
+            unicode_str: Add item
       default_outcome:
         dest: Set input
         feedback:
@@ -432,16 +503,26 @@ states:
       hints: []
       id: SetInput
       solution: null
+    next_content_id_index: 3
     param_changes: []
+    recorded_voiceovers:
+      voiceovers_mapping:
+        ca_buttonText_2: {}
+        content: {}
+        default_outcome: {}
+        feedback_1: {}
+    solicit_answer_details: false
+    written_translations:
+      translations_mapping:
+        ca_buttonText_2: {}
+        content: {}
+        default_outcome: {}
+        feedback_1: {}
   Text Area Input:
     classifier_model_id: null
     content:
       content_id: content
       html: <p>Please type hello.</p>
-    content_ids_to_audio_translations:
-      content: {}
-      default_outcome: {}
-      feedback_1: {}
     interaction:
       answer_groups:
       - outcome:
@@ -457,12 +538,14 @@ states:
         - inputs:
             x: hello
           rule_type: Equals
-        tagged_misconception_id: null
+        tagged_skill_misconception_id: null
         training_data: []
       confirmed_unclassified_answers: []
       customization_args:
         placeholder:
-          value: Type your answer here.
+          value:
+            content_id: ca_placeholder_2
+            unicode_str: Type your answer here.
         rows:
           value: 10
       default_outcome:
@@ -477,16 +560,26 @@ states:
       hints: []
       id: TextInput
       solution: null
+    next_content_id_index: 3
     param_changes: []
+    recorded_voiceovers:
+      voiceovers_mapping:
+        ca_placeholder_2: {}
+        content: {}
+        default_outcome: {}
+        feedback_1: {}
+    solicit_answer_details: false
+    written_translations:
+      translations_mapping:
+        ca_placeholder_2: {}
+        content: {}
+        default_outcome: {}
+        feedback_1: {}
   Text input:
     classifier_model_id: null
     content:
       content_id: content
       html: <p>Enter the string rrrrr<br></p>
-    content_ids_to_audio_translations:
-      content: {}
-      default_outcome: {}
-      feedback_1: {}
     interaction:
       answer_groups:
       - outcome:
@@ -502,12 +595,14 @@ states:
         - inputs:
             x: rrrrr
           rule_type: Equals
-        tagged_misconception_id: null
+        tagged_skill_misconception_id: null
         training_data: []
       confirmed_unclassified_answers: []
       customization_args:
         placeholder:
-          value: Type your answer here.
+          value:
+            content_id: ca_placeholder_2
+            unicode_str: Type your answer here.
         rows:
           value: 1
       default_outcome:
@@ -522,16 +617,26 @@ states:
       hints: []
       id: TextInput
       solution: null
+    next_content_id_index: 3
     param_changes: []
+    recorded_voiceovers:
+      voiceovers_mapping:
+        ca_placeholder_2: {}
+        content: {}
+        default_outcome: {}
+        feedback_1: {}
+    solicit_answer_details: false
+    written_translations:
+      translations_mapping:
+        ca_placeholder_2: {}
+        content: {}
+        default_outcome: {}
+        feedback_1: {}
   World map:
     classifier_model_id: null
     content:
       content_id: content
       html: <p>Click on the USA.<br></p>
-    content_ids_to_audio_translations:
-      content: {}
-      default_outcome: {}
-      feedback_1: {}
     interaction:
       answer_groups:
       - outcome:
@@ -550,7 +655,7 @@ states:
             - 40.0
             - -105.0
           rule_type: Within
-        tagged_misconception_id: null
+        tagged_skill_misconception_id: null
         training_data: []
       confirmed_unclassified_answers: []
       customization_args:
@@ -572,7 +677,19 @@ states:
       hints: []
       id: InteractiveMap
       solution: null
+    next_content_id_index: 2
     param_changes: []
-states_schema_version: 25
+    recorded_voiceovers:
+      voiceovers_mapping:
+        content: {}
+        default_outcome: {}
+        feedback_1: {}
+    solicit_answer_details: false
+    written_translations:
+      translations_mapping:
+        content: {}
+        default_outcome: {}
+        feedback_1: {}
+states_schema_version: 38
 tags: []
 title: Test of expressions and interactions
diff --git a/data/explorations/test_interactions/assets/image/mathImg_20200904_152727_0lz7a7ui3f_height_3d205_width_1d784_vertical_1d306.svg b/data/explorations/test_interactions/assets/image/mathImg_20200904_152727_0lz7a7ui3f_height_3d205_width_1d784_vertical_1d306.svg
new file mode 100644
--- /dev/null
+++ b/data/explorations/test_interactions/assets/image/mathImg_20200904_152727_0lz7a7ui3f_height_3d205_width_1d784_vertical_1d306.svg
@@ -0,0 +1,2 @@
+<svg width="1.784ex" height="3.205ex" viewBox="0 -817.3 768 1379.7" focusable="false" style="vertical-align: -1.306ex;" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"><g transform="translate(120,0)"><rect stroke="none" width="528" height="60" x="0" y="220"/><g transform="translate(59,420)"><path stroke-width="10" transform="scale(0.707)" d="M52 289Q59 331 106 386T222 442Q257 442 286 424T329 379Q371 442 430 442Q467 442 494 420T522 361Q522 332 508 314T481 292T458 288Q439 288 427 299T415 328Q415 374 465 391Q454 404 425 404Q412 404 406 402Q368 386 350 336Q290 115 290 78Q290 50 306 38T341 26Q378 26 414 59T463 140Q466 150 469 151T485 153H489Q504 153 504 145Q504 144 502 134Q486 77 440 33T333 -11Q263 -11 227 52Q186 -10 133 -10H127Q78 -10 57 16T35 71Q35 103 54 123T99 143Q142 143 142 101Q142 81 130 66T107 46T94 41L91 40Q91 39 97 36T113 29T132 26Q168 26 194 71Q203 87 217 139T245 247T261 313Q266 340 266 352Q266 380 251 392T217 404Q177 404 142 372T93 290Q91 281 88 280T72 278H58Q52 284 52 289Z"/></g><g transform="translate(86,-345)"><path stroke-width="10" transform="scale(0.707)" d="M21 287Q21 301 36 335T84 406T158 442Q199 442 224 419T250 355Q248 336 247 334Q247 331 231 288T198 191T182 105Q182 62 196 45T238 27Q261 27 281 38T312 61T339 94Q339 95 344 114T358 173T377 247Q415 397 419 404Q432 431 462 431Q475 431 483 424T494 412T496 403Q496 390 447 193T391 -23Q363 -106 294 -155T156 -205Q111 -205 77 -183T43 -117Q43 -95 50 -80T69 -58T89 -48T106 -45Q150 -45 150 -87Q150 -107 138 -122T115 -142T102 -147L99 -148Q101 -153 118 -160T152 -167H160Q177 -167 186 -165Q219 -156 247 -127T290 -65T313 -9T321 21L315 17Q309 13 296 6T270 -6Q250 -11 231 -11Q185 -11 150 11T104 82Q103 89 103 113Q103 170 138 262T173 379Q173 380 173 381Q173 390 173 393T169 400T158 404H154Q131 404 112 385T82 344T65 302T57 280Q55 278 41 278H27Q21 284 21 287Z"/></g></g></g></svg>
+