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

Lesson preview link visible for students in admin block

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.2, 2.8.1
    • Fix Version/s: 2.7.5, 2.8.3
    • Component/s: Lesson
    • Labels:
    • Testing Instructions:
      Hide
      1. As an admin create a lesson block
      2. Add some content to the lesson (e.g. pages)
      3. Log in as a student
      4. Go to the lesson and navigate around
      5. Ensure that the preview link does not appear in navigation
      Show
      As an admin create a lesson block Add some content to the lesson (e.g. pages) Log in as a student Go to the lesson and navigate around Ensure that the preview link does not appear in navigation
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-45784-master

      Description

      Open a lesson activity as a student and you will be able to see a 'Preview' link under 'Lesson administration' in the Administration block.

      The link doesn't go anywhere.

      In /mod/lesson/lib.php, there's some missing code.

      This is what it currently is:

      $url = new moodle_url('/mod/lesson/view.php', array('id'=>$PAGE->cm->id));
      $lessonnode->add(get_string('preview', 'lesson'), $url);

      This is what it should be:

      if ($canedit)

      { $url = new moodle_url('/mod/lesson/view.php', array('id'=>$PAGE->cm->id)); $lessonnode->add(get_string('preview', 'lesson'), $url); }

      I've tested it and now students cannot see the 'preview' link in the admin block but teachers still can.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  2/Feb/15