Skip to content

Commit

Permalink
add lang strings
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartlamour committed Jul 3, 2024
1 parent 8b978b7 commit ae03b5f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
9 changes: 8 additions & 1 deletion lang/en/local_ass_type.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,12 @@

defined('MOODLE_INTERNAL') || die();

$string['defaultoption'] = 'Select an option';
$string['editinsits'] = 'Edit activity SITS link';
$string['fieldlabel'] = 'Formative or summative?';
$string['formativeoption'] = 'Formative - does not contribute to course mark';
$string['info'] = 'Summative activities count towards the course mark in SITS and are flagged to learners as mandatory.';
$string['pluginname'] = 'Assessment type';
$string['privacy:metadata'] = 'Assessment type does not store any personal data.';
$string['privacy:metadata'] = 'Assessment type does not store any personal data.';
$string['summativeoption'] = 'Summative - counts towards course mark and is mapped in SITS';

23 changes: 12 additions & 11 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,17 @@ function local_ass_type_coursemodule_standard_elements($formwrapper, $mform) {

// Mform element.
$options = [];
$options[''] = 'Select an option';
$options['0'] = 'Formative - does not contribute to course mark';
$options['1'] = 'Summative - counts towards course mark and is mapped in SITS';
$options[''] = get_string('defaultoption', 'local_ass_type');
$options['0'] = get_string('formativeoption', 'local_ass_type');
$options['1'] = get_string('summativeoption', 'local_ass_type');
$attributes = [];
$attributes['required'] = 'required';

// Disable changes when sits mapped.
if ($sitsmapped) {
$attributes['disabled'] = 'disabled';
}
$select = $mform->createElement('select', 'type', 'Formative or summative?', $options, $attributes);
$select = $mform->createElement('select', 'assessment_type', get_string('fieldlabel','local_ass_type'), $options, $attributes);

// Set to summative when sits mapped.
if ($sitsmapped) {
Expand All @@ -115,16 +115,17 @@ function local_ass_type_coursemodule_standard_elements($formwrapper, $mform) {
// Link to edit when cm exists.
// TODO - lang string.
if ($cmid) {
$link .= '<br>
<a href="' . $CFG->wwwroot. '/local/sitsgradepush/dashboard.php?id=' .$cm->course. '" target="_blank"
>Edit activity SITS link
</a>';
$link = '<br>
<a href="' . $CFG->wwwroot. '/local/sitsgradepush/dashboard.php?id=' .$cm->course. '" target="_blank">'
. get_string('editinsits', 'local_ass_type') .
'</a>';
}

$info = $mform->createElement('html',
'<div class="col-md-9 offset-md-3 pb-3">
Summative activities count towards the course mark in SITS and are flagged to learners as mandatory.'
. $link .'</div>');
'<div class="col-md-9 offset-md-3 pb-3">'
. get_string('info', 'local_ass_type') .
$link .
'</div>');

// Add form elements to the dom.
// TODO - check best place in the form to add?
Expand Down

0 comments on commit ae03b5f

Please sign in to comment.