Next in thread → Next in month →

Re: [docbook] Marks assignment for qandaentries

From
Bob Stayton <>
Date
2006-11-02T01:25:40+00:00
ID
060401c6fe1d$ca74d980$6400a8c0@totoro
Thread
Re: [docbook] Marks assignment for qandaentries


Hi Cameron,

There isn't a feature in DocBook to assign marks or 
points to a question, because DocBook wasn't really designed for courseware. But 
DocBook was designed to be customized and extended, in case you have specialized 
needs.

 

For example, almost all elements include an 
empty "local" parameter entity in the DTD for adding new attributes.  
In your case, an attribute named "points" could be added to either the question 
element or the qandaentry element, which contains the question element.  
For example:

 

<!DOCTYPE book SYSTEM "docbook.dtd" 
[

<!ENTITY % local.question.attrib "points CDATA 
#IMPLIED">

]>

 

When the parser loads the DTD, it reads this 
internal subset first, and uses this value of the parameter entity instead of 
the empty one in the DTD. With this change, you 
can add a points attribute to your question elements, and it will 
validate.

 

Putting the entity declaration in the internal 
subset of the DTD (in the XML file itself) is fine for a few documents, but if 
you have lots, you might consider customizing the external DTD.  See Norm 
Walsh's book DocBook: The Definitive Guide (online version) chapter 5 for more 
info on how to do that:

 

http://docbook.org/tdg/en/html/ch05.html

 

The DocBook XSL stylesheets won't know about the 
new attribute, though, so if you want the points to show in the output, you 
would need to customize the XSL template for question.

 

Bob Stayton
Sagehill Enterprises
DocBook Consulting


 

 

  
----- Original Message ----- 

  
From: 
  Cameron 
  Kerr 

  
To:  
  

  
Sent: Monday, October 30, 2006 5:49 
  PM

  
Subject: [docbook] Marks assignment for 
  qandaentries

  

I'm new to Docbook, and want to use it for most of my 
  University-level course documentation.
  

  
I've been looking through the specs, and I cannot find any way to assign 
  marks/points to a question. Can anyone point me in the right direction?

  

  
Thanks.

  

  
-- 

  
• Cameron Kerr  • ✉  •  •

  
• Telecommunications Teaching Fellow & SysAdmin •

  
• ✎ http://humbledown.org/blog/ • ✆ 021 02 333 
  294 •
Next in thread → Next in month →