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

JavaScript Radio Choice Variable Values

New Here ,
Nov 21, 2017 Nov 21, 2017

Copy link to clipboard

Copied

Newbie.

Looking to add a calculations tool on my form that will fill various fields.

This is an evaluation form that asks multiple questions, and the responses either gives you a best answer, good answer, or wrong answer with a value assigned to each response. The form has a total of 48 Groups. Each group contains either 2 or 3 selections (some sections have just a right or wrong answer). I have named each group the same to allow only 1 selection per group. (i.e. Group1, Group2, etc.). I have assigned a Choice value to each with some questions having more weight than others (values 5,4,3,2,1, or 0). Points would be awarded depending on the question and best-worst answer (worst always being 0). No question will have more than a value of 5 for the best response. Lastly, each question group has an "N/A" block that would void the points from that question if the evaluator deemed it not required.

Example (made up): How do you change a tire? Response could be Answer 1 that is a step by step instruction (best =3). Answer 2 is call AAA (good =2). Answer 3, they have no clue (wrong =0) or this question will not be graded (N/A).

I need a block that can:

#1. Count the best score possible based upon the highest points per question (adjusted if N/A is selected)

#2. Count the overall score (total points) from the selections in each group. This will then be a simple calculation to a % block. (Score/Total)

#3. Auto fill a "Pass" (in green) block if the score is >= 75% and "Fail" if the score is < 75%.

Any suggestions are helpful because I don't have a clue how to accomplish! Thanks!

TOPICS
Acrobat SDK and JavaScript , Windows

Views

460

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

correct answers 1 Correct answer

Community Expert , Jan 09, 2018 Jan 09, 2018

You have a lot of work to do.  Pretty much everything you've described is doable with Acrobat JavaScript. But you'll need to either learn quite a bit about scripting, or hire someone to do it for you. You'll find plenty of information on radio buttons and form on this forum, just search for "Radio Button" and you'll get plenty.

Here are some articles on scripting and calculations:

https://acrobatusers.com/tutorials/how-to-do-not-so-simple-form-calculations

https://acrobatusers.com/tutorials/conditional-execution

https://acrobatusers.com/tutorials/entering-scripts-for-form-fields

JavaScript in Acrobat and PDF - YouTube

Learning to Program JavaScript for Adobe Acrobat - KHKonsulting LLC

...

Votes

Translate

Translate
Community Expert ,
Jan 09, 2018 Jan 09, 2018

Copy link to clipboard

Copied

LATEST

You have a lot of work to do.  Pretty much everything you've described is doable with Acrobat JavaScript. But you'll need to either learn quite a bit about scripting, or hire someone to do it for you. You'll find plenty of information on radio buttons and form on this forum, just search for "Radio Button" and you'll get plenty.

Here are some articles on scripting and calculations:

https://acrobatusers.com/tutorials/how-to-do-not-so-simple-form-calculations

https://acrobatusers.com/tutorials/conditional-execution

https://acrobatusers.com/tutorials/entering-scripts-for-form-fields

JavaScript in Acrobat and PDF - YouTube

Learning to Program JavaScript for Adobe Acrobat - KHKonsulting LLC

Calculating field values and more

That last one is a subscription site, and it does have an example quiz PDF that is very similar to what you've described.

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