Assessment Reports
Maps Fluent Forms quiz responses to dynamic report sections and surfaces personalized report content.
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/nicscott01/assessment-reports/archive/refs/heads/main.zipAssessment Reports maps Fluent Forms quiz submissions to dynamic report sections and optionally generates AI-personalized content blocks that can be merged into report content.
Features
- Custom post type for report sections and parent reports
- Fluent Forms submission mapping to section scores
- Shortcode rendering for report output
- AI personalization blocks with token replacement (e.g.
{ai.opening}) - Caches AI content per submission
Requirements
- WordPress
- Fluent Forms
- WP AI Client (for AI generation)
Core Flow
- A Fluent Forms submission is saved.
- Report sections are selected/scored and stored as submission meta.
- The report URL includes an entry hash.
- The report shortcode renders the parent report plus matched sections.
- If AI blocks exist, AI content is generated on first load and cached to submission meta.
Report Links & Hashes
- The report URL uses an entry hash.
- The code supports both:
?entry_hash=(Fluent Forms_entry_uid_hash)?entry=(Assessment Reports encoded hash)
Shortcode
Use [assessment_report] on a page to render a report based on the URL entry hash.
AI Personalization
- AI blocks are configured on parent report posts (Report Configuration > AI Personalization).
- Each block has a token name (e.g.
opening). - Use
{ai.opening}in report content or closing content. - Generated output is stored in submission meta under
ai_generated_content.
Helper Functions
Common helpers live in includes/helper-functions.php.
Notable helpers:
get_entry_field($field_name, $hash = null, $default = '')- Supports dot notation for nested values (e.g.
name.first).
- Supports dot notation for nested values (e.g.
get_ai_generated_content($key = null)- Fetches AI content for the current request via
$_GET['entry_hash'].
- Fetches AI content for the current request via
ar_get_ai_generated_content($entry_id)/ar_set_ai_generated_content($entry_id, $content)- Low-level AI content access by entry ID.
Development Notes
- AI generation is triggered on
template_redirectwhen viewing a singular report and an entry hash is present. - If AI content already exists for the entry, generation is skipped.
- The WP AI Client must be initialized on
init.
Troubleshooting
- If AI meta boxes do not render, confirm callbacks are public.
- If entry hashes fail to resolve, verify the URL parameter and submission hash storage.
- Check PHP error logs for
AR AI:debug lines during AI generation.