Skip to main content

edX

Once you have created a lab, you then need to add it to your course via edX Studio. When you are adding a lab to your course, you embed your lab into a unit of your course. This way, learners will naturally progress through the course, and complete your labs as they go.

Enabling your Course to use Labs​

  1. First, we will need to enable the labs feature for your course. This part only needs to be done once per course.

    i. To start, you will need to open Studio. Navigate to your Course Outline on your course page. Press the "Edit in Studio" button.

    image

    ii. There, head to Settings -> Advanced Settings. This is where you will enable support for labs in your course.

    image

    iii. Enable labs by adding the below to Advanced Module List.

[
"lti_consumer"
]

image

  1. Next, while we are still on the Advanced Settings page, scroll down to LTI Passports. Here you will add the necessary credentials for your course to use the labs service.

i. Add your course's LTI credentials like below.

[
"sn_lti:<LTI Consumer Key>:<LTI Consumer Secret>"
]

image

Where do I find my LTI credentials?

The consumer key and secret can be found in Author Workbench on your course page. Navigate to the Advanced tab and and scroll to the LTI Credentials (Advanced Users Only) section. Here, you will be able to copy the consumer key and secret. If you are publishing your course to Coursera, please use the LTI Credential (Coursera) credentials. Otherwise, use LTI Credential (Skills Network / edX).

image

Now that our course is ready to use labs, we can add our lab to our course!

Add an Instructional Lab to your Course​

This section is only for instructional labs. If you wish to add a different lab type to your course, see the Add a (Non Instructional) Lab to your Course section below.

As a Skills Network author, you can create "instructional labs". These are labs that include step by step instructions for working with tools external to Skills Network Labs, such as services on IBM Cloud.

HTML files will be automatically generated from instructional labs so they can be easliy embedded or linked to from your course. To embed an instructional lab in your course, follow the steps below.

  1. On your course page, navigate to the lab you want (under the Labs tab) and click "Add to Course"

image

  1. Copy the iFrame code provided

image

  1. Close the pop-up and navigate to your Course Outline in the Content tab on your course page. Press the "Edit in edX Studio" button to open the outline in edX Studio

image

  1. Select the unit you want to add your lab in, or create a new unit if one doesn't exist yet

image

  1. Within your desired unit, add a new Text component

image

  1. Select iFrame Tool from the dropdown list

image

  1. Click the HTML button

image

  1. Remove all existing content, and paste the iFrame code you obtained from step 2. Then click Save to exit the HTML editor.

image

  1. Click Save to save your work.

image

  1. Now, your instructional lab should be embedded into your unit. You can preview the unit by clicking the Preview button in the top right corner, or publish the unit if you are satisfied with everything.

image

Add a (Non-Instructional) Lab to your Course​

This section is only applicable for any lab type other than an instructional lab. If you wish to add an instructional lab to your course, see the Add an Instructional Lab to your Course section.

To add a (non-instructional) lab to your course in Studio:

  1. In edX Studio, go to the unit you want your lab to be in. If it doesn't exist yet, you can create a new unit.

image

  1. Click the green advanced button and select LTI Consumer

image

image

  1. Edit the following properties of your LTI Consumer and click Save.

image

LTI ID sn_lti
LTI URL See the Lab Launch Url section below.
LTI Launch Target New Window
Request user's username true
Request user's email true
Send extra parameters true

Lab Launch Url​

The Lab Launch url can be easily found in Author Workbench on your course page. Just follow these steps:

  1. On your course page, navigate to the lab you want (under the Labs tab) and click "Embed"

image

  1. Copy the the Lab's Launchg Url by clicking on the Copy button.

image

Once everything has been added, your final configuration should look something like this:

image image image image

Add a Datasette Lab to your Course​

A Datasette lab needs a SQLite database as well as its instructions. Author Workbench keeps the database with the lab version and sends it to the lab on every launch. Once your lab has a database, you add it to your course the same way as any other lab.

Step 1. Give your lab a database​

When you create a Datasette lab, or a new version of one, upload your database in the Lab database (SQLite) field.

  • The file must be a .db, .sqlite or .sqlite3 SQLite database of 50 MB or less.
  • Datasette shows the database under its file name without the extension, so chinook.db appears as chinook. Links in your instructions such as /chinook/albums use that name, so keep the same file name when you replace the database.
  • Use only letters, digits, _ and - in the file name. Author Workbench changes any other character to _, so Film Locations.db appears as Film_Locations.
  • For a lab where learners build their own tables, upload an empty database. A 0-byte .db file works.
  • A new version made from an existing one starts with a copy of its database, unless you upload a different file.

Each learner keeps their own copy of the database between launches, including any tables they change or add. Learners launching a version for the first time get its current database. When you replace a version's database, learners who launched that version before are asked whether to update their copy. If they update, their old copy is kept as a backup file and the new database replaces it.

Each version has its own copy. Learners who move to a new version start with that version's database, and the changes they made in the earlier version are not loaded.

To replace the database, open the lab's Versions tab, click Database on the version, and click Replace database. Draft and published launches of a version use the same file.

Step 2. Test the lab in Author Workbench​

On the lab's Versions tab, click Test on the version, then Test Lab. Datasette opens with your tables next to the lab instructions.

Step 3. Add the lab to your course​

Follow Add a (Non-Instructional) Lab to your Course. The Lab Launch Url in the Embed window already includes the database, so you do not add any custom parameters.

Step 4. Test the lab in your course​

Publish the unit in Studio, click View Live Version and launch the lab. This checks the course's own LTI settings, which the test in Author Workbench does not.

Datasette labs set up with custom parameters​

A Datasette lab can also be added as an LTI Consumer component in Studio that points at https://labs.cognitiveclass.ai/login/lti, with four custom parameters (sn_labs_tool, sn_labs_filepath, sn_asset_library_sqlite_db_url and sn_asset_library_instructions_url). Labs set up that way keep working. To move one to Author Workbench:

  1. Download the database from the sn_asset_library_sqlite_db_url address.
  2. Rename the downloaded file to the file name at the end of sn_labs_filepath. For sn_labs_filepath=/labs/datasette/lab.db, name it lab.db. Datasette names the database after this file, so the links in your instructions keep working.
  3. Upload it to the lab in Author Workbench, as in Step 1.
  4. Update the LTI Consumer component as in Add a (Non-Instructional) Lab to your Course, and delete the four custom parameters.

After the move, learners who used the lab before get a fresh copy of the database. Their earlier copy is still in their storage, but the lab no longer opens it. Move a lab between course runs if learners build their own tables in it.