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

Alpha Content Parsing Error #3200

Closed
anandwana001 opened this issue May 19, 2021 · 3 comments
Closed

Alpha Content Parsing Error #3200

anandwana001 opened this issue May 19, 2021 · 3 comments
Labels
bug End user-perceivable behaviors which are not desirable. Impact: Low Low perceived user impact (e.g. edge cases). Issue: Needs Clarification Indicates that an issue needs more detail in order to be able to be acted upon. Work: Medium The means to find the solution is clear, but it isn't at good-first-issue level yet. Z-ibt Temporary label for Ben to keep track of issues he's triaged.

Comments

@anandwana001
Copy link
Contributor

anandwana001 commented May 19, 2021

Trying playing exploration with Alpha content logs the error with a blank screen.

Error

Tried opening placed values first chapter

2021-05-19 10:30:47.669 18038-18038/org.oppia.android E/StateFragment: Failed to retrieve ephemeral state
    org.json.JSONException: Value {"value":["ones place","ones","one place","one"]} at normalizedStrSet of type org.json.JSONObject cannot be converted to JSONArray
        at org.json.JSON.typeMismatch(JSON.java:101)
        at org.json.JSONObject.getJSONArray(JSONObject.java:591)
        at org.oppia.android.domain.util.StateRetriever.parseTranslatableSetOfNormalizedString(StateRetriever.kt:359)
        at org.oppia.android.domain.util.StateRetriever.createExactInputFromJson(StateRetriever.kt:250)
        at org.oppia.android.domain.util.StateRetriever.convertToRuleSpec(StateRetriever.kt:223)
        at org.oppia.android.domain.util.StateRetriever.createSingleAnswerGroupFromJson(StateRetriever.kt:127)
        at org.oppia.android.domain.util.StateRetriever.createAnswerGroupsFromJson(StateRetriever.kt:95)
        at org.oppia.android.domain.util.StateRetriever.createInteractionFromJson(StateRetriever.kt:58)
        at org.oppia.android.domain.util.StateRetriever.createStateFromJson(StateRetriever.kt:45)
        at org.oppia.android.domain.exploration.ExplorationRetriever.createStatesFromJsonObject(ExplorationRetriever.kt:56)
        at org.oppia.android.domain.exploration.ExplorationRetriever.loadExplorationFromAsset(ExplorationRetriever.kt:45)
        at org.oppia.android.domain.exploration.ExplorationRetriever.loadExploration(ExplorationRetriever.kt:32)
        at org.oppia.android.domain.exploration.ExplorationProgressController.retrieveCurrentStateWithinCacheAsync(ExplorationProgressController.kt:394)
        at org.oppia.android.domain.exploration.ExplorationProgressController.retrieveCurrentStateAsync(ExplorationProgressController.kt:380)
        at org.oppia.android.domain.exploration.ExplorationProgressController$currentStateDataProvider$1.invoke(ExplorationProgressController.kt:54)
        at org.oppia.android.domain.exploration.ExplorationProgressController$currentStateDataProvider$1.invoke(ExplorationProgressController.kt:34)
        at org.oppia.android.util.data.DataProviders$createInMemoryDataProviderAsync$1.retrieveData(DataProviders.kt:213)
        at org.oppia.android.util.data.DataProviders$NotifiableAsyncLiveData.retrieveFromDataProvider(DataProviders.kt:364)
        at org.oppia.android.util.data.DataProviders$NotifiableAsyncLiveData.handleDataProviderUpdate(DataProviders.kt:352)
        at org.oppia.android.util.data.DataProviders$NotifiableAsyncLiveData$onActive$job$1.invokeSuspend(DataProviders.kt:311)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)

Tried opening the first chapter of multiplication

2021-05-19 10:31:18.732 18038-18038/org.oppia.android E/ExplorationActivity: Failed to retrieve answer outcome
    org.json.JSONException: Value {"value":["4 *6","4 * 6","4* 6","4*6","6* 4","6 *4","6*4","6 * 4"]} at normalizedStrSet of type org.json.JSONObject cannot be converted to JSONArray
        at org.json.JSON.typeMismatch(JSON.java:101)
        at org.json.JSONObject.getJSONArray(JSONObject.java:591)
        at org.oppia.android.domain.util.StateRetriever.parseTranslatableSetOfNormalizedString(StateRetriever.kt:359)
        at org.oppia.android.domain.util.StateRetriever.createExactInputFromJson(StateRetriever.kt:250)
        at org.oppia.android.domain.util.StateRetriever.convertToRuleSpec(StateRetriever.kt:223)
        at org.oppia.android.domain.util.StateRetriever.createSingleAnswerGroupFromJson(StateRetriever.kt:127)
        at org.oppia.android.domain.util.StateRetriever.createAnswerGroupsFromJson(StateRetriever.kt:95)
        at org.oppia.android.domain.util.StateRetriever.createInteractionFromJson(StateRetriever.kt:58)
        at org.oppia.android.domain.util.StateRetriever.createStateFromJson(StateRetriever.kt:45)
        at org.oppia.android.domain.exploration.ExplorationRetriever.createStatesFromJsonObject(ExplorationRetriever.kt:56)
        at org.oppia.android.domain.exploration.ExplorationRetriever.loadExplorationFromAsset(ExplorationRetriever.kt:45)
        at org.oppia.android.domain.exploration.ExplorationRetriever.loadExploration(ExplorationRetriever.kt:32)
        at org.oppia.android.domain.exploration.ExplorationDataController.retrieveExplorationById(ExplorationDataController.kt:75)
        at org.oppia.android.domain.exploration.ExplorationDataController$getExplorationById$1.invokeSuspend(ExplorationDataController.kt:32)
        at org.oppia.android.domain.exploration.ExplorationDataController$getExplorationById$1.invoke(Unknown Source:10)
        at org.oppia.android.util.data.DataProviders$createInMemoryDataProviderAsync$1.retrieveData(DataProviders.kt:213)
        at org.oppia.android.util.data.DataProviders$NotifiableAsyncLiveData.retrieveFromDataProvider(DataProviders.kt:364)
        at org.oppia.android.util.data.DataProviders$NotifiableAsyncLiveData.handleDataProviderUpdate(DataProviders.kt:352)
        at org.oppia.android.util.data.DataProviders$NotifiableAsyncLiveData$onActive$job$1.invokeSuspend(DataProviders.kt:311)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)

