Re: [NTG-context] Prepare exams with ConTeXT

2007-06-03 Thread batela



\startelements dutch english
germanczech
italian   romanian
french

 begin: beginvan  start
anfangzacatek
inizioinceput
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}

{\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:

title   : - Scores
(./preparaexame2.tuo)
system  : Score not found/processed
[2.2]
title   : - Criteria
textblocks  : reading blocks from preparaexame2.tub
(./preparaexame2.tub
textblocks  : answer loaded and typeset
Runaway argument?
! Paragraph ended before \dodowritetolist was complete.
to be read again
   \par
\@@expanded -\dowritetolist {Score} \par
  {1}{10}{Question}
\@@tbanswerafter -\savescore
  \stopAnswer
\thiswasblockanswer ...lue {\??tb answer\c!after }
  \par \egroup  
\setblocklevel -

l.34 \thiswasblock{answer}

?

prepareexam.tex
Description: TeX document


___
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
___


Re: [NTG-context] Prepare exams with ConTeXT

2007-06-03 Thread Patrick Gundlach

[...]


 this code generate a little error:


this is because there are some spurious spaces in Aditya's code. It
works fine if you remove them:


\startelements dutch english
germanczech
italian   romanian
french

 begin: beginvan  start
anfangzacatek
inizioinceput
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}{\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


Patrick
___
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
___


Re: [NTG-context] Prepare exams with ConTeXT

2007-06-03 Thread Aditya Mahajan

On Sun, 3 Jun 2007, batela wrote:




\startelements dutch english
   germanczech
   italian   romanian
   french

begin: beginvan  start
   anfangzacatek
   inizioinceput
   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\startelements dutch english
germanczech
italian   romanian
french

 begin: beginvan  start
anfangzacatek
inizioinceput
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}
{\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
___
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/

Re: [NTG-context] Prepare exams with ConTeXT

2007-06-03 Thread David Arnold
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
germanczech
italian   romanian
french

 begin: beginvan  start
anfangzacatek
inizioinceput
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
 prepareexam.tex
 __ 
 _
 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
 __ 
 _

___
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
___


[NTG-context] Prepare exams with ConTeXT

2007-06-02 Thread batela

Hello to all:

I need to prepare an exam. The layout must be the following one:

Questions
page
Scores
page
Answers

For example:

\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

The result should be:

Question 1: In a body with mass=2 kg is applied a force of 2N. Which is 
the body acceleration?.


Question 2:

Question 3:
__ Page___

Scores

Question 1 . 10 points
Question 2 .. 20 points
Question 3 .. 20 points

___Page
Criteria

Question 1
write F = m a  
5 points
resolve  a = F/m4 
points

find and write correctly a = 1 m/s2 ... 1 points

are there any way to make this a easy task?

thanks a lot

Have a nice day.___
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
___


Re: [NTG-context] Prepare exams with ConTeXT

2007-06-02 Thread David Arnold

You can find some ideas here:

http://www.tug.org/pracjourn/2006-4/mahajan/

On Jun 2, 2007, at 5:22 AM, batela wrote:


Hello to all:

I need to prepare an exam. The layout must be the following one:

Questions
page
Scores
page
Answers

For example:

\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

The result should be:

Question 1: In a body with mass=2 kg is applied a force of 2N.  
Which is the body acceleration?.


Question 2:

Question 3:
__ Page___

Scores

Question 1 . 10 points
Question 2 .. 20 points
Question 3 .. 20 points

___Page
Criteria

Question 1
write F = m  
a  5 points
resolve  a = F/m 
4 points

find and write correctly a = 1 m/s2 ... 1 points

are there any way to make this a easy task?

thanks a lot

Have a nice  
day.__ 
_
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
__ 
_


___
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
___


Re: [NTG-context] Prepare exams with ConTeXT

2007-06-02 Thread batela
Thanks for your support, but I'm afraid that need some major changes to  
do what I need in my exam. In fact I need to grade several items in the  
answer and in the end of the exam I need a table with the scores of all  
questions.


In grading the student answer several aspects should be considerate.  
For example:


writing the formula.. points
explain the variables..points
solve mathematically .points
show the result with units...points

In my country all the exams are make in this format: first the  
questions/problems/quiz.., second the table scores and third the  
specific grading criterions.


I'm looking for a way for writing the question/problem and grade some  
items of the answer. Context should be able to  separate the questions  
from the answer, build the score tables and format the specific grading  
criterions.


thanks

Have a nice day



Em 02/06/2007, às 9:27, David Arnold escreveu:


You can find some ideas here:

http://www.tug.org/pracjourn/2006-4/mahajan/

On Jun 2, 2007, at 5:22 AM, batela wrote:


Hello to all:

I need to prepare an exam. The layout must be the following one:

Questions
page
Scores
page
Answers

For example:

\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

The result should be:

Question 1: In a body with mass=2 kg is applied a force of 2N. Which  
is the body acceleration?.


Question 2:

Question 3:
__ Page___

Scores

Question 1 . 10 points
Question 2 .. 20 points
Question 3 .. 20 points

___Page
Criteria

Question 1
write F = m a  
 5 points
resolve a = F/m4  
points

find and write correctly a = 1 m/s2 ... 1 points

are there any way to make this a easy task?

thanks a lot

Have a nice  
day.__ 
_
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
__ 
_
___ 

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
___ 




Abraços,

Jorge Manuel de Almeida Magalhães
___
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
___


Re: [NTG-context] Prepare exams with ConTeXT

2007-06-02 Thread Aditya Mahajan
On Sat, 2 Jun 2007, batela wrote:

 Hello to all:

 I need to prepare an exam. The layout must be the following one:

 Questions
 page
 Scores
 page
 Answers

 For example:

 \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

 The result should be:

 Question 1: In a body with mass=2 kg is applied a force of 2N. Which is the 
 body acceleration?.

 Question 2:

 Question 3:
 __ Page___

 Scores

 Question 1 . 10 points
 Question 2 .. 20 points
 Question 3 .. 20 points

 ___Page
 Criteria

 Question 1
 write F = m a  5 
 points
 resolve  a = F/m4 points
 find and write correctly a = 1 m/s2 ... 1 points

 are there any way to make this a easy task?

For placing questions and answers at different locations, use blocks. 
I do not know what is a good way of generate list of scores. I think 
that it can be done using lists, but I do not know lists well enough 
to do that quickly.

Also if you do not like the fact that lists use \begin ... \end as 
delimiters, and want to use \start ... \stop here is a ugly hack :)



\startelements dutch english
germanczech
italian   romanian
french

 begin: beginvan  start
anfangzacatek
inizioinceput
debut
   end: eindvan   stop
ende  konec
fine  sfarsit
fin

\stopelements

\defineenumeration[Answer][text=Question]
\defineenumeration[Question]
\defineblock[answer,question]
\setupblock
   [answer][before={\startAnswer},after={\stopAnswer}]
\setupblock
   [question][before={\startQuestion},after={\stopQuestion}]

\def\score[#1]{\dotfill\emspace#1~points\endgraf}

\hideblocks[answer,question]

\def\generateexam
   {\title{Exam}
\useblocks[question]
\title{Scores}
I do not know how to do this. You can use lists, or there may be easier
ways
\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[4]
find and write correctly a = 1 m/s2 \score[1]
  \stopanswer
\stopquestion

\generateexam

\stoptext


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
___


Re: [NTG-context] Prepare exams with ConTeXT

2007-06-02 Thread batela
Thanks a lot. Now I'm very close to the final solution.

In LaTeX there are a exam package that do the summation of the  
individual scores and show that in the page bottom and at end of the  
exam in tabulate format. Perhaps ConTeXT can do the same in similar  
way.


Em 02/06/2007, às 11:27, Aditya Mahajan escreveu:

 On Sat, 2 Jun 2007, batela wrote:

 Hello to all:

 I need to prepare an exam. The layout must be the following one:

 Questions
 page
 Scores
 page
 Answers

 For example:

 \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

 The result should be:

 Question 1: In a body with mass=2 kg is applied a force of 2N. Which  
 is the
 body acceleration?.

 Question 2:

 Question 3:
 __ Page___

 Scores

 Question 1 . 10 points
 Question 2 .. 20 points
 Question 3 .. 20 points

 ___Page
 Criteria

 Question 1
 write F = m a  
  5
 points
 resolve  a = F/m4  
 points
 find and write correctly a = 1 m/s2 ... 1 points

 are there any way to make this a easy task?

 For placing questions and answers at different locations, use blocks.
 I do not know what is a good way of generate list of scores. I think
 that it can be done using lists, but I do not know lists well enough
 to do that quickly.

 Also if you do not like the fact that lists use \begin ... \end as
 delimiters, and want to use \start ... \stop here is a ugly hack :)



 \startelements dutch english
 germanczech
 italian   romanian
 french

  begin: beginvan  start
 anfangzacatek
 inizioinceput
 debut
end: eindvan   stop
 ende  konec
 fine  sfarsit
 fin

 \stopelements

 \defineenumeration[Answer][text=Question]
 \defineenumeration[Question]
 \defineblock[answer,question]
 \setupblock
[answer][before={\startAnswer},after={\stopAnswer}]
 \setupblock
[question][before={\startQuestion},after={\stopQuestion}]

 \def\score[#1]{\dotfill\emspace#1~points\endgraf}

 \hideblocks[answer,question]

 \def\generateexam
{\title{Exam}
 \useblocks[question]
 \title{Scores}
 I do not know how to do this. You can use lists, or there may be  
 easier
 ways
 \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[4]
 find and write correctly a = 1 m/s2 \score[1]
   \stopanswer
 \stopquestion

 \generateexam

 \stoptext


 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
 ___ 
 



___
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
___


Re: [NTG-context] Prepare exams with ConTeXT

2007-06-02 Thread Aditya Mahajan
On Sun, 3 Jun 2007, batela wrote:

 Thanks a lot. Now I'm very close to the final solution.

 In LaTeX there are a exam package that do the summation of the
 individual scores and show that in the page bottom and at end of the
 exam in tabulate format. Perhaps ConTeXT can do the same in similar
 way.

There are surely better ways. I simply abuse lists.

\startelements dutch english
germanczech
italian   romanian
french

 begin: beginvan  start
anfangzacatek
inizioinceput
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}

{\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

___
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
___