Jump to content
Server Maintenance This Week. ×

Radio buttons in portal - only allow one selection


This topic is 1425 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Evening all

I am creating a multiple choice test solution with three possible answers. I have an "Answers" table joined to my "Question" table via a QuestionID field. The answer selection to each question is presented in a portal. Currently I have set up a radio button for the user to select their answer ("selection"), however currently I'm stuck trying to figure out how to only permit one answer choice for each question. Right now I can select all three answers by clicking each radio button in each row. Is there a way to make FileMaker only permit one radio selection in a group of related records (the answers)?

Link to comment
Share on other sites

If there is only one answer possible, then the selection should be stored in a field in the Questions table (or in a Responses table, where there is a record for each response of a subject to a question), not in the Answers table. 

You can have a button in your portal that sets a field in the parent table to the selected answer, and a calculation field (or a conditionally formatted object) to display the selection. 

 

Link to comment
Share on other sites

Thanks, comment.

I have moved the answer choices to a field in the question table and defined a new field in the same table that contains the correct response. The answer choices are now referenced in a value list which displays as a set of radio buttons. AnswerSelection = CorrectAnswer equals correct. AnswerSelect ≠ CorrectAnswer equals incorrect.

Say there are 100 records (100 questions), what would be the best way to record the answer choices as the user progresses through? I see your comment on using a Responses table, but I'm failing to see how a new record would be created/modified within that table during a testing session. A script trigger?

My goal here is to allow the user (me) to go backwards and forwards and change their answer selection before clicking an "End Test" button that will then present the score and list of questions missed. This solution is for me to use as a study aid during my training. I think if I can get help with this I'll be off to a good start.

Link to comment
Share on other sites

A Responses table is required if you want to record more than one response to a question - IOW, when you intend to have more than one person take the test/survey. Or if you want to test yourself multiple times, and keep the results of each trial. 

In such case, you have two choices: either pre-create a response record for each question at the beginning of the test, or create a response record as a result of user picking an answer. If the answers are presented in a portal, then the user can select an answer by clicking a button in the portal - and then a script will create a response record with the selected answer.

If you only want to keep one set of responses, then storing the response in a field of the Questions table is perfectly sufficient.

 

  • Thanks 1
Link to comment
Share on other sites

Thanks comment!

My database has multiple test questions for multiple subjects. I've done my best to simulate the actual test-taking experience that happens in the exam room (also on a computer, multiple choice).

Several subjects have over 1,000 questions in the question bank, not written by me. If I want to "generate a test" for a given subject and have the computer randomly choose 100 questions out of the available 1,000+, would creating a script to export the randomly chosen questions to a Test table suffice? As I see it, this way there's a separate record available for *that* user (via their assigned userID) with the appropriate test ID and questions selected for the given subject. Missed question numbers, subject codes, etc would then be available on a score report, and should a question be revised in the bank down the road, the question/answer itself and score in a completed test would remain unchanged.

Link to comment
Share on other sites

Yes, one test for each subject applicable to that users training level. Pass is 70%, score below a retest is possible, but with a new generated selection of questions.

26 minutes ago, comment said:

P.S. You may notice a trend here: cardinality is the most important aspect of database design.

Agreed. Database design is something I'm teaching myself and I don't design solutions for compensation. My requirements have changed based on input from my instructor. I've now restructured the database question bank via subject > topic > topic code > question. What I've come up with works very well as far as I've managed to test functionality. Further alterations I'll re-visit the drawing board. My concern now is just generating the tests. Currently merely asking how a professional might design this feature. My thought process is new Test table and import the questions and answer, with the answer field being hidden from view. Additionally, I've considered creating a whole new file just for the test taker in a "kiosk mode" and leaving the "back end" as a separate file.

Link to comment
Share on other sites

This topic is 1425 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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