Skip to content

Commit

Permalink
Merge pull request #84 from sarahjcotton/WR438262-submission-interfac…
Browse files Browse the repository at this point in the history
…e-improvements

WR438262: Submission interface improvements
  • Loading branch information
danmarsden authored Sep 13, 2024
2 parents 69ac1a6 + 51a82b6 commit 3bdedcf
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
1 change: 1 addition & 0 deletions lang/en/assignsubmission_maharaws.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
$string['assign_submission_maharaws_name'] = 'Mahara Assignment submission (web services)';
$string['assign_submission_maharaws_description'] = 'Mahara functions used in Mahara assignment submission plugin.<br />Publishing this service on a Moodle site has no effect. Subscribe to this service if you want to be able to use assignments with {$a}.<br />';
$string['collectionsby'] = 'Collections by {$a}';
$string['currentsubmitted'] = 'Current submitted {$a}';
$string['debug_help'] = 'Debug option to interupt the OAuth SSO login jump so parameters can be inspected';
$string['debug'] = 'Debug OAuth';
$string['defaultlockpages_help'] = 'Default setting to use for the "{$a}" setting in new Mahara assignments.';
Expand Down
33 changes: 28 additions & 5 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -477,19 +477,42 @@ public function get_form_elements_for_user($submission, MoodleQuickForm $mform,
);

foreach ($views['data'] as $view) {
$viewurl = "/view/view.php?id=" . $view['id'];
$anchor = $this->get_preview_url($view['title'], $viewurl, strip_tags($view['description']));
$mform->addElement('radio', 'viewid', '', $anchor, 'v' . $view['id']);
// If the view (page) hasn't already been submitted, add it to the options for selection.
if ($view['submissionoriginal'] == 0) {
$viewurl = "/view/view.php?id=" . $view['id'];
$anchor = $this->get_preview_url($view['title'], $viewurl, strip_tags($view['description']));
$mform->addElement('radio', 'viewid', '', $anchor, 'v' . $view['id']);
}
if ($maharasubmission && $view['id'] == $maharasubmission->viewid) {
$currentpagesubmitted = $mform->createElement('static', 'currentsubmission',
get_string('currentsubmitted', 'assignsubmission_maharaws', 'page'), $view['displaytitle']);
}
}

if (!empty($currentpagesubmitted)) {
$mform->addElement($currentpagesubmitted);
}
}
if (!empty($views['collections']['data'])) {
$mform->addElement('static', 'collection_by',
get_string('collectionsby', 'assignsubmission_maharaws', $views['displayname'])
);
foreach ($views['collections']['data'] as $coll) {
$anchor = $this->get_preview_url($coll['name'], $coll['url'], strip_tags($coll['description']));
$mform->addElement('radio', 'viewid', '', $anchor, 'c' . $coll['id']);
// If the collection hasn't already been submitted, add it to the options for selection.
if ($coll['submissionoriginal'] == 0) {
$anchor = $this->get_preview_url($coll['name'], $coll['url'], strip_tags($coll['description']));
$mform->addElement('radio', 'viewid', '', $anchor, 'c' . $coll['id']);
}

if ($maharasubmission && $coll['id'] == $maharasubmission->viewid) {
$currentcollsubmitted = $mform->createElement('static', 'currentsubmission',
get_string('currentsubmitted', 'assignsubmission_maharaws', 'collection'), $coll['name']);
}
}
if (!empty($currentcollsubmitted)) {
$mform->addElement($currentcollsubmitted);
}

}
if (!empty($maharasubmission)) {
if ($maharasubmission->iscollection) {
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

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

$plugin->version = 2023110900;
$plugin->release = 2023110900;
$plugin->version = 2024091300;
$plugin->release = 2024091300;
$plugin->requires = 2020061500;
$plugin->component = 'assignsubmission_maharaws';
$plugin->supported = [39, 403]; // Available as of Moodle 3.9.0 or later.
Expand Down

0 comments on commit 3bdedcf

Please sign in to comment.