Error installing/updating course after Adding/editing quizzes

Hi
There is a course I am working on and I had already pushed it to the staging server. It downloaded and installed well. I have added a number of quizzes to all the topics, I also changed the course title. On publishing the updated course to the server, when i try to install or update the course on the oppia mobile app, it crushes.
(This happened to me last time, but I managed to do a quick fix by creating a backup and then restoring it into a new course)
Link - https://staging.mesau.net/
Name of course - CHW - Continuity Of Essential Health Services During The Covid-19 Pandemic Unit Two: Priority Essential Health Services

Hi,
I just had a look at this… I downloaded the course file directly from the staging oppia mesau, then loaded onto our staging server for testing and checked against the core oppia app connecting to our staging server.

The course failed to install, well actually it crashed the app, then restarted the app, but when the app starts up again, the course got installed ok.

From the logcat I got this error just before the app crashed:

2021-02-11 11:21:49.627 12565-12765/org.digitalcampus.mobile.learning D/DownloadService: https://staging.oppia-mobile.org/api/v2/course/120/download/=install:70
2021-02-11 11:21:50.105 12565-12765/org.digitalcampus.mobile.learning E/AndroidRuntime: FATAL EXCEPTION: IntentService[CourseInstallerService]
    Process: org.digitalcampus.mobile.learning, PID: 12565
    android.database.sqlite.SQLiteConstraintException: constraint failed (code 19 SQLITE_CONSTRAINT)
        at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
        at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:879)
        at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790)
        at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:88)
        at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1599)
        at android.database.sqlite.SQLiteDatabase.insertOrThrow(SQLiteDatabase.java:1494)
        at org.digitalcampus.oppia.database.DbHelper.insertActivityIntoSearchTable(DbHelper.java:2011)
        at org.digitalcampus.oppia.utils.SearchUtils.indexAddCourse(SearchUtils.java:77)
        at org.digitalcampus.oppia.utils.SearchUtils.indexAddCourse(SearchUtils.java:91)
        at org.digitalcampus.oppia.service.courseinstall.CourseInstall.installDownloadedCourse(CourseInstall.java:163)
        at org.digitalcampus.oppia.service.courseinstall.CourseInstallerService.onHandleIntent(CourseInstallerService.java:134)
        at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:78)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.os.HandlerThread.run(HandlerThread.java:67)

I also had a look at the module.xml file, and there seem to be quite a few html entities in the quiz questions/responses, especially in the final self-assessment quiz, eg 5: \n1 \u2013 Not at all\n2 \u2013 Poor extent\n3 \u2013 Moderate extent\n4 \u2013 Good extent\n5 \u2013 Great extent - but don’t know if this is just a false lead…

@jjoseba Please could you have a look at this… I’ll put a task on Jira for it.

Hi @hakimks ,

@jjoseba had a look at this, and it seems the problem is because there are 4 activities with the same digest, and this causes an issue when uniquely identifying the activity as the course is loading. The error is thrown when it tries to add the activities for the search functionality, however it would certainly also cause problems for the activity recording too I would expect, if not on the app, then certainly the server side.

I guess it might be if exactly the same page (title and content) is repeated multiple times in the course. I’m not really sure whether you;d want exactly the same activity multiple times in the same course.

The quick-fix for this would be to put something like hidden html in the pages that are the same, to then force them to be different (eg adding a id or name attribute to a paragraph tag or something). But I’ll also put a task on Jira to figure out how we can fix this properly.

Let me know if that sorts things out or not.
Cheers,
Alex

1 Like

Thanks Alex and Jjoseba, adding id’s has worked.
I have actually gone through the module.xml file to be able to identify the activities.

Thankyou.

2 Likes