TOPIC:

Calculating Radio Values 2 years 6 months ago #247604

  • Topic Author
  • thcinc
  • Offline
  • New Member
  • New Member
  • Registered
  • Posts: 18
  • Thanks: 0
Hi,
I am trying to setup an assessment style quiz. The questionnaire has sections with questions that the values need to be calculated for each section and a total for all sections/questions.
For instance, each question's radio answers are ranked, not necessarily right or wrong but scored.
We want the scores tallied for each section, if possible, and a total score for the assessment/quiz.
Has anyone written a script for these calculations? If so, can you point me to it?
Thanks a bunch for your help.

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

Calculating Radio Values 2 years 6 months ago #247610

  • Topic Author
  • thcinc
  • Offline
  • New Member
  • New Member
  • Registered
  • Posts: 18
  • Thanks: 0
nevermind...finally found the sample form. =/

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

Calculating Radio Values 2 years 6 months ago #247613

  • Topic Author
  • thcinc
  • Offline
  • New Member
  • New Member
  • Registered
  • Posts: 18
  • Thanks: 0
Hi,
I am pretty sure that I understand the script given for the sample form to calculate radio selects.
However, it leads me to this question... My form has 6 sections w/57 questions... Is this script the only/best to use for so many questions? If so, will having such a long action script repeated so many times bog things down? Or am i overlooking a simpler option?
Thanks a bunch for your help.

here is the sample code given for the first radio question on sample form. I have to copy all 50+ vals into each question's script?
function ff_radio1_action(element, action)
{
    switch (action) {
        case 'click':
           vals = '';
opts =  JQuery("[name=\"ff_nm_radio1[]\"]");
for (o = 0; o < opts.length; o++)
 if (opts[o].checked) {
  
   vals = opts[o].value;
 }
          vals1 = '';
opts =  JQuery("[name=\"ff_nm_radio2[]\"]");
for (o = 0; o < opts.length; o++)
 if (opts[o].checked) {
  
   vals1 = opts[o].value;
 }

ff_getElementByName('amount').value=Number(vals)+Number(vals1);

            break;
        default:;
    } // switch
} // ff_radio1_action

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

Calculating Radio Values 2 years 6 months ago #247626

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Registered
  • Posts: 12079
  • Thanks: 780
Hi,

I create a small example that might help to you

File Attachment:

File Name: example_quiz0209.zip
File Size:7 KB

Please download, unzip and install it (BF->Configuration->Package Installer->select file->Install package)

Let me know if you need further assistance

Regards,
Tihana
Attachments:

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

Last edit: Post by tihana.krivic.

Calculating Radio Values 2 years 6 months ago #247771

  • Topic Author
  • thcinc
  • Offline
  • New Member
  • New Member
  • Registered
  • Posts: 18
  • Thanks: 0
Thanks for your help.
I have used that sample and created sum totals for each section/page of the form.
What would the line of code look like to create a total sum for all section's sums?
Hopefully that makes sense.. =/
Thanks again for all your help.

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

Calculating Radio Values 2 years 6 months ago #247781

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Registered
  • Posts: 12079
  • Thanks: 780
Hi,

you can do this on the same way.
I edited the example from the message above:

File Attachment:

File Name: example_radiocalc.zip
File Size:8 KB


Please download, unzip and install it.

Let me know if you need anything else

Regards,
Tihana
Attachments:

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

Time to create page: 0.054 seconds

Support Chat

Join our Discord chat and enter the Crosstec channels for live-support, chat forums and interact directly with the community!

After joining, please enter the Crosstec Area and use the #crosstec-support or #crosstec-general channels.

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

Subscribe to news and updates!

Special Offer

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!

Live Support Chat Opened!

Join our Discord chat here and enter the Crosstec channels to receive live support and talk directly to the team!