TOPIC:

Random or aleatory order 2 weeks 2 days ago #258053

  • Topic Author
  • rarroso
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 17
  • Thanks: 0
Hi experts.

I have a llitle issue to solve.

I create a form with questions from 1 to 12. I wondering if exist some code or option that let me show a random or aleatory order for that questions, or after i creati it i can "mix" that order and shows as 5, 1, 4, 7, 10, etc.

Hope you can help me.

Please Log in or Create an account to join the conversation.

Random or aleatory order 2 weeks 1 day ago #258056

  • Mirec's Avatar
  • Mirec
  • Away
  • Junior Breezer
  • Junior Breezer
  • Posts: 34
  • Karma: 1
  • Thanks: 1
Hello,

I did not understand well your question, could you please, give me more info on what exactly do you want? Then we will bring the best solution to your question.

regards!
Mirko

Please Log in or Create an account to join the conversation.

Random or aleatory order 2 weeks 1 day ago #258060

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 5361
  • Karma: 3
  • Thanks: 383
Hi,

I guess you create a quiz with questions using radio button group.
So you want to mix this radio buttons with questions? Am I right?

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Random or aleatory order 2 weeks 1 day ago #258069

  • Topic Author
  • rarroso
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 17
  • Thanks: 0
Hello again Tihana.

Yep. I create a quiz with questions with radio button group.

It shows questions in front end in order: 1 to 12.

I wondering if exist a posibility that questions appear in aleatory order. I mean 5, 1, 8, 10, etc.
Hope you can help me.

Please Log in or Create an account to join the conversation.

Random or aleatory order 2 weeks 1 day ago #258070

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 5361
  • Karma: 3
  • Thanks: 383
Hi,

please go to your form->Advanced->More options->Scripts->Initialization script->check Custom and put this:
function ff_nameofform_init()
{
  JQuery(document).ready(function() {
   var radioGrp = [];
   JQuery('label[id^="bfGroupLabel16915"]').each(function(){
     radioGrp.push(JQuery(this));
   });

  for( var i = 0; i < radioGrp.length; i++ ){
      var randomOrd = Math.floor(Math.random() * radioGrp.length);
      JQuery(radioGrp[i]).before( radioGrp[randomOrd] );
    } 
  });
} // ff_nameofform_init
Please replace nameofform with name for your form (not title), and
bfGroupLabel16915 with ID of radiogroup (right click to your browser->Inspect->and find in Console ID of radiobutton group).

Let me know if it works for you

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Random or aleatory order 2 weeks 1 day ago #258075

  • Topic Author
  • rarroso
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 17
  • Thanks: 0
Thank you Tihana but i´m in a dilema.

I dont know if radiogroup is "uno" or "dos" (images attached). if it´s "uno" i need to put all the radiogroups id´s?

Can you tell me how?

Than you so much
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.047 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!