From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Borkowski Subject: Re: Extending the Org syntax by a custom exporter - how to do it? Date: Sat, 15 Mar 2014 22:22:44 +0100 Message-ID: <20140315222244.5eee2361@aga-netbook> References: <20140315111059.00d3b8e0@aga-netbook> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOw2g-0008NO-NI for emacs-orgmode@gnu.org; Sat, 15 Mar 2014 17:23:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WOw2b-0005HF-2N for emacs-orgmode@gnu.org; Sat, 15 Mar 2014 17:22:54 -0400 Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:37852) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOw2a-0005H0-NN for emacs-orgmode@gnu.org; Sat, 15 Mar 2014 17:22:48 -0400 Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id 8C24442065 for ; Sat, 15 Mar 2014 22:22:46 +0100 (CET) Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wUEPKyP+3+fd for ; Sat, 15 Mar 2014 22:22:46 +0100 (CET) Received: from aga-netbook (99-234.echostar.pl [213.156.99.234]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id 53EDB42063 for ; Sat, 15 Mar 2014 22:22:46 +0100 (CET) In-Reply-To: <20140315111059.00d3b8e0@aga-netbook> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Dnia 2014-03-15, o godz. 11:10:59 Marcin Borkowski napisa=C5=82(a): > Hi list, >=20 > I'd like to extend the LaTeX exporter to be able to prepare tests with > Org-mode. Four basic kinds of tests I'm thinking about are: single > choice test, multiple choice test, cloze test and an "open" question > (where the expected answer is, say, at most 5 lines of text). It > would enable the user to typeset both the test for students and an > answer sheet for the teacher to facilitate grading. (If - and when - I > succeed in doing this, next logical step is preparing HTML/Javascript > tests from the same Org-mode source.) I have a few questions, though. >=20 > 1. Is it possible to employ syntax like ____{noon|midday} to denote a > cloze with two possible answers? It might get translated to LaTeX as > e.g. \cloze{{noon},{midday}} or similar, and a LaTeX package would > take care to typeset this correctly. Is there any similar thing > (i.e., an exporter built on some existing one) so that I can look at > an example of code doing such thing? >=20 > 2. What would you suggest as the input format on the Org side of > things? My suggestion for the cloze syntax is shown above (let us > assume that at least two or three underscores are needed to > distinguish this from subscript, and some form of escaping the pipe > symbol and braces might be necessary. Alternatively, it might be > configurable to use e.g. ____[noon/midday] (or other characters). >=20 > What about SCTs/MCTs? My idea would be to employ plain lists with > checkboxes - they seem to be pretty useless outside Org-mode anyway, > and I imagine that it could be something like this: >=20 > #+ > - [ ] wrong answer > - [X] good answer > - [X] another good answer > - [ ] a completely stupid answer >=20 > As for "open" questions, I have no good idea. Maybe something like >=20 > #+LINES: 5 >=20 > but what about example answers (for the teacher grading the test)? > Maybe it would be better to say: > #+BEGIN_ANSWER > (Here goes the right answer.) > #+END_ANSWER, >=20 > but is it possible to pass a parameter (number of lines) to > #+BEGIN_ANSWER? >=20 > 3. Bonus question: would there be any demand (apart from myself) for > such an exporter? >=20 > What do you think? OK, so I did some research, and I found out that "special blocks" are probably the best idea. So, items with checkboxes whose :parent is a special block like "MCT" or "SCT" could behave accordingly. Still, I can't see in the docs any mentions about possible properties of special blocks. Is it possible to make an exporter so that I could say #+BEGIN_ANSWER :lines 2 This is an answer. #+END_ANSWER so that I could use the property :lines in org-special-block? I don't want to utilize #+ATTR_LATEX, since I'm aiming at extensions to both LaTeX and HTML exporters recognizing this thing. Best, --=20 Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University