From c2f0ea49bdfd17899f217635d0528406a5376165 Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Mon, 7 Jan 2013 12:32:54 -0500 Subject: [PATCH 1/2] Hopefully fixed yamls for markdown --- .../templates/problem/multiplechoice.yaml | 3 +- .../templates/problem/optionresponse.yaml | 36 +++++++++---------- .../templates/problem/string_response.yaml | 18 ++++++++++ 3 files changed, 35 insertions(+), 22 deletions(-) diff --git a/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml b/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml index f9eb8448b3..f3479f9b4a 100644 --- a/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml +++ b/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml @@ -3,7 +3,7 @@ metadata: display_name: Multiple Choice rerandomize: never showanswer: always - markdown: " + markdown: | A multiple choice problem presents radio buttons for student input. Students can only select a single option presented. Multiple Choice questions have been the subject of many areas of research due to the early invention and adoption of bubble sheets. @@ -19,7 +19,6 @@ metadata: ( ) The vegetable peeler ( ) Android ( ) The Beatles - " data: |

diff --git a/common/lib/xmodule/xmodule/templates/problem/optionresponse.yaml b/common/lib/xmodule/xmodule/templates/problem/optionresponse.yaml index ec88fdf68c..2ec60860d6 100644 --- a/common/lib/xmodule/xmodule/templates/problem/optionresponse.yaml +++ b/common/lib/xmodule/xmodule/templates/problem/optionresponse.yaml @@ -3,26 +3,22 @@ metadata: display_name: Option Response rerandomize: never showanswer: always -# markdown: " -#

OptionResponse gives a limited set of options for students to respond with, and presents those options -# in a format that encourages them to search for a specific answer rather than being immediately presented with options from which to recognize the correct answer.

-# -#

-# The answer options and the identification of the correct answer is defined in the optioninput tag. -#

-#

Translation between Option Response and __________ is extremely straightforward: -# -# -# -# -#

-# -#
-#

Explanation

-#

Multiple Choice also allows students to select from a variety of pre-written responses, although the format makes it easier for students to read very long response options. Optionresponse also differs slightly because students are more likely to think of an answer and then search for it rather than relying purely on recognition to answer the question.

-#
-#
-# " + markdown: | + OptionResponse gives a limited set of options for students to respond with, and presents those options + in a format that encourages them to search for a specific answer rather than being immediately presented with options from which to recognize the correct answer.

+ + The answer options and the identification of the correct answer is defined in the optioninput tag. + + Translation between Option Response and __________ is extremely straightforward: + [[(Multiple Choice), String Response, Numerical Response, External Response, Image Response]] + + +
+

Explanation

+

Multiple Choice also allows students to select from a variety of pre-written responses, although the format makes it easier for students to read very long response options. Optionresponse also differs slightly because students are more likely to think of an answer and then search for it rather than relying purely on recognition to answer the question.

+
+
+ data: |

OptionResponse gives a limited set of options for students to respond with, and presents those options diff --git a/common/lib/xmodule/xmodule/templates/problem/string_response.yaml b/common/lib/xmodule/xmodule/templates/problem/string_response.yaml index 040f4c4ac1..3af6026f56 100644 --- a/common/lib/xmodule/xmodule/templates/problem/string_response.yaml +++ b/common/lib/xmodule/xmodule/templates/problem/string_response.yaml @@ -3,6 +3,24 @@ metadata: display_name: String Response rerandomize: never showanswer: always + markdown: ! + A string response problem accepts a line of text input from the + student, and evaluates the input for correctness based on an expected + answer within each input box. + + The answer is correct if it matches every character of the expected answer. This can be a problem with + international spelling, dates, or anything where the format of the answer is not clear. + + Which US state has Lansing as its capital? + = Michigan + + +

+

Explanation

+

Lansing is the capital of Michigan, although it is not Michgan's largest city, or even the seat of the county in which it resides.

+
+ + data: |

From d8d4c3733139b0fa494a18e7af7672d2c5c52646 Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Mon, 7 Jan 2013 13:57:21 -0500 Subject: [PATCH 2/2] Yaml files now generate markdown in a readable and xml convertable format. The xml converter works. --- .../xmodule/js/src/problem/edit.coffee | 2 +- .../templates/problem/multiplechoice.yaml | 30 ++++++++++++-- .../templates/problem/numericalresponse.yaml | 41 ++++++++++++++++--- .../templates/problem/optionresponse.yaml | 28 +++++++++---- .../templates/problem/string_response.yaml | 31 ++++++++++---- 5 files changed, 107 insertions(+), 25 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/problem/edit.coffee b/common/lib/xmodule/xmodule/js/src/problem/edit.coffee index b869bde966..a481d3ded7 100644 --- a/common/lib/xmodule/xmodule/js/src/problem/edit.coffee +++ b/common/lib/xmodule/xmodule/js/src/problem/edit.coffee @@ -97,7 +97,7 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor // replace string and numerical xml = xml.replace(/^\=\s*(.*?$)/gm, function(match, p) { var string; - var params = /(.*?)\+\-\s*(.*?)/.exec(p); + var params = /(.*?)\+\-\s*(.*?$)/.exec(p); if(parseFloat(p)) { if(params) { string = '\n'; diff --git a/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml b/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml index f3479f9b4a..1e9ccad040 100644 --- a/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml +++ b/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml @@ -3,22 +3,46 @@ metadata: display_name: Multiple Choice rerandomize: never showanswer: always - markdown: | + markdown: " A multiple choice problem presents radio buttons for student input. Students can only select a single option presented. Multiple Choice questions have been the subject of many areas of research due to the early invention and adoption of bubble sheets. + One of the main elements that goes into a good multiple choice question is the existence of good distractors. That is, each of the alternate responses presented to the student should be the result of a plausible mistake - that a student might make. + that a student might make. + What Apple device competed with the portable CD player? + ( ) The iPad + ( ) Napster + (x) The iPod + ( ) The vegetable peeler + ( ) Android + ( ) The Beatles + + + + +

