Back to news list

New feature: Workspaces

Posted on 2024-07-23 by Matt West

Thanks to the amazing work of Tim Yang, Nicolas Nytko, Yipeng Han, and Nathan Walters, PrairieLearn now supports container workspaces that allow students to run browser based applications such as Visual Studio Code and JupyterLab from inside PrairieLearn questions! These workspaces are tightly integrated with the existing external grading system, meaning your existing graders can be used to autograde workspace files. Workspaces are also synced and backed up, so a student's environment will be restored the next time they open the same workspace.

Click on JupyterLab, VS Code, or Xterm.js to try out a demo workspace question yourself. Screenshots of these workspaces are below. You can also use your own Docker image for a workspace in your course, so there's no limit to what workspaces can do!

(Click for full size images)

Adding workspace support to a question can be done by putting a workspaceOptions key in the info.json file. This will contain, among other things, the image used for the workspace, the port that the application runs on, and any files that should be sent to the external grader. The options for the Jupyter example are given below:

"workspaceOptions": {
    "image": "prairielearn/workspace-jupyterlab",
    "port": 8080,
    "home": "/home/jovyan",
    "rewriteUrl": false,
    "gradedFiles": [
        "Workbook.ipynb"
    ]
}

Students can then launch workspaces if you include a <pl-workspace> element in your question.html file. You can read more about the new workspaces functionality at the PrairieLearn documentation.