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

Allow non editing teachers and students with award badge privilege award badges from settings block

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.5.1
    • Component/s: Badges
    • Labels:
    • Testing Instructions:
      Hide

      1. Add a non-editing teacher to the course (this role can award and view recipients by default).
      2. Login as this non-editing teacher.
      3. Go to the course.
      4. Badges navigation should appear under course administration.
      5. If there are any badges, only one action should be available in manage badge table - award a badge.
      5a. If there are no badges, add new badge button should not appear. User should see just a message that there are no badges.
      6. Try to award a badge.
      7a. If the role is not among criteria, you should get a message that it is not possible.
      7b. If the role among criteria, you should be able to award badge.

      Show
      1. Add a non-editing teacher to the course (this role can award and view recipients by default). 2. Login as this non-editing teacher. 3. Go to the course. 4. Badges navigation should appear under course administration. 5. If there are any badges, only one action should be available in manage badge table - award a badge. 5a. If there are no badges, add new badge button should not appear. User should see just a message that there are no badges. 6. Try to award a badge. 7a. If the role is not among criteria, you should get a message that it is not possible. 7b. If the role among criteria, you should be able to award badge.
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull from Repository:

      Description

      Fixes MDL-39830 and MDL-39831 by modifying to the lib/badgeslib to add a badges node under course administration ADMIN_Category

      //@nneko added else clause to add not for non editing users with award privilege
      function badges_add_course_navigation(navigation_node $coursenode, stdClass $course) {
      global $CFG, $SITE;

      ...

      if (!empty($CFG->enablebadges) && !empty($CFG->badges_allowcoursebadges) && !$isfrontpage) {
      if (has_capability('moodle/badges:configuredetails', $coursecontext)) {

      ...

      else {//Add Badge category for non editing teachers and students that have award badge permission
      if(has_capability('moodle/badges:awardbadge', $coursecontext))

      { $coursenode->add(get_string('coursebadges', 'badges'), null, navigation_node::TYPE_CONTAINER, null, 'coursebadges', new pix_icon('i/badge', get_string('coursebadges', 'badges'))); $url = new moodle_url($CFG->wwwroot . '/badges/index.php', array('type' => BADGE_TYPE_COURSE, 'id' => $course->id)); $coursenode->get('coursebadges')->add(get_string('managebadges', 'badges'), $url, navigation_node::TYPE_SETTING, null, 'coursebadges'); }

      }
      }
      }

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  2 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    8/Jul/13