MDL-22893, assignment module should use filepicker and filemanager
[moodle.git] / mod / assignment / assignment.js
CommitLineData
df356478
PS
1var assignment = {};
2
8f36c245 3function setNext(){
4 document.getElementById('submitform').mode.value = 'next';
5 document.getElementById('submitform').userid.value = assignment.nextid;
6}
7
8function saveNext(){
9 document.getElementById('submitform').mode.value = 'saveandnext';
10 document.getElementById('submitform').userid.value = assignment.nextid;
11 document.getElementById('submitform').saveuserid.value = assignment.userid;
12 document.getElementById('submitform').menuindex.value = document.getElementById('submitform').grade.selectedIndex;
e92b7f60
PS
13}
14
15function initNext(nextid, usserid) {
16 assignment.nextid = nextid;
17 assignment.userid = userid;
ce2a1c4d
DC
18}
19
20M.mod_assignment = {};
21
22M.mod_assignment.init_tree = function(Y, expand_all, htmlid) {
23 Y.use('yui2-treeview', function(Y) {
24 var tree = new YAHOO.widget.TreeView(htmlid);
25
26 tree.subscribe("clickEvent", function(node, event) {
27 // we want normal clicking which redirects to url
28 return false;
29 });
30
31 if (expand_all) {
32 tree.expandAll();
33 }
34
35 tree.render();
36 });
37}