Merge branch 'MDL-82508-main-1' of https://github.com/mihailges/moodle
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
define("mod_assign/actionbar/grading/extra_filters_dropdown",["exports","core/local/dropdown/dialog","core_user/repository","jquery"],(function(_exports,_dialog,_repository,_jquery){var obj;
|
||||
/**
|
||||
* Module for the extra filters dropdown on the submissions page.
|
||||
*
|
||||
* @module mod_assign/actionbar/grading/extra_filters_dropdown
|
||||
* @copyright 2024 Mihail Geshoski <mihail@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_jquery=(obj=_jquery)&&obj.__esModule?obj:{default:obj};const Selectors_extraFiltersDropdown=".dropdown.extrafilters",Selectors_extraFiltersClose='a[data-action="close"]',Selectors_workflowFilterElement='select[name="workflowfilter"]',restoreAppliedWorkflowFilter=async extraFiltersDropdown=>{const appliedWorkflowFilter=await(0,_repository.getUserPreference)("assign_workflowfilter");extraFiltersDropdown.getElement().querySelector(Selectors_workflowFilterElement).value=appliedWorkflowFilter};_exports.init=()=>{const extraFiltersDropdown=(0,_dialog.getDropdownDialog)(Selectors_extraFiltersDropdown);extraFiltersDropdown&&(extraFiltersDropdown=>{extraFiltersDropdown.getElement().addEventListener("click",(e=>{e.target.closest(Selectors_extraFiltersClose)&&(e.preventDefault(),extraFiltersDropdown.setVisible(!1))})),(0,_jquery.default)(extraFiltersDropdown.getElement()).on("hide.bs.dropdown",(()=>{restoreAppliedWorkflowFilter(extraFiltersDropdown)}))})(extraFiltersDropdown)}}));
|
||||
|
||||
//# sourceMappingURL=extra_filters_dropdown.min.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"extra_filters_dropdown.min.js","sources":["../../../src/actionbar/grading/extra_filters_dropdown.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\nimport {getDropdownDialog} from 'core/local/dropdown/dialog';\nimport {getUserPreference} from 'core_user/repository';\nimport $ from 'jquery';\n\n/**\n * Module for the extra filters dropdown on the submissions page.\n *\n * @module mod_assign/actionbar/grading/extra_filters_dropdown\n * @copyright 2024 Mihail Geshoski <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/** @constant {Object} The object containing the relevant selectors. */\nconst Selectors = {\n extraFiltersDropdown: '.dropdown.extrafilters',\n extraFiltersClose: 'a[data-action=\"close\"]',\n workflowFilterElement: 'select[name=\"workflowfilter\"]'\n};\n\n/**\n * Register event listeners for the extra filters dropdown.\n *\n * @param {DropdownDialog} extraFiltersDropdown The dropdown dialog instance.\n */\nconst registerEventListeners = (extraFiltersDropdown) => {\n // Click event listener to the extra filters dropdown element.\n extraFiltersDropdown.getElement().addEventListener('click', e => {\n // The target is the 'Close' button.\n if (e.target.closest(Selectors.extraFiltersClose)) {\n e.preventDefault();\n extraFiltersDropdown.setVisible(false);\n }\n });\n // Event listener triggered upon hiding of the dropdown.\n $(extraFiltersDropdown.getElement()).on('hide.bs.dropdown', () => {\n // Restore the filters to their stored preference values once the dropdown is closed.\n restoreAppliedWorkflowFilter(extraFiltersDropdown);\n });\n};\n\n/**\n * Restores the currently applied workflow filter to its stored preference value.\n *\n * @param {DropdownDialog} extraFiltersDropdown The dropdown dialog instance.\n */\nconst restoreAppliedWorkflowFilter = async(extraFiltersDropdown) => {\n const appliedWorkflowFilter = await getUserPreference('assign_workflowfilter');\n const workflowFilterSelect = extraFiltersDropdown.getElement().querySelector(Selectors.workflowFilterElement);\n workflowFilterSelect.value = appliedWorkflowFilter;\n};\n\n/**\n * Initialize module.\n */\nexport const init = () => {\n const extraFiltersDropdown = getDropdownDialog(Selectors.extraFiltersDropdown);\n if (extraFiltersDropdown) {\n registerEventListeners(extraFiltersDropdown);\n }\n};\n"],"names":["Selectors","restoreAppliedWorkflowFilter","async","appliedWorkflowFilter","extraFiltersDropdown","getElement","querySelector","value","addEventListener","e","target","closest","preventDefault","setVisible","on","registerEventListeners"],"mappings":";;;;;;;gJA4BMA,+BACoB,yBADpBA,4BAEiB,yBAFjBA,gCAGqB,gCA6BrBC,6BAA+BC,MAAAA,6BAC3BC,4BAA8B,iCAAkB,yBACzBC,qBAAqBC,aAAaC,cAAcN,iCACxDO,MAAQJ,qCAMb,WACVC,sBAAuB,6BAAkBJ,gCAC3CI,sBAhCwBA,CAAAA,uBAE5BA,qBAAqBC,aAAaG,iBAAiB,SAASC,IAEpDA,EAAEC,OAAOC,QAAQX,+BACjBS,EAAEG,iBACFR,qBAAqBS,YAAW,2BAItCT,qBAAqBC,cAAcS,GAAG,oBAAoB,KAExDb,6BAA6BG,0BAqB7BW,CAAuBX"}
|
||||
@@ -0,0 +1,75 @@
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import {getDropdownDialog} from 'core/local/dropdown/dialog';
|
||||
import {getUserPreference} from 'core_user/repository';
|
||||
import $ from 'jquery';
|
||||
|
||||
/**
|
||||
* Module for the extra filters dropdown on the submissions page.
|
||||
*
|
||||
* @module mod_assign/actionbar/grading/extra_filters_dropdown
|
||||
* @copyright 2024 Mihail Geshoski <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
/** @constant {Object} The object containing the relevant selectors. */
|
||||
const Selectors = {
|
||||
extraFiltersDropdown: '.dropdown.extrafilters',
|
||||
extraFiltersClose: 'a[data-action="close"]',
|
||||
workflowFilterElement: 'select[name="workflowfilter"]'
|
||||
};
|
||||
|
||||
/**
|
||||
* Register event listeners for the extra filters dropdown.
|
||||
*
|
||||
* @param {DropdownDialog} extraFiltersDropdown The dropdown dialog instance.
|
||||
*/
|
||||
const registerEventListeners = (extraFiltersDropdown) => {
|
||||
// Click event listener to the extra filters dropdown element.
|
||||
extraFiltersDropdown.getElement().addEventListener('click', e => {
|
||||
// The target is the 'Close' button.
|
||||
if (e.target.closest(Selectors.extraFiltersClose)) {
|
||||
e.preventDefault();
|
||||
extraFiltersDropdown.setVisible(false);
|
||||
}
|
||||
});
|
||||
// Event listener triggered upon hiding of the dropdown.
|
||||
$(extraFiltersDropdown.getElement()).on('hide.bs.dropdown', () => {
|
||||
// Restore the filters to their stored preference values once the dropdown is closed.
|
||||
restoreAppliedWorkflowFilter(extraFiltersDropdown);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Restores the currently applied workflow filter to its stored preference value.
|
||||
*
|
||||
* @param {DropdownDialog} extraFiltersDropdown The dropdown dialog instance.
|
||||
*/
|
||||
const restoreAppliedWorkflowFilter = async(extraFiltersDropdown) => {
|
||||
const appliedWorkflowFilter = await getUserPreference('assign_workflowfilter');
|
||||
const workflowFilterSelect = extraFiltersDropdown.getElement().querySelector(Selectors.workflowFilterElement);
|
||||
workflowFilterSelect.value = appliedWorkflowFilter;
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize module.
|
||||
*/
|
||||
export const init = () => {
|
||||
const extraFiltersDropdown = getDropdownDialog(Selectors.extraFiltersDropdown);
|
||||
if (extraFiltersDropdown) {
|
||||
registerEventListeners(extraFiltersDropdown);
|
||||
}
|
||||
};
|
||||
@@ -29,6 +29,7 @@ use context_module;
|
||||
use templatable;
|
||||
use renderable;
|
||||
use moodle_url;
|
||||
use core\output\local\dropdown\dialog;
|
||||
|
||||
/**
|
||||
* Output the grading actionbar for this activity.
|
||||
@@ -77,7 +78,7 @@ class grading_actionmenu implements templatable, renderable {
|
||||
* @return array Data to render.
|
||||
*/
|
||||
public function export_for_template(\renderer_base $output): array {
|
||||
global $PAGE;
|
||||
global $PAGE, $OUTPUT;
|
||||
|
||||
$course = $this->assign->get_course();
|
||||
$actionbarrenderer = $PAGE->get_renderer('core_course', 'actionbar');
|
||||
@@ -104,11 +105,17 @@ class grading_actionmenu implements templatable, renderable {
|
||||
$data['groupselector'] = $actionbarrenderer->render(new \core_course\output\actionbar\group_selector($course));
|
||||
}
|
||||
|
||||
if (groups_get_course_group($course)) {
|
||||
if ($extrafiltersdropdown = $this->get_extra_filters_dropdown()) {
|
||||
$PAGE->requires->js_call_amd('mod_assign/actionbar/grading/extra_filters_dropdown', 'init', []);
|
||||
$data['extrafiltersdropdown'] = $OUTPUT->render($extrafiltersdropdown);
|
||||
}
|
||||
|
||||
if (groups_get_course_group($course) || $this->get_applied_extra_filters_count() > 0) {
|
||||
$url = new moodle_url('/mod/assign/view.php', [
|
||||
'id' => $this->cmid,
|
||||
'action' => 'grading',
|
||||
'group' => 0,
|
||||
'workflowfilter' => '',
|
||||
]);
|
||||
$data['pagereset'] = $url->out(false);
|
||||
}
|
||||
@@ -188,4 +195,71 @@ class grading_actionmenu implements templatable, renderable {
|
||||
|
||||
return $actions;
|
||||
}
|
||||
|
||||
/**
|
||||
* The renderable for the extra filters dropdown, if available.
|
||||
*
|
||||
* @return dialog|null The renderable for the extra filters dropdown, if available.
|
||||
*/
|
||||
private function get_extra_filters_dropdown(): ?dialog {
|
||||
global $OUTPUT;
|
||||
|
||||
$dropdowncontentdata = [
|
||||
'actionurl' => (new moodle_url('/mod/assign/view.php'))->out(false),
|
||||
'id' => $this->assign->get_course_module()->id,
|
||||
'action' => 'grading',
|
||||
'filters' => [],
|
||||
];
|
||||
|
||||
// If marking workflow is enabled.
|
||||
if ($this->assign->get_instance()->markingworkflow) {
|
||||
$dropdowncontentdata['filters']['markingworkflow'] = [
|
||||
'workflowfilteroptions' => $this->assign->get_marking_workflow_filters(true),
|
||||
];
|
||||
}
|
||||
|
||||
// If there are no available filters, return null.
|
||||
if (empty($dropdowncontentdata['filters'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Define the content output for the extra filters dropdown menu.
|
||||
$dropdowncontent = $OUTPUT->render_from_template(
|
||||
'mod_assign/actionbar/grading/extra_filters_dropdown_body',
|
||||
$dropdowncontentdata
|
||||
);
|
||||
|
||||
// Define the output for the extra filters dropdown trigger.
|
||||
$buttoncontent = $OUTPUT->render_from_template(
|
||||
'mod_assign/actionbar/grading/extra_filters_dropdown_trigger',
|
||||
['appliedfilterscount' => $this->get_applied_extra_filters_count()]
|
||||
);
|
||||
|
||||
return new dialog(
|
||||
$buttoncontent,
|
||||
$dropdowncontent,
|
||||
[
|
||||
'classes' => 'extrafilters d-flex',
|
||||
'buttonclasses' => 'btn d-flex border-none align-items-center dropdown-toggle p-0',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of applied extra filters.
|
||||
*
|
||||
* @return int The number of applied extra filters.
|
||||
*/
|
||||
private function get_applied_extra_filters_count(): int {
|
||||
$appliedextrafilterscount = 0;
|
||||
|
||||
// If marking workflow is enabled.
|
||||
if ($this->assign->get_instance()->markingworkflow) {
|
||||
if (get_user_preferences('assign_workflowfilter')) {
|
||||
$appliedextrafilterscount++;
|
||||
}
|
||||
}
|
||||
|
||||
return $appliedextrafilterscount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,10 +71,6 @@ class mod_assign_grading_options_form extends moodleform {
|
||||
$markingfilter = get_string('markerfilter', 'assign');
|
||||
$mform->addElement('select', 'markerfilter', $markingfilter, $instance['markingallocationopt']);
|
||||
}
|
||||
if (!empty($instance['markingworkflowopt'])) {
|
||||
$workflowfilter = get_string('workflowfilter', 'assign');
|
||||
$mform->addElement('select', 'workflowfilter', $workflowfilter, $instance['markingworkflowopt']);
|
||||
}
|
||||
// Quickgrading.
|
||||
if ($instance['showquickgrading']) {
|
||||
$mform->addElement('checkbox', 'quickgrading', get_string('quickgrading', 'assign'));
|
||||
|
||||
@@ -88,6 +88,7 @@ class assign_grading_table extends table_sql implements renderable {
|
||||
parent::__construct('mod_assign_grading-' . $assignment->get_context()->id);
|
||||
|
||||
$this->is_persistent(true);
|
||||
$this->set_attribute('id', 'submissions');
|
||||
$this->assignment = $assignment;
|
||||
|
||||
// Check permissions up front.
|
||||
|
||||
@@ -363,6 +363,7 @@ $string['markingallocation'] = 'Use marking allocation';
|
||||
$string['markingallocation_help'] = 'If enabled together with marking workflow, markers can be allocated to particular students.';
|
||||
$string['markinganonymous'] = 'Allow partial release of grades while marking anonymously';
|
||||
$string['markinganonymous_help'] = 'If enabled together with anonymous submissions and marking workflow, it allows partial release of grades while marking anonymously.';
|
||||
$string['markingstate'] = 'Marking state';
|
||||
$string['markingworkflow'] = 'Use marking workflow';
|
||||
$string['markingworkflow_help'] = 'If enabled, marks will go through a series of workflow stages before being released to students. This allows for multiple rounds of marking and allows marks to be released to all students at the same time.';
|
||||
$string['markingworkflowstate'] = 'Marking workflow state';
|
||||
|
||||
@@ -4492,7 +4492,15 @@ class assign {
|
||||
$perpage = $this->get_assign_perpage();
|
||||
$filter = get_user_preferences('assign_filter', '');
|
||||
$markerfilter = get_user_preferences('assign_markerfilter', '');
|
||||
$workflowfilter = get_user_preferences('assign_workflowfilter', '');
|
||||
|
||||
// Retrieve the 'workflowfilter' parameter, or set it to null if not provided.
|
||||
$workflowfilter = optional_param('workflowfilter', null, PARAM_ALPHA);
|
||||
// Check if the parameter is not null and if it exists in the list of valid workflow filters.
|
||||
if ($workflowfilter !== null && array_key_exists($workflowfilter, $this->get_marking_workflow_filters())) {
|
||||
// Save the valid 'workflowfilter' value as a user preference.
|
||||
set_user_preference('assign_workflowfilter', $workflowfilter);
|
||||
}
|
||||
|
||||
$controller = $gradingmanager->get_active_controller();
|
||||
$showquickgrading = empty($controller) && $this->can_grade();
|
||||
$quickgrading = get_user_preferences('assign_quickgrading', false);
|
||||
@@ -4564,7 +4572,6 @@ class assign {
|
||||
$gradingoptionsdata->perpage = $perpage;
|
||||
$gradingoptionsdata->filter = $filter;
|
||||
$gradingoptionsdata->markerfilter = $markerfilter;
|
||||
$gradingoptionsdata->workflowfilter = $workflowfilter;
|
||||
$gradingoptionsform->set_data($gradingoptionsdata);
|
||||
|
||||
$buttons = new \mod_assign\output\grading_actionmenu(cmid: $this->get_course_module()->id, assign: $this);
|
||||
@@ -7418,9 +7425,6 @@ class assign {
|
||||
if (isset($formdata->markerfilter)) {
|
||||
set_user_preference('assign_markerfilter', $formdata->markerfilter);
|
||||
}
|
||||
if (isset($formdata->workflowfilter)) {
|
||||
set_user_preference('assign_workflowfilter', $formdata->workflowfilter);
|
||||
}
|
||||
if ($showquickgrading) {
|
||||
set_user_preference('assign_quickgrading', isset($formdata->quickgrading));
|
||||
}
|
||||
|
||||
@@ -143,12 +143,6 @@ M.mod_assign.init_grading_options = function(Y) {
|
||||
Y.one('form.gradingoptionsform').submit();
|
||||
});
|
||||
}
|
||||
var workflowfilterelement = Y.one('#id_workflowfilter');
|
||||
if (workflowfilterelement) {
|
||||
workflowfilterelement.on('change', function(e) {
|
||||
Y.one('form.gradingoptionsform').submit();
|
||||
});
|
||||
}
|
||||
var quickgradingelement = Y.one('#id_quickgrading');
|
||||
if (quickgradingelement) {
|
||||
quickgradingelement.on('change', function(e) {
|
||||
|
||||
@@ -123,6 +123,10 @@
|
||||
background-color: #efcfcf;
|
||||
}
|
||||
|
||||
.path-mod-assign div.dropdown.extrafilters .dropdown-menu {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.path-mod-assign .gradingtable .c0 {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
{{!
|
||||
This file is part of Moodle - http://moodle.org/
|
||||
Moodle is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
Moodle is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
}}
|
||||
{{!
|
||||
@template mod_assign/actionbar/grading/extra_filters_dropdown_body
|
||||
|
||||
Template for the body of the extra filters dropdown menu.
|
||||
|
||||
Context variables required for this template:
|
||||
* actionurl - Form action URL
|
||||
* id - Course module id
|
||||
* filters - Array of filter options
|
||||
* markingworkflow
|
||||
* workflowfilteroptions - Array of workflow filter options
|
||||
* key - The key of the workflow filter option
|
||||
* name - The name of the workflow filter option
|
||||
* active - Whether the workflow filter option is currently active
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"actionurl": "http://moodlesite/mod/assign/view.php",
|
||||
"id": 3,
|
||||
"action": "grading",
|
||||
"filters": [
|
||||
{
|
||||
"markingworkflow": {
|
||||
"workflowfilteroptions": [
|
||||
{
|
||||
"key": "notmarked",
|
||||
"name": "Not marked",
|
||||
"active": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}}
|
||||
<div class="flex-column h-100 w-100 p-1">
|
||||
<form action="{{{actionurl}}}" method="GET">
|
||||
<input type="hidden" name="id" value="{{id}}">
|
||||
<input type="hidden" name="action" value="{{action}}">
|
||||
{{#filters}}
|
||||
{{#markingworkflow}}
|
||||
<div class="row m-0 pb-3">
|
||||
<label class="w-100" for="filter-workflow-{{uniqid}}">
|
||||
{{#str}}markingstate, mod_assign{{/str}}
|
||||
</label>
|
||||
<select name="workflowfilter" id="filter-workflow-{{uniqid}}" class="custom-select w-100">
|
||||
{{#workflowfilteroptions}}
|
||||
<option value="{{key}}" {{#active}}selected="selected"{{/active}}>{{name}}</option>
|
||||
{{/workflowfilteroptions}}
|
||||
</select>
|
||||
</div>
|
||||
{{/markingworkflow}}
|
||||
{{/filters}}
|
||||
<div class="d-flex flex-row justify-content-end align-items-center pt-2">
|
||||
<a href="#" class="pull-right mx-3 text-decoration-none text-dark" data-action="close">{{#str}}closebuttontitle{{/str}}</a>
|
||||
<input class="btn btn-primary pull-right" type="submit" value="{{#str}}apply{{/str}}">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,32 @@
|
||||
{{!
|
||||
This file is part of Moodle - http://moodle.org/
|
||||
Moodle is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
Moodle is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
}}
|
||||
{{!
|
||||
@template mod_assign/actionbar/grading/extra_filters_dropdown_trigger
|
||||
|
||||
Template for the trigger of the extra filters dropdown menu.
|
||||
|
||||
Context variables required for this template:
|
||||
* appliedfilterscount - The number of applied extra filters
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"appliedfilterscount": 2
|
||||
}
|
||||
}}
|
||||
<div class="pr-3">
|
||||
<span>{{#str}} advanced, core {{/str}}</span>
|
||||
{{#appliedfilterscount}}
|
||||
<span class="badge badge-pill badge-primary ml-1">+{{.}}</span>
|
||||
{{/appliedfilterscount}}
|
||||
</div>
|
||||
@@ -25,12 +25,14 @@
|
||||
Context variables required for this template:
|
||||
* userselector - HTML that outputs the user selector
|
||||
* groupselector - (optional) HTML that outputs the group selector
|
||||
* extrafiltersdropdown - HTML that outputs the extra filters dropdown
|
||||
* actions - (optional) HTML that outputs the bulk action menu
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"userselector": "<div class='user-search'></div>",
|
||||
"groupselector": "<div class='group-selector'></div>",
|
||||
"extrafiltersdropdown": "<div class='dropdown extrafilters'></div>",
|
||||
"pagereset": "http://moodle.local/mod/assign/view.php?id=2&action=grading&group=0",
|
||||
"actions": "<div class='action-menu'></div>"
|
||||
}
|
||||
@@ -54,6 +56,12 @@
|
||||
</div>
|
||||
<div class="navitem-divider d-none d-sm-flex"></div>
|
||||
{{/groupselector}}
|
||||
{{#extrafiltersdropdown}}
|
||||
<div class="navitem">
|
||||
{{{.}}}
|
||||
</div>
|
||||
<div class="navitem-divider d-none d-sm-flex"></div>
|
||||
{{/extrafiltersdropdown}}
|
||||
{{#pagereset}}
|
||||
<div class="navitem align-self-center">
|
||||
<a href="{{{.}}}" class="btn btn-link">{{#str}}clearall, core{{/str}}</a>
|
||||
|
||||
@@ -29,6 +29,7 @@ Feature: Check that the assignment grade can not be input in a wrong format.
|
||||
| submissiondrafts | 0 |
|
||||
When I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I follow "View all submissions"
|
||||
And I change window size to "large"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I set the field "Grade out of 100" to "50,,6"
|
||||
And I press "Save changes"
|
||||
@@ -59,6 +60,7 @@ Feature: Check that the assignment grade can not be input in a wrong format.
|
||||
| submissiondrafts | 0 |
|
||||
When I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I follow "View all submissions"
|
||||
And I change window size to "large"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I set the field "Grade out of 100" to "50..6"
|
||||
And I press "Save changes"
|
||||
|
||||
@@ -29,6 +29,7 @@ Feature: Check that the assignment grade can be updated correctly
|
||||
| submissiondrafts | 0 |
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
Then I follow "View all submissions"
|
||||
And I change window size to "large"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I set the field "Grade out of 100" to "50"
|
||||
And I set the field "Notify student" to "0"
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
@mod @mod_assign
|
||||
Feature: In an assignment, teachers can filter displayed submissions by marking workflow status.
|
||||
In order to manage submissions more easily
|
||||
As a teacher
|
||||
I need to filter submissions by their marking workflow status.
|
||||
|
||||
Background:
|
||||
Given the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||
| student1 | Student | 1 | student1@example.com |
|
||||
| student2 | Student | 2 | student2@example.com |
|
||||
| student3 | Student | 3 | student3@example.com |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
| student2 | C1 | student |
|
||||
| student3 | C1 | student |
|
||||
And the following "activity" exists:
|
||||
| activity | assign |
|
||||
| course | C1 |
|
||||
| name | Test assignment |
|
||||
|
||||
@javascript
|
||||
Scenario: The marking workflow filter is available only when marking workflow is enabled in the assignment.
|
||||
Given I am on the "Test assignment" Activity page logged in as teacher1
|
||||
And I follow "View all submissions"
|
||||
And I change window size to "large"
|
||||
And "Advanced" "button" should not exist in the ".tertiary-navigation" "css_element"
|
||||
When I am on the "Test assignment" "assign activity editing" page
|
||||
And I expand all fieldsets
|
||||
And I set the field "Use marking workflow" to "Yes"
|
||||
And I press "Save and display"
|
||||
And I follow "View all submissions"
|
||||
Then "Advanced" "button" should exist in the ".tertiary-navigation" "css_element"
|
||||
And I click on "Advanced" "button" in the ".tertiary-navigation" "css_element"
|
||||
And "Marking state" "select" should exist in the ".extrafilters .dropdown-menu" "css_element"
|
||||
And the field "Marking state" matches value "No filter"
|
||||
And the "Marking state" select box should contain "No filter"
|
||||
And the "Marking state" select box should contain "Not marked"
|
||||
And the "Marking state" select box should contain "Marking completed"
|
||||
And the "Marking state" select box should contain "In review"
|
||||
And the "Marking state" select box should contain "Ready for release"
|
||||
And the "Marking state" select box should contain "Released"
|
||||
|
||||
@javascript
|
||||
Scenario: Filter submissions by marking workflow status
|
||||
Given I am on the "Test assignment" "assign activity editing" page logged in as teacher1
|
||||
And I expand all fieldsets
|
||||
And I set the field "Use marking workflow" to "Yes"
|
||||
And I press "Save and display"
|
||||
And I follow "View all submissions"
|
||||
And I change window size to "large"
|
||||
# Change the marking workflow state for Student 2 and Student 3.
|
||||
And I click on "Grade" "link" in the "Student 2" "table_row"
|
||||
And I set the field "Marking workflow state" to "In marking"
|
||||
And I press "Save changes"
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 3" "table_row"
|
||||
And I set the field "Marking workflow state" to "Marking completed"
|
||||
And I press "Save changes"
|
||||
And I follow "View all submissions"
|
||||
# Ensure all students are displayed in the submissions table before applying the marking workflow filter.
|
||||
And the following should exist in the "submissions" table:
|
||||
| -2- |
|
||||
| Student 1 |
|
||||
| Student 2 |
|
||||
| Student 3 |
|
||||
# Ensure the badge indicating the number of applied filters is absent before applying any marking workflow filter.
|
||||
And ".badge" "css_element" should not exist in the ".extrafilters .dropdown-toggle" "css_element"
|
||||
# Filter by 'In marking' marking workflow status.
|
||||
And I click on "Advanced" "button" in the ".tertiary-navigation" "css_element"
|
||||
And I set the field "Marking state" in the ".extrafilters .dropdown-menu" "css_element" to "In marking"
|
||||
When I click on "Apply" "button" in the ".extrafilters .dropdown-menu" "css_element"
|
||||
# Ensure only Student 2 is now displayed in the submissions table.
|
||||
Then the following should exist in the "submissions" table:
|
||||
| -2- |
|
||||
| Student 2 |
|
||||
And the following should not exist in the "submissions" table:
|
||||
| -2- |
|
||||
| Student 1 |
|
||||
| Student 3 |
|
||||
# Ensure the badge indicating the number of applied filters is present.
|
||||
And ".badge" "css_element" should exist in the ".extrafilters .dropdown-toggle" "css_element"
|
||||
And I should see "+1" in the ".extrafilters .badge" "css_element"
|
||||
# Ensure the filter remains applied when navigating away from and returning to the assignment submissions page.
|
||||
And I am on the "Test assignment" Activity page
|
||||
And I follow "View all submissions"
|
||||
And the following should exist in the "submissions" table:
|
||||
| -2- |
|
||||
| Student 2 |
|
||||
And the following should not exist in the "submissions" table:
|
||||
| -2- |
|
||||
| Student 1 |
|
||||
| Student 3 |
|
||||
And I click on "Advanced" "button" in the ".tertiary-navigation" "css_element"
|
||||
And the field "Marking state" matches value "In marking"
|
||||
# Ensure the filter is not applied unless the 'Apply' button is pressed.
|
||||
And I set the field "Marking state" in the ".extrafilters .dropdown-menu" "css_element" to "Marking completed"
|
||||
And I click on "Close" "link" in the ".extrafilters .dropdown-menu" "css_element"
|
||||
And the following should exist in the "submissions" table:
|
||||
| -2- |
|
||||
| Student 2 |
|
||||
And the following should not exist in the "submissions" table:
|
||||
| -2- |
|
||||
| Student 1 |
|
||||
| Student 3 |
|
||||
And I click on "Advanced" "button" in the ".tertiary-navigation" "css_element"
|
||||
And the field "Marking state" matches value "In marking"
|
||||
# Filter by 'Marking completed' marking workflow status.
|
||||
And I set the field "Marking state" in the ".extrafilters .dropdown-menu" "css_element" to "Marking completed"
|
||||
And I click on "Apply" "button" in the ".extrafilters .dropdown-menu" "css_element"
|
||||
# Ensure only Student 3 is now displayed in the submissions table.
|
||||
And the following should exist in the "submissions" table:
|
||||
| -2- |
|
||||
| Student 3 |
|
||||
And the following should not exist in the "submissions" table:
|
||||
| -2- |
|
||||
| Student 1 |
|
||||
| Student 2 |
|
||||
|
||||
@javascript
|
||||
Scenario: The applied marking workflow filter can be reset using the 'Clear all' option.
|
||||
Given I am on the "Test assignment" "assign activity editing" page logged in as teacher1
|
||||
And I expand all fieldsets
|
||||
And I set the field "Use marking workflow" to "Yes"
|
||||
And I press "Save and display"
|
||||
And I follow "View all submissions"
|
||||
And I change window size to "large"
|
||||
# Change the marking workflow state for Student 2.
|
||||
And I click on "Grade" "link" in the "Student 2" "table_row"
|
||||
And I set the field "Marking workflow state" to "In marking"
|
||||
And I press "Save changes"
|
||||
And I follow "View all submissions"
|
||||
# Ensure the 'Clear all' option is not available until the marking workflow filter has been applied.
|
||||
And "Clear all" "link" should not exist in the ".tertiary-navigation" "css_element"
|
||||
# Filter by 'In marking' marking workflow status.
|
||||
And I click on "Advanced" "button" in the ".tertiary-navigation" "css_element"
|
||||
And I set the field "Marking state" in the ".extrafilters .dropdown-menu" "css_element" to "In marking"
|
||||
And I click on "Apply" "button" in the ".extrafilters .dropdown-menu" "css_element"
|
||||
# Ensure only Student 2 is now displayed in the submissions table.
|
||||
Then the following should exist in the "submissions" table:
|
||||
| -2- |
|
||||
| Student 2 |
|
||||
And the following should not exist in the "submissions" table:
|
||||
| -2- |
|
||||
| Student 1 |
|
||||
| Student 3 |
|
||||
# Ensure the 'Clear all' option is now available.
|
||||
And "Clear all" "link" should exist in the ".tertiary-navigation" "css_element"
|
||||
# Ensure the marking workflow filter is reset when the 'Clear All' option is triggered.
|
||||
When I click on "Clear all" "link" in the ".tertiary-navigation" "css_element"
|
||||
Then the following should exist in the "submissions" table:
|
||||
| -2- |
|
||||
| Student 1 |
|
||||
| Student 2 |
|
||||
| Student 3 |
|
||||
And I click on "Advanced" "button" in the ".tertiary-navigation" "css_element"
|
||||
And the field "Marking state" matches value "No filter"
|
||||
@@ -49,7 +49,9 @@ Feature: In an assignment, teachers can change filters in the grading app
|
||||
And I follow "View all submissions"
|
||||
And I set the field "filter" to "Not submitted"
|
||||
And I set the field "markerfilter" to "Marker 1"
|
||||
And I set the field "workflowfilter" to "In marking"
|
||||
And I click on "Advanced" "button" in the ".tertiary-navigation" "css_element"
|
||||
And I set the field "Marking state" in the ".extrafilters .dropdown-menu" "css_element" to "In marking"
|
||||
And I click on "Apply" "button" in the ".extrafilters .dropdown-menu" "css_element"
|
||||
And I change window size to "large"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I change window size to "medium"
|
||||
@@ -77,4 +79,5 @@ Feature: In an assignment, teachers can change filters in the grading app
|
||||
And I click on "View all submissions" "link"
|
||||
Then the field "filter" matches value "Not submitted"
|
||||
And the field "markerfilter" matches value "Marker 1"
|
||||
And the field "workflowfilter" matches value "In marking"
|
||||
And I click on "Advanced" "button" in the ".tertiary-navigation" "css_element"
|
||||
And the field "Marking state" matches value "In marking"
|
||||
|
||||
Reference in New Issue
Block a user