Quiz randomization: possible to exclude fields?

By: Margriet Bleeker | Asked: 07/30/2023
ForumsCategory: General questionsQuiz randomization: possible to exclude fields?
Margriet Bleeker asked 1 year ago
Hi, I've made a long personality questionnare, with summaryscores per 10 questions. I would like to exclude some of the fields (name / email / summary scores) from the randomization. Is this possible? I've tried to use a section and page end, but that doesn't work out. And if I'm reading the support well, it isn't possible? Thanks for helping, Margriet
Felipe Drago replied 12 months ago

<p>add_filter('frm_get_paged_fields', 'randomize_field_responses', 10, 3); function randomize_field_responses($fields, $form_id, $error = false) { if ($form_id == 25) { // Change 25 to your form ID foreach ($fields as &$field) { if ($field->type == 'select' || $field->type == 'checkbox') { // Make sure it is a multiple select field if ($field->id != 42) { // Change 42 to the ID of the field you do not want to randomize shuffle($field->options); } } } } return $fields; }</p>

1 Answers
Victor Font answered 1 year ago
The Quiz Maker add-on has 15 filters available to developers. Only 4 are documented in the Formidable KnowledgeBase. If you're comfortable looking through source code, there is an undocumented filter named frm_quizzes_not_randomized_field_types. This filter may work for you, but since it is undocumented, you'll need to figure out how to use it. Here's the list of all filters in the Quiz Make add-on: https://formidable-masterminds.com/codexv2-filter-list/?header_id=3638
Margriet Bleeker replied 1 year ago

Thanks Victor, I'm not quite comfortable with source code, but I know my way around it. Thanks, this does help.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right