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

Survey summary image can be mysteriously broken

    XMLWordPrintable

Details

    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • MDL-48942_survey
    • Hide

      Create a survey activity. Set its group mode to "visible groups".

      As a student complete the survey. Afterwards you will be returned to the course page.

      Click back into the survey activity and the page should say that you completed the survey but not reference a graph.

      Edit the survey settings as teacher or admin to have no groups.

      Now when the student enters the survey activity they should see a graph.

      Show
      Create a survey activity. Set its group mode to "visible groups". As a student complete the survey. Afterwards you will be returned to the course page. Click back into the survey activity and the page should say that you completed the survey but not reference a graph. Edit the survey settings as teacher or admin to have no groups. Now when the student enters the survey activity they should see a graph.

    Description

      See MDLSITE-3772. If student groups or capabilities are misconfigured the student can get to the page where the summary image should be but the image itself does not display. No explanation is given for why.

      The image has a URL like https://learn.moodle.net/mod/survey/graph.php?id=28074&sid=21409&group=0&type=student.png Opening that URL in a new tab takes you to a page that says "No permission to see this!"

      This appears to be due to either a problem with capabilities or groups. The page containing the image should really give some sort of clue why the image is not visible. This seems to be the relevant check in graph.php

      if (!has_capability('mod/survey:readresponses', $context)) {
              if ($type != "student.png" or $sid != $USER->id ) {
                  print_error('nopermissiontoshow');
              } else if ($groupmode and !groups_is_member($group)) {
                  print_error('nopermissiontoshow');
              }
          }
      

      Attachments

        Issue Links

          Activity

            People

              andyjdavis Andrew Davis
              andyjdavis Andrew Davis
              Ankit Agarwal Ankit Agarwal
              Dan Poltawski Dan Poltawski
              Jetha Chan Jetha Chan
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Mar/15