Moodle
  1. Moodle
  2. MDL-37039

Grading of Offline Assignment is not possible if filter is set to submitted earlier.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3, 2.4
    • Fix Version/s: 2.3.5, 2.4.2
    • Component/s: Assignment
    • Labels:
    • Testing Instructions:
      Hide
      1. Create an assignment with file submissions set to "Yes"
      2. Go to the grading page for the assignment and change the filter to "Submitted"
      3. Create an assignment with no submission types enabled
      4. Go to the grading page for the assignment and verify that you can still see students in the list
      5. Change the number of Assignments per page and verify you can still see students in the list
      6. Go back to the first assignment and verify that the filter is still set to "Submitted".
      Show
      Create an assignment with file submissions set to "Yes" Go to the grading page for the assignment and change the filter to "Submitted" Create an assignment with no submission types enabled Go to the grading page for the assignment and verify that you can still see students in the list Change the number of Assignments per page and verify you can still see students in the list Go back to the first assignment and verify that the filter is still set to "Submitted".
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull 2.4 Branch:
    • Pull Master Branch:
      MDL-37039-master
    • Rank:
      46579

      Description

      Grading of offline assignments (assignments with no file, no text, and no comment; e.g. "activity or assessment process is performed outside of Moodle") is not possible if filter is set to submit prior. The filter option is not listed under options, if all assignment plugins (e.g. for offline assignments) are disabled. Thus the filter cannot be set back to "no filter" and since offline assignments can't be submitted you will not see any submission and cannot give any grade or feedback.

      Testing Instruction:

      • Goto any course with at least some students
      • create two assignments
        • first with file and/or text submission option.
        • second without file, text and comment submission options
      • Select "View/grade all submissions" for the first assignment and set the filter to "Submitted"
      • Select "View/grade all submissions" for the second assignment
        --> the filter "submitted" is still active and thus no data is listed because submitting data is impossible.

      Solution 1:
      Set filter to "submitted" if an offline submission is listed.

      modassignlocallib.php
      +++ b/mod/assign/locallib.php
      @@ -2297,6 +2297,9 @@ class assign {
               $gradingoptionsdata->filter = $filter;
               $gradingoptionsform->set_data($gradingoptionsdata);
      
      +        if(!$this->is_any_submission_plugin_enabled())
      +            $filter = '';
      +
               $actionformtext = $this->get_renderer()->render($gradingactions);
      

      Solution 2:
      Do not disable the filter for offline assignments. The filter is not very helpful for offline assignments because it results in either showing all or none, but we can get rid of any logic for disabling the filter. This leads to easier mantainability:

      +++ b/mod/assign/gradingoptionsform.php
      @@ -53,9 +53,7 @@ class mod_assign_grading_options_form extends moodleform {
               $options = array('' => get_string('filternone', 'assign'),
                                ASSIGN_FILTER_SUBMITTED => get_string('filtersubmitted', 'assign'),
                                ASSIGN_FILTER_REQUIRE_GRADING => get_string('filterrequiregrading', 'assign'));
      -        if ($instance['submissionsenabled']) {
      -            $mform->addElement('select', 'filter', get_string('filter', 'assign'), $options, $dirtyclass);
      -        }
      +        $mform->addElement('select', 'filter', get_string('filter', 'assign'), $options, $dirtyclass);
      
               // quickgrading
               if ($instance['showquickgrading']) {
      diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php
      index 7c5a925..51d2ffa 100644
      --- a/mod/assign/locallib.php
      +++ b/mod/assign/locallib.php
      @@ -2278,7 +2278,6 @@ class assign {
      array('cm'=>$this->get_course_module()->id,
             'contextid'=>$this->context->id,
             'userid'=>$USER->id,
      -      'submissionsenabled'=>$this->is_any_submission_plugin_enabled(),
             'showquickgrading'=>$showquickgrading,
      

        Activity

        Hide
        Damyon Wiese added a comment -

        Thanks for reporting this.

        I've put that on the backlog.

        I think the best solution might be not to apply any filters if there are no submissions. This way it will still remember your filters when jumping between offline and online assignments.

        Damyon

        Show
        Damyon Wiese added a comment - Thanks for reporting this. I've put that on the backlog. I think the best solution might be not to apply any filters if there are no submissions. This way it will still remember your filters when jumping between offline and online assignments. Damyon
        Hide
        Dan Poltawski added a comment -

        Inegrated, thanks Damyon

        Show
        Dan Poltawski added a comment - Inegrated, thanks Damyon
        Hide
        Frédéric Massart added a comment -

        Test passed on 2.3 onwards. Cheers!

        Show
        Frédéric Massart added a comment - Test passed on 2.3 onwards. Cheers!
        Hide
        Damyon Wiese added a comment -

        Congratulations this fix has been added to Moodle!

        You may want to dedicate this issue to someone special on this Valentines day.

        Thanks!

        Show
        Damyon Wiese added a comment - Congratulations this fix has been added to Moodle! You may want to dedicate this issue to someone special on this Valentines day. Thanks!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: