Home โ€บ Templates

Template Customisation

Templates let you control how the submission form looks and how submitted work is displayed. You can also inject custom CSS for styling. This is an advanced feature โ€” the defaults work well for most activities.

๐Ÿ”‘
Required capability: mod/casestudy:managetemplates โ€” Editing Teacher or Manager role.

Accessing templates

Inside the Case Study activity, click Manage Templates in the activity navigation.

โš ๏ธ
You must add fields before templates are useful. If no fields exist, a warning is shown and the template placeholders have nothing to reference.
Templates editor with three tabs: View, Form, and CSS
The Templates editor โ€” three tabs for View, Form, and CSS

Three templates

TemplateControls
Submission View TemplateHow a completed submission is displayed to students and graders
Submission Form TemplateThe layout of the form students fill in when submitting
Custom CSSAdditional styles applied to both the form and submission view pages

Submission View Template

Controls how submitted answers are displayed. Without a custom template, all field values are shown in a simple vertical list.

Available placeholder tags

๐Ÿ“Œ
All tags use double square brackets: [[tag]]. Tags that don't match any field are silently removed from the output.

User information

TagOutput
[[user]]Student's full name
[[userpicture]]Student's profile picture (<img> element, 50ร—50 px)
[[userid]]Student's Moodle user ID

Submission information

TagOutput
[[timesubmitted]]Date/time the submission was submitted
[[timecreated]]Date/time the submission was first created
[[timemodified]]Date/time the submission was last modified
[[status]]Submission status label (e.g., "Satisfactory")
[[attempt]]Attempt number (1, 2, 3โ€ฆ)

Grade information

TagOutput
[[grade]]Grade badge (satisfactory / unsatisfactory)
[[feedback]]Grader's feedback text (formatted HTML)
[[grader]]Grader's name (hidden if Hide Grader is enabled)
[[gradetime]]Date/time the grade was given

Field values โ€” use the field name or short name

Replace Field Name with the actual field name (e.g., Case Study Title) or its short name (e.g., CStitle).

TagOutput
[[Field Name]]Complete field block: label + value (HTML wrapped)
[[Field Name#name]]The field label only
[[Field Name#id]]The field's internal database ID
๐Ÿ’ก
Tags work with the exact field name, the short name, or a lowercase no-space version. For example, a field named Case Study Title with short name CStitle can be referenced as [[Case Study Title]], [[CStitle]], or [[casestudytitle]].
Single Template editor
The Submission View Template editor

Submission Form Template

Controls the layout of the form students use to enter their submission. Without a custom template, all fields are rendered using the default Moodle form fields.

๐Ÿ“Œ
All tags use double square brackets: [[tag]]. Replace Field Name with the actual field name (e.g., Case Category) or the field's short name (e.g., category). Both work.

Available placeholder tags

Per field โ€” use the field name or short name

TagOutput
[[Field Name]]Complete form element: label + input + description
[[Field Name#label]]Field label with required indicator (*)
[[Field Name#description]]Field description text only (formatted HTML)
[[Field Name#input]]Input element only (no label or description)
[[Field Name#required]]Required indicator โ€” red * if required, empty otherwise
[[Field Name#id]]The field's HTML element ID attribute
Submission Form Template editor with example field tags
The Submission Form Template editor

Custom CSS Template

Write plain CSS to style the submission form and view pages for this activity only.

๐Ÿ’ก
Use specific selectors like .casestudy-submission or .casestudy-form to avoid styles bleeding into the rest of the Moodle page.
Custom CSS Template editor with example CSS code
The Custom CSS Template editor

Saving and resetting templates

Click Save to persist your changes. Each template is saved independently.