Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg S <enimihil@gmail.com>2009-05-06 19:33:42 (GMT)
committer Greg S <enimihil@gmail.com>2009-05-06 19:33:42 (GMT)
commit0cc8a0559d02e1c9d3f21e95aa078f9d574bbb16 (patch)
tree2b0595c5c999cc169e7fb53cc54bbabd181b088a
parentc4459d838d97e5dff3b46b2da4bf05223fc95845 (diff)
parente3b4abcb266953b03add3bdf025a6c44aad8ee0d (diff)
Merge branch 'master' of gitorious@git.sugarlabs.org:question-support-api/mainline
-rw-r--r--doc/question_interface.rst22
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/question_interface.rst b/doc/question_interface.rst
new file mode 100644
index 0000000..4b3e9c0
--- /dev/null
+++ b/doc/question_interface.rst
@@ -0,0 +1,22 @@
+Question
+========
+
+A Question object is guaranteed to have the following behavior:
+
+ - When initially created stores None as `response` and `submitted` is False.
+ - Whenever response is updated, the `correct` property is set to the credit
+ earned for the question (often actually set to True=1 and False=0, though
+ partial credit is possible).
+ - The `text` attribute of a question is the data object to be presented to
+ the user, along with possible answers, if any are given. The `text` and
+ `answers` fields will contain an object that can be passed to some subset
+ of the markup/media-type conversion functions to produce a value of the
+ appropriate type. (It is not recommended that you test types directly,
+ instead use the functions provided for this purpose).
+ - A `title` attribute will *always* be present on the object, though it may
+ be None.
+ - Some question types may have additional information required to present
+ them correctly. It is recommended that generic functions, with
+ appropriate error handling, be used for rendering questions to the user.
+ (Generic functions are already used internally by the question API, so
+ the PEAK-Rules implementation is already available to users of the API).