Survey System
Ever Works includes a powerful survey system for creating interactive assessments, quizzes, and tests.
Overviewβ
The survey system provides:
- π Dynamic surveys - Create custom surveys and quizzes
- π― Item integration - Attach surveys to directory items
- π Conditional display - Control when and how surveys appear
- π SurveyJS integration - Powerful survey rendering engine
- π¨ Customizable CTAs - Flexible call-to-action buttons
Architectureβ
Configurationβ
Item YAML Fieldsβ
1. action (optional)β
Defines the type of CTA (Call To Action) to display for the item.
Possible values:
visit-website(default): Displays "Visit Website" buttonstart-survey: Displays "Start Survey" button that launches the first surveybuy: Placeholder for future purchase system (currently disabled)
Example:
action: "start-survey"
2. showSurveys (optional)β
Controls the display of the Surveys section on the item page.
Possible values:
true(default): Displays the Surveys section if surveys are availablefalse: Completely hides the Surveys section even if surveys are defined
Example:
showSurveys: false
3. publisher (optional)β
Name of the item's publisher. If defined, will be displayed in the right column.
Example:
publisher: "Ever Works"
Complete Exampleβ
IQ Test Itemβ
name: IQ Test
description: Discover your intelligence quotient with our comprehensive IQ test. This scientifically validated assessment measures various cognitive abilities including logical reasoning, pattern recognition, and problem-solving skills.
source_url: https://example.com
category: tests
tags:
- iq
- intelligence
- assessment
action: "start-survey"
showSurveys: true
publisher: "Ever Works"
updated_at: 2025-01-15 10:00
Personality Test Itemβ
name: Personality Test
description: Discover your personality type with our comprehensive assessment based on the Big Five personality traits.
category: tests
tags:
- personality
- psychology
- assessment
action: "start-survey"
showSurveys: true
publisher: "Ever Works"
updated_at: 2025-01-15 10:00
Conditional Displayβ
The following blocks are automatically hidden if they are empty or undefined:
Right Column Blocksβ
- Publisher: Displayed only if
publisheris defined in the YAML - Website: Displayed only if
source_urlexists and is valid - Categories: Displayed only if a category is defined
- Tags: Displayed only if there is at least one tag
- Similar products: Displayed only if similar items exist
"Start Survey" CTA Behaviorβ
When action: "start-survey" is defined:
- The
ItemCTAButtoncomponent automatically loads the first published survey attached to the item - On clicking the "Start Survey" button, the survey opens in a modal (
SurveyDialog) - The survey uses SurveyJS for rendering
- After submission, a success message is displayed
Prerequisites for "Start Survey"β
- The item must have at least one created and published survey
- The survey must be of type
itemand associated with the item viaitemId - The survey must be in published state
Usage Examplesβ
Basic Survey Itemβ
name: Quick Quiz
description: Test your knowledge with this quick quiz
action: "start-survey"
showSurveys: true
category: quizzes
tags: [quiz, knowledge]
Item with Website Linkβ
name: External Assessment
description: Complete this assessment on our partner site
source_url: https://partner.com/assessment
action: "visit-website"
showSurveys: false
category: assessments
Item with Hidden Surveys Sectionβ
name: Simple Test
description: A simple test without survey listing
action: "start-survey"
showSurveys: false # Hides the surveys section
category: tests
Component Integrationβ
ItemCTAButton Componentβ
The ItemCTAButton component handles the CTA logic:
// Automatically detects action type
<ItemCTAButton
item={item}
surveys={surveys}
/>
Behavior:
- If
action: "start-survey": Shows "Start Survey" button - If
action: "visit-website": Shows "Visit Website" button - Loads first published survey when "Start Survey" is clicked
SurveyDialog Componentβ
The SurveyDialog component renders the survey modal:
<SurveyDialog
survey={survey}
open={isOpen}
onOpenChange={setIsOpen}
/>
Features:
- SurveyJS integration
- Responsive design
- Success message on submission
- Error handling
Best Practicesβ
1. Survey Designβ
- Keep surveys concise and focused
- Use clear, simple language
- Provide progress indicators
- Include validation for required fields
2. Item Configurationβ
- Always provide a clear description
- Use relevant tags for discoverability
- Set appropriate action type
- Include publisher information when applicable
3. User Experienceβ
- Test surveys before publishing
- Ensure mobile responsiveness
- Provide clear instructions
- Show estimated completion time
4. Content Organizationβ
- Group similar tests in categories
- Use consistent naming conventions
- Maintain up-to-date content
- Archive outdated surveys
Troubleshootingβ
Survey Not Loadingβ
Issue: "Start Survey" button doesn't work
Solution: Verify prerequisites
- Check that survey exists and is published
- Verify survey is associated with the item
- Check browser console for errors
CTA Button Not Showingβ
Issue: No CTA button appears on item page
Solution: Check YAML configuration
# Ensure action is defined
action: "start-survey"
Surveys Section Hiddenβ
Issue: Surveys section doesn't appear
Solution: Check showSurveys field
# Ensure showSurveys is true or omitted
showSurveys: true
Advanced Configurationβ
Custom Survey Typesβ
You can create different survey types for different purposes:
- IQ Tests: Cognitive ability assessments
- Personality Tests: Personality trait evaluations
- Knowledge Quizzes: Subject-specific quizzes
- Feedback Forms: User feedback collection
- Assessments: Skill or competency evaluations
Survey Metadataβ
Include metadata in your survey configuration:
{
type: "item",
itemId: "iq-test",
published: true,
estimatedTime: "15 minutes",
difficulty: "medium",
questions: 30
}
Next Stepsβ
- Customization - General customization guide
- Development - Set up your development environment
- Admin Dashboard - Manage directory content