30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

LearnDash Get Question

learndash/get-question fetches a single question: its post fields, its LearnDash settings, the quiz it belongs to, and its answers.

The answers are fetched separately, because they are not on the post.

At a glance

Abilitylearndash/get-question
ToolsetLearnDash — toolset/learndash
GroupLearnDash › Questions
RequiresAcrossAI Pro, plus LearnDash LMS active on the site
Capabilitymanage_options
SafetyRead-only — changes nothing
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Pro 0.9.16 and later

How it works

Answers are stored against the linked ProQuiz record rather than as post meta. So a read of the question post returns a question with no answers, which looks like an incomplete question and is not.

This fetches both halves and returns the answers under answers, along with the answer type and the points.

If linked comes back false the ProQuiz record is missing entirely. The question cannot be answered by a learner regardless of how complete the post looks — it has a title, a type and points, and no answers to choose from.

That is worth checking before assuming a quiz is finished.

The answer type decides how scoring works: single choice, multiple choice, free text and the rest all behave differently, and the correct flags mean different things across them.

Input

NameTypeRequiredWhat it is
question_idintegerYesThe question post ID.

What comes back

NameTypeWhat it is
questionobjectPost fields, settings and the quiz it belongs to.
answersarrayThe answers, from the ProQuiz record.
linkedbooleanWhether the ProQuiz record exists at all.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation.

Example

Ask your assistant:

Show me this question and its answers.

It resolves to one call:

{
  "ability": "learndash/get-question",
  "parameters": {
    "question_id": 660
  }
}

Worth knowing

  • Answers come from the ProQuiz record, not from post meta.
  • linked=false means the question cannot be answered, however complete it looks.
  • The answer type changes what the correct flags mean.
  • Read-only.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading