Moodle
  1. Moodle
  2. MDL-30271

"Assessing example submission" throws db error when viewing in student role

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.0.7, 2.1.4
    • Component/s: Workshop
    • Labels:
    • Environment:
      Centos 5.x x86_64, Postgresql 8.4, php 5.3.x, apache 2.2
    • Database:
      PostgreSQL
    • Testing Instructions:
      Hide
      1. Prepare a course with two editing teachers - say Teacher A and Teacher B
      2. Login as the Teacher A and create a new Workshop activity
      3. In the Workshop settings, enable "Use examples" feature
      4. Define a simple assessment form for the workshop, add example submission and provide the reference assessment for the submission
      5. Switch the workshop to the Submission phase
      6. Still logged in as Teacher A, switch role to the Student
      7. TEST: Try to assess the example submission. Make sure a message displays saying that you can't assess the example because you are the one who provided the example assessment.
      8. Return to normal role and log in as the second Teacher B
      9. Logged in as Teacher B, switch role to the Student again
      10. TEST: Try to assess the example submission. Make sure that you can fill the assessment form, save it and then the normal comparison between the reference assessment and your assessment appears.
      Show
      Prepare a course with two editing teachers - say Teacher A and Teacher B Login as the Teacher A and create a new Workshop activity In the Workshop settings, enable "Use examples" feature Define a simple assessment form for the workshop, add example submission and provide the reference assessment for the submission Switch the workshop to the Submission phase Still logged in as Teacher A, switch role to the Student TEST: Try to assess the example submission. Make sure a message displays saying that you can't assess the example because you are the one who provided the example assessment. Return to normal role and log in as the second Teacher B Logged in as Teacher B, switch role to the Student again TEST: Try to assess the example submission. Make sure that you can fill the assessment form, save it and then the normal comparison between the reference assessment and your assessment appears.
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-30271-switch-role-workshop
    • Rank:
      32601

      Description

      When you (teacher/admin) switch to the student role and then click on the Assess button to see the "Example submissions to assess" you get the "Can not find data record in database table workshop_assessments." error. (see attachment)

      Replication steps:

      1. Create a new workshop activity
      2. Set it up until you reach the Submission phase
      3. As teacher/admin, switch to the student role
      4. Click on the Assess button to see the "Example submissions to assess"

      You get the "Can not find data record in database table workshop_assessments." error. (see attachment)

        Activity

        Hide
        Michael de Raadt added a comment -

        Thanks for reporting that.

        I've put that on the backlog.

        In the meantime feel free to help us work on this issue. If you are able to provide a patch, please add a patch label so we will spot it.

        Show
        Michael de Raadt added a comment - Thanks for reporting that. I've put that on the backlog. In the meantime feel free to help us work on this issue. If you are able to provide a patch, please add a patch label so we will spot it.
        Hide
        David Mudrak added a comment -

        Confirmed and fixed. The reason here is that the same person (user) can't provide the reference assessment and then try to assess the example submission (due to database scheme constraints).

        Submitting a patch for the integration. The patchset consists of two patches. The first one just moves some $PAGE settings and the renderer initialization so that we can produce output in param handling sections of the code.

        The second patch actually fixes this issue by displaying a nice message instead of throwing the error.

        Show
        David Mudrak added a comment - Confirmed and fixed. The reason here is that the same person (user) can't provide the reference assessment and then try to assess the example submission (due to database scheme constraints). Submitting a patch for the integration. The patchset consists of two patches. The first one just moves some $PAGE settings and the renderer initialization so that we can produce output in param handling sections of the code. The second patch actually fixes this issue by displaying a nice message instead of throwing the error.
        Hide
        Sam Hemelryk added a comment -

        Spot on thanks David, this has been integrated now.

        Show
        Sam Hemelryk added a comment - Spot on thanks David, this has been integrated now.
        Hide
        Rajesh Taneja added a comment -

        Works Great
        Thanks for fixing this David.

        Show
        Rajesh Taneja added a comment - Works Great Thanks for fixing this David.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Sent upstream! Just in time for Moodle 2.2rc1 (if related), yay!

        Closing and big thanks!

        Show
        Eloy Lafuente (stronk7) added a comment - Sent upstream! Just in time for Moodle 2.2rc1 (if related), yay! Closing and big thanks!

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: