Skip to content

Commit

Permalink
Merge branch 'MDL-48773_m32v1' of https://github.com/sbourget/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Aug 23, 2016
2 parents 132b75d + dddadf5 commit 0969f0d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mod/choice/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ function definition() {
$mform->addElement('selectyesno', 'allowupdate', get_string("allowupdate", "choice"));

$mform->addElement('selectyesno', 'allowmultiple', get_string('allowmultiple', 'choice'));
if ($this->_instance) {
if ($DB->count_records('choice_answers', array('choiceid' => $this->_instance)) > 0) {
// Prevent user from toggeling the number of allowed answers once there are submissions.
$mform->freeze('allowmultiple');
}
}

$mform->addElement('selectyesno', 'limitanswers', get_string('limitanswers', 'choice'));
$mform->addHelpButton('limitanswers', 'limitanswers', 'choice');
Expand Down

0 comments on commit 0969f0d

Please sign in to comment.