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.
Best Answer
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;
}
You can randomize the field order: https://formidableforms.com/knowledgebase/frm_get_paged_fields/#sts=Randomize%20Field%20Order
<p>That is ok, but how to randomly choose responses in a survey, not field?</p>
Please login or Register to submit your answer