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

Start free trial

LearnDash Manage Question

learndash/manage-question creates a new question in a quiz, or updates an existing one.

Unlike the other write abilities here, it goes through LearnDash’s own REST controller.

At a glance

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

Why the REST controller

A question is stored both as a post and as a ProQuiz record holding the answers, and only LearnDash’s controller keeps the two halves in sync.

Writing the post directly produces exactly the linked=false state the listing reports: a question that exists in wp-admin and cannot be answered.

The consequence is a dependency. This ability requires LearnDash’s REST API to be enabled, and says so plainly when it is not — rather than falling back to a direct write that would appear to succeed.

Answers are required on create. LearnDash rejects a question without them, which is correct: a question with no answers cannot be scored.

Give each answer as {answer, correct, points}. At least one should be correct for the single and multiple types — a question where nothing is correct is answerable and unscoreable.

Idempotent.

Input

NameTypeRequiredWhat it is
actionstringYescreate or update.
quiz_idintegerFor createThe quiz to add the question to.
question_idintegerFor updateWhich question.
titlestringFor createThe question text.
answersarrayFor createEach answer as {answer, correct, points}.
settingsobjectNoLearnDash question settings.

What comes back

NameTypeWhat it is
questionobjectThe question after the write, with its ProQuiz link.
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:

Add a multiple-choice question to the quiz.

It resolves to one call:

{
  "ability": "learndash/manage-question",
  "parameters": {
    "action": "create",
    "quiz_id": 640,
    "title": "Which shortcut opens the command palette?",
    "answers": [
      { "answer": "Ctrl+K", "correct": true, "points": 1 },
      { "answer": "Ctrl+P", "correct": false, "points": 0 }
    ]
  }
}

Worth knowing

  • Requires LearnDash’s REST API. It says so rather than writing half a question.
  • Answers are required on create, and rightly so.
  • A question with no correct answer is answerable and unscoreable.
  • Idempotent.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading