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

Implement multiple choice ExerciseWidget #120

Open
agoscinski opened this issue Feb 26, 2025 · 0 comments
Open

Implement multiple choice ExerciseWidget #120

agoscinski opened this issue Feb 26, 2025 · 0 comments

Comments

@agoscinski
Copy link
Collaborator

These are the notes from how we would like this to look like

mc1 = MultipleChoiceExercise(
    description='How many sides does a square have?',
    key='square_sides',
    options={
        'one': 'One side',
        'two': 'Two sides',
        'three': 'Three sides',
        'four': 'Four sides'        
    }

    # OK, and then key and what you display is the same,  you internally
    # do `options = {k: k for k in options}`
    options=['one', 'two', 'three', 'four'],
    allow_multiple=False, # Default False
    randomize_order=False # Default False
    )

### BEGIN HIDDEN TEST
assert mc1.answer == 'four'
### END HIDDEN TEST



mc1 = MultipleChoiceExercise(
    description='How many sides do a triangle or a square have?',
    key='square_sides',
    options={
        'one': 'One side',
        'two': 'Two sides',
        'three': 'Three sides',
        'four': 'Four sides'        
    }

    # OK, and then key and what you display is the same,  you internally
    # do `options = {k: k for k in options}`
    options=['one', 'two', 'three', 'four'],
    allow_multiple=True, # Default False
    randomize_order=False # Default False
    )

### BEGIN HIDDEN TEST
print(mc1.answer) # -> always returns a set, even if allow_multiple = False

assert mc1.check_correct_answers(['four', 'three'])
assert mc1.check_correct_answers('four', 'three')
assert mc1.check_correct_answers('four')
### END HIDDEN TEST



## Try on 3 students to see if the "time cost" for grading for the teacher does NOT scale with the number of students

The MultipleChoiceExercise would inherit from ExerciseWidget


One can look at the TextExercise for a simple implementation example inheriting from it https://github.com/osscar-org/scicode-widgets/blob/main/src/scwidgets/exercise/_widget_text_exercise.py to get an idea how to implement it.

@agoscinski agoscinski changed the title Multiple Choice ExerciseWidget Implement multiple choice ExerciseWidget Feb 26, 2025
@tulga-rdn tulga-rdn mentioned this issue Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant