All,<br><br>I think this is absolutely brilliant. After our class on Friday, I noticed a LOT of conceptual overlap of the simple projects that people were proposing and I think a math API would be a great place to start. As I've been trying to mention to everyone, I've not had any experience with Python so perhaps I'd be better suited to work on the database integration? (Not that I've done SQLite either, but SQL is SQL generally...).<br>
<br>In regards to the class, I know Profs. Jacobs and Grace are not extremely regulating our final deliverable for the class but I feel a strong API would be much more of a milestone than 10 small apps. that don't make it out of a beta stage.<br>
<br>I think we should try and drum up support for this idea. Bring on the replies!<br><br>Cheers,<br>Brian Long<br><a href="mailto:bbl5660@rit.edu">bbl5660@rit.edu</a><br><br><br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
---------- Forwarded message ----------<br>From: Enimihil <<a href="mailto:enimihil@gmail.com">enimihil@gmail.com</a>><br>To: <a href="mailto:fourthgrademath@lists.sugarlabs.org">fourthgrademath@lists.sugarlabs.org</a><br>
Date: Fri, 27 Mar 2009 22:32:03 -0400<br>Subject: [math4] Quiz/Question API Proposal<br>Hello all,<br>
<br>
This is my first post so I guess I should introduce myself a bit. I'm<br>
Greg S., one of the RIT students in the class working on the Math4<br>
goals, and something that I've mentioned might be a good idea a few<br>
times now is a shared library/API for quiz questions/drilling so that<br>
activity developers can leverage content and easily use questions<br>
written in a variety of formats, from a variety of sources.<br>
<br>
Inline below is a simple outline of a proposal for an API along those<br>
lines, with a few notes on implementation at the end. Just trying to<br>
propose something to save and/or centralize some common work that<br>
needs to be done for a variety of activities.<br>
<br>
=================================<br>
Sugar Quiz API Preliminary Design<br>
=================================<br>
<br>
Motivation<br>
==========<br>
<br>
In the RIT class working on the Math4 projects, many proposed activities<br>
require a question database of some kind. A common API or library for<br>
accessing databases in different formats, stored either locally or remotely,<br>
along with a simple mechanism to determine more complex formatting or<br>
presentation than simple text (e.g. to include simple graphics or<br>
mathematical notation) would cover a majority of the cases where the<br>
activity needs some configurable "curriculum data".<br>
<br>
Eventually this library could be extended to provide hints, explanations, or<br>
walkthroughs for questions, in addition to the basic metadata about level,<br>
grouping, difficulty, and subject matter that would be part of the base<br>
system.<br>
<br>
Envisioned Usage<br>
================<br>
<br>
Consider a simple flash-card-like activity. It presents a question from a<br>
list of questions, allows the student to select an answer from the provided<br>
answers for the question or to enter their own answer. Then the correct<br>
answer is revealed and the student it told whether their answer is correct.<br>
If the question has an explanation of the correct answer, the flash-card<br>
activity will show the explanation of the correct answer. (Note that this<br>
is just a simple usage example, the interaction design of a drilling<br>
activity could be markedly different.)<br>
<br>
The flash-card activity would use this proposed Quiz API for the following:<br>
<br>
- Loading the questions from the storage location into memory. This<br>
includes any filtering or network lookup to download the questions<br>
from a remote resource and select appropriate questions for the<br>
student.<br>
<br>
- Determining whether the student has entered a correct answer.<br>
<br>
- Rendering the question to a simple widget/canvas. (i.e. pass the<br>
library a GtkCanvas or similar and tell it to display the question)<br>
<br>
To start with, the library would simply be a time-saving tool for developers<br>
needing similar functionality, but as the XS (School Server) becomes more<br>
fully developed the library should integrate the functions provided by the<br>
XS to enable automated update of course material for the current topic of<br>
study so the students can drill material using any tool they prefer, while<br>
still reporting progress to the instructor using the XS services.<br>
<br>
Proposed API<br>
============<br>
<br>
The Quiz API would be a python library, to act mostly as glue between<br>
various file formats (and local or remote resources) for question data and<br>
the Gtk graphical environment, providing a simple way to consistently<br>
present and layout questions.<br>
<br>
:quizdata.open(uri, [cache=False]):<br>
Opens a URI, returning a list of quizdata.Question instances. A<br>
standard method of filtering question data based on parameters<br>
should be specified. Examples of URIs that might be used::<br>
<br>
<a href="http://xs-server/math4class/current_topic?level=4&difficulty=hard&format=moodle" target="_blank">http://xs-server/math4class/current_topic?level=4&difficulty=hard&format=moodle</a><br>
<br>
file:///var/lib/mathquestions/quiz1?level=4&difficulty=hard&format=xml<br>
<br>
xmpp://teacheraccount@xs.server/classname?difficulty=hard&level=4<br>
<br>
The cache parameter would locally save the retrieved questions to a<br>
persistent storage so requests from the same URI (with cache=True)<br>
would read from the cache.<br>
<br>
:class quizdata.Question:<br>
This class contains individual data for a question:<br>
- The question text<br>
- The style of answer (incl. multiple-choice, numeric, free<br>
response, etc.)<br>
- The correct answer (or if the question is subjective, that<br>
there *is* no correct answer).<br>
- Question difficulty<br>
- Grade level<br>
- Tags (for free-form grouping by topic, course, instructor,<br>
etc.)<br>
<br>
The question text and answers should support at least minimal<br>
markup, like that supported by pango, in addition to markup<br>
rendering with MathML/LaTeX syntax.<br>
<br>
.. note::<br>
The attributes listed above will should grow standardized names<br>
and be documented as part of the interface to the Question<br>
class, to allow for fine-grained for activity controlled<br>
rendering of the Question, if the simple show() call is not<br>
appropriate.<br>
<br>
:Question.show(surface, x, y, [width=-1, [height=-1]]):<br>
Draw the question to the drawing surface at coordinates (x,y)<br>
limited to the optionally specified width/height.<br>
<br>
This also should set up the appropriate input widgets for the<br>
type of question (multiple-choice/free-response) and handle the<br>
vents for those widgets.<br>
<br>
:Question.answered():<br>
Returns True if the student has provided an answer for the<br>
Question.<br>
<br>
:Question.submitted():<br>
Returns True if the student has submitted an answer for the<br>
Question.<br>
<br>
:Question.correct():<br>
Returns True if the currently selected answer is correct for the<br>
Question.<br>
<br>
:Question.answer():<br>
Returns the answer the student has currently selected, or None<br>
if no answer has been entered.<br>
<br>
:Question.clear():<br>
Removes the widgets and drawings that show() set up, preparing<br>
the surface to receive the next question or other widgets.<br>
<br>
<br>
Implementation Issues<br>
======================<br>
<br>
The implementation of this (deceptively simple) library will take some<br>
effort, in that it will be closely tied to the windowing/graphical toolkit,<br>
PyGtk/Cairo/Pango rather directly, due to the high level of abstraction.<br>
Additionally the URI lookup and question filtering based on parameters will<br>
be necessary, as will interpreter the various format parsers necessary to<br>
build the Question objects.<br>
<br>
For MathML support, the GtkMathView widget will need to be available, so a<br>
certain amount of effort may be involved in packaging the library in a<br>
simple way for activity developers.<br>
<br>
Next Steps<br>
==========<br>
<br>
Firstly, this API is being proposed and posted to the Math4 mailing list for<br>
feedback and changes before any commitments to this interface is decided.<br>
For any activity developers who are currently working on an activity that<br>
could take advantage of such a system, or who have written similar<br>
functionality in an activity, your input on usage and the naturalness of the<br>
API.<br>
<br>
Secondly, anyone who is interested in doing work on this library or using<br>
the library in their activity should chime in, along with the expected usage<br>
or how you can contribute.<br>
<br>
Greg S.<br>
--<br>
Email is packaged by intellectual weight, not volume. Some settling of<br>
contents may have occurred during transmission.<br>
<br>
<br>_______________________________________________<br>
FourthGradeMath mailing list<br>
<a href="mailto:FourthGradeMath@lists.sugarlabs.org">FourthGradeMath@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/fourthgrademath" target="_blank">http://lists.sugarlabs.org/listinfo/fourthgrademath</a><br>
<br></blockquote></div><br>