-
New Feature
-
Resolution: Done
-
Blocker
-
3.8
-
MOODLE_38_STABLE
-
MOODLE_38_STABLE
-
MDL-66358-master
-
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.
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.
- Create new mustache templates in grade/grading/form/[type]/templates
- Replace the existing JS with a new ES6/AMD module called from the template and using uniqid (should be trivial)
- Create a new renderable for each of the advanced grading forms in /path/classes/output/grading_panel_renderable.php
- Implement an export_for_template(renderer_base $output) in there
- Constructor to take finalised values
- 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.
- Create a new WS to call the new function/class method. That will then call export_for_template, then return the result.
- When it comes to saving grades in the grading panel we call the named webservice for each grading form type:
- gradingform_rubric_save_grades_for_user_in_cmid($user, $cmid, $gradeoptions); or similar
- That should return the same values (along with a success/fail)
- gradingform_rubric_save_grades_for_user_in_cmid($user, $cmid, $gradeoptions); or similar
- Create a generic grade one for simple direct grading
- We also need to either:
- limit the list of advanced grading types in the modgrade form field where we choose them from; or
- ???
When setting up the JS we can do it similar to user selector, except that we have curried fns to:
- fetch the name of the template to use during render
- fetch the current data (curried which already provides cmid) and takes just user
- 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
- Type (for Simple direct only)
- Marking guide
- Rubric
- Simple direct (not an advanced)
The Scale/Point are shown when using the other advanced types, but are not editable.
- is blocked by
-
MDL-66079 Add configuration to show grading options in the Forum settings
- Closed