Random Survey Polls

By: Felipe Drago | Asked: 05/08/2023
ForumsCategory: How-toRandom Survey Polls
Felipe Drago asked 2 years ago

How to ask random questions from a survey? How to ask random questions from a survey? Each time the question is sent the questions are random.

2 Answers
Best Answer
Felipe Drago answered 1 year ago

add_filter('frm_get_paged_fields', 'randomize_field_responses', 10, 3);
 
function randomize_field_responses($fields, $form_id, $error = false) {
    if ($form_id == 25) { // Cambia 25 al ID de tu formulario
        foreach ($fields as &$field) {
            if ($field->type == 'select' || $field->type == 'checkbox') { // Asegúrate de que sea un campo de selección múltiple
                shuffle($field->options);
            }
        }
    }
    return $fields;
}

Victor Font Staff answered 2 years ago

You can randomize the field order: https://formidableforms.com/knowledgebase/frm_get_paged_fields/#sts=Randomize%20Field%20Order

Felipe Drago replied 1 year ago

<p>That is ok, but how to randomly choose responses in a survey, not field?</p>

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