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

Make "Section is hidden due to Activity Completion Condition" error message more informative

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4.3
    • None
    • None
    • MOODLE_24_STABLE

    Description

      STEPS TO REPRODUCE:
      1. Create activity
      2. Create section
      3. In the section edit screen, under Restrict access:
      3.1 Choose an Activity completion condition from the drop-down,
      3.2 Choose "Must be marked complete" from the drop-down underneath
      3.3 Click the Save Changes button.
      4. Now change to a user-role that doesn't have permission to view hidden section
      5. Go to the section that you made dependent on an activity

      The error message you get is made up of 3 parts:
      1. A message saying: "Sorry, but you do not currently have permissions to do that (View hidden sections)"
      2. A link to Moodle's permissions documentation
      3. A Continue button, which returns you to the main page of the course

      IMHO, all 3 parts aren't helpful:

      1. The message doesn't tell the user what she has to do in order to view this hidden section. A better message would be "Sorry, but you can't view this section until the <name of activity, with link> is completed".
      2. The link to Moodle's permissions documentation doesn't tell the user anything helpful either, and it also takes her out of the current Moodle course
      3. A link back to the main page of the course doesn't help. The user probably either wants to go back to where she was, or go to the activity that will enable her to see this hidden section.

      The code that generates this message is locate in the

      fatal_error()

      function in

      \lib\outputrenderers.php


      and I would rather not change Core - it would put on us too big a maintenance burden...

      What would you suggest? Is this a problem anyone else has encountered?

      Attachments

        Issue Links

          Activity

            People

              quen Sam Marshall
              leac Lea Cohen
              Sam Marshall, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona), Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: