Skip to content
Snippets Groups Projects
  • Guruprasad Lakshmi Narayanan's avatar
    Fix the order randomization behaviour of Randomized Content Block · 149ebfec
    Guruprasad Lakshmi Narayanan authored
    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.
    
    A new block structure transformer, ContentLibraryOrderTransformer has
    been added to transform the order of the selected children XBlocks to
    match the order of the selections made in the
    ContentLibraryTransformer. This ensures that same correct randomized order
    of blocks is also returned by the course blocks API.
    149ebfec