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

Importing a course with scorm and changing the scorm file deletes the exported course scorm file as well #70

Closed
Danyal-Faheem opened this issue Mar 26, 2024 · 0 comments · Fixed by #71
Assignees
Labels
bug Something isn't working

Comments

@Danyal-Faheem
Copy link
Contributor

Issue

Exporting a course that contains a unit with a scorm module and then importing it into another course works perfectly fine. However, if you change the scorm file in either the exported or the imported course, the other one breaks with the message:

image

This issue only happens if the exported course and the imported course are in the same openedx instance.

This error is also seen when you duplicate a subsection/unit that contains a scorm module with a scorm file already uploaded. For that, just duplicated the unit throws that error.

Steps to reproduce

  1. Install Tutor and make sure scorm is installed by running: tutor [dev|local] run lms pip list | grep -i scorm
  2. Create a new course.
  3. Add scorm into the "Advanced Module List" under advanced settings.
  4. Create a new unit with a scorm module and upload any scorm file in it.

And then after this, follow the respective steps for each issue.

To reproduce the course import/export and change scorm issue:

  1. Publish the unit and export the current course.
  2. Create a new course and import the exported course into it.
  3. Change the scorm file with another file (not the same scorm file) in either the exported course or the imported course.
  4. The scorm module in the other course (the one in which the scorm file was not changed) will show that error.

To reproduce the subsection/duplicate issue:

  1. Duplicate the unit or subsection in which the scorm module was opened.
  2. Open the scorm module unit and it will show that error.

Possible Cause

For the course export import issue:

  • Scorm saves the zip_file content at the location scorm/block_id/hash_of_file. It seems that the imported course keeps the same block_id and hash_of_file of the exported course and thus they reading the data from the same directory. When the scorm file is changed in either course, it overwrites the previous directory as the hash changes and the other course cannot access the data.

For the subsection/unit duplicate issue:

  • Scorm only saves the contents inside the zip_file after submitting inside studio. This means that whenever the unit it duplicated or a new course is created, the data for that scorm unit is not saved automatically and it tries to access the file at the path scorm/block_id/hash_of_file but that directory doesn't exist as nothing was saved there.

Possible solutions

  • The simplest solution would be to just never delete the directory when the course is imported. However, I do not know if there is a way to check the course was imported. This does not resolve the subsection/unit duplicate issue.
  • Save the package_file onto the storage as was already being done before this commit and extract the zip_file contents again onto the storage in case the original directory does not exist on the storage.
  • Change the location where scorm stores the zip_file contents to make it unique for each course. For example appending course_id to block_id to make it something like scorm/block_id+course_id/hash_of_file. This would make separate directories for the exported and the imported course. However, this would require the zip_file contents to be extracted again as there would be nothing saved at the new directory resulting in the same issue as the subsection/unit duplicate.
@Danyal-Faheem Danyal-Faheem added the bug Something isn't working label Mar 26, 2024
@Danyal-Faheem Danyal-Faheem self-assigned this Mar 26, 2024
@Danyal-Faheem Danyal-Faheem moved this from Pending Triage to Backlog in Tutor project management Mar 26, 2024
@DawoudSheraz DawoudSheraz moved this from Backlog to In review in Tutor project management Apr 9, 2024
@hinakhadim hinakhadim moved this from In review to In Progress in Tutor project management Apr 9, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Tutor project management Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
1 participant