diff --git a/element/date/classes/element.php b/element/date/classes/element.php index dcf6a6f..30cab73 100644 --- a/element/date/classes/element.php +++ b/element/date/classes/element.php @@ -190,7 +190,12 @@ class element extends \mod_customcert\element { // Ensure that a date has been set. if (!empty($date)) { - \mod_customcert\element_helper::render_content($pdf, $this, $this->get_date_format_string($date, $dateformat)); + $date = $this->get_date_format_string($date, $dateformat); + // If we are previewing, we want to let the user know it's an example date so they don't get confused. + if ($preview) { + $date = get_string('exampledata', 'customcert', 'date') . ' ' . $date; + } + \mod_customcert\element_helper::render_content($pdf, $this, $date); } } diff --git a/element/grade/classes/element.php b/element/grade/classes/element.php index 0c454ea..95bc64d 100644 --- a/element/grade/classes/element.php +++ b/element/grade/classes/element.php @@ -108,6 +108,7 @@ class element extends \mod_customcert\element { if ($preview) { $courseitem = \grade_item::fetch_course_item($courseid); $grade = grade_format_gradevalue('100', $courseitem, true, $gradeinfo->gradeformat); + $grade = get_string('exampledata', 'customcert', 'grade') . ' ' . $grade; } else { if ($gradeitem == CUSTOMCERT_GRADE_COURSE) { $grade = \mod_customcert\element_helper::get_course_grade_info( diff --git a/lang/en/customcert.php b/lang/en/customcert.php index f705c95..917e159 100644 --- a/lang/en/customcert.php +++ b/lang/en/customcert.php @@ -87,6 +87,8 @@ $string['emailteachers'] = 'Email teachers'; $string['emailteachers_help'] = 'If set this will email the teachers a copy of the certificate when it becomes available.'; $string['emailothers'] = 'Email others'; $string['emailothers_help'] = 'If set this will email the email addresses listed here (separated by a comma) with a copy of the certificate when it becomes available.'; +$string['exampledata'] = 'Example {$a}:'; +$string['exampledatawarning'] = 'Some of these values may just be an example to ensure positioning of the elements is possible.'; $string['font'] = 'Font'; $string['font_help'] = 'The font used when generating this element.'; $string['fontcolour'] = 'Colour'; diff --git a/rearrange.php b/rearrange.php index 78f40ad..7483953 100644 --- a/rearrange.php +++ b/rearrange.php @@ -125,7 +125,8 @@ $html .= html_writer::end_tag('div'); echo $OUTPUT->header(); echo $OUTPUT->heading($heading); -echo $OUTPUT->heading(get_string('rearrangeelementsheading', 'customcert'), 4); +echo $OUTPUT->heading(get_string('rearrangeelementsheading', 'customcert'), 3); +echo $OUTPUT->notification(get_string('exampledatawarning', 'customcert'), \core\output\notification::NOTIFY_WARNING); echo $html; $PAGE->requires->js_call_amd('mod_customcert/rearrange-area', 'init', array('#pdf')); echo $OUTPUT->footer();