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

Display grading form in the grading panel



    • 5
    • Internationals - 3.8 Sprint 5, Internationals - 3.8 Sprint 6, Internationals - 3.8 Sprint 7, Internationals - 3.8 Sprint 8


      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.


      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.


      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.


        Issue Links



              mathewmay Mathew May
              dobedobedoh Andrew Lyons
              0 Vote for this issue
              2 Start watching this issue



                Time Tracking

                  Original Estimate - 4 days Original Estimate - 4 days
                  Remaining Estimate - 0 minutes
                  Time Spent - 3 weeks, 4 days, 3 hours, 46 minutes
                  3w 4d 3h 46m


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