ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Hiding subanswer blocks
@ 2006-07-15 16:48 David Arnold
  0 siblings, 0 replies; only message in thread
From: David Arnold @ 2006-07-15 16:48 UTC (permalink / raw)
  Cc: Jacob Prystowsky

All,

Below I have our environment for our question and answer blocks. We  
are attempting to have questions that have parts, as in:

1. Yada, Yada, Yada, Yada, Yada, Yada, Yada, Yada, Yada.

1a) Yada, Yada, Yada, Yada, Yada, Yada, Yada, Yada, Yada.

1b) Yada, Yada, Yada, Yada, Yada, Yada, Yada, Yada, Yada.

1c) Yada, Yada, Yada, Yada, Yada, Yada, Yada, Yada, Yada,

2,

2a)

2b)

Etc.

However, we want to "hide" some of the shortsubanswers. We try with:

\beginshortanswer
\startanswer

\startsubanswer[-]
\stopsubanswer

\startsubanswer[-]
\stopsubanswer

\startsubanswer[-]
\stopsubanswer

\startsubanswer
\startbuffer

...


When typeset, the first three subanswers here are hidden, but the  
first subanswer that is not hidden, which should be the answer to  
"part d," it winds up be labeled "part a" in the pdf output.

Can anyone help?

\def\genericqacommands#1{\unnumberedsubsection{#1}\vskip 1em}

\def\startgenericqadouble#1{\genericqacommands{#1}\startcolumns[n=2]}
\def\stopgenericqadouble{\stopcolumns}

\def\startgenericqasingle#1{\genericqacommands{#1}}
\def\stopgenericqasingle{}

\def\preqacontainment{\vskip 0.5ex plus 1ex}
\def\postqacontainment{\vskip 0.5ex plus 1ex}

\def\startquestions{\startgenericqadouble{Exercises}}
\def\stopquestions{\stopgenericqadouble}

\def\startlonganswers{\startgenericqasingle{Answers}}
\def\stoplonganswers{\stopgenericqasingle}

\def\startshortanswers{\startgenericqadouble{Answers}}
\def\stopshortanswers{\stopgenericqadouble}

\def\questionbreak{\vskip 2em plus 1ex minus 1 ex}

\def\placeanswers{%
	\doifmodeelse{short}
	{
		\startshortanswers
		\selectblocks[shortanswer,shortsubanswer][criterium=section]
		\stopshortanswers
	}
	{
		\startlonganswers
		\selectblocks[longanswer,longsubanswer][criterium=section]
		\stoplonganswers
	}
}


\defineenumeration
	[question]
	[text=,
	headcolor=heavygreen]

\setupenumerations
	[question]
	[location=left,
	width=fit,
	distance=1em,
	hang=1,
	margin=0pt,
	headcolor=heavygreen,
	right=.,
	way=bysection,
	sectionnumber=no,
	before=\preqacontainment,
	after=\postqacontainment]

\defineenumeration
	[subquestion]
	[location=hanging,
	text=,
	headcolor=heavygreen,
	conversion=characters]

\setupenumerations
	[subquestion]
	[right=)]

\defineenumeration
	[answer]
	[text=,
	headcolor=heavygreen]

\setupenumerations
	[answer]
	[location=left,
	width=fit,
	distance=1em,
	hang=1,
	margin=0pt,
	headcolor=heavygreen,
	right=.,
	way=bysection,
	sectionnumber=no,
	before=\preqacontainment,
	after=\postqacontainment]

\defineenumeration
	[subanswer]
	[location=hanging,
	text=,
	headcolor=heavygreen,
	conversion=characters]

\setupenumerations
	[subanswer]
	[right=)]

\defineblock 
[question,shortanswer,longanswer,subquestion,shortsubanswer,longsubanswe 
r]
\hideblocks[shortanswer,longanswer,shortsubanswer,longsubanswer]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-07-15 16:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-15 16:48 Hiding subanswer blocks David Arnold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).