-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #404 from edx/lyla/templates
Adding a template for drag-and-drop.
- Loading branch information
Showing
2 changed files
with
56 additions
and
15 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
common/lib/xmodule/xmodule/templates/problem/drag_and_drop.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
metadata: | ||
display_name: Drag and Drop | ||
markdown: !!null | ||
data: | | ||
<problem> | ||
Here's an example of a "Drag and Drop" question set. Click and drag each word in the scrollbar below, up to the numbered bucket which matches the number of letters in the word. | ||
<customresponse> | ||
<drag_and_drop_input img="https://studio.edx.org/c4x/edX/DemoX/asset/L9_buckets.png"> | ||
<draggable id="1" label="a"/> | ||
<draggable id="2" label="cat"/> | ||
<draggable id="3" label="there"/> | ||
<draggable id="4" label="pear"/> | ||
<draggable id="5" label="kitty"/> | ||
<draggable id="6" label="in"/> | ||
<draggable id="7" label="them"/> | ||
<draggable id="8" label="za"/> | ||
<draggable id="9" label="dog"/> | ||
<draggable id="10" label="slate"/> | ||
<draggable id="11" label="few"/> | ||
</drag_and_drop_input> | ||
<answer type="loncapa/python"> | ||
correct_answer = { | ||
'1': [[70, 150], 121], | ||
'6': [[190, 150], 121], | ||
'8': [[190, 150], 121], | ||
'2': [[310, 150], 121], | ||
'9': [[310, 150], 121], | ||
'11': [[310, 150], 121], | ||
'4': [[420, 150], 121], | ||
'7': [[420, 150], 121], | ||
'3': [[550, 150], 121], | ||
'5': [[550, 150], 121], | ||
'10': [[550, 150], 121]} | ||
if draganddrop.grade(submission[0], correct_answer): | ||
correct = ['correct'] | ||
else: | ||
correct = ['incorrect'] | ||
</answer> | ||
</customresponse> | ||
</problem> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters