From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/14012 Path: main.gmane.org!not-for-mail From: Bernd Militzer Newsgroups: gmane.comp.tex.context Subject: enumeration and countproblem Date: 05 Nov 2003 09:02:23 +0100 Sender: ntg-context-admin@ntg.nl Message-ID: <1068019343.1803.3.camel@eagle.militzer.net.local> Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-DvnjhCBAMS2AYyGoEq2x" X-Trace: sea.gmane.org 1068019816 16807 80.91.224.253 (5 Nov 2003 08:10:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 5 Nov 2003 08:10:16 +0000 (UTC) Original-X-From: ntg-context-admin@ntg.nl Wed Nov 05 09:10:14 2003 Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AHIk2-0006Ph-00 for ; Wed, 05 Nov 2003 09:10:14 +0100 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 5C14B10B0E; Wed, 5 Nov 2003 09:10:06 +0100 (MET) Original-Received: from ws10-zva.region-aachen.de (ws10-zva.region-aachen.de [212.117.64.203]) by ref.ntg.nl (Postfix) with ESMTP id B993510ABB for ; Wed, 5 Nov 2003 09:02:33 +0100 (MET) Original-Received: from localhost (localhost [127.0.0.1]) by ws10-zva.region-aachen.de (Postfix) with ESMTP id BA1572C030 for ; Wed, 5 Nov 2003 09:12:42 +0100 (CET) Original-Received: by ws10-zva.region-aachen.de (Postfix, from userid 65534) id E72052C006; Wed, 5 Nov 2003 09:12:40 +0100 (CET) Original-Received: from eagle.militzer.net.local (pD9E42BB2.dip.t-dialin.net [217.228.43.178]) by ws10-zva.region-aachen.de (Postfix) with ESMTP id 91F6B2BFAB for ; Wed, 5 Nov 2003 09:12:36 +0100 (CET) Original-To: "ntg-context@ntg.nl" X-Mailer: Ximian Evolution 1.2.2 X-Virus-Scanned: by AMaViS snapshot-20020531 Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:14012 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:14012 --=-DvnjhCBAMS2AYyGoEq2x Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi all, Writing examinations I want to tell my students the points of each question and the max points they can reach. I wrote a macro which prints the points at the right side of the question and count the points. % % % ad the points of each question \def\getPunkte[#1]{\advance\summeP by \number#1} % % show the points on the right side \def\showP[#1]{\inright{\hfill(#1 P.)}} % % handle the points \def\pkt[#1]% {% \ifnum\ZeigeP=1 \showP[#1]% \ifnum\addP=1 \getPunkte[#1] \fi \fi% } % Using this macro in normal text like TestQuestion \pkt[5] it works without problems! But when I use this macro in combination with enumeration I run in a problem example: % \defineenumeration[question][location=inmargin,text=,width=fit] % \question\pkt[5] TestQuestion\par nothing ist count in this case! How can I fix this problem? Thanks in advance. Bernd --=-DvnjhCBAMS2AYyGoEq2x Content-Disposition: attachment; filename=test.tex Content-Type: text/plain; name=test.tex; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit \starttext % % Zähler für die Punkte [summeP] = 0 % \global\newcount\summeP \summeP=0 % % % Schalter [ZeigeP] (intern) zur Steuerung der Anzeige der Punkte % Ausgangswert 0, d.h. die Punkte werden nicht angezeigt % \chardef\ZeigeP=0 % % Schalter [addP] (intern) zur Steuerung der Berechnung der Gesamtpunkte % Ausgangswert 0, d.h. die Gesamtpunkte werden nicht berechnet \chardef\addP=0 % % Die Schalter für den Anwender % direkt nach \starttext setzen % [1] % die Punkte der Aufgaben anzeigen \def\zeigePunkte{\chardef\ZeigeP=1} % % [2] % die Gesamtpunktzahl berechnen \def\SummePunkte{\chardef\addP=1} % % Berechnung der GesamtPunkte [getPunkte] durchführen % \def\getPunkte[#1]{\advance\summeP by \number#1} % % % Punkte im rechten Rand ausgeben % \def\showP[#1]{\inright{\hfill(#1 P.)}} % % % Die Behandlung der Punktangaben % \def\pkt[#1]% {% \ifnum\ZeigeP=1 \showP[#1]% \ifnum\addP=1 \getPunkte[#1] \fi \fi% } % % \defineenumeration[question][location=inmargin,text=,width=fit] % \zeigePunkte % Punkte anzeigen \SummePunkte % Summe der Punkte berechnen % % \textrule[top]{first test} max. points (start): \number\summeP\blank % First TestQuestion \pkt[5] \dorecurse{10}{just a test text } \blank[medium] Second TestQuestion \pkt[15] \dorecurse{10}{just a test text } \blank[medium] % max. points (end): \number\summeP.\blank[2*big] % % \textrule[top]{second test} % \summeP=0 max. points (start): \number\summeP\blank % \question\pkt[5] \dorecurse{10}{just a test text }\par % \question\pkt[15] \dorecurse{10}{just a test text }\par % max. points (end): \number\summeP.\blank[2*big] % % \textrule[top]{third test} % \summeP=0 max. points (start): \number\summeP\blank % \question \dorecurse{10}{just a test text }\par\pkt[5] % \question \dorecurse{10}{just a test text }\par\pkt[15] % max. points (end): \number\summeP.\blank[2*big] % \stoptext --=-DvnjhCBAMS2AYyGoEq2x--