Skip to content

feat(quizandsurveymaster): add Quiz And Survey Master (QSM) integration - #220

Open
RishadAlam wants to merge 8 commits into
mainfrom
feat/quiz-and-survey-master-integration
Open

RishadAlam wants to merge 8 commits into
mainfrom
feat/quiz-and-survey-master-integration

Conversation

@RishadAlam

@RishadAlam RishadAlam commented Sep 6, 2026

Copy link
Copy Markdown
Member

Description

Adds the free half of the Quiz And Survey Master (QSM) integration: the action endpoint that maps fields and fires the Pro filters, the three-step wizard and edit screens, and the registrations that put QSM in the trigger and action pickers.

Motivation & Context

Pairs with the Pro PR that carries the handlers. The free plugin does no QSM work of its own — it maps the field values, fires one bit_integrations_quiz_and_survey_master_* filter per action, and logs the result so the Task Log has something to show when Pro is absent or an action fails.

Related Links: (if applicable)

Requires the Pro handlers; Bit-Pi carries the same integration separately:

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 📚 Documentation update
  • ⚡ Improvement
  • 🔄 Code refactor

Key Changes

Backend

  • Added QuizAndSurveyMasterController, RecordApiHelper and routes for 8 write actions
  • Added refresh routes for the themes and question-type dropdowns
  • Added QSM to the trigger name list
  • Fixed a flow with no action selected now fails instead of falling back to Create Quiz, which had it quietly creating quizzes on every run

Frontend

  • Added authorization step, field map, integration layout, utilities, wizard and edit screens
  • Added the QSM logo, and lazy imports plus cases in the new, edit and info screens and the action picker
  • Improvement yes/no utilities are plain checkboxes rather than a checkbox opening a modal holding a two-item select; unticking now stores an explicit 0 instead of leaving the plugin default to decide
  • Improvement the theme utility gained a refresh button beside its select
  • Fixed the action picker showed the raw type QuizAndSurveyMaster, since it renders inte.name || inte.type and the entry carried no name

Field mapping

  • Identifiers an action targets (quiz_id, question_id, result_id) are field-map rows, so they can come from trigger data at run time
  • Known option sets (question type, theme, yes/no switches) are selects, not mapped text

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Tests added/updated
  • Documentation updated if needed
  • README updated if needed

Verification

Exercised against a live install with QSM 11.2.6:

  • 45 assertions over all 8 actions through the real controller — unknown ids, empty required fields, custom field-map values, and database re-reads for answers, points, correct flags, hints, question settings and the page layout
  • 6 assertions that the boolean utilities store and apply 1 and 0 correctly
  • pnpm build passes, eslint clean, PHP lint clean

Not covered: no screen has been rendered in a browser, and no saved flow has been run trigger-to-action inside the product.

Changelog

  • New Integration: Quiz And Survey Master (QSM) as an action
  • New Actions: Create Quiz, Update Quiz Name, Duplicate Quiz, Delete Quiz, Create Question, Update Question, Delete Question, Delete Result
  • Improvement: yes/no options in Utilities are single checkboxes instead of a checkbox plus a modal

Controller, RecordApiHelper and routes for the Quiz And Survey Master
action. The free side does no work of its own: it maps the fields, then
fires one bit_integrations_quiz_and_survey_master_* filter per action
and logs whatever comes back, so the Task Log has something to show when
Pro is absent or an action fails.

Each case passes only the arguments its Pro handler reads, so the filter
signatures stay honest rather than padded to a common shape.

The three refresh routes feed the dropdowns: themes and question types
from the plugin, and the setting keys of a chosen settings section
collected from the quizzes already stored.
Registers Quiz And Survey Master in the trigger name list so the Pro
trigger appears in the picker.
Three-step wizard, edit screen and the field map for the nine actions,
plus the plugin's own icon as the integration logo.

What is mapped and what is picked follows one rule. The identifier of
the record an action targets is a field-map row, so it can come from
trigger data at run time: a hand-picked dropdown would tie the action to
one quiz for ever. Everything else that names a known set of values is a
select instead: the settings section and key, the question type, and the
themes and yes/no switches under Utilities.

Answers map as four sets of text, points and correct flag, since the
field map has no repeater.
Lazy imports and cases in the new, edit and info screens, and the entry
in the action list. Registered last so every component it points at
already exists.
Removes the Update Quiz Settings action: its switch case, the
setting-keys refresh route and controller method, the field map, and the
settings section and key dropdowns with their fetcher.

Leaves 8 actions.
Yes/no options were each a checkbox that opened a modal holding a
two-item Yes/No select, so turning one on took three clicks and the
checkbox state did not mean what it looked like. They are plain
checkboxes now, writing "1" or "0" straight to the utility.

Unchecking one used to leave the utility unset, which let the plugin
default decide. It now sends "0", so an unticked Required really does
store required = 0.

The Theme option keeps its modal, since it picks from a fetched list,
and gains a refresh button beside the select so the list can be
reloaded without leaving the dialog.

The Yes/No option list is gone with the selects that used it.
…ion is set

The dispatcher fell back to create_quiz when a flow carried no
mainAction, so a misconfigured flow quietly created quizzes on every
run. It now falls through to the default branch and reports that no
action was selected, which the task log records as an error.

This deviates from the FluentCart helper it was cloned from, which
still defaults to its first action.
…r (QSM)

The action picker renders `inte.name || inte.type`, and the entry
carried no name, so it read "QuizAndSurveyMaster" unspaced. It now
carries the label, as do the trigger list, the authorization step, the
field-map column and the default integration name.
Copilot AI lite review requested due to automatic review settings September 6, 2026 05:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants