Add a Google Drive File to Your Course#

Tags: educator how-to

To add a Google Drive file in the course body, you create an advanced component in Studio or create a Google Document XBlock in OLX.

Publish the Google Drive File and Obtain the Embed Code#

Before you can add a Google Drive file to your course, you must publish the file to the web and obtain the embed code for the file.

Important

The task described in this section relies on the use of third-party software. Because the software is subject to change by its owner, the steps provided here are intended as guidelines and not as an exact procedure.

  1. Open the Google Drive file.

  2. From the File menu, select Publish to the web.

    The Google Drive file Publish to the web dialog box.
  3. Select Publish, and then select OK to confirm the action.

  4. Select the Embed tab.

    The Google Drive file Publish to web Embed tab
  5. Copy the complete string in the Embed field, including the <iframe> tags.

    Note

    Google images do not have an <iframe> tag. To embed an image, you copy the complete img tag.

    You use that string to configure the Google Drive file component.

Add a Google Drive File Component in Open edX Studio#

Ensure you enable Google Drive files before you add the component.

To add a Google Drive file component, follow these steps.

  1. On the Course Outline page, open the unit where you want to add the Google Drive component.

  2. Under Add New Component, select Advanced, and then select Google Document.

    The new component is added to the unit, with the default Google presentation embedded.

  3. In the new component, select Edit.

  4. In the Display Name field, enter the name for the component.

  5. In the Embed Code field, paste the embed code you copied in the Publish the Google Drive File and Obtain the Embed Code task.

  6. Select Save.

You can then Previewing Draft Content to see how the unit with the Google drive file will appear to learners.

Add a Google Drive File XBlock in OLX#

To add a Google Drive file XBlock in OLX, you create the google-document element. You can embed the google-document element in the vertical element, or you can create the google-document element as a stand-alone file you reference in the vertical.

For example:

<google-document url_name="c5804436419148f68e2ee44abd396b12"
  embed_code="&lt;iframe
  frameborder=&quot;0&quot; src=&quot;https://docs.google.com/spreadsheet/pub
  ?key=0AuZ_5O2JZpH5dGVUVDNGUE05aTFNcEl2Z0ZuTUNmWUE&amp;output=html&amp;widge
  t=true&quot;&gt;&lt;/iframe&gt;" display_name="Google Document"/>

The value of the embed_code attribute is the embed code you copied in the Publish the Google Drive File and Obtain the Embed Code task.

Note

The Open edX LMS sets the height and width values for Google Drive files. If you add these attributes, the LMS overrides your changes.

Maintenance chart

Review Date

Working Group Reviewer

Release

Test situation