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

feat: generalize proxy assets for use with every storage #91

Merged

Conversation

Danyal-Faheem
Copy link
Contributor

@Danyal-Faheem Danyal-Faheem commented Nov 6, 2024

Closes #87

  • We do this so that custom storage does not need to be defined for Scorm
  • The default storage configured for Open edX should work out of the box with scorm now
  • This also fixes an issue of X-Frame-Options on the LMS when running in development mode

We do this so that custom storage does not need to be defined for Scorm
The default storage configured for Open edX should work out of the box with scorm now
This also fixes an issue of X-Frame-Options on the LMS when running in development mode
closes overhangio#87
@Danyal-Faheem Danyal-Faheem marked this pull request as draft November 6, 2024 10:45
@Danyal-Faheem Danyal-Faheem marked this pull request as ready for review November 6, 2024 13:18
Copy link
Contributor

@timmc-edx timmc-edx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one question and a style suggestion, but otherwise this looks great! And I was able to use it to set up a scorm xblock in devstack with no trouble.

openedxscorm/scormxblock.py Outdated Show resolved Hide resolved
@@ -765,7 +764,7 @@ def find_file_path(self, filename):
Search recursively in the extracted folder for a given file. Path of the first
found file will be returned. Raise a ScormError if file cannot be found.
"""
path = self.get_file_path(filename, self.extract_folder_path)
path = self.get_file_path(filename, self.extract_folder_path) or self.get_file_path(filename, self.extract_folder_base_path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this part needed for generalizing asset serving? (Not entirely sure what the effect of this line is.) It looks like it would fall back to searching across all upload-versions of the same scorm xblock.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this for backwards compatibility as older versions of scorm would store files in the base path. We also need this as we have modified the index_page_url property.

Reference: https://github.com/overhangio/openedx-scorm-xblock/pull/91/files#diff-e9b43e0a1aaf2777389c708425492661ab8f0e10b102afab1cd95acb07f8666aR422-R424

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks! And find_file_path is now invoked from assets_proxy.

Co-authored-by: Tim McCormack <tmccormack@edx.org>
@ziafazal ziafazal merged commit ea54a52 into overhangio:master Nov 25, 2024
andrii-hantkovskyi pushed a commit to raccoongang/openedx-scorm-xblock that referenced this pull request Dec 18, 2024
* feat: generalize proxy assets for use with every storage
We do this so that custom storage does not need to be defined for Scorm
The default storage configured for Open edX should work out of the box with scorm now
This also fixes an issue of X-Frame-Options on the LMS when running in development mode
closes overhangio#87

Co-authored-by: Tim McCormack <tmccormack@edx.org>

---------

Co-authored-by: Tim McCormack <tmccormack@edx.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Generalizing assets_proxy for all assets
3 participants