numbas / Numbas

A completely browser-based e-assessment/e-learning system, with an emphasis on mathematics
http://www.numbas.org.uk
Apache License 2.0
207 stars 122 forks source link

Add an option to shuffle question groups #525

Closed christianp closed 4 years ago

christianp commented 6 years ago

At the moment, you can ask for the questions inside question groups to appear in a random order, but you can't do the same with question groups themselves. You might want to do this so that you don't always get a question on the same topic at the start of the exam.

To do this:

artemdou commented 4 years ago

Hi, I would like to work on this issue

christianp commented 4 years ago

@artemdou Thanks! Please have a look at our guidelines on contributing to Numbas

artemdou commented 4 years ago

Hi, I've been working on this issue for a while now but something is going wrong when I test whether it is able to load or not and I can't seem to fix it. I changed the chooseQuestionSubset, makeQuestionList, and load methods in runtime/scripts/exam.js as well as the initQuestionList in themes/default/files/scripts/exam-display.js and thought the shuffling is working fine when I exit the test and try to reload it, it shows me the loading bar but never the actual test. Do you have any idea what is going wrong because I can't think of where the problem may occur?

christianp commented 4 years ago

@artemdou thanks for sticking with this! If you make a pull request, I can look at your code and find the problem.

artemdou commented 4 years ago

@christianp Hi, as you may have seen I already made a pull request in this repository and it seems to be working fine so I started changing the editor repository, adding a suffleQuestionGroups field and I come across this error

Unable to process binding "checked: function(){return shuffleQuestionGroups }" Message: shuffleQuestionGroups is not defined

The new field is modeled after the showQuestionGroupNames property so I don't understand what I am missing. If you could take a look and give me some direction I would really appreciate it

christianp commented 4 years ago

@artemdou for the problem with the editor: if you're inside a foreach block, you might need to use $parent.shuffleQuestionGroups.