diff --git a/common/lib/xmodule/xmodule/capa_module.py b/common/lib/xmodule/xmodule/capa_module.py index ae7ebc3b78..4211434619 100644 --- a/common/lib/xmodule/xmodule/capa_module.py +++ b/common/lib/xmodule/xmodule/capa_module.py @@ -638,14 +638,13 @@ class CapaDescriptor(RawDescriptor): stores_state = True has_score = True + template_dir_name = 'problem' # Capa modules have some additional metadata: # TODO (vshnayder): do problems have any other metadata? Do they # actually use type and points? metadata_attributes = RawDescriptor.metadata_attributes + ('type', 'points') - template_dir_name = 'problem' - # VS[compat] # TODO (cpennington): Delete this method once all fall 2012 course are being # edited in the cms diff --git a/common/lib/xmodule/xmodule/discussion_module.py b/common/lib/xmodule/xmodule/discussion_module.py index 4bfaeee183..1deceac5d0 100644 --- a/common/lib/xmodule/xmodule/discussion_module.py +++ b/common/lib/xmodule/xmodule/discussion_module.py @@ -30,3 +30,4 @@ class DiscussionModule(XModule): class DiscussionDescriptor(RawDescriptor): module_class = DiscussionModule + template_dir_name = "discussion" diff --git a/common/lib/xmodule/xmodule/html_module.py b/common/lib/xmodule/xmodule/html_module.py index f5672ca1b8..a6ec33e08c 100644 --- a/common/lib/xmodule/xmodule/html_module.py +++ b/common/lib/xmodule/xmodule/html_module.py @@ -34,6 +34,7 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor): mako_template = "widgets/html-edit.html" module_class = HtmlModule filename_extension = "xml" + template_dir_name = "html" js = {'coffee': [resource_string(__name__, 'js/src/html/edit.coffee')]} js_module_name = "HTMLEditingDescriptor" diff --git a/common/lib/xmodule/xmodule/seq_module.py b/common/lib/xmodule/xmodule/seq_module.py index d5c26d889e..b625646e66 100644 --- a/common/lib/xmodule/xmodule/seq_module.py +++ b/common/lib/xmodule/xmodule/seq_module.py @@ -117,7 +117,7 @@ class SequenceDescriptor(MakoModuleDescriptor, XmlDescriptor): stores_state = True # For remembering where in the sequence the student is - template_dir_name = 'sequential' + template_dir_name = 'sequence' @classmethod def definition_from_xml(cls, xml_object, system): diff --git a/common/lib/xmodule/xmodule/templates/discussion/default.yaml b/common/lib/xmodule/xmodule/templates/discussion/default.yaml new file mode 100644 index 0000000000..fa6dcbff54 --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/discussion/default.yaml @@ -0,0 +1,6 @@ +--- +metadata: + display_name: Discussion Tag +data: | + +children: [] diff --git a/common/lib/xmodule/xmodule/templates/html/announcement.yaml b/common/lib/xmodule/xmodule/templates/html/announcement.yaml new file mode 100644 index 0000000000..ae89c3890e --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/html/announcement.yaml @@ -0,0 +1,25 @@ +--- +metadata: + display_name: Announcement + +data: | +
    +
  1. +

    September 21

    +
    +
    +

    Words of encouragement! This is a short note that most students will read.

    +

    — Anant Agarwal (6.002x Principle Instructor)

    +
    +

    Primary versus Secondary Updates:

    Unfortunately, the internet throws a lot of text at students, and they + do not read everything that they are given. However, many students do read all that they are + given, and so detailed explainations in this section will benefit the most concientious. + Any essential information should be extremely quickly summarized in the primary section for skimmers.

    +

    Star Forum Poster

    + Students appriciate knowing that the course staff is reading what they post, and one of several ways + that you can do this is by acknowledging the start posters in your announcements. +

    +
    +
  2. +
+children: [] diff --git a/common/lib/xmodule/xmodule/templates/html/everything.yaml b/common/lib/xmodule/xmodule/templates/html/everything.yaml new file mode 100644 index 0000000000..348ce64fa1 --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/html/everything.yaml @@ -0,0 +1,33 @@ +--- +metadata: + display_name: Announcement + +data: | +

Heading of document

+

First subheading

+

This is a paragraph. It will take care of line breaks for you.

HTML only parses the location + + of tags for inserting line breaks into your doc, not + line + breaks + you + add + yourself. +

+

Links

+

You can refer to other parts of the internet with a link, to other parts of your course by prepending your link with /course/

+

Now a list:

+ +

This list has an ordering

+
    +
  1. An item
  2. +
  3. Another item
  4. +
  5. Yet another item
  6. +
+

Note, we have a lot of standard edX styles, so please try to avoid any custom styling, and make sure that you make a note of any custom styling that you do yourself so that we can incorporate it into + tools that other people can use.

