Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-25673

usability: show form common fields - groups, groupings, visible and set advanced on idnumber and gradecat

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Inactive
    • 1.9.10
    • None
    • Forms Library
    • MOODLE_19_STABLE
    • Easy

    Description

      I found that most teachers miss important fields when asked to set various values and Module's setting in Forms,
      like Groupings and Grouping's visibility and get confused with module's Idnumber (for grading) and Grade category.

      So i change the code inside function standard_coursemodule_elements (course/moodleform_mod.php )
      at 4 different lines. ( every where it is commented by "// patch" )

      I am, also, attaching a patch.

              if (!empty($CFG->enablegroupings)) {
                  if ($this->_features->groupings or $this->_features->groupmembersonly) {
                      //groupings selector - used for normal grouping mode or also when restricting access with groupmembersonly
                      $options = array();
                      $options[0] = get_string('none');
                      if ($groupings = get_records('groupings', 'courseid', $COURSE->id)) {
                          foreach ($groupings as $grouping) {
                              $options[$grouping->id] = format_string($grouping->name);
                          }
                      }
                      $mform->addElement('select', 'groupingid', get_string('grouping', 'group'), $options);
                      $mform->setHelpButton('groupingid', array('grouping', get_string('grouping', 'group')));
                      //$mform->setAdvanced('groupingid'); // (patch)
                  }
       
                  if ($this->_features->groupmembersonly) {
                      $mform->addElement('checkbox', 'groupmembersonly', get_string('groupmembersonly', 'group'));
                      $mform->setHelpButton('groupmembersonly', array('groupmembersonly', get_string('groupmembersonly', 'group')));
                      //$mform->setAdvanced('groupmembersonly'); // (patch)
                  }
              }
       
              $mform->addElement('modvisible', 'visible', get_string('visible'));
       
              if ($this->_features->idnumber) {
                  $mform->addElement('text', 'cmidnumber', get_string('idnumbermod'));
                  $mform->setHelpButton('cmidnumber', array('cmidnumber', get_string('idnumbermod')), true);
                  $mform->setAdvanced('cmidnumber'); // (patch)
              }
       
              if ($this->_features->gradecat) {
                  $categories = grade_get_categories_menu($COURSE->id, $outcomesused);
                  $mform->addElement('select', 'gradecat', get_string('gradecategory', 'grades'), $categories);
                  $mform->setAdvanced('gradecat'); // (patch)
              }

      Attachments

        Activity

          People

            Unassigned Unassigned
            nadavkav Nadav Kavalerchik
            David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: