1 <script type=
"text/javascript">
5 // javascript objects for excluded students
6 foreach ($listmembers as
$grade_itemid
=> $listmember
) {
7 echo
"grade_item$grade_itemid = new Object();\n";
8 $useridstring
= "grade_item$grade_itemid.userid = new Array(";
9 $usernamestring
= "grade_item$grade_itemid.username = new Array(";
10 $max
= count($listmember
);
12 foreach ($listmember as
$userid
=> $username
) {
14 $useridstring
.= "\"$userid\"";
15 $usernamestring
.= "\"$username\"";
17 $useridstring
.= ', ';
18 $usernamestring
.= ', ';
21 $useridstring
.= ");\n";
22 $usernamestring
.= ");\n";
28 // javascript objects for included students
29 foreach ($nonmembers as
$grade_itemid
=> $listmember
) {
30 echo
"grade_item_inc$grade_itemid = new Object();\n";
31 $useridstring
= "grade_item_inc$grade_itemid.userid = new Array(";
32 $usernamestring
= "grade_item_inc$grade_itemid.username = new Array(";
33 $max
= count($listmember
);
35 foreach ($listmember as
$userid
=> $username
) {
37 $useridstring
.= "\"$userid\"";
38 $usernamestring
.= "\"$username\"";
40 $useridstring
.= ', ';
41 $usernamestring
.= ', ';
44 $useridstring
.= ");\n";
45 $usernamestring
.= ");\n";
52 function updategrade_item() {
53 getElementById('form1').grade_itemid
.value
= getElementById('form2').grade_items
.value
;
54 getElementById('form3').grade_itemid
.value
= getElementById('form2').grade_items
.value
;
58 function updateMembers(selectgrade_item
) {
59 eval('grade_item=grade_item'+selectgrade_item
.value
);
61 username
= grade_item
.username
;
62 userid
= grade_item
.userid
;
64 getElementById('form3')['members[]'].length
= username
.length
;
66 for (i
=0;i
<username
.length
;i
++) {
67 getElementById('form3')['members[]'].options
[i
].value
= userid
[i
];
68 getElementById('form3')['members[]'].options
[i
].text
= username
[i
];
71 eval('grade_item_inc=grade_item_inc'+selectgrade_item
.value
);
73 username
= grade_item_inc
.username
;
74 userid
= grade_item_inc
.userid
;
76 getElementById('form1')['nonmembers[]'].length
= username
.length
;
78 for (i
=0;i
<username
.length
;i
++) {
79 getElementById('form1')['nonmembers[]'].options
[i
].value
= userid
[i
];
80 getElementById('form1')['nonmembers[]'].options
[i
].text
= username
[i
];
86 // end hiding script -->
91 <table border=
"0" cellspacing=
"2" cellpadding=
"5" align=
"center" class=
"generalbox">
93 <td colspan=
"3" class=
"header">
95 print get_string('gradeexceptions','grades');
96 helpbutton('exceptions',get_string('gradeexceptionshelp','grades'), 'grade');
101 <td width=
"33%" align=
"center" class=
"generaltableheader"><?php p($strgradeitemnonmembers) ?></td>
102 <td width=
"33%" align=
"center" class=
"generaltableheader"><?php p($strgradeitems) ?></td>
103 <td width=
"33%" align=
"center" class=
"generaltableheader"><?php p($strgradeitemmembersselected) ?></td>
105 <tr align=
"center" valign=
"top">
106 <td class=
"generalboxcontent">
107 <form id=
"form1" method=
"post" action=
"exceptions.php">
108 <input type=
"hidden" name=
"id" value=
"<?php p($course->id) ?>" />
109 <input type
="hidden" name
="grade_itemid" value
="<?php p($selectedgrade_item) ?>" />
110 <input type
="hidden" name
="action" value
="excepts" />
111 <input type
="hidden" name
="sesskey" value
="<?php p($USER->sesskey) ?>"/>
112 <select name
="nonmembers[]" size
="15" multiple
="multiple">
114 if (!empty($nonmembers[$selectedgrade_item])) {
115 foreach ($nonmembers[$selectedgrade_item] as $id => $nonmembername) {
116 echo "<option value=\"$id\">$nonmembername</option>";
122 <input type=
"submit" name=
"nonmembersadd" value=
"<?php p($strgradeitemaddusers) ?>"
123 onclick
="updategrade_item()" />
127 <td
class="generalboxcontent">
128 <form id
="form2" method
="post" action
="grade_items.php">
129 <input type
="hidden" name
="id" value
="<?php p($course->id) ?>" />
130 <input type
="hidden" name
="action" value
="excepts" />
131 <input type
="hidden" name
="sesskey" value
="<?php p($USER->sesskey) ?>"/>
132 <select name
="grade_items" size
="15" onchange
="updateMembers(this)">
134 if (!empty($listgrade_items)) {
135 foreach ($listgrade_items as $id => $listgrade_item) {
137 if ($id == $selectedgrade_item) {
138 $selected = 'selected="selected"';
140 echo "<option $selected value=\"$id\">$listgrade_item</option>";
149 <td class=
"generalboxcontent">
150 <form id=
"form3" method=
"post" action=
"exceptions.php">
151 <input type=
"hidden" name=
"id" value=
"<?php p($course->id) ?>" />
152 <input type
="hidden" name
="grade_itemid" value
="<?php p($selectedgrade_item) ?>" />
153 <input type
="hidden" name
="sesskey" value
="<?php p($USER->sesskey) ?>"/>
154 <input type
="hidden" name
="action" value
="excepts" />
155 <select name
="members[]" size
="15" multiple
="multiple">
157 if (!empty($listmembers[$selectedgrade_item])) {
158 foreach ($listmembers[$selectedgrade_item] as $id => $membername) {
159 echo "<option value=\"$id\">$membername</option>";
165 <input type=
"submit" name=
"membersremove" value=
"<?php p($strgradeitemremovemembers) ?>"
166 onclick
="updategrade_item()" />
172 <script type
="text/javascript">
175 echo 'updateMembers('.$selectedgrade_item.');';