Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
a95e8098
Commit
a95e8098
authored
Jan 21, 2013
by
Alexander Kryklia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
documentation extended
parent
2d67ee47
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
common/lib/capa/capa/verifiers/draganddrop.py
+14
-6
No files found.
common/lib/capa/capa/verifiers/draganddrop.py
View file @
a95e8098
...
...
@@ -126,7 +126,8 @@ class DragAndDrop(object):
# 'number' rule special case
# for reusable draggables we may get in self.user_groups
# {'1': [u'2', u'2', u'2'], '0': [u'1', u'1'], '2': [u'3']}
# if +number in rule - do not remove duplicates but clean rule
# if '+number' is in rule - do not remove duplicates and strip
# '+number' from rule
current_rule
=
self
.
correct_positions
[
groupname
]
.
keys
()[
0
]
if
'number'
in
current_rule
:
rule_values
=
self
.
correct_positions
[
groupname
][
current_rule
]
...
...
@@ -246,7 +247,7 @@ class DragAndDrop(object):
""" Populates DragAndDrop variables from user_answer and correct_answer.
If correct_answer is dict, converts it to list.
Correct answer in dict form is simpe structure for fast and simple
grading. Example of corr
r
ect answer dict example::
grading. Example of correct answer dict example::
correct_answer = {'name4': 't1',
'name_with_icon': 't1',
...
...
@@ -255,10 +256,10 @@ class DragAndDrop(object):
It is draggable_name: dragable_position mapping.
Complex
form converted from simple form uses 'exact' rule
Advanced
form converted from simple form uses 'exact' rule
for matching.
Correct answer in list form is designed for
complex
cases::
Correct answer in list form is designed for
advanced
cases::
correct_answers = [
{
...
...
@@ -273,10 +274,17 @@ class DragAndDrop(object):
}
]
Correct
answer in list form is list of dicts, and every dict must have
Advanced
answer in list form is list of dicts, and every dict must have
3 keys: 'draggables', 'targets' and 'rule'. 'Draggables' value is
list of draggables ids, 'targes' values are list of targets ids, 'rule'
value is 'exact' or 'anyof'.
value one of 'exact', 'anyof', 'unordered_equal', 'anyof+number',
'unordered_equal+number'
Advanced form uses "all dicts must match with their rule" logic.
Same draggable cannot appears more that in one dict.
Behavior is more widely explained in sphinx documentation.
Args:
user_answer: json
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment