Forums

Radio group points and summing

sylwekb 02 Aug, 2016
1. Multipage form on 10 pages, 199 questions, four answers to choose from, select the radio. One correct answer, 3 incorrect. Can you set the score at 1 point, 0 points for incorrect? How to do that at the end of the totaled results of all 199 questions? How does it perform?
2. Can I set depending on the amount of the scores assigned to any group name and send filling?
after obtaining the radio points in the field 0-49pkt by sending form. I got the e-mail message that goes to the group A1
after obtaining the radio points in the field 50-100pkt by sending form. I got the e-mail message that goes to the group A2
after obtaining the radio points in the field 101-149pkt by sending form. I got the e-mail message that enters the group A3
after obtaining the radio points in the field 150-199pkt by sending form. I got the e-mail message that goes to Grade A4
Such confirmation would like to fill received an e-mail. Understand? Is it possible?
3. The form is to be sent to the recipient and confirm to fill the form.
Is there a tutorial on how to do it?
GreyHead 02 Aug, 2016
Hi sylwekb,

Do you need the answers submitted or just the score?

If it's just the score then you could set the values to 0 + 1 then total up the submitted values.

If you need the answers then you can use a Custom Code action after the form submits to look up the correct answers and calculate the total.

As it is a multi-page form you can add an Email action in any of the intermediate events - that can use the form data submitted up to that page.

You can send an email to the User with the Dynamic settings in the Email action.

Bob







Bob
sylwekb 02 Aug, 2016
I need the answers Submitted and the score.
Is there an example of how to do it because it looks complicated?
GreyHead 02 Aug, 2016
Hi sylwekb,

Can you post an example set of questions? It's usually more helpful to give examples that use real form content.

It would need to include the radio button names and values.

Bob
sylwekb 02 Aug, 2016
Please look 2 from 199 Code radio groups.
Each radio Consists of four
How to assign value 1 points to the correct and incorrect 3 - 0 points?
How does it add up?
How to sum up and convey to send e-mail from multipage form all 199 question?

<div class="form-group gcore-form-row" id="form-row-radio1"><label for="radio1" class="control-label gcore-label-left gcore-label-checkbox">1. Jak masz ...... ?</label>
<div class="gcore-input gcore-display-table" id="fin-radio1"><div class="gcore-multiple-column" id="fclmn1"><div class="gcore-radio-item" id="fitem1"><input name="radio1" id="radio1" value="1" class="A" title="" style="" data-load-state="" data-tooltip="" type="radio" />
<label class="control-label gcore-label-checkbox" for="radio1">a) dobrze</label></div>
<div class="gcore-radio-item" id="fitem2"><input name="radio1" id="radio11" value="2" class="A" title="" style="" data-load-state="" data-tooltip="" type="radio" />
<label class="control-label gcore-label-checkbox" for="radio11">b) na imię</label></div>
<div class="gcore-radio-item" id="fitem3"><input name="radio1" id="radio12" value="3" class="A" title="" style="" data-load-state="" data-tooltip="" type="radio" />
<label class="control-label gcore-label-checkbox" for="radio12">c) nazywasz się</label></div>
<div class="gcore-radio-item" id="fitem4"><input name="radio1" id="radio13" value="4" class="A" title="" style="" data-load-state="" data-tooltip="" type="radio" />
<label class="control-label gcore-label-checkbox" for="radio13">d) lat</label></div></div></div></div>


<div class="form-group gcore-form-row" id="form-row-radio2"><label for="radio2" class="control-label gcore-label-left gcore-label-checkbox">2. ……jesteś?</label>
<div class="gcore-input gcore-display-table" id="fin-radio2"><div class="gcore-multiple-column" id="fclmn2"><div class="gcore-radio-item" id="fitem5"><input name="radio2" id="radio2" value="1" class="A" title="" style="" data-load-state="" data-tooltip="" type="radio" />
<label class="control-label gcore-label-checkbox" for="radio2">a) gdzie</label></div>
<div class="gcore-radio-item" id="fitem6"><input name="radio2" id="radio21" value="2" class="A" title="" style="" data-load-state="" data-tooltip="" type="radio" />
<label class="control-label gcore-label-checkbox" for="radio21">b) skąd</label></div>
<div class="gcore-radio-item" id="fitem7"><input name="radio2" id="radio22" value="3" class="A" title="" style="" data-load-state="" data-tooltip="" type="radio" />
<label class="control-label gcore-label-checkbox" for="radio22">c) dlaczego</label></div>
<div class="gcore-radio-item" id="fitem8"><input name="radio2" id="radio23" value="4" class="A" title="" style="" data-load-state="" data-tooltip="" type="radio" />
<label class="control-label gcore-label-checkbox" for="radio23">d) kto</label></div></div></div></div>
sylwekb 07 Aug, 2016
Bob, do you have any idea how to solve it?
GreyHead 07 Aug, 2016
Hi sylwekb,

When each page submits you are going to get results in the $form->data array like this:
$form->data['radio1'] = 3
$form->data['radio2'] = 2
$form->data['radio3'] = 1
. . .
You can use a Custom Code action to add up the results.
<?php
$score = 0;
if ( $form->data['radio1'] == 3 ) [
  $score++;
}
if ( $form->data['radio2'] == 1 ) [
  $score++;
}
if ( $form->data['radio3'] == 4 ) [
  $score++;
}
$form->data['score'] += $score;
?>
This is a rather messy way of handling the whole thing. It might be a lot easier to keep all the questions and answers in a separate file and load them as needed. That way of something changed you only need to edit that file and not ten custom code actions.

