CountNumberOfSections: CountNumberOfSections

View source: R/AnswerSheets.R

CountNumberOfSectionsR Documentation

CountNumberOfSections

Description

It counts the number of subparts in each section and outputs the result as a table. It doesn't act recursively, it only does the outermost layer.

Usage

CountNumberOfSections(Document)

Arguments

Document

Document, as defined in StructureDocument. Remember however that the function StructureDocument returns the document and the preamble together in a list.

Details

The regular expression that defines this methods behaviour is the following

"^[^[:digit:]]*([[:digit:]]+)_([^[:digit:]]+)_([[:digit:]]+)_(.*)"

The replacement is simply "\1".

It tries to first find whether there exist attributes command and section that explain the command and section, before starting to use regexs on the names.

Value

A table, counting the number of "\cmdName" items in which the document was divided when parsed for every begin-end section. It doesn't act resursively.

It will return a table with an integer that identifies the section, and a count, with how many items it found on that section. If it doesn't find any items or sections, it will return an empty table.

See Also

Other Extracting information: ConstructAnswerSheet(), FindExamAnswers(), GenerateShortAnswerSheet()


TexExamRandomizer documentation built on May 29, 2024, 9:12 a.m.