How to add a rating scale with different weights

New Here ,
Apr 06, 2021 Apr 06, 2021

Copy link to clipboard

Copied

Hi I am looking on how to add rating scales with different weights to calculate a final score. 

 

I am trying to create fillable PDFs for people to complete performance evaluations on when they can't access our online system. 

 

In this scenario I have 8 questions and the questions have different weights for the final score. 

Question 1-5 and 7 have a 15% weight

Question 6 and 8 have a 5% weight

 

both the employee and manager will give a rating for each question which then gets calculated to an overall score. 

 

TOPICS
Create PDFs, Edit and convert PDFs, How to, PDF forms

Views

477

Likes

translate

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

Most Valuable Participant , Apr 07, 2021 Apr 07, 2021
OK, I see. Then assuming the fields are named Q1 to Q8 you can use this code as the custom calculation script of the total field (formatted as Percentage) to show the result:     var questionsData = [ {name: "Q1", rating: 0.15}, {name: "Q2", rating: 0.15}, {name: "Q3", rating: 0.15}, {name: "Q4", rating: 0.15}, {name: "Q5", rating: 0.15}, {name: "Q6", rating: 0.05}, {name: "Q7", rating: 0.15}, {name: "Q8", rating: 0.05}, ] var total = 0; for (var i in questionsData) { var f = this.getF...

Likes

translate

Translate

Translate
Most Valuable Participant ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

It's possible with a script. What kind of fields are they? Radio-buttons? Text fields? Drop-downs? Something else?

And where are the correct answers stored, if at all?

Likes

translate

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 ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

I should be more specific each question (more of a competency)  has a rating of 1-5 that the employee rates themselves on and then the manager also rates the employee from 1-5. 

Likes

translate

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 ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

I should be more specific each question (more of a competency)  has a rating of 1-5 that the employee rates themselves on and then the manager also rates the employee from 1-5. 

Likes

translate

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
Most Valuable Participant ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

OK, I see. Then assuming the fields are named Q1 to Q8 you can use this code as the custom calculation script of the total field (formatted as Percentage) to show the result:

 

 

var questionsData = [
	{name: "Q1", rating: 0.15},
	{name: "Q2", rating: 0.15},
	{name: "Q3", rating: 0.15},
	{name: "Q4", rating: 0.15},
	{name: "Q5", rating: 0.15},
	{name: "Q6", rating: 0.05},
	{name: "Q7", rating: 0.15},
	{name: "Q8", rating: 0.05},
]

var total = 0;
for (var i in questionsData) {
	var f = this.getField(questionsData[i].name);
	total+=(Number(f.valueAsString)/5 * questionsData[i].rating);
}
event.value = rating;

Edit: Code fixed thanks to Nesa

 

Likes

translate

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
Adobe Community Professional ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

Just to add, change Q6 and Q8 to 0.05 and in last line change 'rating' to 'total'.

Likes

translate

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 ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

How would I enter the 1-5 scale when it comes to each question. Just a drop down list? Would it calculate both the employee's ratings and manager's ratings?

Likes

translate

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
Most Valuable Participant ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

Yes, a drop-down list is probably the best option.

And yes, it will calculate a weighted total of all the ratings.

Likes

translate

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
Engaged ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

Last line is still wrong.

I belive OP wants separate field for employeers and managers, they both can't use same field to make ratings. 

Likes

translate

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
Most Valuable Participant ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

You're correct, and I fixed it. Thanks!

Likes

translate

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 ,
Apr 08, 2021 Apr 08, 2021

Copy link to clipboard

Copied

Thank you very much, can you have the old script up as well? I may only use the managers rating for the overall calculation and let the employee rate themselves through a drop down, but not have it affect the score. I apologize for switching up and appreciate the help. 

Likes

translate

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 ,
Apr 09, 2021 Apr 09, 2021

Copy link to clipboard

Copied

Also Im using this version of Adobe Acrobat and I don't see a calculate tab when going into the properties of the text box

 

HelpMePlease12_0-1617995485398.png

 

Likes

translate

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 ,
Apr 09, 2021 Apr 09, 2021

Copy link to clipboard

Copied

I found how to bring it in "revert to acrobat form" but it would help great if i can get the calculation from prior. I will no longer use the employee's rating to calculate the final overall score, it would just be the managers. same number of questions and weighting and using a drop down from 1-5. Thank you for the help so far. 

Likes

translate

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
Engaged ,
Apr 09, 2021 Apr 09, 2021

Copy link to clipboard

Copied

Did you try to use code try67 gave you?

Likes

translate

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 ,
Apr 09, 2021 Apr 09, 2021

Copy link to clipboard

Copied

I did and it failed. I believe its because he changed it since I requested it to calculate both the employees score from 1-5 and managers score from 1-5 to count for the overall score. 

 

I stand corrected, only the managers score should count. Therefore I am leaving the managers drop downs with the field names of Q1-Q8 like his code and will name the code for the employees code something else so it doesn't calculate it.  

 

The employee can rate themselves too so each question will have two drop downs next to it, but the employee's rating is just for show if that makes sense. Only the managers score should count at the end where I have a text field and using the calculate tab. Sorry for changing my requests many times and not having it set in stone before I posed the question. 

Likes

translate

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
Engaged ,
Apr 09, 2021 Apr 09, 2021

Copy link to clipboard

Copied

What exactly is failed? Code doesn't work at all or it calculate wrong?

Code should give you percentage of rating, did you format field as percentage?

Likes

translate

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 ,
Apr 09, 2021 Apr 09, 2021

Copy link to clipboard

Copied

I copied the code into the custom calculation script it opened as a "javascript editor"

 

HelpMePlease12_0-1618000340528.png

 

 

I then formatted as a percentage 

HelpMePlease12_1-1618000358816.png

 

 

I saved the form and opened it up and chose 4 for each of the rating fields labeled Q1-Q8 but the overall score was just showing as 0.00%. 

 

These are what the rating scales look like and they are defaulted to 1 because it's forcing me to chose a default. 

 

HelpMePlease12_2-1618000429138.png

 

 

 

Likes

translate

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
Engaged ,
Apr 09, 2021 Apr 09, 2021

Copy link to clipboard

Copied

I see, try reading last part of @Nesa Nurani  post above and see if that resolve issue.

Likes

translate

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 ,
Apr 09, 2021 Apr 09, 2021

Copy link to clipboard

Copied

oh man that worked. you guys are awesome. 

 

Just a couple things for the future

1) is there a way i don't have to elect a number in the drop down, and be able to leave it blank, so that overall score isn't preloaded with a percentage? 

2) for other job positions I may need to add questions. Would it be as simple as keeping everything the same and adjusting the rating weight and adding multiple lines for the extra questions? 

 

 I'm curious how this code was created in the first place. I would have never understood how to code it myself. Are there tutorials to learn this? This was a great help and appreciate going out the way everyone. 

Likes

translate

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