Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pretext/project/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,11 @@ def ensure_webwork_reps(self, clean_tmp_dirs: bool = True) -> None:
if self.source_element().xpath(".//webwork[@copy|@source|*|text()]"):
log.debug("Source contains webwork problems")
# Get list of all assembly-ids for webwork (this will be the assembly-id of the parent of the webwork element).
# NB: assembly stamps the id in the "pi" (PreTeXt internal) namespace, so the xpath must be namespace-aware.
pi_ns = {"pi": "http://pretextbook.org/2020/pretext/internal"}
webwork_assembly_ids = self.source_element_with_ids().xpath(
".//webwork[@copy|@source|*|text()]/parent::*/@assembly-id"
".//webwork[@copy|@source|*|text()]/parent::*/@pi:assembly-id",
namespaces=pi_ns,
)
assert isinstance(webwork_assembly_ids, list)
for id in webwork_assembly_ids:
Expand Down