Skip to content

Fixing Common Errors

Drew Lewis edited this page Apr 22, 2026 · 4 revisions

error: * PTX:BUG: Exercise component mis-labeled

This usually means that you have placed an <answer> within a <statement>. Unfortunately, this error doesn't tell you where the problem occurs, so it can be hard to find. You can use the following command in the terminal to list all of the places where <answer>s are neither a child of an <activity> or of a <task>:

python scripts/xpath_wrapper.py --query "//answer[not(parent::activity or parent::task)]" source/*/source/*/*.ptx

Text not showing up

Most often, this means the text should be enclosed in a <p> tag

Text showing up in HTML but not PDF

For reasons unknown, there are some tags like <statement> for which bare text will show up in HTML, but not PDF. These need to be enclosed in a <p> tag to show up correctly in all output formats. You can search for these with:

python scripts/xpath_wrapper.py --query '//statement[normalize-space(text()) != ""]' source/*/source/*/*.ptx

Clone this wiki locally