diff --git a/mod/data/export_form.php b/mod/data/export_form.php
index 1377e6c73a6..fdee10f0a3e 100644
--- a/mod/data/export_form.php
+++ b/mod/data/export_form.php
@@ -58,8 +58,10 @@ class mod_data_export_form extends moodleform {
$mform->setDefault('delimiter_name', 'comma');
}
$mform->addElement('header', 'notice', get_string('chooseexportfields', 'data'));
+ $numfieldsthatcanbeselected = 0;
foreach($this->_datafields as $field) {
if($field->text_export_supported()) {
+ $numfieldsthatcanbeselected++;
$html = '
' . $field->field->name . '
';
$name = ' (' . $field->name() . ')';
@@ -72,7 +74,9 @@ class mod_data_export_form extends moodleform {
$mform->addElement('static', 'unsupported' . $field->field->id, $field->field->name, $str);
}
}
- $this->add_checkbox_controller(1, null, null, 1);
+ if ($numfieldsthatcanbeselected > 1) {
+ $this->add_checkbox_controller(1, null, null, 1);
+ }
$context = context_module::instance($this->_cm->id);
if (has_capability('mod/data:exportuserinfo', $context)) {
$mform->addElement('checkbox', 'exportuser', get_string('includeuserdetails', 'data'));