Only part of the solution is JavaScript, the other part is in the field naming. The fields need to be named so that they are easy to access in a script. For your case, the best solution is to use "dot" notation to group the fields. This only works for fields that are of the same type.
For example, the dropdown fields are gouped with "Section1" as the prefix and each individual dropdown is Q1 thru Q4.
Then the full field names (as entered in the Field Properties dialog) are: "Section1.Q1", "Section1.Q2", "Section1.Q3", "Section1.Q4",
This calculation script will count the number of selected A's. i.e., this code goes into the calculation script for the A text box
var nSum = 0;
this.getField("Section1").getArray().forEach(function(a){if(a.value=="A") nSum++;});
event.value = nSum;
This code works regardless of the number of questions. The only thing that matters is that all the questions are grouped in "Section1"
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often