Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-4605

Students can't read responses unless mod/questionnaire:readallresponseanytime is allowed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.8
    • Fix Version/s: 2.5
    • Component/s: Module: Questionnaire
    • Labels:
      None
    • Plugin Version:
      2013051901
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE

      Description

      The following line was added to /mod/questionnaire/report.php at some point between 2.3.3 (Build: 20121112) and 2.3.8 (Build: 20130708):

      — a/mod/questionnaire/report.php Wed Jan 09 09:46:38 2013
      +++ b/mod/questionnaire/report.php Wed Aug 14 18:08:38 2013
      @@ -579,6 +578,7 @@
      case 'vall': // view all responses
      case 'vallasort': // view all responses sorted in ascending order
      case 'vallarsort': // view all responses sorted in descending order
      + require_capability('mod/questionnaire:readallresponseanytime', $context);
      $PAGE->set_title(get_string('questionnairereport', 'questionnaire'));
      $PAGE->set_heading(format_string($course->fullname));
      $PAGE->navbar->add(get_string('questionnairereport', 'questionnaire'));

      This capability requirement overrides everything that came before it, so the ability to view all responses is now based entirely on mod/questionnaire:readallresponseanytime. All previous checks of mod/questionnaire:readallresponses and $questionnaire->resp_view in both tabs.php and report.php are irrelevant.

      If mod/questionnaire:readallresponseanytime is allowed, students can always see all responses, even if the $questionnaire->resp_view conditions are not met. This is confusing in itself, but I assume it's by design.

      If mod/questionnaire:readallresponseanytime is not allowed, students can never see all responses, even if all other conditions are met. If mod/questionnaire:readallresponses is allowed and the $questionnaire->resp_view conditions are met, the "All responses" tab is displayed, but students see the following error when they click it:

      Sorry, but you do not currently have permissions to do that (Read all responses any time)

      If this final check is necessary, it should replicate the previous checks more closely so they're not rendered meaningless.

        Attachments

          Activity

            People

            Assignee:
            rezeau Joseph Rézeau
            Reporter:
            malgozzine Mike Algozzine
            Participants:
            Component watchers:
            Mike Churchward
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              14/May/13