I only registered here a couple of days ago, after using the help on this forum silently for a while . I'm fairly new to Moodle, and to php, which is of course the ideal combination for some foolish bravery. The project that I'm working on does language teaching in a hospital environment, and to cut the story short, our trainers need an adaptive test to check new students' language level.
I knew about the 'random question type' in Moodle, and figured it shouldn't be hard to condition the rendering of questions in that qtype so it could become an adaptive qtype. So, this is what I want the qtype to do:
Given that I have a category in the question bank with 3 subcategories, named "1", "2", and "3": The first questions should be rendered from subcat 1. If the student answers correctly, the questionid is stored in an array ($arrgood). If the student's answer is wrong, the questionid is stored in another array ($arrbad). If $arrgood has 3, or a multiplication of 3, entries, the next question is rendered from the subcategory one higher than the current one. Similarly, if $arrbad has 3, or a multiplication of 3, entries, the next question is rendered from the subcategory one lower than the current one. In all other cases, questions from the same subcategory are rendered.
Unfortunately, I'm stuck already in the get_usable_questions function (I am altering the random qtype), where I want to select the appropriate subcategory. I added my questiontype.php (as a txtfile) to this thread, so if anyone would want to take a look at it, and give me some hints, I would be very grateful. Of course, you'll need to forgive me my noobishness as well