-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Lyla/templates #404
Merged
Merged
Lyla/templates #404
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d83d49c
drag_and_drop template added
2262ffe
updated imageresponse example to a more universal example (baby animals)
a512337
removed soon-to-be-universally-fixed defaults
a47daf2
removed uneeded defaults from imageresponse
3f8246f
merge conflict
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oof, this link to an outside course's assets is going to be a problem to manage long term, i.e. what happens if that course gets deleted. I don't know if there's a workaround right now and probably part of a bigger discussion about templates that have dependencies (e.g. links, embedded images, etc.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. I have a ticket out to put these images on amazon s3, but I figured that I could update those next week or something after the images were uploaded. As it stands, I wanted to try to get this into the release candidate so that people would have a reference for drag-and-drop other than the rumors and word-of-mouth that the question type exists.