-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WR438262: Submission interface improvements #84
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does |
||
$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']); | ||
Comment on lines
+487
to
+488
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like this can can be abstracted to a method to avoid a code duplication. See pretty much same code at lines 506-507 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've run out of time on this WR so can only do what's necessary to move it along I'm afraid. |
||
} | ||
} | ||
|
||
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) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably need a version bump for this string to come up.