Copy link to clipboard
Copied
I'm creating an assessment form that needs to provide an overall rating based on how many times a specific level is acheived in different areas.
I've created a number of radio groups (Group1, Group2, Group3, Group4, Group5, Group6, Group7, Group8) for each area with 5 choices (A,B,C,D,E) and created a tally counter (TallyA, TallyB, TallyC, TallyD, TallyE). The tally is working fine but I'm struggling with the next step and would be grateful of some help.
The scoring matrix is as follows:
I would like a text return of Excellent, Very Good, Clear Pass, Borderline Pass, Borderline Fail or Clear Fail based on the tally counts if this is possible. I have some limited experience with JavaScript and am willing to use this if required.
Any help would be gratefully received. Thanks in advance.
Just in case your conditions don't cover all possible situations I would add a default value to the end of your code.
Something like this:
else event.value = "";
If you don't do that, the last applied value will remain, even if it's no longer valid at all.
Copy link to clipboard
Copied
So TallyA shows number of "A" choices, TallyB number of "B" choices?
Each Tally will have it's own field to show text?
Copy link to clipboard
Copied
It's possible, but your scoring matrix is incomplete.
For example, there could be a scenario where there's both an E and more than 5 A's... What should the score be then? Does the E override the A's, or the other way around?
Also, there could be a scenario where none of these conditions are true (eg. 3 A's, 3 B's, 2 C's). What's the score then?
Copy link to clipboard
Copied
Thank you for your responses. I've managed to come up with the following which broadly seems to work:
var TallyA = this.getField("TallyA").value;
var TallyB = this.getField("TallyB").value;
var TallyC = this.getField("TallyC").value;
var TallyD = this.getField("TallyD").value;
var TallyE = this.getField("TallyE").value;
var OverallTally = this.getField("OverallTally").value;
if( OverallTally < 8 ) {
event.value = "Please complete all 8 elements to grade";
}
else if( OverallTally < 7 ) {
event.value = "Learning objectives achieved";
}
else if( TallyE > 0 ) {
event.value = "Requires further remediation";
}
else if( TallyD > 4 ) {
event.value = "Same day remediation";
}
else if( TallyD > 3 ) {
event.value = "Learning objectives achieved";
}
else if( TallyC > 4 ) {
event.value = "Learning objectives clearly achieved";
}
else if( TallyB > 4 ) {
event.value = "Very good overall performance";
}
else if( TallyA > 4 ) {
event.value = "Excellent overall performance";
}
I've adjusted the matrix so each element is weighted to create score bands to complete the scoring system and am aiming to adjust the above to display the result in one field.
Copy link to clipboard
Copied
Just in case your conditions don't cover all possible situations I would add a default value to the end of your code.
Something like this:
else event.value = "";
If you don't do that, the last applied value will remain, even if it's no longer valid at all.