Problem Structure ================= Problems are a collection of a problem overview (or introduction), a question, and a solution. All problems are contained within an element with a class of "problems". Single Problems *************** The basic structure of a problem looks something like this (indents will be appropriate for copy and paste): .. code-block:: html
`` markup indicates that you are generating the intro or overview part of the problem. We want to use the class ``"problem"`` here for consistency but you can can think of it as "introduction" or "overview" or "needed info." Problem or Introduction ----------------------- The problem overview/introduction is optional and is defined with a class of "problem." It is mainly useful for word problems or any kind of problem that has important text or information that isn't explicitly part of the statement of the question. For example, a Physics problem may describe the situation and the various objects in the world before asking about a certain quality of a certain object. You could also put information in after the question if you want to provide clarity on how to answer the question. For example: .. code-block:: html
Express DECIMAL as a fraction.
(Extra Info: You can express this as any fraction - you don't have to "reduce to lowest terms" for the correct answer)
will let the user know what kind of answer is acceptable. If you are doing this, ``extra-info`` can be used for consistency. Question -------- The question is required and is defined with a class of "question". At the moment, the question is appended directly after the problem and is formatted the same, although this may change depending on the system. We provide these guidelines for how to choose the problem overview content and question content, but they are ultimately left at the discretion of the exercise author. The contents are not handled or interpreted in any particular way. Solution -------- Unlike problem introductions and questions, solutions do have a very specific form of markup. Like introductions and questions, it is the class name ("solution") which matters, not the element type; however, the content of the solution element is very important and is used as the basis for validating the user's input. For example, a valid solution that is dynamically-generated from a previously-created variable would be: .. code-block:: htmlround(DIST1)
The user would then need to enter a number into the fill-in-the-blank form that matches the ``DIST1`` variable, rounded to the nearest integer. Multiple Problem Structure ************************** While it's totally possible that you might create an exercise with a single type of problem, it's very likely that you'll want to provide students with multiple styles of problems to challenge them. You will recall that the problem section of an exercise looks like this: .. code-block:: htmlBen traveled by CAR1 at an avg speed of SPEED1 mph.
He also traveled by CAR2 at an avg speed of SPEED2 mph.
The total distance covered was DIST miles for TIME hours.
How many miles did Ben go by VEHICLE1? (Round to the nearest mile.)
round(DIST1)
How many miles did Ben go by VEHICLE2? (Round to the nearest mile.)
round(DIST2)
A scarf costs $NUM_1. You buy multiple scarves.
How much would AMT_1 scarves cost?
NUM_1 * AMT_1
This is a multiplication question.
The answer is NUM_1 * AMT_1 dollars.
Sally is CHILD_AGE years old. Her mom is PARENT_MULT times older.
How old is Sally's mom?
PARENT_MULT * CHILD_AGE
"Times older" is a clue word for multiplication.
Sally's mom is PARENT_MULT * CHILD_AGE years old.