STSTEER

Reference

The API: fresh questions over HTTP

The API has two endpoints. Both return JSON.

EndpointReturns
GET /api/sampleGenerated questions, in the same form as the dataset.
GET /api/elementsEvery element, with its types, domains, perspectives and difficulty levels.

Sampling questions

/api/sample takes the parameters below. Leave a filter out and it is chosen at random.

element_nameWhich element, for example law_of_demand
typeThe form of the question
domainThe subject matter, for example finance
tagsThe perspective, for example first_person
difficulty_levelThe difficulty level within the element, from 1 (its easiest) up to its number of levels. Levels are relative to each element; without element_name, only elements that have the level are drawn from. A level out of range returns an error (400)
nHow many questions, from 1 to 50
seedQuestion i uses seed + i, so the same seed returns the same questions
curl "https://steer-benchmark.cs.ubc.ca/api/sample?element_name=law_of_demand&n=1&seed=42"

Each question comes back as one row per part, with exactly the fields of the dataset:

{
  "questions": [
    {
      "element": "law_of_demand",
      "question_id": "law_of_demand/08207ad1a1f14bb2/0",
      "base_id": "08207ad1a1f14bb2",
      "part": 0,
      "template_id": "law_of_demand/questions/1653",
      "question_text": "John is analyzing the market for a particular stock. Initially, the stock is priced at 19222.79 and the quantity demanded is 6. After some time, he notices that the quantity demanded has decreased to 2. What might be the new price that led to this decrease in quantity demanded?",
      "options": ["18836.16", "19721.29", "18328.52", "18763.49"],
      "grading": "answer",
      "correct_index": 1,
      "consistency_group": null,
      "consistency_rule": null,
      "type": "quantity_decrease",
      "domain": "finance",
      "perspective": "man",
      "tags": [],
      "difficulty": 1,
      "setting": "Consumption Decisions in Non-Strategic Environments",
      "module": "Comparative Statics of Demand",
      "generator": "autosteer@0.1.0+f90fd64",
      "seed": 42
    }
  ]
}
question_idUnique per part; base_id groups the parts of one question
options, correct_indexThe options in the order to show them, and the position of the correct one
gradinganswer for one correct option, or consistency, in which case the parts sharing a consistency_group are scored together by consistency_rule
difficultyThe difficulty level within the element, from 1 (its easiest); not comparable across elements
generator, seed, template_idTogether these reproduce the row exactly

Called with no n or seed, the endpoint returns a single question in a shorter form, which this site uses for its "Generate a question" buttons.