Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 67... Línea 67...
67
                    }
67
                    }
68
                });
68
                });
69
            });
69
            });
70
        }
70
        }
Línea 71... Línea -...
71
 
-
 
72
        const batchform = Y.one('form.gradingbatchoperationsform');
-
 
73
        if (batchform) {
-
 
74
            batchform.on('submit', function(e) {
-
 
75
                M.util.js_pending('mod_assign/module.js:batch:submit');
-
 
76
                let selectedusers = [];
-
 
77
                checkboxes.each(function(node) {
-
 
78
                    if (node.get('checked')) {
-
 
79
                        selectedusers.push(node.get('value'));
-
 
80
                    }
-
 
81
                });
-
 
82
 
-
 
83
                const operation = Y.one('#id_operation');
-
 
84
                const usersinput = Y.one('input.selectedusers');
-
 
85
                usersinput.set('value', selectedusers.join(','));
-
 
86
                if (selectedusers.length === 0) {
-
 
87
                    alert(M.util.get_string('nousersselected', 'assign'));
-
 
88
                    e.preventDefault();
-
 
89
                } else {
-
 
90
                    let action = operation.get('value');
-
 
91
                    const prefix = 'plugingradingbatchoperation_';
-
 
92
                    let confirmmessage = false;
-
 
93
                    if (action.indexOf(prefix) === 0) {
-
 
94
                        const pluginaction = action.slice(prefix.length);
-
 
95
                        const plugin = pluginaction.split('_')[0];
-
 
96
                        action = pluginaction.slice(plugin.length + 1);
-
 
97
                        confirmmessage = M.util.get_string('batchoperationconfirm' + action, 'assignfeedback_' + plugin);
-
 
98
                    } else if (action === 'message') {
-
 
99
                        e.preventDefault();
-
 
100
                        require(['core_message/message_send_bulk'], function(BulkSender) {
-
 
101
                            BulkSender.showModal(selectedusers, function() {
-
 
102
                                document.getElementById('page-header').scrollIntoView();
-
 
103
                            });
-
 
104
                        });
-
 
105
                    } else {
-
 
106
                        confirmmessage = M.util.get_string('batchoperationconfirm' + operation.get('value'), 'assign');
-
 
107
                    }
-
 
108
                    // Complete here the action (js_complete event) when we send a bulk message, or we have a confirmation message.
-
 
109
                    // When the confirmation dialogue is completed, the event is fired.
-
 
110
                    if (action === 'message' || confirmmessage !== false && !confirm(confirmmessage)) {
-
 
111
                        M.util.js_complete('mod_assign/module.js:batch:submit');
-
 
112
                        e.preventDefault();
-
 
113
                    }
-
 
114
                    // Note: Do not js_complete. The page being reloaded will empty it.
-
 
115
                }
-
 
116
            });
-
 
117
        }
-
 
118
 
71
 
119
        var quickgrade = Y.all('.gradingtable .quickgrade');
72
        var quickgrade = Y.all('.gradingtable .quickgrade');
120
        quickgrade.each(function(quick) {
73
        quickgrade.each(function(quick) {
121
            quick.on('change', function(e) {
74
            quick.on('change', function(e) {
122
                this.get('parentNode').addClass('quickgrademodified');
75
                this.get('parentNode').addClass('quickgrademodified');
123
            });
76
            });
124
        });
77
        });
125
    });
78
    });
Línea 126... Línea -...
126
};
-
 
127
 
-
 
128
M.mod_assign.init_grading_options = function(Y) {
-
 
129
    Y.use('node', function(Y) {
-
 
130
        var paginationelement = Y.one('#id_perpage');
-
 
131
        paginationelement.on('change', function(e) {
-
 
132
            Y.one('form.gradingoptionsform').submit();
-
 
133
        });
-
 
134
        var filterelement = Y.one('#id_filter');
-
 
135
        if (filterelement) {
-
 
136
            filterelement.on('change', function(e) {
-
 
137
                Y.one('form.gradingoptionsform').submit();
-
 
138
            });
-
 
139
        }
-
 
140
        var markerfilterelement = Y.one('#id_markerfilter');
-
 
141
        if (markerfilterelement) {
-
 
142
            markerfilterelement.on('change', function(e) {
-
 
143
                Y.one('form.gradingoptionsform').submit();
-
 
144
            });
-
 
145
        }
-
 
146
        var workflowfilterelement = Y.one('#id_workflowfilter');
-
 
147
        if (workflowfilterelement) {
-
 
148
            workflowfilterelement.on('change', function(e) {
-
 
149
                Y.one('form.gradingoptionsform').submit();
-
 
150
            });
-
 
151
        }
-
 
152
        var quickgradingelement = Y.one('#id_quickgrading');
-
 
153
        if (quickgradingelement) {
-
 
154
            quickgradingelement.on('change', function(e) {
-
 
155
                Y.one('form.gradingoptionsform').submit();
-
 
156
            });
-
 
157
        }
-
 
158
        var showonlyactiveenrolelement = Y.one('#id_showonlyactiveenrol');
-
 
159
        if (showonlyactiveenrolelement) {
-
 
160
            showonlyactiveenrolelement.on('change', function(e) {
-
 
161
            Y.one('form.gradingoptionsform').submit();
-
 
162
            });
-
 
163
        }
-
 
164
        var downloadasfolderselement = Y.one('#id_downloadasfolders');
-
 
165
        if (downloadasfolderselement) {
-
 
166
            downloadasfolderselement.on('change', function(e) {
-
 
167
                Y.one('form.gradingoptionsform').submit();
-
 
168
            });
-
 
169
        }
-
 
170
    });
-
 
171
};
79
};
172
 
80
 
173
M.mod_assign.init_plugin_summary = function(Y, subtype, type, submissionid) {
81
M.mod_assign.init_plugin_summary = function(Y, subtype, type, submissionid) {
174
    var suffix = subtype + '_' + type + '_' + submissionid;
82
    var suffix = subtype + '_' + type + '_' + submissionid;
175
    var classname = 'contract_' + suffix;
83
    var classname = 'contract_' + suffix;