I am trying to make a student testing system. The task now is to implement multiple choice of answer options. That’s where I’m stuck.
My structure is as follows (omitted all unimportant fields):
%StudentAnswer{
selected_options: [
%SelectedOption{task_option_id: "some_id"}}
]
}
I collect these answers and after the test is completed, I save them to a database.
I’m running the entire structure through changeset. And because I don’t insert SelectedOption
into the database, they have id: nil
. I assume that this is the reason for incorrect and glitchy editing.
This has been discussed in more detail here
At the moment I don’t quite know how I can implement the functionality I need. Maybe someone has encountered something similar and knows how to organize flow correctly?
Maybe I should generate the necessary ids for the structures myself? That doesn’t sound right…