rdmorganiser / rdmorganiser/rdmo

QuestionSet titles are missing from "View Answers" and exports

Open
#1,722 0 comments 0 reactions 1 assignee View on GitHub

@maklem is already working on this.

Since Sep 4, 2026.

  • #1728 by @maklem — open
Dominant language
Python
Stars
133
Forks
60
Avg merge
3d 14h
Merged PRs (30d)
21

Description

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:

https://github.com/rdmorganiser/rdmo/pull/320

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

Later, when the Page model was introduced in:

https://github.com/rdmorganiser/rdmo/commit/471c4089922714bda14a58169f800de7e54d4989

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.