Copy link to clipboard
Copied
I am a teacher and use PDF-forms to give a mark for digital things, the students had to send me. I start with word, create the standard of evaluation and transform it into a pdf-form. This form consists of checkboxes which are checked by me, if an aspect of the given task is successfully made in the work of the student. I set the checkboxes to give back a value of 1, so I can calculate the textboxes for the points (Pkt.), beeing the sum of checkbox x to z. Easy. But I often want to give just one point, if a specific amount of checkboxes are activated, otherwhise it's 0 points.
Unfortunately there is no construction kit in the settings of an if-then-else or other functions. I mean ... the premade functions like "sum of ..." or "product of ..." etc. are good and satisfy the majority of my needs. But the Java-Editor is so horrible ... I tried to create the fuction in another Java-editor and paste it into the "custom calculation script"-field, but it doesn't work at all. Please help me!
Concrete: I want in this form, that if all 8 checkboxes from Check Box 1.0 to Check Box 1.7 are checked, the textfield "Punkte 1.0" (points of task 1) gives back 1, else 0.
As 'Custom calculation script' of "Punkte 1.0" field use this:
var total = 0;
for(var i=0; i<=7; i++){
if(this.getField("Check Box1."+i).valueAsString != "Off")total++;}
if(total == 8)event.value = 1;
else
event.value = 0;
Copy link to clipboard
Copied
I am using Adobe Acrobat Pro DC, (Version 2022.001.20142, but automatically updating)
Copy link to clipboard
Copied
As 'Custom calculation script' of "Punkte 1.0" field use this:
var total = 0;
for(var i=0; i<=7; i++){
if(this.getField("Check Box1."+i).valueAsString != "Off")total++;}
if(total == 8)event.value = 1;
else
event.value = 0;
Copy link to clipboard
Copied
OMG, that was fast and correct! Thank you so much!