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

Survey summary image can be mysteriously broken

    XMLWordPrintable

    Details

    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull Master Branch:
      MDL-48942_survey

      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

              Assignee:
              andyjdavis Andrew Davis
              Reporter:
              andyjdavis Andrew Davis
              Peer reviewer:
              Ankit Agarwal
              Integrator:
              Dan Poltawski
              Tester:
              Jetha Chan
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Mar/15