Error - Ratio

2021-05-19 10:42:50.932 18038-18038/org.oppia.android E/StateFragment: Failed to retrieve ephemeral state
    org.json.JSONException: Value {"value":["2:5","\"2 to 5\"","2 to 5"]} at normalizedStrSet of type org.json.JSONObject cannot be converted to JSONArray
        at org.json.JSON.typeMismatch(JSON.java:101)
        at org.json.JSONObject.getJSONArray(JSONObject.java:591)
        at org.oppia.android.domain.util.StateRetriever.parseTranslatableSetOfNormalizedString(StateRetriever.kt:359)
        at org.oppia.android.domain.util.StateRetriever.createExactInputFromJson(StateRetriever.kt:250)
        at org.oppia.android.domain.util.StateRetriever.convertToRuleSpec(StateRetriever.kt:223)
        at org.oppia.android.domain.util.StateRetriever.createSingleAnswerGroupFromJson(StateRetriever.kt:127)
        at org.oppia.android.domain.util.StateRetriever.createAnswerGroupsFromJson(StateRetriever.kt:95)
        at org.oppia.android.domain.util.StateRetriever.createInteractionFromJson(StateRetriever.kt:58)
        at org.oppia.android.domain.util.StateRetriever.createStateFromJson(StateRetriever.kt:45)
        at org.oppia.android.domain.exploration.ExplorationRetriever.createStatesFromJsonObject(ExplorationRetriever.kt:56)
        at org.oppia.android.domain.exploration.ExplorationRetriever.loadExplorationFromAsset(ExplorationRetriever.kt:45)
        at org.oppia.android.domain.exploration.ExplorationRetriever.loadExploration(ExplorationRetriever.kt:32)
        at org.oppia.android.domain.exploration.ExplorationProgressController.retrieveCurrentStateWithinCacheAsync(ExplorationProgressController.kt:394)
        at org.oppia.android.domain.exploration.ExplorationProgressController.retrieveCurrentStateAsync(ExplorationProgressController.kt:380)
        at org.oppia.android.domain.exploration.ExplorationProgressController$currentStateDataProvider$1.invoke(ExplorationProgressController.kt:54)
        at org.oppia.android.domain.exploration.ExplorationProgressController$currentStateDataProvider$1.invoke(ExplorationProgressController.kt:34)
        at org.oppia.android.util.data.DataProviders$createInMemoryDataProviderAsync$1.retrieveData(DataProviders.kt:213)
        at org.oppia.android.util.data.DataProviders$NotifiableAsyncLiveData.retrieveFromDataProvider(DataProviders.kt:364)
        at org.oppia.android.util.data.DataProviders$NotifiableAsyncLiveData.handleDataProviderUpdate(DataProviders.kt:352)
        at org.oppia.android.util.data.DataProviders$NotifiableAsyncLiveData$onActive$job$1.invokeSuspend(DataProviders.kt:311)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)

Screenshot 2021-05-19 at 10 43 48

@anandwana001
Copy link
Contributor Author

@rt4914 Checked on the latest develop branch, getting these errors.

@anandwana001
Copy link
Contributor Author

Solution - src/main/java/org/oppia/android/domain/util/StateRetriever.kt

private fun parseTranslatableSetOfNormalizedString(
    translatableSetOfStringsJson: JSONObject
  ): TranslatableSetOfNormalizedString = TranslatableSetOfNormalizedString.newBuilder().apply {
    contentId = translatableSetOfStringsJson.getString("contentId")
++    val normalizedStrObj = translatableSetOfStringsJson.getJSONObject("normalizedStrSet")
++ val strSet = normalizedStrObj.getJSONArray("value")
    for (i in 0 until strSet.length()) {
      addNormalizedStrings(strSet.getString(i))
    }
  }.build()

@seanlip seanlip added bug End user-perceivable behaviors which are not desirable. and removed issue_type_bug labels Mar 29, 2023
@MohitGupta121 MohitGupta121 added the Work: Medium The means to find the solution is clear, but it isn't at good-first-issue level yet. label Jun 8, 2023
@seanlip
Copy link
Member

seanlip commented Jun 8, 2023

Confirmed with @BenHenning that this is obsolete; we don't use the JSON loading pipeline anymore.

@seanlip seanlip closed this as not planned Won't fix, can't repro, duplicate, stale Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug End user-perceivable behaviors which are not desirable. Impact: Low Low perceived user impact (e.g. edge cases). Issue: Needs Clarification Indicates that an issue needs more detail in order to be able to be acted upon. Work: Medium The means to find the solution is clear, but it isn't at good-first-issue level yet. Z-ibt Temporary label for Ben to keep track of issues he's triaged.
Development

Successfully merging a pull request may close this issue.

5 participants