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

How to add a rating scale with different weights

New Here ,
Apr 06, 2021 Apr 06, 2021

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
6.8K
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
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.getField(questionsData[i].name);
	total+=(Number(f.valueAsString)/5 * questionsData[i].rating);
}
event.value = rating;

Edit: Code fixed thanks to Nesa

 

View solution in original post

Translate
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 ,
Dec 03, 2021 Dec 03, 2021
LATEST

Looking to do an average of up to 3 fields. I'm able to do determine the value for 3, however, if only 2 have a value, I want it to average for 2, not 3. What formula do I need to use? I think it's an IF THEN statement, where IF would be null; but that's all I've got. As you can tell, I'm not a java user

Thanks COMMUNITY!

Translate
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