From e273bb12591d399592c201fe15bf9de059fcadc3 Mon Sep 17 00:00:00 2001 From: Valera Rozuvan Date: Mon, 21 Jan 2013 15:47:59 +0200 Subject: [PATCH] Updated DOCS with sample XML for DnD. --- docs/source/drag-n-drop-demo.xml | 245 +++++++++--------- docs/source/drag-n-drop-demo2.xml | 373 ++++++++++++++++++++++++++++ docs/source/drag_and_drop_input.rst | 9 +- 3 files changed, 498 insertions(+), 129 deletions(-) create mode 100644 docs/source/drag-n-drop-demo2.xml diff --git a/docs/source/drag-n-drop-demo.xml b/docs/source/drag-n-drop-demo.xml index 6f82db24a2..67712407a1 100644 --- a/docs/source/drag-n-drop-demo.xml +++ b/docs/source/drag-n-drop-demo.xml @@ -1,13 +1,15 @@ - + -

Please set hydrogen atoms to LEFT carbon atom

-
+

[Anyof rule example]


+

Please label hydrogen atoms connected with left carbon atom.

+
- + @@ -39,43 +41,44 @@ else: -

Describe carbon molecule in LCAO-MO

-
+

[Complex grading example]


+

Describe carbon molecule in LCAO-MO.

+
- + - - - - - - + + + + + + - - - - + + + + - - + + - - + + - + - + - - + + @@ -112,27 +115,27 @@ correct_answer = [ 'targets': [ 's_left', 's_right', 's_sigma', 's_sigma_star', 'p_pi_1', 'p_pi_2' ], - 'rule': 'anyof' + 'rule': 'unordered_equal' }, { 'draggables': ['7','8', '9', '10'], 'targets': ['p_left_1', 'p_left_2', 'p_right_1','p_right_2'], - 'rule': 'anyof' + 'rule': 'unordered_equal' }, { 'draggables': ['11', '12'], 'targets': ['s_sigma_name', 'p_sigma_name'], - 'rule': 'anyof' + 'rule': 'unordered_equal' }, { 'draggables': ['13', '14'], 'targets': ['s_sigma_star_name', 'p_sigma_star_name'], - 'rule': 'anyof' + 'rule': 'unordered_equal' }, { 'draggables': ['15'], 'targets': ['p_pi_name'], - 'rule': 'anyof' + 'rule': 'unordered_equal' }, { 'draggables': ['16'], 'targets': ['p_pi_star_name'], - 'rule': 'anyof' + 'rule': 'unordered_equal' }] if draganddrop.grade(submission[0], correct_answer): @@ -144,47 +147,48 @@ else: -

Describe oxygen molecule in LCAO-MO

-
+

[Another complex grading example]


+

Describe oxygen molecule in LCAO-MO

+
- + - - - - - - - - - + + + + + + + + + - - - - - - + + + + + + - - + + - - + + - + - + - - + + @@ -255,30 +259,21 @@ else: ]]>
- -

- Drag and drop pictures to proper positions. -

-

- Drag images to the cow)). -

-
- -

Individual targets with outlines. One draggable per target.

-

Drag ant to first and star to 3rd.

-
+

[Individual targets with outlines, One draggable per target]


+

+ Drag -Ant- to first position and -Star- to third position


- + - - + + - - - + + + @@ -298,22 +293,22 @@ else: -

- SMALL IMAGE. Individual targets WITHOUT outlines. Move Star to the - volcano opening, and Label3 on to the right ear of the cow. - One draggable per target. -

-
+

[SMALL IMAGE, Individual targets WITHOUT outlines, One draggable + per target]


+

+ Move -Star- to the volcano opening, and -Label3- on to + the right ear of the cow. +


- + - - + + - - - + + + @@ -333,19 +328,19 @@ else: -

Many draggable per target. Move star and ant to most left target - and lable 3 and label 2 to most right target.

-
+

[Many draggables per target]


+

Move -Star- and -Ant- to most left target + and -Label3- and -Label2- to most right target.


- + - - + + - - - + + + @@ -368,20 +363,20 @@ else: -

Draggables can be places anywhere on base image. - Place grass in the middle of the image and ant in the - right upper corner.

-
+

[Draggables can be placed anywhere on base image]


+

+ Place -Grass- in the middle of the image and -Ant- in the + right upper corner.


- + - - + + - - - + + + @@ -398,11 +393,11 @@ else: -

Please identify the Carbon and Oxygen atoms in the molecule.

-
+

[Another anyof example]


+

Please identify the Carbon and Oxygen atoms in the molecule.


- + @@ -449,13 +444,13 @@ else: -

If the element appears in this molecule, - drag the label onto it

-
+

[Again another anyof example]


+

If the element appears in this molecule, drag the label onto it

+
- + @@ -499,22 +494,18 @@ else: -

- SMALL IMAGE. Individual targets WITHOUT outlines. Move Star to the - volcano opening, and Label3 on to the right ear of the cow. - One draggable per target. -

-
+

[Wrong base image url example] +


- + - - + + - - - + + + diff --git a/docs/source/drag-n-drop-demo2.xml b/docs/source/drag-n-drop-demo2.xml new file mode 100644 index 0000000000..6ffac18e44 --- /dev/null +++ b/docs/source/drag-n-drop-demo2.xml @@ -0,0 +1,373 @@ + + + + +

[Draggable is reusable example]

+
+

Please label all hydrogen atoms.

+
+
+ + + + + + + + + + + + + + + + + + + +
+ + + +

[Complex grading example]


+

Describe carbon molecule in LCAO-MO.

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

[Many draggables per target]


+

Move two Stars and three Ants to most left target + and one Label3 and four Label2 to most right target.


+
+ + + + + + + + + + + + + + + + + + +
+ + + +

[Draggables can be placed anywhere on base image]


+

+ Place -Grass- in the middle of the image and -Ant- in the + right upper corner.


+
+ + + + + + + + + + + + + + +
+ + + +

[Another anyof example]


+

Please identify the Carbon and Oxygen atoms in the molecule.


+
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + +

[Exact number of draggables for a set of targets.]


+

Drag two Grass and one Star to first or second positions, and three Cloud to any of the three positions.

+
+
+ + + + + + + + + + + + + + + + + + +
+ + + +

[As many as you like draggables for a set of targets.]


+

Drag some Grass to any of the targets, and some Stars to either first or last target.

+
+
+ + + + + + + + + + + + + + + + + + +
+ +
diff --git a/docs/source/drag_and_drop_input.rst b/docs/source/drag_and_drop_input.rst index d03d9755bd..06a28a5926 100644 --- a/docs/source/drag_and_drop_input.rst +++ b/docs/source/drag_and_drop_input.rst @@ -312,7 +312,12 @@ Logic flow Example ======= -Various configuration of DnD on one page ----------------------------------------- +Examples of draggables that can't be reused +------------------------------------------- .. literalinclude:: drag-n-drop-demo.xml + +Draggables can be reused +------------------------ + +.. literalinclude:: drag-n-drop-demo2.xml