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

Mod/Assign add_grade_form_elements missing hidden param userid

XMLWordPrintable

    • MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE
    • MOODLE_30_STABLE
    • MDL-52133-master
    • Easy
    • Hide

      Pre test setup

      1. Create a course and add an assignment activity
      2. Enrol 2 or more users (ideally a few more) in the course

      Test v3.0 and v2.9

      1. Log in as admin
      2. Navigate to the assignment activity
      3. Click "View/grade all submissions"
      4. Grade the first student by clicking the grade icon (or selecting edit > grade)
      5. Confirm that you're taken to the grading page and the student matches the one you selected
      6. Confirm that the grading form shows the current student count and where you are in the list, e.g. Grading student: 1 out of 10
      7. Enter a grade for the student and click "Save and show next"
      8. Confirm you are taken to the next student in the list and the position in the list has changed, e.g. Grading student: 2 out of 10
      9. Use the previous button to return to the previous user and verify the grade has been updated
      10. Use the next button to go to the next user in the list
      11. Remove the "rownum" and "useridlistid" params from the URL and add "userid" and set the value to the id of the user you're currently viewing and then hit enter to reload the page
        • You can get the current user's id from the URL in the link on their name at the top of the grading page
      12. Confirm that the user is the same user as before (the one that matches the id)
      13. Confirm that you no longer see a student count, e.g. Grading student: 2 out of 10 has disappeared
      14. Confirm that you don't see "next" or "prev" buttons any more
      15. Enter a grade for the user and click "Save changes"
      16. Return to the list of all students (from step 3) and confirm that the grades were successfully saves for the students

      Test master - old grading interface

      1. Log in as admin
      2. Navigate to the assignment activity
      3. Click "View all submissions"
      4. Repeat instructions from "Test v3.0 and v2.9" from step 4, however to grade a student with the older interface you must use "edit > grade" as the grade icon/button will now take you to the new interface (if MDL-53916 is integrated you will have to revert it).

      Test master - new grading interface

      1. Log in as admin
      2. Navigate to the assignment activity
      3. Click "View all submissions"
      4. Click the "Grade" button next to a user
      5. Confirm that you are taken to the new grading interface and the correct user is loaded
      6. Enter a grade for the user and save it
      7. Navigate forwards/backwards to different users and grade a few more users
      8. Return to the list of users (step 3) and confirm that all of the grades were saved correctly
      Show
      Pre test setup Create a course and add an assignment activity Enrol 2 or more users (ideally a few more) in the course Test v3.0 and v2.9 Log in as admin Navigate to the assignment activity Click "View/grade all submissions" Grade the first student by clicking the grade icon (or selecting edit > grade) Confirm that you're taken to the grading page and the student matches the one you selected Confirm that the grading form shows the current student count and where you are in the list, e.g. Grading student: 1 out of 10 Enter a grade for the student and click "Save and show next" Confirm you are taken to the next student in the list and the position in the list has changed, e.g. Grading student: 2 out of 10 Use the previous button to return to the previous user and verify the grade has been updated Use the next button to go to the next user in the list Remove the "rownum" and "useridlistid" params from the URL and add "userid" and set the value to the id of the user you're currently viewing and then hit enter to reload the page You can get the current user's id from the URL in the link on their name at the top of the grading page Confirm that the user is the same user as before (the one that matches the id) Confirm that you no longer see a student count, e.g. Grading student: 2 out of 10 has disappeared Confirm that you don't see "next" or "prev" buttons any more Enter a grade for the user and click "Save changes" Return to the list of all students (from step 3) and confirm that the grades were successfully saves for the students Test master - old grading interface Log in as admin Navigate to the assignment activity Click "View all submissions" Repeat instructions from "Test v3.0 and v2.9" from step 4, however to grade a student with the older interface you must use "edit > grade" as the grade icon/button will now take you to the new interface (if MDL-53916 is integrated you will have to revert it). Test master - new grading interface Log in as admin Navigate to the assignment activity Click "View all submissions" Click the "Grade" button next to a user Confirm that you are taken to the new grading interface and the correct user is loaded Enter a grade for the user and save it Navigate forwards/backwards to different users and grade a few more users Return to the list of users (step 3) and confirm that all of the grades were saved correctly

      In mod/assign/locallib.php function add_grade_form_elements is missing param userid. This function should respect optional param userid.
      For example:
      You can normaly browse link like to view info about student submission http://xxx.xxx.xxx.xxx/mod/assign/view.php?id=500&userid=460&rownum=0&action=grade
      But your atempt to grade student will fail, because add_grade_form_elements doesn't respect param userid for savegrade, while function process_save_grade can work with that optional param.

      Solution: add 2 lines to mod/assign/locallib.php (currently on line 6229):

      $mform->addElement('hidden', 'userid', $userid);
      $mform->setType('userid', PARAM_INT);

            ryanwyllie Ryan Wyllie
            evsoldatkin Evgeny Soldatkin
            Damyon Wiese Damyon Wiese
            David Monllaó David Monllaó
            cameron1729 cameron1729
            Votes:
            1 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

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