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

The error is shown when switching user role to student

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.9.2, 2.9.3, 3.0.9, 3.1.5, 3.2.2, 3.3
    • Assignment
    • MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE
    • MDL-53155-master
    • Hide

      There are four different scenarios, which should be tested (now covered by PHPUnit):

      1. As a teacher in an empty course:

      • Enrol a student.
      • Create a new mod_assign
        • only setting to change is "Students submit in groups" -> yes
      • Switch your role to student
      • View the assign instance

      Here the teacher is assumed to be in the default group.

      This currently leads to the exception nopermissiontocomment

      2. As a teacher in an empty course:

      • Enrol a student.
      • Create a group
      • Add the student and yourself to the group
      • Create a new mod_assign
        • only setting to change is "Students submit in groups" -> yes
      • Switch your role to student
      • View the assign instance

      Here the teacher is assumed to be in the group you created.

      This currently leads to the exception nopermissiontocomment

      3. As a teacher in an empty course:

      • Enrol a student.
      • Create two groups
      • Add yourself to both groups
      • Create a new mod_assign
        • only setting to change is "Students submit in groups" -> yes
      • Switch your role to student
      • View the assign instance

      Here the teacher is assumed to be in the default group.

      This currently leads to the exception nopermissiontocomment

      4. As a teacher in an empty course:

      • Enrol a student.
      • Create a new mod_assign
        • only setting to change is "Students submit in groups" -> no
      • Switch your role to student
      • View the assign instance

      This version should not be broken by the patch.

      Show
      There are four different scenarios, which should be tested (now covered by PHPUnit): 1. As a teacher in an empty course: Enrol a student. Create a new mod_assign only setting to change is "Students submit in groups" -> yes Switch your role to student View the assign instance Here the teacher is assumed to be in the default group. This currently leads to the exception nopermissiontocomment 2. As a teacher in an empty course: Enrol a student. Create a group Add the student and yourself to the group Create a new mod_assign only setting to change is "Students submit in groups" -> yes Switch your role to student View the assign instance Here the teacher is assumed to be in the group you created. This currently leads to the exception nopermissiontocomment 3. As a teacher in an empty course: Enrol a student. Create two groups Add yourself to both groups Create a new mod_assign only setting to change is "Students submit in groups" -> yes Switch your role to student View the assign instance Here the teacher is assumed to be in the default group. This currently leads to the exception nopermissiontocomment 4. As a teacher in an empty course: Enrol a student. Create a new mod_assign only setting to change is "Students submit in groups" -> no Switch your role to student View the assign instance This version should not be broken by the patch.

      When a teacher switches her role to student and views an assignment with groupmode the following error is thrown:

      You can't add comments
      More information about this error
      Debug info:
      Error code: nopermissiontocomment
      Stack trace:

      line 58 of /mod/assign/submission/comments/lib.php: comment_exception thrown
      line ? of unknownfile: call to assignsubmission_comments_comment_validate()
      line 7135 of /lib/moodlelib.php: call to call_user_func_array()
      line 7117 of /lib/moodlelib.php: call to component_callback()
      line 937 of /comment/lib.php: call to plugin_callback()
      line 948 of /comment/lib.php: call to comment->validate()
      line 436 of /comment/lib.php: call to comment->can_view()
      line 74 of /mod/assign/submission/comments/locallib.php: call to comment->output()
      line 927 of /mod/assign/renderer.php: call to assign_submission_comments->view_summary()
      line 316 of /lib/outputrenderers.php: call to mod_assign_renderer->render_assign_submission_plugin_submission()
      line 697 of /mod/assign/renderer.php: call to plugin_renderer_base->render()
      line 316 of /lib/outputrenderers.php: call to mod_assign_renderer->render_assign_submission_status()
      line 3972 of /mod/assign/locallib.php: call to plugin_renderer_base->render()
      line 4289 of /mod/assign/locallib.php: call to assign->view_student_summary()
      line 556 of /mod/assign/locallib.php: call to assign->view_submission_page()
      line 53 of /mod/assign/view.php: call to assign->view()

            tobias.reischmann Tobias Reischmann
            tikvaw Tikva
            Mark Nelson Mark Nelson
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            10 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.