Skip to content

QuestionSet titles are missing from "View Answers" and exports #1722

Description

@MyPyDavid

Description / Beschreibung

issue was written with help of ChatGPT

The "View Answers" page does not display the titles of QuestionSets.

When a catalog has:

Section
└── Page
    └── QuestionSet
        ├── Question
        └── Question

the "View Answers" currently only renders:

Section
└── Page
    ├── Question
    └── Question

The QuestionSets, or nested QuestionSets, are missing.

The current templates may explain the behavior:

https://github.com/rdmorganiser/rdmo/blob/main/rdmo/projects/templates/projects/project_answers_tree.html

It renders Section and Page titles and delegates each Page element to:

https://github.com/rdmorganiser/rdmo/blob/main/rdmo/projects/templates/projects/project_answers_element.html

For Questions, project_answers_element.html renders the question text and corresponding values. For QuestionSets, however, it only recursively renders the contained elements:

The available element.title is not rendered.

Regression

This also seems to be at least partly a regression.

The implementation associated with #318 / #320 previously rendered top-level QuestionSet titles in project_answers_tree.html:

#320

<h3>{{ questionset.title }}</h3>

Later, when the Page model was introduced in:

471c408

the tree changed approximately from:

{% for questionset in section.questionsets.all %}
    <h3>{{ questionset.title }}</h3>
    ...
{% endfor %}

to:

{% for page in section.pages.all %}
    <h3>{{ page.title }}</h3>

    {% for element in page.elements %}
        {% include 'projects/project_answers_element.html' %}
    {% endfor %}
{% endfor %}

Since the recursive project_answers_element.html template does not render QuestionSet titles itself, the QuestionSet heading disappeared from "View Answers".

Nested QuestionSets appear to have had the same problem already when support for nested QuestionSets was introduced.

Expected behaviour / Erwartetes Verhalten

"View Answers" should preserve the structural hierarchy of the catalog and display QuestionSet titles before their contained questions/elements.

For example:

Section title

    Page title

        QuestionSet title

            Question?
            Answer

            Question?
            Answer

        Another QuestionSet

            Question?
            Answer

Nested QuestionSets should also retain their titles, for example:

Page
└── QuestionSet A
    └── QuestionSet B
        └── Question

should not be flattened to:

Page
└── Question

The exact HTML heading levels or styling could follow the existing hierarchy. For example, Section and Page currently use h2 and h3; QuestionSets could use an appropriate lower-level heading or dedicated styling.

Empty QuestionSet titles should of course not result in empty headings.

QuestionSet titles should support Markdown consistently with the existing Section/Page titles.

Exports

The same hierarchy should also be retained in exports created from the "View Answers" page.

project_answers_export.html uses the same tree:

https://github.com/rdmorganiser/rdmo/blob/main/rdmo/projects/templates/projects/project_answers_export.html

{% include 'projects/project_answers_tree.html' %}

so fixing the recursive tree rendering should also make QuestionSet titles available in the corresponding answer exports.

Steps to reproduce / Schritte zum Reproduzieren

  1. Create or use a Catalog containing:

    • a Section and a Page
    • a QuestionSet with a non-empty title,
    • one or more Questions inside that QuestionSet.
  2. Create a Project using the Catalog.

  3. Answer the Questions.

  4. Open View Answers.

  5. See that the Section title, Page title, Questions and Answers are displayed, but the QuestionSet title is missing.

  6. Optionally create a nested QuestionSet and observe that its title is missing as well.

  7. Export the answers from this page and observe the same missing QuestionSet structure.

References / Verweise

Activity

  1. added theissue type on Aug 25, 2026
  2. self-assigned this
    on Sep 4, 2026
  3. linked a pull request that will close this issueAdd help text to pdf export (#403 #1680 #1722) #1728on Sep 4, 2026
  4. added this to the RDMO 2.5.2 milestone on Oct 1, 2026
  5. added a commit that references this issue on Oct 2, 2026
  6. jochenklar commented on Oct 5, 2026

    @jochenklar
    Member

    We will fix this in 3.0.0 not in 2.5.2, right? Did I assign the wrong Milestone?

  7. maklem commented on Oct 6, 2026

    @maklem
    Collaborator

    @jochenklar It is fixed in #1728 for 3.0.0 after a comment referring to this issue.

  8. added 2 commits that reference this issue on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions