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

Display grading form in the grading panel

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Blocker
    • Resolution: Unresolved
    • Affects Version/s: 3.8
    • Fix Version/s: None
    • Component/s: Forum
    • Story Points:
      5
    • Sprint:
      Internationals - 3.8 Sprint 5, Internationals - 3.8 Sprint 6, Internationals - 3.8 Sprint 7

      Description

      Display the grading form in within the grading panel for the current student/content

      How it works in Assignment

      Assignment grading currently does:

      - lib.php::mod_assign_output_fragment_gradingpanel()
      -- locallib::view()
      --- locallib::view_single_grading_panel
      ---- gradeform.php::mod_assign_grade_form::definition()
      ----- locallib::add_grade_form_elements()
      ------ mod/form/grading.php::toHtml()
      return $this->get_gradinginstance()->render_grading_element($PAGE, $this);
      

      That comes from grade/grading/form/[type]/lib.php::render_grading_element()
      And that calls a renderer function to do loads of things.

      Recommendations

      I don't think that we shuld use the fragments API to do this, at least initially. It doesn't fit in well with what we're
      doing here more generally.

      Therefore I think we need to update the existing grading options to support a new UI.
      We may be able to replace the existing rendering with that, but we shouldn't do it in this issue.

      1. Create new mustache templates in grade/grading/form/[type]/templates
      2. Replace the existing JS with a new ES6/AMD module called from the template and using uniqid (should be trivial)
      3. Create a new renderable for each of the advanced grading forms in /path/classes/output/grading_panel_renderable.php
        1. Implement an export_for_template(renderer_base $output) in there
        2. Constructor to take finalised values
      4. Create an instance of the renderable in a new function in lib.php, or better still in a new class in grade/grading/form/[type]/classes/gradingpanel.php or similar. That function should return the instance of the renderable.
      5. Create a new WS to call the new function/class method. That will then call export_for_template, then return the result.
      6. When it comes to saving grades in the grading panel we call the named webservice for each grading form type:
        1. gradingform_rubric_save_grades_for_user_in_cmid($user, $cmid, $gradeoptions); or similar
          1. That should return the same values (along with a success/fail)
      7. Create a generic grade one for simple direct grading
      8. We also need to either:
        1. limit the list of advanced grading types in the modgrade form field where we choose them from; or
        2. ???

      When setting up the JS we can do it similar to user selector, except that we have curried fns to:

      1. fetch the name of the template to use during render
      2. fetch the current data (curried which already provides cmid) and takes just user
      3. save the data in the form right now (curried which already provides cmid) and takes user and data in form

      Theoretically it should be the Forum which provides the curried functions, but they're also kinda the property of the Grading API so we need to work out how best to do that longer term.

      Scope

      Do not do eveything that the current stuff does. Don't handle all of the modes (especially edit). We should break out
      marking an editing anyway.
      Keep everything as basic as possible.

      Configuration containing list of grading mechanisms:

      • Advanced type:
        • Simple direct (not an advanced)
          • Type (for Simple direct only)
            • Scale
            • Point
        • Marking guide
        • Rubric

      The Scale/Point are shown when using the other advanced types, but are not editable.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                dobedobedoh Andrew Nicols
                Participants:
                Component watchers:
                Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - 4 days
                  4d
                  Remaining:
                  Time Spent - 1 day, 1 hour, 30 minutes Remaining Estimate - 2 days, 6 hours
                  2d 6h
                  Logged:
                  Time Spent - 1 day, 1 hour, 30 minutes Remaining Estimate - 2 days, 6 hours
                  1d 1h 30m