Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shuffle not working #209

Closed
monicangela opened this issue Oct 13, 2023 · 12 comments
Closed

Shuffle not working #209

monicangela opened this issue Oct 13, 2023 · 12 comments
Labels

Comments

@monicangela
Copy link

Hello,

With version v4.1.0 (2023070701) on a Moodle 4.1 the question shuffle is not working. The groups have the same order even if we click on the "Shuffle answers/Reload question list"

Is it possible to fix this ?
Thanks,
Monica

@LisaE14
Copy link

LisaE14 commented Oct 16, 2023

Hello, we can confirm this problem on Moodle 4.1.5+ and offline quiz 2023070701.

@Syl20D20
Copy link

Hello,
I have the same problem on Moodle 4.1.6+ and offline quiz 2023070701.

@goggo24
Copy link
Member

goggo24 commented Oct 24, 2023

Thanks for reporting - we are just preparing v.4.2.0 where shuffle already works again and backport it afterwards. Please be patient. Thanks.

@goggo24 goggo24 added the bug label Oct 24, 2023
@moodleulpgc
Copy link

Hi, we at ULPGC saw this a couple of weeks ago too. The failure to generate random exams when using several Groups/templates is quite a showstopper for may of our teachers. Do you have a time expectation to fix this bug??

Or a tip to try to correct it myself.
I see in locallib.php the functions
offlinequiz_get_group_template_usage() and
offlinequiz_shuffle_questions()

But probably the problem is in createquiz.php itself. Obviously the concern is randomize questions not only for output (doable with explicit shuffle of $templateusage array in createquiz.php) but keeping that order usage for the scan/correction phase.

I have a lot of teachers waiting for this being corrected; I can invest some time in fixing it, , with some help, in our site and put it back in github.

@univietw
Copy link
Contributor

we are still working on 4.2.0 which will be released pretty soon.
Until then you can delete the following line:
srand((int)microtime() * 1000000); // For php < 4.2.
in the locallib. This will fix the issue.
I am already working on all the backports for 4.1

@ndunand
Copy link

ndunand commented Nov 16, 2023

I can confirm that removing the srand() function call seems to fix the issue. Question and answer propositions now shuffle as needed.

Using mod_offlinequiz 20232023070701 on Moodle 4.2.3 2023042403

@moodleulpgc
Copy link

moodleulpgc commented Nov 18, 2023

Hi, yes, confirmed, commenting out srand() in locallib.php returns shuffling.
Using mod_offlinequiz 2023070701 with moodle 4.1.6+ (Build: 20231102)

Thanks a lot!!

@Syl20D20
Copy link

Hello,
I also confirm that it works on Moodle 4.1.6+ and offline quiz 2023070701.

Thanks !

@crnfpp
Copy link

crnfpp commented Nov 22, 2023

hi!
is the dev version available somewhere to test the fix?
I'm not finding it here on github and the main one seems not synced with the version i see on moodle plugin official website
https://moodle.org/plugins/mod_offlinequiz/versions

Thanks!

@univietw
Copy link
Contributor

@crnfpp I just pushed the backport402to401 branch to test it. We will probably publish it very soon.

@crnfpp
Copy link

crnfpp commented Nov 28, 2023

Tested locally backport402to401 and it works!

I've tested also quiz creation, groupings, form creation, upload and correction without encountering any issue!

@goggo24
Copy link
Member

goggo24 commented Nov 30, 2023

Thanks for your feedback and testing - we have just released v.4.1.2/v.4.2.0. Please note #220 before you update!

@goggo24 goggo24 closed this as completed Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants