MmUxNmMyMGUxZjBiZWJmNzJmZGIwNzQ4ZWM0MjNhYzYxZWExOTYxZDVhOTZlYjk0YmE0NWM4M2E1MmIwOTlmOQ.msfh9zkn.eyJ1cmwiOiIvcGwvY291cnNlX2luc3RhbmNlLzIvaW5zdGFuY2VfcXVlc3Rpb24vMjAxLyIsImF1dGhuX3VzZXJfaWQiOiIxIn0
Skip to main content Accessibility guide
PrairieLearn Go home
  • XC 101, SectionA
  • Assessments
  • Gradebook
  • C4
Load from disk
  • Dev User student
    View type
    ✓ Staff view staff ✓ Student view student ✓ Student view without access restrictions student
    Effective user
    Customize…
    Course Requests Settings Log out

Regenerate assessment instance

Warning: Regenerating the assessment instance will select a new set of questions from this assessment. Any progress on the current assessment instance will be lost.

Are you sure you want to regenerate the assessment instance?

Course staff: Regenerate your assessment instance to pick up changes to the assessment or to get a fresh set of questions.

C4.40. Elements to show or hide text in specific panels

PrairieLearn questions have three types of panels that are shown to the student:
  1. Question panel: shows the question prompt. The panel containing this text is the question panel. There is only one question panel and it is always visible.
  2. Submission panel: shows the student's submitted answer. There is one submission panel for each submitted answer, so the student can see the history of their attempts.
  3. Answer panel: shows the correct answer or other feedback to the student once they can no longer attempt the question. There is at most one answer panel.

By default, the contents of question.html is shown in all three panels. Elements used in question.html are aware of which panel they are in. For example, the <pl-multiple-choice> element will let the student choose an option in the question panel, show the student the option they chose in the submission panel, and display the correct option in the answer panel.

Elements to control panel display

There are four elements that can be used to control whether text is shown in each panel:

  • <pl-question-panel> only displays its contents in the question panel. This should be used for the question prompt.
  • <pl-submission-panel> only displays its contents in the submission panel. This could be used to give specific feedback on a particular student submission.
  • <pl-answer-panel> only displays its contents in the answer panel. This could be used to give information about the correct answer.
  • <pl-hide-in-panel> has attributes that allow content to be hidden in one or more panels.

In normal usage, we put the question prompt in a <pl-question-panel> element and all inputs requesting student input outside of this element.

Example HTML

As an example, this question contains the follow panel elements. Click the "Save & Grade" button to make the submission and answer panels appear.

<pl-question-panel>
  <p>(A) This text is only shown in the question panel.
</pl-question-panel>

<pl-submission-panel>
  <p>(B) This text is only shown in the submission panel.
</pl-submission-panel>

<pl-answer-panel>
  <p>(C) This text is only shown in the answer panel.
</pl-answer-panel>

<pl-hide-in-panel question="true">
  <p>(D) This text is hidden in the question panel, and shown in the others.
</pl-hide-in-panel>

<pl-hide-in-panel submission="true">
  <p>(E) This text is hidden in the submission panel, and shown in the others.
</pl-hide-in-panel>

<pl-hide-in-panel answer="true">
  <p>(F) This text is hidden in the answer panel, and shown in the others.
</pl-hide-in-panel>
Output of above example

(A) This text is only shown in the question panel.

(E) This text is hidden in the submission panel, and shown in the others.

(F) This text is hidden in the answer panel, and shown in the others.

Additional attempts available with new variants

Correct answer

Collection 4

Assessment overview
Total points: 0/360
Score:
0%

Question C4.40

Value: 2
All variants: Open (current)
Total points: — /10
Auto-graded question

This form is only for reporting errors in the question itself. Do not use this form if you just don't know how to answer the question.

Previous question

 Personal Notes

No attached notes

Attached files will be saved here for your reference. These files act as personal notes and can be used for your own review purposes. They are not used for grading.

Max file size: 10 MB

Attached personal notes will be saved here for your reference. These notes can be used for your own review purposes. They are not used for grading.

Staff information

Student details

Dev User
dev@example.com

Question

QID:
element/panels
Title:
Elements to show or hide text in specific panels

Variant

Started at:
2026-08-04 16:38:10 (CDT)
Duration:
0s
Show/Hide answer
{}

Assessment instance

Assessment:
gallery/elements
Started at:
2026-08-04 16:37:17 (CDT)
Duration:
0s
View log
This box is not visible to students.