Fix the order randomization behaviour of Randomized Content Block
The Randomized Content Block XBlock only randomizes the selection of the children blocks and has unpredictable randomization of the order of the selected child blocks due to the usage of sets, which are unordered, for storing the selected blocks. This becomes apparent when all the available child blocks in a library are chosen for a Randomized Content Block, to randomize just the order of the child blocks and not just the selection of the blocks. The order of the selected blocks ends up being similar for multiple learners. This change modifies the XBlock to store the selected child blocks in a list, instead of a set, after randomly shuffling them.
Showing
- common/lib/xmodule/xmodule/library_content_module.py 21 additions, 22 deletionscommon/lib/xmodule/xmodule/library_content_module.py
- common/lib/xmodule/xmodule/tests/test_library_content.py 5 additions, 14 deletionscommon/lib/xmodule/xmodule/tests/test_library_content.py
- lms/djangoapps/course_blocks/api.py 1 addition, 0 deletionslms/djangoapps/course_blocks/api.py
- lms/djangoapps/course_blocks/transformers/library_content.py 3 additions, 1 deletionlms/djangoapps/course_blocks/transformers/library_content.py
- lms/djangoapps/course_blocks/transformers/tests/test_library_content.py 129 additions, 1 deletion.../course_blocks/transformers/tests/test_library_content.py
- setup.py 1 addition, 0 deletionssetup.py
Please register or sign in to comment