feat(quizandsurveymaster): add Quiz And Survey Master (QSM) integration - #220
Open
RishadAlam wants to merge 8 commits into
Open
RishadAlam wants to merge 8 commits into
RishadAlam wants to merge 8 commits into
Conversation
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.
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Key Changes
Backend
QuizAndSurveyMasterController,RecordApiHelperand routes for 8 write actionsFrontend
0instead of leaving the plugin default to decideQuizAndSurveyMaster, since it rendersinte.name || inte.typeand the entry carried no nameField mapping
quiz_id,question_id,result_id) are field-map rows, so they can come from trigger data at run timeChecklist
Verification
Exercised against a live install with QSM 11.2.6:
1and0correctlypnpm buildpasses,eslintclean, PHP lint cleanNot covered: no screen has been rendered in a browser, and no saved flow has been run trigger-to-action inside the product.
Changelog