Changing the number of rows in matching questions

MidGe
Forums
The matching question currently allows five rows. Unlike some other formats, there does not seem to be any "Add more" button to add more rows. Is there a way to allow for more than five rows? I went through the content type settings but could not find a way there either. Thanks for any help, Michel
axel

Hi

Hi

The interface is reachable at:

admin/quiz/settings/questions_settings

Best regards,

 

 

MidGe

Hi there,

Hi there, re: admin/quiz/settings/questions_settings There does not seem to be any such menu or files for that matter. I have seen a number of places where I could change the number of questions but that does not seem to have any effect on anything. I tried 1) Lesson - Lesson Settngs - Question Configuration 2) Structure - Content Types - Matching - Manage Fields and more to no avail. I seem to be stabbing in the dark here. Surely there must be a place where I can increase the number of pairs from the current five? Yet, some of the things I tried had text saying that an add more button would then be provided, but it did not happen when I tried. Any ideas as to what I may be doing wrong or where exactly is there a control for that state? Thanks Michel
James Aparicio

Hi MidGe,

Hi MidGe,

Some quiz fields are not entities, that can be changed using normal drupal administration.

This is one of them. If you look inside the file questiontypeyouwant_classes.inc inside the questions in the quiz module, you will will find a function called getCreationForm.

You can alter this there. I advise you to create your own module and do a form_alter, so you can easily update opigno in the future.

 

Let me know if this helped, best regards 

James Aparicio

MidGe

Hiya James,

Hiya James, Yes, I finally found where it is set after a couple of hours searching for it. For those wanting to know, it is in the following file: "/profiles/opigno_lms/modules/contrib/question_types/matching/matching.classes.inc". the line that needs changing is in the function: "public function getCreationForm(array &$form_state = NULL) " It currently reads: "for ($i = 1; $i <= variable_get('quiz_matching_form_size', 5); ++$i) {" and needs be changed to "for ($i = 1; $i <= variable_get('quiz_matching_form_size', 12); ++$i) {" if you would like 12 pairs in the matching question. You can probably increase it to whatever value you require. I have not tried reducing the value but I suspect it may create problems with the database!? I have not looked at what is needed to create a new module and do a form_alter, so this change will be needed to be redone every time that an update of opigno is done unless a new module is created and a form_alter (whatever that is) is done. Right now I am more interested in delivering the course, which is a task big enough in itself, than in spending time learning the setup at the level of detail required to handle these types of issues, as it will take too long given the available documentation, so I will leave opigno for a while and maybe come back to it later. Thanks for you prompt replies and I have no doubts that opigno shows heaps of promises and I am sure it will be a great success. Kind regards Michel