+children: [] diff --git a/common/lib/xmodule/xmodule/templates/problem/circuitschematic.yaml b/common/lib/xmodule/xmodule/templates/problem/circuitschematic.yaml new file mode 100644 index 0000000000..224227aa5e --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/problem/circuitschematic.yaml @@ -0,0 +1,131 @@ +--- +metadata: + display_name: Circuit Schematic +data: | + + + + + Your goal for this lab is to design a circuit that implements a + + 3-input logic gate that implements \(Z = \lnot{(C(A+B))}\) where the + \(\lnot\) symbol stands for logical negation. This function is + enumerated in the following truth table: + +
+      C B A | Z
+      =========
+      0 0 0 | 1
+      0 0 1 | 1
+      0 1 0 | 1
+      0 1 1 | 1
+      1 0 0 | 1
+      1 0 1 | 0
+      1 1 0 | 0
+      1 1 1 | 0
+      
+ + The schematic diagram below includes the resistive pullup for the logic + gate and some voltage sources that serve as the power supply and + generators for the signals that will be the inputs to the gate. + The voltage sources generate the three input signals (A, B and C), timed so that all + possible combinations of the inputs will be generated over a \(4\mu s\) + interval. + +

Please add the appropriate pulldown network of mosfet + switches connected to node Z to implement the truth table above, with + \(R_{ON}\) of the mosfets chosen so that \(V_{ol}\) of the logic gate is less than + \(0.25V\) for any combination of inputs. In the schematic tool, the mosfet + model has \(V_{th} = 0.5V\), so \(V_{ol} \lt 0.25V\) + will ensure that when the output of the logic gate is 0, if it is used + as the input to some other logic gate, the mosfet to which + it connects will be off. + +

On page 305 of the text we + see from Equation (6) that \(R_{ON} = R_n \frac{L}{W}\). In the + schematic tool, the mosfet model has \(R_n \approx 26.5k\Omega\) when + using a \(3V\) power supply. To adjust \(R_{ON}\), double click the + mosfet and select an appropriate value for the W/L parameter. For + example, setting a mosfet's W/L to 10 would result in \(R_{ON} = + 2.65k\Omega\). + +

Note that the "Plot offset" property of the scope probes + on the A, B and C signals has been set so that the plots will not + overlap, making it easier to see what's happening. + +

Please do not change the voltages of the voltage sources or the + resistance of the pullup resistor. + + + + +
+ +
+ + # for a schematic response, submission[i] is the json representation + # of the diagram and analysis results for the i-th schematic tag + + def get_tran(json,signal): + for element in json: + if element[0] == 'transient': + return element[1].get(signal,[]) + return [] + + def get_value(at,output): + for (t,v) in output: + if at == t: return v + return None + + output = get_tran(submission[0],'Z') + okay = True + + # output should be 1, 1, 1, 1, 1, 0, 0, 0 + if get_value(0.0000004,output) < 2.7: okay = False; + if get_value(0.0000009,output) < 2.7: okay = False; + if get_value(0.0000014,output) < 2.7: okay = False; + if get_value(0.0000019,output) < 2.7: okay = False; + if get_value(0.0000024,output) < 2.7: okay = False; + if get_value(0.0000029,output) > 0.25: okay = False; + if get_value(0.0000034,output) > 0.25: okay = False; + if get_value(0.0000039,output) > 0.25: okay = False; + + correct = ['correct' if okay else 'incorrect'] + + +
+ + + + When your circuit is ready for testing, run a \(4\mu s\) transient + simulation to verify correct functionality and appropriate \(V_{ol}\) + when the output of the gate is logic 0. To submit, please click + CHECK. The checker will be verifying the voltage of the + output node at several different times, so you'll earn a checkmark + only after you've performed the transient simulation so that + the checker will have a waveform to check! + +

Hint: you'll only need 3 mosfet switches to implement the gate. + +

When the gate is correctly implemented, the plot produced by the transient + analysis should like similar to the following figure. + +
+ +
Figure 1. Example plot output +
+ +

Food for thought: You'll notice there are little spikes, + sometimes called glitches, in the output waveform (see the + bottom cyan-colored waveform in Figure 1). These only occur when the + A and B inputs are changing simultaneously and the C input is high. + Can you explain why? Think about what is happening in the pulldown + circuitry at the time the glitches occur. + + + +
+children: [] diff --git a/common/lib/xmodule/xmodule/templates/problem/customgrader.yaml b/common/lib/xmodule/xmodule/templates/problem/customgrader.yaml new file mode 100644 index 0000000000..3b1f6599fa --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/problem/customgrader.yaml @@ -0,0 +1,31 @@ +--- +metadata: + display_name: Custom Grader +data: | + + +

Example: Custom Response Problem

+ +

+ A custom response problem accepts one or more lines of text input from the + student, and evaluates the inputs for correctness based on evaluation using a + python script embedded within the problem. +

+ + + + + Enter two integers which sum to 10:
+ +
+ +
+
+ +
+
+children: [] diff --git a/common/lib/xmodule/xmodule/templates/problem/forumularesponse.yaml b/common/lib/xmodule/xmodule/templates/problem/forumularesponse.yaml new file mode 100644 index 0000000000..398438d953 --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/problem/forumularesponse.yaml @@ -0,0 +1,38 @@ +--- +metadata: + display_name: Formula Repsonse +data: | + + +

Example: Formula Response Problem

