Skip to content

FITB: Automatic solution is not sanitized #2516

@dbrianwalton

Description

@dbrianwalton

When a fill-in-the-blank exercise is authored with a statement containing labeled/xml:id'd children, the automatically generated solution for that exercise duplicates the entire statement resulting in duplicate xml:id errors.

See this conversation:
https://groups.google.com/g/pretext-support/c/34E4PpRSlhA/m/EHGQ1rFLAAAJ

The error was first identified when images were included in a problem.

I believe that the fault occurs in xsl/pretext-runestone-static.xsl lines 1040-1060. This block of code duplicates the original statement replacing all of the fillin elements with their correct answers. It was implemented with a recursive copy of the statement xml hierarchy, and only the fillin is overridden with a change.

To preserve the original intent of the automatic solution, what is the best alternative?

  • Copy only text-based elements (e.g., p and ul and ol) and skip any other children
  • Copy only paragraphs that contain fill-in-blanks that require substitution, skipping all other elements (including paragraphs) that involve no substitution

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions