I have designed a 5 question survey that has multiple subparts to each question. The use checks a Yes or No Check box for each subpart and i have built if/then statements that yield, for each question, a text outcome (Outcome 1 or Outcome 2).
I want to create an overall scoring for the survey. I was thinking of assigning a value of 10 to each Outcome 1 and -10 to Outcome 2. Then i would tally the numeric scores of all five questions. If the total score >0, then combined answer to the five questions will be Outcome 1. if the score is <0, then the result would be Outcome 2.
The checkbox javascript already is functional, producing the right outcomes for each individual question. i am not sure how best to assign a numerical value to the outcome field to add the five scores together. All fields are in a table.
I thought about using a hidden numerical field (score) to capture a value based on Outcome 1 or Outcome 2
In this code, "subrecipient" is outcome 1 and subcontractor is outcome 2.
A relative rookie at javascript and I am not married to this approach and was hoping the better minds of this forum could provide advice on the immediate issue and then on how to add the five question score fields (although i think i can add table fields in formcalc - suggestions/code examples appreciated.
Solved! Go to Solution.
Views
Replies
Total Likes
There was a number of errors in the Score1 calculate event
This works now after these changes. This circled button is for checking the code. It can be handy to find which line errors are on. Also pressing CTRL+J after previewing the file will show any javascript errors and what line they are on as well.
Javascript Debugger - the highlighted number is the line number in the event code.
Views
Replies
Total Likes
I have used hidden fields before for calculations, global variables dont always work how i want.
You would just need to do something like (javascript) - numericField1.rawValue = numericField1.rawValue +10;
Or something like that. To keep a running total, you add (or subtract) the current field total to the 10 points.
Views
Replies
Total Likes
Thanks for the replay.
The hidden numeric field is Score 1 in Row 11 in the table1. The field at present is not hidden for testing purposes. I tried to take your suggestion but the code is not working. Any chance you can figure out what is wrong?
The file is attached.
Dropbox - Subcontractor Determination Checklist2.pdf
Thanks.
Views
Replies
Total Likes
There was a number of errors in the Score1 calculate event
This works now after these changes. This circled button is for checking the code. It can be handy to find which line errors are on. Also pressing CTRL+J after previewing the file will show any javascript errors and what line they are on as well.
Javascript Debugger - the highlighted number is the line number in the event code.
Views
Replies
Total Likes
Embarrassed by those kind of mistakes.
Thanks for your assistance; now marked as answered.
Views
Replies
Total Likes
Hi,
I wouldnt worry about it, everyone has made mistakes and wondered how they did that. The thing I found in my experience is that I never seem to do it again, and it is first thing in my mind when error checking the next time.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies