Skip to content

Backport Course ID fix for Ficus

Latest
Compare
Choose a tag to compare

Overview

If you have a long course ID e..g len(course.id) > 40, ORA2 will be confused and report inconsistent information which makes manual grading impossible. UW have had this issue.

More Info

What this Tag Does?

This tag is for Ficus edx-ora==1.1.13 and cherry picks edX fix from Ginkgo (openedx#1008).

For this solution to work the following needs to be done:

  • Use the the following in extra requirements: git+https://github.com/appsembler/[email protected]#egg=ora2==1.1.13-appsembler-course-id-fix
  • Install requirements and do migrations.
  • Update the truncated IDs manually in the database (some clues in Trello) see the section below:

Rough Instructions for Updating the Database

  • Check out openedx#1008
  • Look for updated course IDs that are too low (probably enough to look for max_length=40)
  • Take a backup of the whole database, just in case.
  • Do a database dump for all assessment_* tables.
  • Figure out which course IDs have been truncated (usually WHERE CHAR_LENGTH(course_id)=40
  • Update the truncated (see the code bellow)
  • Just note that this is a multi-table issue, not a single table. However it's possible that you'll only have data in few tables since some of them are ai tables for machine learning grading, which is probably not used.
# Run inside `$ python manage.py lms --settings=aws_appsembler shell`

from openassessment.assessment.models.staff import StaffWorkflow

old_bad_length = 40  # Depends on the course_id field length
full_id = 'course-v1:UW+DATASCI400master+2018_Winter'
truncated_id = full_id[:old_bad_length]

incorrect = StaffWorkflow.objects.filter(course_id=truncated_id)

assert len(incorrect)

for obj in incorrect:
    obj.course_id = full_id
    obj.save()

incorrect_after = StaffWorkflow.objects.filter(course_id=truncated_id)

assert len(incorrect_after) == 0