Skip to content

Validation on learner_managed may fail to save changed M/N values on imported exercise #3758

Description

@bjester

Observed behavior

Split out from #3757

I import and exercise from KA EN channel that has 5/7 goal, and change it to 3/5, import into Kolibri, but on the learner side I still see the Get 5 correct. Same thing for exercise imported from the CK12 channel, default was 5/5, I lowered to 3/5, but no change in Kolibri.

From Blaine: testing this, I found that it works correctly, but the change to the M/N values may fail to save if combined with an update for invalid data like to learner_managed

Expected behavior

learner_managed should default to false and avoid causing a failure

Errors and logs

{
"disallowed": [],
"allowed": [
...
],
"changes": [],
"errors": [
{
"key": "fcce9b50254248fb82ca7ec1c15ed40a",
"mods": {
"changed": true,
"extra_fields.options.modality": null,
"extra_fields.options.completion_criteria.threshold.n": 9,
"extra_fields.options.completion_criteria.learner_managed": null
},
"errors": {
"extra_fields": {
"options": {
"completion_criteria": {
"learner_managed": [
"This field may not be null."
]
}
}
}
},
"server_rev": 4520,
"table": "contentnode",
"type": 2,
"channel_id": "5fbe14ce253e4f22ab31019c6c4e4401",
"user_id": null,
"created_by_id": 2512
}
],
"successess": [],
"tasks": [],
"successes": []
}

Additional information

Steps to reproduce the issue

  1. Import a KA exercise into a channel
  2. Update the exercise's M/N values
  3. Publish the channel
  4. In a Kolibri instance, update the options.ini > CENTRAL_CONTENT_BASE_URL = https://hotfixes.studio.learningequality.org
  5. Import the channel into Kolibri
  6. Open the Coach planner, and add a new quiz
  7. Browse for the exercise
  8. Ensure the completion description appropriately captures the M/N criteria

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions