The best platform for online assessments

PrairieLearn empowers instructors to build content that helps their students achieve mastery.

DocumentationGet in touch

Questions as code

PrairieLearn questions are defined as code, which is what makes them so powerful. The familiar HTML syntax and Mustache templates make it easy to get started writing questions. A broad variety of building blocks like number inputs and multiple choice responses come built-in, so you can hit the ground running.

question.html
<pl-question-panel>
<p>
Suppose a ball is thrown from a level surface at a
{{params.angle}}° angle with a velocity of
{{params.velocity}}m/s. How far will the ball travel?
</p>
</pl-question-panel>
<pl-integer-input answers-name="distance" suffix="m"><pl-integer-input>

Automatic generation and grading

Once you've defined an HTML template, generate parameters for your question with the power of Python and popular libraries like numpy and matplotlib. And questions grade themselves, from simple multiple-choice questions to free-body diagrams to code, so instructors can focus on the important things.

server.py
import math, random
def generate(data):
velocity = random.randint(100, 800) / 100
angle = random.randint(2000, 8000) / 100
distance = (math.sin(2 * math.radians(angle)) * velocity**2) / 9.8
data["params"]["velocity"] = velocity
data["params"]["angle"] = angle
data["answers"]["distance"] = distance

Write once, use forever

Once a question has been defined in code, it can be reused in any future assessment. And students can keep trying new variants of difficult problems until they've mastered the topic—no need for you to manually write new questions.

Try me!Question 5: Ball trajectory

Suppose a ball is thrown from a level surface at a 69.2° angle with a velocity of 2.8 m/s. How far will the ball travel?

m

Limitless flexibility

From code autograding and in-browser IDEs to collaborative assignments and custom elements, PrairieLearn provides a powerful foundation for your assignments and assessments.

Trusted by the best

Instructors at top universities in the United States and Canada have been using PrairieLearn to teach the next generation of engineers, scientists, and businesspeople.

Students
15,000+
Courses
100+

Open-source. Forever.

PrairieLearn began life as open-source software, and we're committed to making sure it stays that way. With an active developer community of professors, course staff, and students, PrairieLearn gets better all the time.

Get started

New to PrairieLearn? Check out the question gallery to see what's possible with PrairieLearn, or head over to the documentation to learn how to set up PrairieLearn on your computer and start creating content.

Looking for managed hosting, instructional workshops, and direct support? Want a personalized demo of all PrairieLearn has to offer? Reach out to us, and we'll get back to you with more details.

Get in touch