+ + Explanation + + + The release of the iPod allowed consumers to carry their entire music library with them in a + format that did not rely on fragile and energy-intensive spinning disks. + +
+ + + " data: |

@@ -41,7 +65,7 @@ data: |

Explanation

-

The release of the iPod allowed consumers to carry their entire music library with them in a format that did not rely on fragile and enery-intensive spinning disks.

+

The release of the iPod allowed consumers to carry their entire music library with them in a format that did not rely on fragile and energy-intensive spinning disks.

diff --git a/common/lib/xmodule/xmodule/templates/problem/numericalresponse.yaml b/common/lib/xmodule/xmodule/templates/problem/numericalresponse.yaml index 7ac4daa88a..614cf66d6f 100644 --- a/common/lib/xmodule/xmodule/templates/problem/numericalresponse.yaml +++ b/common/lib/xmodule/xmodule/templates/problem/numericalresponse.yaml @@ -3,22 +3,53 @@ metadata: display_name: Numerical Response rerandomize: never showanswer: always - markdown: | + markdown: " A numerical response problem accepts a line of text input from the student, and evaluates the input for correctness based on its - numerical value. + numerical value. + The answer is correct if it is within a specified numerical tolerance of the expected answer. + - Enter the numerical value of Pi: + Enter the numerical value of Pi: + = 3.14159 +- .02 - Enter the approximate value of 502*9: + + Enter the approximate value of 502*9: + = 4518 +- 15% + - Enter the number of fingers on a human hand: + Enter the number of fingers on a human hand: + = 5 + + + + +
+ + Explanation + + + Pi, or the the ratio between a circle's circumference to its diameter, is an irrational number + known to extreme precision. It is value is approximately equal to 3.14. + + + Although you can get an exact value by typing 502*9 into a calculator, the result will be close to + 500*10, or 5,000. The grader accepts any response within 15% of the true value, 4518, so that you + can use any estimation technique that you like. + + + If you look at your hand, you can count that you have five fingers. + +
+
+ " + data: |

diff --git a/common/lib/xmodule/xmodule/templates/problem/optionresponse.yaml b/common/lib/xmodule/xmodule/templates/problem/optionresponse.yaml index 2ec60860d6..5e07151e50 100644 --- a/common/lib/xmodule/xmodule/templates/problem/optionresponse.yaml +++ b/common/lib/xmodule/xmodule/templates/problem/optionresponse.yaml @@ -3,22 +3,36 @@ metadata: display_name: Option Response rerandomize: never showanswer: always - markdown: | + markdown: " OptionResponse gives a limited set of options for students to respond with, and presents those options - in a format that encourages them to search for a specific answer rather than being immediately presented with options from which to recognize the correct answer.

+ in a format that encourages them to search for a specific answer rather than being immediately presented + with options from which to recognize the correct answer. + The answer options and the identification of the correct answer is defined in the optioninput tag. + Translation between Option Response and __________ is extremely straightforward: + [[(Multiple Choice), String Response, Numerical Response, External Response, Image Response]] + -
-

Explanation

-

Multiple Choice also allows students to select from a variety of pre-written responses, although the format makes it easier for students to read very long response options. Optionresponse also differs slightly because students are more likely to think of an answer and then search for it rather than relying purely on recognition to answer the question.

-
-
+
+ + Explanation + + + Multiple Choice also allows students to select from a variety of pre-written responses, although the + format makes it easier for students to read very long response options. Optionresponse also differs + slightly because students are more likely to think of an answer and then search for it rather than + relying purely on recognition to answer the question. + +
+ + + " data: |

OptionResponse gives a limited set of options for students to respond with, and presents those options diff --git a/common/lib/xmodule/xmodule/templates/problem/string_response.yaml b/common/lib/xmodule/xmodule/templates/problem/string_response.yaml index 3af6026f56..adeff4bb58 100644 --- a/common/lib/xmodule/xmodule/templates/problem/string_response.yaml +++ b/common/lib/xmodule/xmodule/templates/problem/string_response.yaml @@ -3,24 +3,37 @@ metadata: display_name: String Response rerandomize: never showanswer: always - markdown: ! - A string response problem accepts a line of text input from the - student, and evaluates the input for correctness based on an expected + # Note, the extra newlines are needed to make the yaml parser add blank lines instead of folding + markdown: " + A string response problem accepts a line of text input from the + student, and evaluates the input for correctness based on an expected answer within each input box. + - The answer is correct if it matches every character of the expected answer. This can be a problem with - international spelling, dates, or anything where the format of the answer is not clear. + The answer is correct if it matches every character of the expected answer. This can be a problem with + international spelling, dates, or anything where the format of the answer is not clear. + Which US state has Lansing as its capital? + = Michigan + -

-

Explanation

-

Lansing is the capital of Michigan, although it is not Michgan's largest city, or even the seat of the county in which it resides.

+ +
+ + Explanation + + + Lansing is the capital of Michigan, although it is not Michgan's largest city, + or even the seat of the county in which it resides. + +
+ - + " data: |