Hello!
I have the following section in my db.
I'm using set_relation_n_n to allow the content manager to select questions for the quiz. Fairly straightforward.
But in my case, quizzes should have 7 questions — no more, no less. Is there any way to set this validation?
Here's how I'm setting the relation:
$form1->set_relation_n_n('Questions', 'quiz_has_questions', 'quiz_questions', 'quiz_id', 'question_id', 'text', 'quiz_order');
I tried setting a rule like this, but it's not doing anything. Should it? If not, is there any workaround?
$form1->set_rules('Questions', 'Questions', 'callback_questions_check');