Google Drive & Calendar XBlock 
This XBlock allows embedding of Google documents and calendar, within an edX course.
Installation
Install the requirements into the python virtual environment of your edx-platform installation by running the following command from the root folder:
$ make requirements
Enabling in Studio
You can enable the Google Drive & Calendar XBlock in studio through the advanced settings.
From the main page of a specific course, navigate to Settings -> Advanced Settings from the top menu.
Check for the advanced_modules policy key, and add "google-document" and "google-calendar" to the policy value list.
Click the “Save changes” button.
Workbench installation and settings
Install to the workbench’s virtualenv by running the following command form the google-drive repo root:
pip install -r requirements/base.in
pip install -e .
Running the workbench
$ ./manage.py runserver 8000
Access it at http://localhost:8000/.
Running tests
From google-drive directory, run the tests with the following command:
$ pytest
If you want to run only the integration or the unit tests, append the directory to the command. You can also run separate modules in this manner.
$ pytest tests/unit
To see the coverage report in HTML format, run the tests using the following command:
$ make coverage
If you have not installed the xblock-sdk in the active virtualenv, you might also have to prepend PYTHONPATH=".:/path/to/xblock" to the command above. (/path/to/xblock is the path to the xblock-sdk, where the workbench resides).
Changes to be documented
Calendar width is set to 100% of parent element’s width; this optimizes the display of google document content within the LMS user interface
Max width of Google images is set to 100% to prevent images from overflowing outside the parent element’s boundaries
Since Google WordProcessing documents and Spreadsheets don’t allow users to explicitly define width and height, their width is set to 100%. Also, min height is set to 450px, so that documents and/or spreadsheets with larger number of rows are displayed in their natural size. Overflow scroll is automatically turned on when the height of the document becomes larger than the height of the parent.
Validation
Each time a character is added to or removed from Google Calendar ID, validation takes place. Analogically, validation takes place for embedded code of Google Drive File.
Google calendar IDs are being validated against a regular expression. IDs must contain at least one ‘@’ character, with at least one character on each side of it, ie. ‘a@a’.
Embedded code of Google Drive file is being validated on the server side, by checking the status code of the HTTP response. Since error status codes start with 400, it’s assumed that each status code that’s larger than or equal to 400 states that file is invalid. If for any reason exception occurs while getting an HTTP response, error code is returned, thus overriding default signalization that is invoked by edx platform when the 500 status code is reported.
Accessibility (a11y)
For users with a visual impairment:
Iframes in which Google calendars and Google Drive files (except images) are shown now have title attribute with alternative text content which describes what the iframe contains.
Images have alt attribute which contains alternative text that has the same purpose as the title attribute of an iframe has
Analytics
For analytics purposes, each time an image or iframe containing a calendar or Google Drive file is loaded, an event will be triggered.
There are two types of events:
edx.googlecomponent.calendar.displayed (if an iframe containing a Google calendar is loaded)
edx.googlecomponent.document.displayed (if an image or an iframe containing a Google Drive File is loaded)
License
The Google Drive & Calendar XBlocks are available under the GNU Affero General Public License (AGPLv3).
Metadata
Release files for xblock-google-drive 0.8.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| xblock_google_drive-0.8.2.tar.gz | 27.4 kB | Without provenance | Details for xblock_google_drive-0.8.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xblock_google_drive-0.8.2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for xblock_google_drive-0.8.2-py2.py3-none-any.whl |
Total release size: 57.0 kB
Release files / xblock_google_drive-0.8.2.tar.gz
| Download URL | xblock_google_drive-0.8.2.tar.gz |
|---|---|
| Size | 27.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a52de4bdf49d8f7abe08590af7c532a91537c1091f27a07970bc4914031dec82
|
|
BLAKE2b-256 checksum How to use checksums |
a53dce1f6b9ce2a783cede2e4383d3753282a5c92c22ba4dfc381863ca39bafb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / xblock_google_drive-0.8.2-py2.py3-none-any.whl
| Download URL | xblock_google_drive-0.8.2-py2.py3-none-any.whl |
|---|---|
| Size | 29.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
38458b147da38e932f4f983db8cef27121529e05e2c853de6208ef614e128e07
|
|
BLAKE2b-256 checksum How to use checksums |
4423ab4647e9976692e8f7c79acd4e0bbc9a5eb4d2bdef2bbbee71076b33500d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for xblock-google-drive 0.8.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.