Provides setup, recipes, and extension code for the CrestApps Orchard Core Surveys module covering surveys, polls, forms, quizzes, invitations, embedding, QTI import, API, AI features, scoring, grading, and extension points.
Ships in crestapps-orchardcore. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are an Orchard Core expert. Generate accurate setup, recipes and extension code for the CrestApps Surveys module. Surveys owns survey definitions, published versions, question types, logic, question banks, collectors (links, kiosks, invitation lists), access rules and limits, responses, scoring, grading, results and every integration. It needs no other product module; Learning runs its course surveys, choices and quizzes on it (see orchardcore-learning-assessments).
CrestApps.OrchardCore.Surveys (or CrestApps.OrchardCore.Cms.Core.Targets) in the web/startup project. Reference CrestApps.OrchardCore.Surveys.Abstractions for records, contracts, SurveysPermissions and the AddSurvey* helpers, and CrestApps.OrchardCore.Surveys.Core for the handler, scorer and settings-driver base classes.Surveys YesSql collection; responses and their answer index are in SurveyResponses. They are not content items.Survey.Draft). Publish makes an immutable SurveyVersion; a response stays on the version it started on. Access, retention and anonymity (Survey.Access, Survey.Retention) apply live, without a new version.SurveyQuestion.Scoring, settings marked [SurveyKey]) never reach respondents. Visibility, branching, limits, deadlines, quotas and scores are decided on the server on every post.{ "steps": [...] }.sealed modifier, except View Models.| Feature | ID | Depends on | Adds |
|---|---|---|---|
| Surveys | CrestApps.OrchardCore.Surveys | OrchardCore.Users, CrestApps Resources | Surveys, versions, designer, question types, logic, pools, banks, web links and kiosks, access rules, responses, scoring, grading, accommodations, reports, admin pages |
| Survey Invitations | CrestApps.OrchardCore.Surveys.Invitations | Surveys, OrchardCore.Notifications, Outreach | Personal invitations to users, user audiences, cohorts and e-mail addresses, reminders, unsubscribe link |
| Survey Embedding | CrestApps.OrchardCore.Surveys.Embedding | Surveys, OrchardCore.Contents | SurveyPart, the SurveyWidget content type and the [survey] shortcode |
| QTI Question Import | CrestApps.OrchardCore.Surveys.Qti | Surveys, OrchardCore.Media | QTI 2.1 and 3.0 import into question banks |
| Surveys API | CrestApps.OrchardCore.Surveys.Api | Surveys | JSON endpoints under /api/surveys on the Api authentication scheme |
| Surveys AI (module Surveys AI) | CrestApps.OrchardCore.Surveys.AI | Surveys, CrestApps AI | AI tools, answer summaries, translation, scoring help |
Integrations light up on their own when their feature is on: Recipes and Deployment, CrestApps Recipes (schemas), Workflows, Reports, Data Pipelines, Audit Trail, Notifications, Webhooks, Rate Limits, reCAPTCHA, Attachments (the File upload question type), Widgets and Shortcodes.
{
"steps": [
{
"name": "Feature",
"enable": [
"CrestApps.OrchardCore.Surveys",
"CrestApps.OrchardCore.Surveys.Invitations",
"CrestApps.OrchardCore.Surveys.Embedding"
],
"disable": []
}
]
}
The module ships the Surveys: samples recipe (SurveysSamples): a customer satisfaction survey, an NPS survey, a graded quiz and a question bank, each published with a public link.
| Record | Holds |
|---|---|
Survey | Name (lowercase letters, digits, dashes; unique), Title, Kind (SurveyKinds: Survey, Quiz, Poll), Status (Draft, Open, Closed, Archived), Draft, PublishedVersionNumber, Owner (a RecordRef such as Content:{id} for a course item), OwnerId (user), Tags, Access, Retention, NoDefaultWebLink |
SurveyDefinition | Title, Introduction, Pages, Variables, Endings, ScoreCategories, ScoreBands, Quotas, Presentation, Navigation, Scoring, Review, Timing, Translations, Properties |
SurveyPage | Id, Name, Title, Description, Visibility, Questions, Pools, QuestionOrder (AsDefined, Shuffle), Branches, AllowBack, TimeLimitSeconds |
SurveyQuestion | Id (stable), Name (code used by piping, formulas, exports), ControlType, Title, Description, Required, Visibility, RequiredWhen, EnabledWhen, Choices, Rows, ShuffleChoices, ChoicesFrom, Scoring (key), Validation, Settings (type settings JSON), Properties |
SurveyVersion | Number, definition, publisher, notes, SHA-256 of the definition |
SurveyCollector | Kind (WebLink, Kiosk, Invitation, Embed), Token (/s/{token}), opening and closing times, MaxResponses, password hash, hidden variable values, Culture, IsDefault |
SurveyResponse | Status (InProgress, Completed, ScreenedOut, Abandoned, Voided), Grading, VersionNumber, Context (RecordRef), AttemptNumber, Answers, Variables, Score, MaxScore, Percent, Passed, CategoryScores, EndingId, IsTest |
QuestionBank, BankQuestion | Reusable questions with tags, difficulty and SourceIdentifier; pools draw from them and publishing copies the draws into the version |
SurveyOverride | An accommodation: extra minutes, extra attempts or another window for a user or audience, with a reason |
SurveyTemplate | Starting definitions; seeded Customer satisfaction, Net Promoter Score, Employee engagement, Event feedback, Quiz and Poll (SurveyTemplateNames), plus the code-only Blank survey |
A "form" is a survey without scoring; a quiz is a survey of kind Quiz with Scoring.Enabled; a new poll gets Total 1 and Cookie uniqueness.
See question types and logic for every built-in type, capabilities, rules, branching, piping, formulas and building a custom type.
ISurveyDefinitionValidator): unique ids and names, registered types, no forward references or cycles in rules, formulas that compile, pools that can draw enough, complete scoring, valid endings, plus every ISurveyDefinitionValidationContributor. Errors block; warnings show.Properties["bankRevision"]).ISurveyDefinitionDiffer); changes that affect existing answers (type changed, choice removed, key changed, question made required) ask for confirmation.NoDefaultWebLink).ISurveyObserver.PublishedAsync (workflow event, audit trail, webhook).Restore copies an old version into the draft; Compare diffs two versions. Draft saves use optimistic concurrency (X-Survey-Draft-Version, 409 on a stale draft).
GET /s/{token} (start page), POST /s/{token}/start, GET/POST /s/r/{responseId} (pages), /save, /evaluate, /check/{questionId}, /done, /review, /reopen, /s/i/{token} (personal invitation), /s/{token}/results, /surveys/my. A GET never starts a response.ISurveyAccessRule, first refusal wins): Status 100, AvailabilityWindow 200, WeeklySchedule 300, Audience 400 (Anyone, SignedIn, Audiences, InvitationOnly), Captcha 450, Statement 475, Password 500 (five wrong in 15 minutes locks out for 15), Invitation 700, RespondentLimits 800 (Total, PerDay, PerWeek, PerMonth, CooldownMinutes; Uniqueness SignedInUser, Invitation, Cookie, None), MaxResponses 900, Quota 1000.ISurveyResponseService.StartAsync(StartResponseRequest) and a Context (RecordRef); limits and attempts are kept per context. ISurveyLinkService makes public and personal links.Surveys.Respond group (120 requests a minute per client) and response routes in Surveys.Respond.Response.Details on anonymity, invitations, embedding, scoring, review, time limits, grading and accommodations: collecting and scoring.
| Menu | Route (under the admin prefix) | Permission |
|---|---|---|
| Surveys > Surveys | surveys (designer surveys/{id}/design, publish, versions, access, logic, collectors, responses, preview, overrides, translations) | ManageOwnSurveys |
| Surveys > Question Banks | surveys/banks | ViewQuestionBanks |
| Surveys > Grading | surveys/grading | GradeOwnSurveyResponses (or a grading scope) |
| Surveys > Templates | surveys/templates | ManageSurveyTemplates |
| Settings > Surveys | Site settings group surveys | ManageSurveySettings |
| Reports > Surveys | Survey Results, Survey Responses, Quiz Results, Item Analysis, Completion Funnel, Survey Participation, Satisfaction Trend, Survey Activity | ViewOwnSurveyResponses |
The survey list hides surveys other features own (course items) unless Show is set to Also surveys owned by other features. Its row menu has Results, Responses, Versions, Logic overview, Access and settings, Accommodations, Regrade versions, Copy as a draft, Save as a template, Close/Open, Archive and Delete (only for a survey without real responses and not owned by another feature) and, with Surveys AI, Summarize answers with AI and Translate with AI.
Settings > Surveys has the cards New surveys (default retention days, idle hours before abandoning, default minimum group size) and Responding (Smallest group size allowed floor, largest upload in MB, allowed redirect hosts, invitation e-mails per day, 2,000 by default). They travel in the Settings step as SurveySettings.
| Permission | Description | Implied by |
|---|---|---|
ManageSurveys | Manage all surveys | |
ManageOwnSurveys | Manage own surveys | ManageSurveys |
PublishSurveys / PublishOwnSurveys | Publish, restore and close (own) surveys | ManageSurveys / PublishSurveys |
ManageSurveyTemplates | Manage survey templates | ManageSurveys |
ViewSurveyResponses / ViewOwnSurveyResponses | View responses of all / own surveys | ManageSurveys / ViewSurveyResponses, ManageOwnSurveys |
ExportSurveyResponses | Export survey responses with respondent identity (security critical) | |
DeleteSurveyResponses / DeleteOwnSurveyResponses | Void and delete (own) survey responses | ManageSurveys / DeleteSurveyResponses |
GradeSurveyResponses / GradeOwnSurveyResponses | Grade (own) survey responses | ManageSurveys / GradeSurveyResponses |
ManageSurveyOverrides / ManageOwnSurveyOverrides | Manage (own) survey accommodations | ManageSurveys / ManageSurveyOverrides |
ManageQuestionBanks | Manage question banks | |
ViewQuestionBanks | View question banks | ManageQuestionBanks |
ManageSurveyInvitations / ManageOwnSurveyInvitations | Manage (own) survey invitations | ManageSurveys / ManageSurveyInvitations |
RespondToSurveys | Respond to surveys | |
ManageSurveySettings | Manage survey settings |
Defaults: Administrator holds all; Editor holds the own variants (manage, publish, view, delete, grade, accommodations) and View question banks; Authenticated holds Respond to surveys. Public links need no permission. Manage own surveys alone does not publish, grade, void or send invitations. Checks on one survey go through ISurveyAuthorizationService (global permission, then owner, then each ISurveyAccessProvider).
| Step | Records | Matched by |
|---|---|---|
Surveys | Surveys with draft, access, retention, Versions, Collectors | Id, then Name |
SurveyTemplates | Templates with their Definition | Id, then Name |
SurveyQuestionBanks | QuestionBanks with Questions | Id, then Name; questions by id, then SourceIdentifier |
SurveyResponses | Responses (opt-in, personal data) | Id |
SurveyOverrides | Accommodations, people by user name | Id |
SurveyInvitations | Invitations, token hashes only (import before SurveyResponses) | Id |
Deployment steps: Surveys, Survey Templates, Question Banks, Survey Responses, Survey Accommodations, Survey Invitations. The responses, invitations and accommodations steps write records only for a user with Export survey responses with respondent identity.
{
"steps": [
{
"name": "Surveys",
"Surveys": [
{
"Name": "event-feedback",
"Title": "Event feedback",
"Kind": "Survey",
"Status": "Open",
"OwnerUserName": "admin",
"Draft": {
"Title": "How was the event?",
"Pages": [
{
"Id": "4fna3nztjphx3vvktbfk2pa12v",
"Name": "page_1",
"Questions": [
{
"Id": "4dfhbt1zbets75mz7j6b1bhkz8",
"Name": "q_nps",
"ControlType": "Rating",
"Title": "How likely are you to recommend this event?",
"Required": true,
"Settings": { "Min": 0, "Max": 10, "Style": "Numbers" }
},
{
"Id": "4qy7k3m1c2x9v8b6n5t4r3e2w1",
"Name": "q_comments",
"ControlType": "LongText",
"Title": "What should we change?"
}
]
}
],
"Endings": [
{ "Id": "4k2c3szmm1twwgd96qe16wnzr1", "Name": "thanks", "Title": "Thank you", "Outcome": "Completed", "IsDefault": true }
]
},
"Access": { "Audience": "Anyone", "Anonymity": "Anonymous", "MinimumGroupSize": 5 },
"Collectors": [
{ "Name": "Public link", "Kind": "WebLink", "IsDefault": true }
]
}
]
}
]
}
A survey imported with only a Draft stays unpublished; add Versions and PublishedVersionNumber to publish (see the quiz sample in recipes and integrations). Tokens and password hashes travel only with Include secrets; the anonymity secret never travels.
| Area | What it adds |
|---|---|
| Events | Survey Response Started, Survey Page Completed, Survey Response Completed, Survey Response Screened Out, Survey Response Abandoned, Survey Response Needs Grading, Survey Response Graded, Survey Response Passed, Survey Response Failed, Survey Response Score Changed, Survey Response Matches Condition, Survey Published, Survey Closed, Survey Quota Reached |
| Tasks | Create Survey Link, Send Survey Invitation, Close Survey, Open Survey, Void Survey Response, Regrade Survey Response, Grant Survey Accommodation, Set Survey Response Property |
| Webhooks | survey.published, survey.response.completed, survey.response.graded |
| Notifications | SurveyResponseGraded, SurveyNeedsGrading; Invitations add SurveyInvitation, SurveyReminder |
| Data source | Surveys with Surveys, SurveyVersions, SurveyQuestions, SurveyResponses, SurveyAnswers, SurveyCategoryScores, SurveyPageVisits, SurveyInvitations and one wide SurveyResponses_{surveyName} per published survey |
| AI tools (Surveys AI) | list_surveys, get_survey_results, create_survey_draft (saves a draft, never publishes) |
Inputs, the API and the data sets are in recipes and integrations.
Registration (Surveys.Abstractions) | Contract | For |
|---|---|---|
AddSurveyControl<T>(name, configure) | ISurveyControlHandler | A question type |
AddSurveyControlScorer<T>(), AddSurveyControlAnalyzer<T>(), AddSurveyControlPreset(name, baseControl, configure) | ISurveyControlScorer, ISurveyControlAnalyzer | Scoring, results summaries, presets such as NPS |
AddSurveyAccessRule<T>() | ISurveyAccessRule | Allowing a start, resume or completion |
AddSurveyResponseObserver<T>(), AddSurveyObserver<T>() | ISurveyResponseObserver, ISurveyObserver | Response and survey events |
AddSurveyGradingScope<T>(), AddSurveyAccessProvider<T>() | ISurveyGradingScope, ISurveyAccessProvider | Granting grading or operations on some surveys |
AddSurveyContextKind(kind, displayName[, identifiesRespondent]), AddSurveyContextOwnershipCheck<T>(), AddSurveyContextKindGradingQueue(kind) | Record kinds responses belong to | |
AddSurveyConditionSourceProvider<T>(), AddSurveyResponseFieldProvider<T>(), AddSurveyTemplateProvider<T>(), AddSurveyImportFormat<T>(), AddSurveyDefinitionValidationContributor<T>(), AddSurveyOwnerLinkProvider<T>(), AddSurveyScoreChangeCheck<T>() | context:{key} sources, data set fields, templates, bank file formats, publish checks, "Back to" links, grade-change checks | |
AddSurveyEndingRenderer<T>(), AddSurveyInvitationRecipientPolicy<T>() (Surveys.Core) | Ending rendering, invitation opt-outs |
using CrestApps.OrchardCore.Surveys.Services;
using Microsoft.Extensions.Logging;
public sealed class TicketSurveyObserver : ISurveyResponseObserver
{
private readonly ILogger _logger;
public TicketSurveyObserver(ILogger<TicketSurveyObserver> logger)
{
_logger = logger;
}
public Task CompletedAsync(SurveyResponseEventContext context)
{
// Runs after the response is saved. Skip test responses and other contexts.
if (context.Response.IsTest || context.Response.Context?.Kind != "Ticket")
{
return Task.CompletedTask;
}
_logger.LogInformation("Ticket {TicketId} got survey response {ResponseId} scoring {Percent}%.",
context.Response.Context.Value.Id, context.Response.ItemId, context.Response.Percent);
return Task.CompletedTask;
}
}
// Startup:
// services.AddSurveyContextKind("Ticket", LocalizationSource.Create("Ticket", typeof(Startup)));
// services.AddSurveyResponseObserver<TicketSurveyObserver>();
using CrestApps.OrchardCore.Surveys;
using CrestApps.OrchardCore.Surveys.Services;
public sealed class WeekdayAccessRule : ISurveyAccessRule
{
public string Name => "Weekday";
// Built-in rules use 100 to 1000; run after the audience check.
public int Order => 420;
public Task<SurveyAccessDecision> CheckStartAsync(SurveyAccessContext context)
{
if (!context.Survey.Tags.Contains("weekdays-only"))
{
return Task.FromResult(SurveyAccessDecision.Allow);
}
var day = DateTime.UtcNow.DayOfWeek;
return Task.FromResult(day is DayOfWeek.Saturday or DayOfWeek.Sunday
? SurveyAccessDecision.Deny(SurveyErrorCode.NotAvailableNow, "This survey is open on weekdays only.")
: SurveyAccessDecision.Allow);
}
}
// Startup: services.AddSurveyAccessRule<WeekdayAccessRule>();
invalid-formula-source, rating-nps-scale, edit-after-review (score or key shown while finished responses can be changed) and ending-liquid.SurveyControl.Respond-Acme.Thumbs.cshtml; name it SurveyControl-Acme.Thumbs.Respond.cshtml.Related skills: orchardcore-learning, orchardcore-learning-assessments, orchardcore-report-builder, orchardcore-reports, orchardcore-outreach, orchardcore-workflows, orchardcore-crestapps-recipes, orchardcore-ai-tools.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/crestapps-orchardcore:orchardcore-surveysfrom crestapps-orchardcore
npx claudepluginhub crestapps/crestapps.agentskills --plugin crestapps-orchardcore137 skills in this plugin
/orchardcore-accountsSkill for the CrestApps Orchard Core Accounts module (CrestApps.OrchardCore.Accounts) with its Account Members, Account Team, Account E-mail Domains and Account Locations features. Covers the Account type and AccountPart, the account picker and search, IAccountChildTypeRule, account page sections (AccountPageTabs, AddPageSection, Notes), members and IAccountMemberService, account invitations, the account owner and team picked from staff, e-mail domains, locations with a billing location, the account's billing profile and party members, the Accounts recipe and deployment steps, and the admin menu. Use this skill when requests mention accounts, the businesses or households records belong to, an account page tab, members, invitations, owners, domains or locations. Strong matches include AccountPart, AccountPageTabs, IAccountMemberService, IAccountInvitationService, AccountInvitation, AccountTeamPart, AccountEmailDomainsPart, IAccountEmailDomains, AccountLocationsPart and ManageAccountMembers./orchardcore-accounts-b2bSkill for the CrestApps Orchard Core Accounts B2B module (CrestApps.OrchardCore.Accounts.B2B), business selling on an Account content item. Covers B2BAccountPart and B2BAccount, buyers as account members and ship-to addresses as account locations, terms (deposit, net days, credit limit) through the account-terms tender billed to the account, the account's billing profile, purchase order numbers, quotes, price lists through IBuyerPriceProvider, order limits, approvals and budgets, OCI punchout, the account/business page and API, the PriceLists recipe and deployment steps, the B2BAccounts report source, and the move from the removed Companies module. Use this skill when requests mention B2B, wholesale or business buyers, net terms, purchase orders, price lists, order approvals or punchout. Strong matches include B2BAccountPart, B2BAccount, AccountTerms, AccountTermsTenderProvider, B2BAccountBillingProfileSource, IB2BAccountStore, PriceList, B2BPriceProvider, B2BApprovalService and ManageB2BAccounts.Other plugins' skills for the same job