Jump to content
Sign in to follow this  
BFH

How to count values in fields within each record?

Recommended Posts

I have databases containing students' responses to test items. Each record in the databases corresponds to a student. 40 of the fields in each database correspond to test items. The values in these text fields are "correct" or "incorrect."

How can I programmatically count each student's number of correct items on the test? In other words, I want to count within records, not between, the total number of correct items.

Many thanks in advance for any pointers!

Share this post


Link to post
Share on other sites

If you have a calc field for each question that it's results returned "1" for correct, and "0" (zero) for incorrect, you can then have a "Total Correct" field for each record that is simply:

Question1 + Question2 +Question3 +Question4.... etc...

It will add up each correct calculation for a total number correct.

Share this post


Link to post
Share on other sites

The 1 or 0 option is one that I make use of. I would also recommend putting test results into their own database, e.g. Test_Results.fp5, where each record is one test answer, related to the student by the student's unique key. Then, getting the total correct responses would be as simple as using the Sum() function. The next step beyond that would be to create a join file, say, Tests.fp5 which would allow you to track multiple tests and their results for each student.

Share this post


Link to post
Share on other sites

Many thanks for the helpful suggestion. I'll give it a whirl.

Cheers!

Share this post


Link to post
Share on other sites

An alternative way of doing it is using PatternCount e.g.

PatternCount(answer 1 & " " & answer 2 & " " & answer 3 & " " & answer 4 & " " & answer 5 & " " & answer 6 & " " & answer 7; "Correct")

/Keda

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.