Package: xblock-google-drive
Google Drive & Calendar XBlockThis XBlock allows embedding of Google documents and calendar, within an
edX course.InstallationInstall the requirements into the python virtual environment of youredx-platforminstallation by running the following command from the
root folder:$makerequirementsEnabling in StudioYou can enable the Google Drive & Calendar XBlock in studio through the
advanced settings.From the main page of a specific course, navigate toSettings->Advanced Settingsfrom the top menu.Check for theadvanced_modulespolicy key, and add"google-document"and"google-calendar"to the policy value
list.Click the “Save changes” button.Workbench installation and settingsInstall to the workbench’s virtualenv by running the following command
form the google-drive repo root:pipinstall-rrequirements/base.inpipinstall-e.Running the workbench$./manage.pyrunserver8000Access it athttp://localhost:8000/.Running testsFrom google-drive directory, run the tests with the following command:$pytestIf 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.$pytesttests/unitTo see the coverage report in HTML format, run the tests using the
following command:$makecoverageIf you have not installed the xblock-sdk in the active virtualenv, you
might also have to prependPYTHONPATH=".:/path/to/xblock"to the
command above. (/path/to/xblockis the path to the xblock-sdk, where
the workbench resides).Working with translationsFor information about working with translations, see theInternationalization Supportsection of
theOpen edX XBlock Tutorial.Prepare your virtualenv and ensure that theTransifex authentication file(~/.transifexrc) is properly set up.Push new strings to Transifex:$makepush_translationsTo get the latest translations from Transifex:$makepull_translationsFor testing purposes it’s faster to avoid Transifex and work on dummy Esperanto translations:$makebuild_dummy_translationsChanges to be documentedCalendar width is set to 100% of parent element’s width; this
optimizes the display of google document content within the LMS user
interfaceMax width of Google images is set to 100% to prevent images from
overflowing outside the parent element’s boundariesSince 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.ValidationEach 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 hasAnalyticsFor 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)LicenseThe Google Drive & Calendar XBlocks are available under the GNU Affero
General Public License (AGPLv3).