Ned Query
Alpha manualNed Query (local_nedquery) lets authorized Moodle administrators create reusable reports by describing the information they need in plain language. Ned Hub AI generates, validates, tests, explains, and—when necessary—repairs a read-only SQL query.
Requirements
- Moodle 4.5 or later.
- Ned Hub 0.3.0 or later with the Ned AI platform enabled and connected.
local/nedquery:use; sharing also requireslocal/nedquery:share.
Create and save a report
- Open the Request Report tab.
- Use the two-column request page: describe the report you want to create in the request field and review the stock examples alongside it, then select Generate report. The processing view shows an animated spinner, elapsed time, the submitted request, an accessible AI activity log, and a Cancel request action while the request runs.
- Review the generated results and the cumulative Ned Tokens used. Select Modify to revise the request, Download for a CSV file, or Save to keep the report.
- When saving, enter its name and description and choose Personal or Shared space.
- Open saved reports later from the standard-width Saved Reports tab. Ned Query supplies a short user-facing AI description by default. Saved Reports also lists the Ned Tokens consumed when each report was generated and provides separate View and Delete actions; deletion requires confirmation.
Report spaces
| Space | Access |
|---|---|
| Personal | Visible to the owner and Ned Query managers. |
| Shared | Available to authorized Ned Query users. Publishing requires the sharing capability. |
Limits and long-running queries
Administrators configure the result-row limit, long-running notice time, maximum execution time, and AI repair attempts. When the notice threshold is reached, the intended interface offers Continue waiting or Cancel and update query. Database-native cancellation varies by driver in this alpha; the PHP execution limit and row cap provide the initial protection layer.
Security and privacy
- Only one read-only
SELECTorWITHstatement is accepted. - Comments, multiple statements, data-changing operations, delay functions, and credential-like fields are rejected.
- The AI receives the user's report request and a restricted Moodle schema catalogue—not query results.
- Moodle stores saved report definitions and an audit record of executions. A dedicated read-only database account is recommended for defence in depth.
Current alpha limits
Scheduled delivery, charts, exports, interactive parameters, course-scoped teacher creation, and reliable cross-database query cancellation are not yet included. AI-generated reports can still be logically incomplete and must be reviewed before being shared.
Change history
- 071a13bAdded a spinner, visible submitted request, AI activity log, elapsed timer, and cancellation state while generating reports.
- 92ee62bAdded cumulative Ned Token usage to previews and Saved Reports, removed the duplicate preview title, and spaced report actions consistently.
- 1822711Matched the Ned Hub dashboard width, generated user-facing report descriptions, and added confirmed View and Delete actions.
- fad842eStandardized the Saved Reports width, removed its duplicate title, and added AI-generated default report descriptions.
- 5bb3b48Constrained the request page to Moodle's standard content width and added a responsive two-column request and examples layout.
- b63bd3fAccepted nested, labelled, prose-wrapped, and JSON-encoded AI responses, removed leaked debug output, and added processing progress, elapsed time, and cancellation controls.
- 0e08b64Corrected the report request wording, restored the stock examples, and removed the duplicate page title.
- 8a67cb2Simplified report requests to one field, added Request Report and Saved Reports tabs, and moved Modify, Save, and Download actions to the generated preview.
- b7ef3fdMade AI response parsing resilient to valid JSON, fenced SQL, and plain SQL while preserving read-only validation.
- 7a44d32Retried the development installation after migrating Explain Your Thinking to Ned Hub and verified the installed plugin version.
- d3ebd81Created the initial alpha with Ned Hub AI generation, validation and repair, personal/shared reports, examples, limits, and audit history.