Skip to content

Commit

Permalink
answerclasses in SHTML
Browse files Browse the repository at this point in the history
  • Loading branch information
Jazzpirate committed Jan 25, 2024
1 parent f7dfbda commit ee4aa84
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,23 @@ trait SHTMLDocumentServer { this : STeXServer =>
plain.attributes((this.namespace, "data-problem-g-note")) = "true"
}
}
case class AnswerClass(orig:HTMLNode) extends SHTMLNode(orig) {
def copy = AnswerClass(orig.copy)

override def onAdd = {
super.onAdd
val id = plain.attributes((HTMLParser.ns_shtml,"answerclass"))
plain.attributes((this.namespace,"data-problem-answerclass")) = id
plain.attributes.get((HTMLParser.ns_shtml,"answerclass-pts")) match {
case Some(pts) => plain.attributes((this.namespace,"data-problem-answerclass-pts")) = pts
case _ =>
}
plain.attributes.get((HTMLParser.ns_shtml,"answerclass-feedback")) match {
case Some(fdb) => plain.attributes((this.namespace,"data-problem-answerclass-feedback")) = fdb
case _ =>
}
}
}
case class ProblemPoints(orig: HTMLNode) extends SHTMLNode(orig) {
def copy = ProblemPoints(orig.copy)

Expand Down Expand Up @@ -1032,6 +1049,7 @@ trait SHTMLDocumentServer { this : STeXServer =>
simple("problemhint", n => ProblemHint(n))
simple("problemnote", n => ProblemNote(n))
simple("problemgnote", n => ProblemGNote(n))
simple("answerclass", n => AnswerClass(n))
simple("problempoints", n => ProblemPoints(n))
simple("problemminutes", n => ProblemMinutes(n))
simple("slideshow", n => Slideshow(n))
Expand Down

0 comments on commit ee4aa84

Please sign in to comment.