Aditya, As usual, great work. I don't understand the purpose of the fourth argument to \dowritelist: \def\savescore{\expanded{\dowritetolist{Score} {\convertednumber[Answer]}{\countervalue{totalscore}}{Question}}} There are 4 arguments here, as in \dowritelist#1#2#3#4. It appears that: #1 holds the name of the list. #2 ? #3 ? #4 ? Can you describe what is expected in #2, #3, and #4? Above, I can see that you are sending the number of the current answer to #2 and the value of the total score to #3. This is not my problem. My problem is what is generally expected in #2 and #3 and I am baffled by the use of #4. Any help appreciated. On Jun 3, 2007, at 7:36 AM, Aditya Mahajan wrote:
On Sun, 3 Jun 2007, batela wrote:
\startelements dutch english german czech italian romanian french
begin: beginvan start anfang zacatek inizio inceput debut end: eindvan stop ende konec fine sfarsit fin \stopelements \defineenumeration[Answer][text=Question] \defineenumeration[Question] \defineblock[answer,question] \setupblock [answer][before={\startAnswer\resetscore},after={\savescore \stopAnswer}] \setupblock [question][before={\startQuestion},after={\stopQuestion}] \makecounter{totalscore} \definelist[Score] [ pagenumber=no, width=5em, height=broad, textcommand=\showscores, numbercommand=\showquestionnumber, ] \def\showscores#1{\dotfill\emspace#1~points} \def\showquestionnumber#1{Question~#1} \def\score[#1]% {\incrementcounter{totalscore}{#1}% \dotfill\emspace#1~points\endgraf} \def\resetscore{\resetcounter{totalscore}} \def\savescore {\expanded{\dowritetolist{Score}
There should be no line break here
{\convertednumber[Answer]}{\countervalue{totalscore}}{Question}}} \hideblocks[answer,question] \def\generateexam {\title{Exam} \useblocks[question] \title{Scores} \placelist[Score][criterium=all] \title{Criteria} \useblocks[answer]} \starttext \startquestion In a body with mass=2 kg is applied a force of 2N. Which is the body acceleration? \startanswer write F = m a \score[5] solve a = F/m \score[4] find and write correctly a = 1 m/s2 \score[1] \stopanswer \stopquestion \startquestion In a body with mass=2 kg is applied a force of 2N. Which is the body acceleration? \startanswer write F = m a \score[5] solve a = F/m \score[14] find and write correctly a = 1 m/s2 \score[10.5] \stopanswer \stopquestion \generateexam \stoptext
this code generate a little error:
Wrong line breaks caused by email client. Try the attached code.
Aditya
______________________________________________________________________ _____________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ______________________________________________________________________ _____________