magpie-ea / magpie-modules

the reusable front-end bits in the _magpie modules
MIT License
7 stars 1 forks source link

Generalize 2 option forced choice tasks to take more options (forcedChoice, sentenceChoice, imageSelection) #57

Open michael-franke opened 5 years ago

michael-franke commented 5 years ago

Currently, the template views forcedChoice, sentenceChoice and imageSelection all take two options to select from. We should ideally generalize this to allow an arbitrary number of choice options.

Instead of providing options like this:

{
    picture: 'path/to/picture_of_bread.jpg',
    option1: 'jam',
    option2: 'ham'
}

We could have:

{
    picture: 'path/to/picture_of_bread.jpg',
    options: ['1', '2', '3', '4', '5', '6'],
    grid_layout: [3,2],
    fill_by: 'row',
}

with also an optional field grid_layout which takes the numbers of rows and columns of a table to be filled in with the options. Here [3,2] would give us three rows and two column. The optional field fill_by would specify whether to fill the grid row- or column-wise. The above would yield an display like this:

1 2 3 4 5 6

JannisBush commented 5 years ago

This should be possible, but first we should finish/decide on #48