+ +

+ A formula response problem accepts a line of text input from the + student, and evaluates the input for correctness based on numerical sampling of + the symbolic formula which is given. +

+ +

+ The answer is correct if it is within a specified numerical tolerance + of the expected answer. +

+ +

This kind of response checking can handle symbolic expressions, but places an extra burden + on the problem author to specify the allowed variables in the expression, and the + numerical ranges over which the variables must be sampled to test for correctness.

+ + + + +
+ Give an equation for the relativistic energy of an object with mass m. Explicitly indicate multiplication with a * symbol.
+
+ + +
E = +
+ +
+
+children: [] diff --git a/common/lib/xmodule/xmodule/templates/problem/imageresponse.yaml b/common/lib/xmodule/xmodule/templates/problem/imageresponse.yaml new file mode 100644 index 0000000000..3469e9c055 --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/problem/imageresponse.yaml @@ -0,0 +1,26 @@ +--- +metadata: + display_name: Image Response +data: | + + +

Example: Image Response Problem

+ +

+ When teaching conventionally, a common check for understanding is to ask the student to point + at something which satisfies a set of contraints. This use case is captured in the imageresponse. + An image response problem presents an image for the student. Input is + given by the location of mouse clicks on the image. Correctness of input can only be evaluated based on expected dimensions of a rectangle. + +

+ + + Click on the cow in this image: + + + + +
+
+ +children: [] diff --git a/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml b/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml new file mode 100644 index 0000000000..cc2502a855 --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml @@ -0,0 +1,27 @@ +--- +metadata: + display_name: Multiple Choice +data: | + + +

Example: Multiple Choice Response Problem

+ +

+ A multiple choice response problem presents radio buttons for student + input. One or more of the choice may be correct.--> Correctness of + input is evaluated based on expected answers specified within each + "choice" stanza. +

+ +

Select the correct choice. Grass is:

+ + + Red + Green + Yellow + Blue + + +
+
+children: [] diff --git a/common/lib/xmodule/xmodule/templates/problem/numericalresponse.yaml b/common/lib/xmodule/xmodule/templates/problem/numericalresponse.yaml new file mode 100644 index 0000000000..3f4861a01e --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/problem/numericalresponse.yaml @@ -0,0 +1,28 @@ +--- +metadata: + display_name: Numerical Response +data: | + + +

Example: Numerical Response Problem

+ +

+ A numerical response problem accepts a line of text input from the + student, and evaluates the input for correctness based on its + numerical value. +

+ +

+ The answer is correct if it is within a specified numerical tolerance + of the expected answer. +

+ +

Enter the numerical value of Pi: + + + + +

+
+
+children: [] diff --git a/common/lib/xmodule/xmodule/templates/problem/optionresponse.yaml b/common/lib/xmodule/xmodule/templates/problem/optionresponse.yaml new file mode 100644 index 0000000000..95e19e369c --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/problem/optionresponse.yaml @@ -0,0 +1,19 @@ +--- +metadata: + display_name: Option Response +data: | + + +

Example: Option Response Problem

+

+ An option response problem presents option boxes for students to select from. Correctness of input is evaluated based + on which option is defined as correct in the optioninput statement. +

+

Select the correct options:

+ +

The location of the sky is:

+

The location of the earth is:

+
+
+
+children: [] diff --git a/common/lib/xmodule/xmodule/templates/problem/string_response.yaml b/common/lib/xmodule/xmodule/templates/problem/string_response.yaml new file mode 100644 index 0000000000..47c5adf1a4 --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/problem/string_response.yaml @@ -0,0 +1,41 @@ +--- +metadata: + display_name: String Response +data: | + + +

Example: String Response Problem

+

+ + 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 is the expected answer. +

+
+ + +

Which US state has Lansing as its capital?    

+ + + + + + + + + The state capital of Wisconsin is Madison. + + + The state capital of Minnesota is St. Paul. + + + The state you are looking for is also known as the 'Great Lakes State' + + + +
+ +
+children: [] diff --git a/common/lib/xmodule/xmodule/templates/sequential/with_video.yaml b/common/lib/xmodule/xmodule/templates/sequence/with_video.yaml similarity index 50% rename from common/lib/xmodule/xmodule/templates/sequential/with_video.yaml rename to common/lib/xmodule/xmodule/templates/sequence/with_video.yaml index 2aed4594c1..a56d44ebff 100644 --- a/common/lib/xmodule/xmodule/templates/sequential/with_video.yaml +++ b/common/lib/xmodule/xmodule/templates/sequence/with_video.yaml @@ -1,6 +1,7 @@ --- metadata: display_name: Sequence with Video + data_dir: a_made_up_name data: '' children: - - 'i4x://edx/templates/video/Empty' + - 'i4x://edx/templates/video/default' diff --git a/common/lib/xmodule/xmodule/templates/video/default.yaml b/common/lib/xmodule/xmodule/templates/video/default.yaml new file mode 100644 index 0000000000..0ce2046ebe --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/video/default.yaml @@ -0,0 +1,7 @@ +--- +metadata: + display_name: default + data_dir: a_made_up_name +data: | +