Bob
sylwekb 12 Aug, 2016
How to perform a summation points divided into individual pages multi page form? How to allocate to individual groups according to the following scenario? The result of a sum of points and assignment to groups such as eg. A 1,2

I have a test of 180 questions,

10 questions on the (form type multipage), 4 type radio response, always one correct answer, 3 incorrect.

How will the code assigned to the filling to the group based on the selected fields RADIO to the group and calculated the points together?

How could he look like the code? The following scenario:

Page 1 Test (questions 1-10) - the range of 0-5 points A0 group, the scope of points 6-10 group A1,1

Page 2 Test (questions 11-20) - the range of 0-5 points A1,1 group, the scope of points 6-10 group? A1,2

Page 3 Test (questions 21-30) - the range of 0-5 group? 1,2 points, the range of 6-10 points group? A1,3

Page 4 Test (questions 31-40) - the range of 0-5 group? 1,3 points, the range of 6-10 points group A2,1

Page 5 Test (questions 41-50) - the range of 0-5 points A2,1 group, the scope of points 6-10 group A2,2

Page 6 Test (questions 51-60) - the range of 0-5 points A2,2 group, the scope of points 6-10 group a2,3

Page 7 Test (questions 61-70) - the range of 0-5 points a2,3 group, the scope of points 6-10 group B1,1

Page 8 Test (questions 71-80) - the range of 0-5 points B1,1 group, the scope of points 6-10 group B1,2

Page 9 Test (questions 81-90) - the range of 0-5 points B1,2 group, the scope of points 6-10 group B1,3

Page 10 Test (91-100 questions) - the range of 0-5 points B1,3 group, the scope of points 6-10 group B2,1

Page 11 Test (101-110 question) - the range of 0-5 points B2,1 group, the scope of points 6-10 group B2,2

Page 12 Test (111-120 question) - the range of 0-5 points B2,2 group, the scope of points 6-10 group B2,3

Page 13 Test (121-130 question) - the range of 0-5 points B2,3 group, the scope of points 6-10 group B2,4

Page 14 Test (131-140 question) - the range of 0-5 points B2,4 group, the scope of points 6-10 group C1,1

Page 15 Test (141-150 question) - the range of 0-5 points C1,1 group, the scope of points 6-10 group C1,2

Page 16 Test (151-160 question) - the range of 0-5 points C1,2 group, the scope of points 6-10 group C1,3

Page 17 Test (161-170 question) - the range of 0-5 points C1,3 group, the scope of points 6-10 group C1,4

Page 18 Test (171-180 question) - the range of 0-5 points C1,4 group, the range of 6-10 points C2

Is it clearly described?
GreyHead 12 Aug, 2016
Hi sylwekb,

Please see my previous post - you need to repeat that for each page.

Bob
sylwekb 12 Aug, 2016
Thank You Bob

How do assign to the group on the basis of the sum of points obtained on the site? for example, page 1 the range of 0-5 points A0 group, the scope of points 6-10 group A1,1 and another by rozpiski above ?.
GreyHead 12 Aug, 2016
Hi sylwekb,

I have no idea what you mean by group or scope or rozpiski ???

If you want to assign to a group depending on the points it will be something like this:
<?php
if ( $form->data['points'] > 0 && $form->data['points'] < 6 ) {
  $form->data['group'] = 'A.0';
} else if ( $form->data['points'] > 5 && $form->data['points'] < 10 )
  $form->data['group'] = 'A.1.1';
}
?>

Bob
sylwekb 12 Aug, 2016
I'm sorry, to for Polish :-) rozpiski - that scenario described above.
Thank You
Greetings from Poland
sylwekb 12 Aug, 2016
If I understand you wrote a script for page 1 multipage forms?

For page 2 of the script should look like this:

    <?php
    if ( $form->data['points'] > 0 && $form->data['points'] < 6 ) {
      $form->data['group'] = 'A.1.1';
    } else if ( $form->data['points'] > 5 && $form->data['points'] < 10 )
      $form->data['group'] = 'A.1.2';
    }
    ?>


For page 3 of the script should look like this:

    <?php
    if ( $form->data['points'] > 0 && $form->data['points'] < 6 ) {
      $form->data['group'] = 'A.1.3';
    } else if ( $form->data['points'] > 5 && $form->data['points'] < 10 )
      $form->data['group'] = 'A.1.4';
    }
    ?>


and subsequent alike?

And another very important question. How do I insert the page points and total points and the assigned group eg A 1.1 to e-mail message for sending?
sylwekb 12 Aug, 2016
How to set points (values) for radio?
I would like to have 3 replies 0 points and only one 1 point.
ChronoForms not accept the following as value (points). I think it was wrong to do?
How correctly?

0=a) Good
1=b) Very Good
0=c) Warszaw.
0=d) Thank You.
GreyHead 12 Aug, 2016
Hi sylwekb,

Normally you don't want the 'correct' answers to be visible in the form HTML so I would add them in Custom Code after the page submits (you could load them from a file or a database table if that helps).

See my earlier post for an example.

Bob
This topic is locked and no more replies can be posted.