B
Bruce Musgrove
I am trying to create a form to allow me to enter a students test answer's,
compare them against the correct answer in Table2 and then display the
score.
Table 1 is the student, testName and one field for each question (named 1, 2
, 3 etc)
Table 2 is the TestName and 1 field for each question (named 1, 2, 3 etc)
Right now there are only 10 answer fields but when we are done there will be
70-150
I can do this individually on each field by comparing the fields for each
question, set the value of a hidden field then have the score fieldadd up
all of the hidden score fields. This however will be a pain for a 150
fields. My intent would be to have the score field do the comparisons and
create the score, but again, writing the code to compare each and every
answer field independentlyand then scoring it would a royal pain.
Is there an easier way to do this using an array or looping the comparisons?
IE making it do a for...each statement to loop through all questions and
provide a score/count to me? Declare two arrays and then compare them for
field entries that are equal? Another method to keep from hand coding each
field comparison?
compare them against the correct answer in Table2 and then display the
score.
Table 1 is the student, testName and one field for each question (named 1, 2
, 3 etc)
Table 2 is the TestName and 1 field for each question (named 1, 2, 3 etc)
Right now there are only 10 answer fields but when we are done there will be
70-150
I can do this individually on each field by comparing the fields for each
question, set the value of a hidden field then have the score fieldadd up
all of the hidden score fields. This however will be a pain for a 150
fields. My intent would be to have the score field do the comparisons and
create the score, but again, writing the code to compare each and every
answer field independentlyand then scoring it would a royal pain.
Is there an easier way to do this using an array or looping the comparisons?
IE making it do a for...each statement to loop through all questions and
provide a score/count to me? Declare two arrays and then compare them for
field entries that are equal? Another method to keep from hand coding each
field comparison?