Importing & exporting Open edX content libraries - Appsembler

Importing & exporting Open edX content libraries

Working with Content Libraries allows course authors flexibility with building out their course content. In this article, we’ll explore a few of the ways you can leverage this flexibility to meet your course creating needs.

Exporting content libraries can be a great way to back-up your course content, or split it up if the library is too large for the page to load.

Scenario: Imagine you have an exam on your course that is 100 questions long. It’s pulling questions from a content library so that the questions are always randomized. However, loading that much content on a single page is causing the page to take forever to load! What do you do? 

Answer: Use the import/export features of content libraries to break up the library into smaller parts. Here’s how it’s done:

Export the Content Library

Navigate to the library you wish to export.

From Open edX Studio Home, make sure you click on the Libraries tab to see the libraries you have set up for you organization. 

Note: For this example I’ve set up a library that has 15 (not 100, but we can pretend) multiple choice questions named L1Q10-L1Q15 (For Library 1 Question 1 etc). 

Under the Tools menu, select the Export option. 

Then, click the giant Export Library Content button.

You will then download a .tar.gz file. Make sure you know where it is. 

Import the Content Library

The first step is to create an empty content library, for detailed instructions on how to do that, click here.

In an empty content library, select Import from the Tools drop down menu. 

Click the big Choose a File to Import button, and select the .tar.gz file of the library we exported earlier. 

Click, Replace my library with the selected file.

If everything went well, you should see a successful status message that looks like this: 

Delete content from each library.

For our Giant Exam problem, the next step is going to be shrinking each library. Because right now we have two libraries that have all the exact same content. So I’m going to delete questions from each so that both are smaller and each contains different content.

First, I’ll delete questions L1Q6-L1Q15 from Library 1. This is the library we started with. Deleting questions is as easy as clicking the trash can icon.

So now my entire Example Library 1 looks like this: 

Now, I’ll do the same with Example Library 2, except I’ll keep questions 6-10. 

Note: When you import a content library, everything is the same as the original except the library code. So in order to keep things straight, it would probably behoove you to change the name of the new library to keep it separate. 

Now, I’ll simply do the same thing we did with Library 1, except delete questions 1-5, and 11-15.

Here’s the final library: 

Repeat the process once more for Example Library 3.

Here’s what it looks like when it’s done.

Adjust Randomized Content Blocks

Back in Studio, where I originally had a single unit with 15 questions, I’m going to create 3 separate units. One for each library we’ve created. 

For the first randomized content block, all we have to do is click Update Now.

Open edX is able to tell when a content library has changed, so instead of deleting it and starting over, all we need to do is click Update

Next, create a new unit for part 2. 

Repeat for Part 3. 

We now have a much more manageable 3-part exam that still uses all of the content of the original exam.