OLI Dynamic Questions

OLI Dynamic Questions

  • Docs
  • API
  • Examples
  • Help

›Creating Questions

Getting Started

  • Overview
  • Requirements

Creating Questions

  • Workflow
  • Referencing Variables

Writing Scripts

  • Script Basics
  • Built-In Functions
  • Third-Party Libraries

Referencing Variables

A dynamic question can reference variables in a variety of different places in a question. In all places, a variable reference is required to be delimited on both sides by the @@ character sequence.

Reference locations

Variable references are most commonly seen in the body of a question.

Variables in question body

But they can also appear in the following locations:

Choices

In multiple choice, check all that apply, and ordering style questions it is possible to vary a portion or the entirety of the content of each choice.

Variables in choices

Feedback

When creating dynamic questions it is often helpful to provide custom feedback that includes the actual values shown to the student.

Variables in feedback

Hints

Hints also can contain variable references.

Variables in hints

Match expressions

The match expressions for numeric or text input questions can contain variable references.

Variables in matching

Constraints and limitations

There are some constraints to keep in mind on how variables can be referenced and how dynamic content can be created.

Number of choices, hints

While variable references can be used to make the contents of a question choice or hint dynamic, there is no way to structure a dynamic question to vary the number of choices displayed to a student or to vary the number of hints available.

Images

Currently, varying the display of an image (e.g. displaying one image out of a set of five) is not supported.

← WorkflowScript Basics →
  • Reference locations
    • Choices
    • Feedback
    • Hints
    • Match expressions
  • Constraints and limitations
    • Number of choices, hints
    • Images
OLI Dynamic Questions
Docs
Getting StartedWriting Scripts
Community
Course Showcase (Coming soon)OLI Slack
More
OLIOLI Course EditorGitHubStar
Copyright © 2025 Carnegie Mellon University