mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-9076 - Move the 'Add 3 more overall feedbacks' button inside that group of elements on the quiz settings form.
To make this possible, I added an extra argument to the repeat_elements method, which other people may find helpful on other forms.
This commit is contained in:
parent
e2833e8700
commit
6f3b54c8aa
3 changed files with 9 additions and 3 deletions
|
@ -524,9 +524,11 @@ class moodleform {
|
|||
* @param string $addfieldsname name for button to add more fields
|
||||
* @param int $addfieldsno how many fields to add at a time
|
||||
* @param string $addstring name of button, {no} is replaced by no of blanks that will be added.
|
||||
* @param boolean $addbuttoninside if true, don't call closeHeaderBefore($addfieldsname). Default false.
|
||||
* @return int no of repeats of element in this page
|
||||
*/
|
||||
function repeat_elements($elementobjs, $repeats, $options, $repeathiddenname, $addfieldsname, $addfieldsno=5, $addstring=null){
|
||||
function repeat_elements($elementobjs, $repeats, $options, $repeathiddenname,
|
||||
$addfieldsname, $addfieldsno=5, $addstring=null, $addbuttoninside=false){
|
||||
if ($addstring===null){
|
||||
$addstring = get_string('addfields', 'form', $addfieldsno);
|
||||
} else {
|
||||
|
@ -598,7 +600,9 @@ class moodleform {
|
|||
}
|
||||
$mform->addElement('submit', $addfieldsname, $addstring);
|
||||
|
||||
$mform->closeHeaderBefore($addfieldsname);
|
||||
if (!$addbuttoninside) {
|
||||
$mform->closeHeaderBefore($addfieldsname);
|
||||
}
|
||||
|
||||
return $repeats;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue