diff --git a/lang/en/assignsubmission_maharaws.php b/lang/en/assignsubmission_maharaws.php index 02aff4d..623496b 100644 --- a/lang/en/assignsubmission_maharaws.php +++ b/lang/en/assignsubmission_maharaws.php @@ -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.
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}.
'; $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.'; diff --git a/locallib.php b/locallib.php index e5c3b85..4c39ce8 100644 --- a/locallib.php +++ b/locallib.php @@ -477,9 +477,19 @@ 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 ($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 ($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'])) { @@ -487,9 +497,20 @@ public function get_form_elements_for_user($submission, MoodleQuickForm $mform, 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 ($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 ($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) {