• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Score calculation in pdf form having check boxes

Participant ,
Jun 04, 2020 Jun 04, 2020

Copy link to clipboard

Copied

Hello, I have created a score form having check boxes. I can easily calculate total score by assigning values 1 2 3 to check boxes and by giving same names in same row to the check boxes. 

 

But how is this possible to calculate sub total score of each column separately. See picture

Score Form.png

 

TOPICS
Create PDFs , PDF forms

Views

2.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 04, 2020 Jun 04, 2020

Copy link to clipboard

Copied

You should structure the naming rule by column, as in this example that you should examine: https://documentcloud.adobe.com/link/track?uri=urn:aaid:scds:US:1c732995-09a8-4dc3-ab3b-661aa1d3f1ab

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 07, 2020 Jun 07, 2020

Copy link to clipboard

Copied

These look like Radio button groups. If this is true, then a script won't be able to identify the individual column fields by name. Instead you'll the script will need to count selected values.

 For example, lets say the radio button groups are named "Score1" thorough "Score10". The calculation script for the 0 column total would be this:

 

var nSum = 0, oFld;

for(var i=1;i<=10 ;i++)

{

    oFld = this.getField("Score" + i);

     if(oFld.value == 0)  nSum++;

}

event.value = nSum;

      

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 24, 2023 May 24, 2023

Copy link to clipboard

Copied

Hi Tom. I am creating some self-assessments in Adobe. I used Radio Buttons for the Selections. Do you know how I would be able to summarize the score by adding all choice 1's together, sum Choice 2's together, etc......?

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 24, 2023 May 24, 2023

Copy link to clipboard

Copied

What are the names of radio button groups?

Do you want to show all results in one field?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 25, 2023 May 25, 2023

Copy link to clipboard

Copied

LATEST

I would suggest that you first prefix the names of the radio button groups with a "group name". For example if the radio button groups are named "Question1", "Question2", etc. Then change them to "Assesment.Question1", "Assesment.Question2", etc.

Then if the export value of all choice 1's is "1", this code will create a sum for choice 1

Place this code in the custom calculation script of the field where the total for choice 1 will be shown. 

  

var aQuestionList = this.getField("Assesment").getArray();
var nSum = 0;
for(var i=0;i<aQuestionList.length;i++)
{
     if(aQuestionList[i].valueAsString == "1")
         nSum++;
}
event.value = nSum;

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines