0

The GUI gives very hard to get sample code. Especially :

correct_answer = {
        '1':      [[100, 150], 100],
        '2':      [[300, 150], 100],
        '3':      [[500, 150], 100],
        '4':      [[700, 150], 100]}

How to understand and use it ?

Hugolpz
  • 17,296
  • 26
  • 100
  • 187

1 Answers1

0

It's documented there. The hard part it the 'id': [[x coordinate, y coordinate], radius].

<problem>
Recreate the sentence : `Demain, je vais marche`.
   <customresponse>
        <drag_and_drop_input img="https://studio.edx.org/c4x/edX/DemoX/asset/L9_buckets.png">
            <draggable id="1" label="I"/>
            <draggable id="3" label="walk"/>
            <draggable id="4" label="tomorrow"/>
            <draggable id="2" label="will"/>
        </drag_and_drop_input>
        <answer type="loncapa/python">
correct_answer = {
        '1':      [[100, 150], 100],
        '2':      [[300, 150], 100],
        '3':      [[500, 150], 100],
        '4':      [[700, 150], 100]}
if draganddrop.grade(submission[0], correct_answer):
    correct = ['correct']
else:
    correct = ['incorrect']
        </answer>
    </customresponse>
</problem>
Hugolpz
  • 17,296
  • 26
  • 100
  • 187