Skip to content

Commit

Permalink
Merge branch 'MDL-37554-master-test' of git://github.com/cameron1729/…
Browse files Browse the repository at this point in the history
…moodle
  • Loading branch information
stronk7 committed Jun 20, 2016
2 parents 5c3de4f + 6ae9dbc commit 795150c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 5 additions & 4 deletions completion/criteria/completion_criteria_activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ public static function fetch($params) {
*/
public function config_form_display(&$mform, $data = null) {
$modnames = get_module_types_names();
$mform->addElement('checkbox', 'criteria_activity['.$data->id.']',
$modnames[self::get_mod_name($data->module)].
' - '.
format_string($data->name));
$mform->addElement('advcheckbox',
'criteria_activity['.$data->id.']',
$modnames[self::get_mod_name($data->module)] . ' - ' . format_string($data->name),
null,
array('group' => 1));

if ($this->id) {
$mform->setDefault('criteria_activity['.$data->id.']', 1);
Expand Down
3 changes: 3 additions & 0 deletions course/completion_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ public function definition() {
$activities = $completion->get_activities();
if (!empty($activities)) {

if (!$completion->is_course_locked()) {
$this->add_checkbox_controller(1, null, null, 0);
}
foreach ($activities as $activity) {
$params_a = array('moduleinstance' => $activity->id);
$criteria = new completion_criteria_activity(array_merge($params, $params_a));
Expand Down

0 comments on commit 795150c

Please sign in to comment.