Custom Branching Quiz
Wordpres plugin - quiz step form building
by Your Name · github.com/goodfriendjob/wordpress_quiz_plugin
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/goodfriendjob/wordpress_quiz_plugin/archive/refs/heads/main.zipCustom Branching Quiz Plugin - Multi-Quiz Support
Overview
This WordPress plugin now supports multiple quiz forms with different questions, branching logic, and redirect rules.
Usage
Shortcode Syntax
To display different quizzes on your WordPress pages, use the following shortcodes:
Quiz 1 (Original Case Calculator):
[custom_quiz]
or
[custom_quiz name="quiz1"]
Quiz 2 (Settlement Calculator):
[custom_quiz name="quiz2"]
Quiz 3 (Good Case Calculator):
[custom_quiz name="quiz3"]
Available Quizzes
Quiz 1: Case Calculator
- Original quiz with 5-6 questions about injury cases
- Redirects to various CVR pages based on injury severity and medical bills
- Sends leads to ActiveCampaign with tag "Quiz Lead"
- Email subject: "New Case Calculator Quiz Lead"
Quiz 2: Settlement Calculator
- 6-7 questions specifically for settlement calculation
- Smart branching: Work Injury goes to Q3, others go to Q2
- Enhanced opt-in form with Attorney-Client Privilege notice
- Redirects based on fault determination, injury severity, and medical bills
- Sends leads to ActiveCampaign with tag "Settlement Calculator 2-21"
- Email subject: "Settlement Calculator Lead"
Quiz 3: Good Case Calculator
- 6-7 questions to evaluate case quality
- Smart branching: Work Injury goes to Q3, others go to Q2
- Includes question about who injured the claimant (defendant's resources)
- Enhanced opt-in form with Attorney-Client Privilege notice
- Redirects based on fault, injury severity, and defendant's ability to pay
- Sends leads to ActiveCampaign with tag "Good Case Quiz"
- Email subject: "Good Case Calculator Lead"
Quiz 2 Redirect Logic
The Settlement Calculator uses priority-based redirect logic:
- CVR1 (Real Challenge): If fault is "My Fault" OR not on the clock
- CVR2 ($1M or more): Very serious injury/death OR medical bills over $350,000
- CVR3 ($300K-$600K): Serious injury with surgery OR medical bills $100,001-$350,000
- CVR4 ($100K-$300K): Medical bills $30,001-$100,000
- CVR5 ($60K-$100K): Medical bills $7,501-$30,000
- CVR6 ($15K-$60K): Medical bills under $7,500
Quiz 3 Redirect Logic
The Good Case Calculator uses priority-based redirect logic:
- GCR1 (Real Challenge): If fault is "My Fault" OR not on the clock OR defendant has no insurance
- GCR2 (Premium Case): If (injury is very serious/death OR little care) AND defendant is big corporation/rich person with excellent insurance
- GCR4 (Good Case): If serious injury with medical care/injections/surgery
- GCR3 (Moderate Case): All other cases
Question Flow - Quiz 2
Question 1: How Did You Get Injured?
- Car/Motorcycle/Truck/Bus Crash → Q2
- Work Injury → Q3
- Medical Mistake or Nursing Home Injury → Q2
- Other (Dog Bite, Bar Fight, etc.) → Q2
Question 2: Whose Fault Was It?
- Someone Else's Fault → Q4
- My Fault → Q4
- A Combination of My Fault and Other(s) → Q4
Question 3: Were you an Employee "On the Clock"?
- Yes → Q4
- No → Q4
Question 4: How Big Are Your Injuries?
- Very Serious Permanent Injury or Death → Q5
- Serious Injury with Medical Care/Injections/Surgery → Q5
- Injury With Medical Care → Q5
- Injury With Little or No Medical Care → Q5
Question 5: How Big Are Your Medical Bills?
- Under $7,500 → Q6
- $7,501 to $30,000 → Q6
- $30,001 to $100,000 → Q6
- $100,001 to $350,000 → Q6
- Over $350,000 → Q6
Question 6: Were You Injured In Illinois & Do You Have A Lawyer?
- In Illinois & No Lawyer → Submit Form
- In Illinois & I Have a Lawyer → Submit Form
- Outside of Illinois & No Lawyer → Submit Form
- Outside of Illinois & I Have a Lawyer → Submit Form
Question 7: Opt-in Form
Collects Name, Email, and Phone with Attorney-Client Privilege notice
Question Flow - Quiz 3
Question 1: How Did You Get Injured?
- Car/Motorcycle/Truck/Bus Crash → Q2
- Work Injury → Q3
- Medical Mistake or Nursing Home Injury → Q2
- Other (Dog Bite, Bar Fight, etc.) → Q2
Question 2: Whose Fault Was It?
- Someone Else's Fault → Q4
- My Fault → Q4
- A Combination of My Fault and Other(s) → Q4
Question 3: Were you an Employee "On the Clock"?
- Yes → Q4
- No → Q4
Question 4: How Big Are Your Injuries?
- Very Serious Permanent Injury or Death → Q5
- Serious Injury with Medical Care/Injections/Surgery → Q5
- Injury With Medical Care → Q5
- Injury With Little or No Medical Care → Q5
Question 5: I Got Injured By…
- A Big Corporation → Q6
- A Rich Person With Excellent Insurance → Q6
- Someone With Good Insurance → Q6
- Someone With Bad Insurance → Q6
- An Unemployed Person With No Insurance → Q6
Question 6: Were You Injured In Illinois & Do You Have A Lawyer?
- In Illinois & No Lawyer → Submit Form
- In Illinois & I Have a Lawyer → Submit Form
- Outside of Illinois & No Lawyer → Submit Form
- Outside of Illinois & I Have a Lawyer → Submit Form
Question 7: Opt-in Form
Collects Name, Email, and Phone with Attorney-Client Privilege notice
Email Notifications
All quiz submissions send an email to calls@desalvolaw.com with:
- Quiz type (quiz1, quiz2, or quiz3)
- Contact information (name, email, phone)
- Complete question and answer history
ActiveCampaign Integration
The plugin integrates with ActiveCampaign:
- Quiz 1: Tagged as "Quiz Lead"
- Quiz 2: Tagged as "Settlement Calculator 2-21"
- Quiz 3: Tagged as "Good Case Quiz"
File Structure
wordpress_quiz_plugin/
├── custom-branching-quiz.php # Main plugin file
├── data/
│ ├── questions.json # Quiz 1 questions
│ ├── questions-quiz2.json # Quiz 2 questions
│ └── questions-quiz3.json # Quiz 3 questions
├── js/
│ └── quiz-logic.js # JavaScript logic for all quizzes
├── css/
│ └── quiz-style.css # Shared styling
└── img/
└── template-img-4-1.jpg # Background image
Adding More Quizzes
To add a new quiz (e.g., quiz4):
- Create
data/questions-quiz4.jsonwith the question structure - Add the quiz data to the
cbq_enqueue_assets()function incustom-branching-quiz.php - Add a new redirect function like
cbq_generate_results_quiz4() - Update the
cbq_submit_results()function to handle quiz4 - Use shortcode:
[custom_quiz name="quiz4"]
Notes
- All quizzes share the same styling (quiz-style.css)
- The JavaScript automatically detects which quiz to load based on the shortcode parameter
- SSL encryption and Attorney-Client Privilege protection is mentioned for Quiz 2 and Quiz 3
- Quiz 1 uses the original opt-in message style
- Quiz 2 and Quiz 3 use enhanced opt-in forms with legal protection notices