2007-01-03 14:44:17 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
//<![CDATA[
|
2005-03-17 16:23:28 +00:00
|
|
|
|
|
|
|
<?php
|
2005-05-16 22:22:31 +00:00
|
|
|
// javascript objects for excluded students
|
2005-03-17 16:23:28 +00:00
|
|
|
foreach ($listmembers as $grade_itemid => $listmember) {
|
|
|
|
echo "grade_item$grade_itemid = new Object();\n";
|
|
|
|
$useridstring = "grade_item$grade_itemid.userid = new Array(";
|
|
|
|
$usernamestring = "grade_item$grade_itemid.username = new Array(";
|
|
|
|
$max = count($listmember);
|
|
|
|
$count = 0;
|
|
|
|
foreach ($listmember as $userid => $username) {
|
|
|
|
$count++;
|
|
|
|
$useridstring .= "\"$userid\"";
|
|
|
|
$usernamestring .= "\"$username\"";
|
|
|
|
if ($count < $max) {
|
|
|
|
$useridstring .= ', ';
|
|
|
|
$usernamestring .= ', ';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$useridstring .= ");\n";
|
|
|
|
$usernamestring .= ");\n";
|
|
|
|
|
|
|
|
echo $useridstring;
|
|
|
|
echo $usernamestring;
|
|
|
|
}
|
2005-05-16 22:22:31 +00:00
|
|
|
|
|
|
|
// javascript objects for included students
|
|
|
|
foreach ($nonmembers as $grade_itemid => $listmember) {
|
2005-03-17 16:23:28 +00:00
|
|
|
echo "grade_item_inc$grade_itemid = new Object();\n";
|
|
|
|
$useridstring = "grade_item_inc$grade_itemid.userid = new Array(";
|
|
|
|
$usernamestring = "grade_item_inc$grade_itemid.username = new Array(";
|
|
|
|
$max = count($listmember);
|
|
|
|
$count = 0;
|
|
|
|
foreach ($listmember as $userid => $username) {
|
|
|
|
$count++;
|
|
|
|
$useridstring .= "\"$userid\"";
|
|
|
|
$usernamestring .= "\"$username\"";
|
|
|
|
if ($count < $max) {
|
|
|
|
$useridstring .= ', ';
|
|
|
|
$usernamestring .= ', ';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$useridstring .= ");\n";
|
|
|
|
$usernamestring .= ");\n";
|
|
|
|
|
|
|
|
echo $useridstring;
|
|
|
|
echo $usernamestring;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
function updategrade_item() {
|
2007-01-04 21:32:36 +00:00
|
|
|
getElementById('form1').grade_itemid.value = getElementById('form2').grade_items.value;
|
|
|
|
getElementById('form3').grade_itemid.value = getElementById('form2').grade_items.value;
|
2005-03-17 16:23:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function updateMembers(selectgrade_item) {
|
|
|
|
eval('grade_item=grade_item'+selectgrade_item.value);
|
|
|
|
|
|
|
|
username = grade_item.username;
|
|
|
|
userid = grade_item.userid;
|
|
|
|
|
2007-01-04 21:32:36 +00:00
|
|
|
getElementById('form3')['members[]'].length = username.length;
|
2005-03-17 16:23:28 +00:00
|
|
|
|
|
|
|
for (i=0;i<username.length;i++) {
|
2007-01-04 21:32:36 +00:00
|
|
|
getElementById('form3')['members[]'].options[i].value = userid[i];
|
|
|
|
getElementById('form3')['members[]'].options[i].text = username[i];
|
2005-03-17 16:23:28 +00:00
|
|
|
}
|
2005-05-16 22:22:31 +00:00
|
|
|
|
|
|
|
eval('grade_item_inc=grade_item_inc'+selectgrade_item.value);
|
2005-03-17 16:23:28 +00:00
|
|
|
|
|
|
|
username = grade_item_inc.username;
|
|
|
|
userid = grade_item_inc.userid;
|
|
|
|
|
2007-01-04 21:32:36 +00:00
|
|
|
getElementById('form1')['nonmembers[]'].length = username.length;
|
2005-03-17 16:23:28 +00:00
|
|
|
|
|
|
|
for (i=0;i<username.length;i++) {
|
2007-01-04 21:32:36 +00:00
|
|
|
getElementById('form1')['nonmembers[]'].options[i].value = userid[i];
|
|
|
|
getElementById('form1')['nonmembers[]'].options[i].text = username[i];
|
2005-03-17 16:23:28 +00:00
|
|
|
}
|
2005-05-16 22:22:31 +00:00
|
|
|
|
2005-03-17 16:23:28 +00:00
|
|
|
updategrade_item();
|
|
|
|
}
|
|
|
|
|
|
|
|
// end hiding script -->
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-05-16 22:22:31 +00:00
|
|
|
<table border="0" cellspacing="2" cellpadding="5" align="center" class="generalbox">
|
|
|
|
<tr>
|
2006-12-13 03:03:43 +00:00
|
|
|
<td colspan="3" class="header">
|
2005-05-16 22:22:31 +00:00
|
|
|
<?php
|
|
|
|
print get_string('gradeexceptions','grades');
|
|
|
|
helpbutton('exceptions',get_string('gradeexceptionshelp','grades'), 'grade');
|
|
|
|
?>
|
2006-12-13 03:03:43 +00:00
|
|
|
</td>
|
2005-05-16 22:22:31 +00:00
|
|
|
</tr>
|
2005-03-17 16:23:28 +00:00
|
|
|
<tr>
|
2005-03-28 18:05:45 +00:00
|
|
|
<td width="33%" align="center" class="generaltableheader"><?php p($strgradeitemnonmembers) ?></td>
|
|
|
|
<td width="33%" align="center" class="generaltableheader"><?php p($strgradeitems) ?></td>
|
|
|
|
<td width="33%" align="center" class="generaltableheader"><?php p($strgradeitemmembersselected) ?></td>
|
2005-03-17 16:23:28 +00:00
|
|
|
</tr>
|
|
|
|
<tr align="center" valign="top">
|
|
|
|
<td class="generalboxcontent">
|
2007-01-04 21:32:36 +00:00
|
|
|
<form id="form1" method="post" action="exceptions.php">
|
2005-03-17 16:23:28 +00:00
|
|
|
<input type="hidden" name="id" value="<?php p($course->id) ?>" />
|
|
|
|
<input type="hidden" name="grade_itemid" value="<?php p($selectedgrade_item) ?>" />
|
2005-05-16 22:22:31 +00:00
|
|
|
<input type="hidden" name="action" value="excepts" />
|
|
|
|
<input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>"/>
|
2005-03-17 16:23:28 +00:00
|
|
|
<select name="nonmembers[]" size="15" multiple="multiple">
|
|
|
|
<?php
|
|
|
|
if (!empty($nonmembers[$selectedgrade_item])) {
|
|
|
|
foreach ($nonmembers[$selectedgrade_item] as $id => $nonmembername) {
|
|
|
|
echo "<option value=\"$id\">$nonmembername</option>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
<p>
|
2005-03-28 18:05:45 +00:00
|
|
|
<input type="submit" name="nonmembersadd" value="<?php p($strgradeitemaddusers) ?>"
|
2005-03-17 16:23:28 +00:00
|
|
|
onclick="updategrade_item()" />
|
|
|
|
</p>
|
|
|
|
</form>
|
|
|
|
</td>
|
|
|
|
<td class="generalboxcontent">
|
2007-01-04 21:32:36 +00:00
|
|
|
<form id="form2" method="post" action="grade_items.php">
|
2005-03-17 16:23:28 +00:00
|
|
|
<input type="hidden" name="id" value="<?php p($course->id) ?>" />
|
2005-05-16 22:22:31 +00:00
|
|
|
<input type="hidden" name="action" value="excepts" />
|
|
|
|
<input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>"/>
|
2005-03-17 16:23:28 +00:00
|
|
|
<select name="grade_items" size="15" onchange="updateMembers(this)">
|
|
|
|
<?php
|
|
|
|
if (!empty($listgrade_items)) {
|
|
|
|
foreach ($listgrade_items as $id => $listgrade_item) {
|
|
|
|
$selected = '';
|
|
|
|
if ($id == $selectedgrade_item) {
|
|
|
|
$selected = 'selected="selected"';
|
|
|
|
}
|
|
|
|
echo "<option $selected value=\"$id\">$listgrade_item</option>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</form>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="generalboxcontent">
|
2007-01-04 21:32:36 +00:00
|
|
|
<form id="form3" method="post" action="exceptions.php">
|
2005-03-17 16:23:28 +00:00
|
|
|
<input type="hidden" name="id" value="<?php p($course->id) ?>" />
|
|
|
|
<input type="hidden" name="grade_itemid" value="<?php p($selectedgrade_item) ?>" />
|
2005-05-16 22:22:31 +00:00
|
|
|
<input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>"/>
|
|
|
|
<input type="hidden" name="action" value="excepts" />
|
2005-03-17 16:23:28 +00:00
|
|
|
<select name="members[]" size="15" multiple="multiple">
|
|
|
|
<?php
|
|
|
|
if (!empty($listmembers[$selectedgrade_item])) {
|
|
|
|
foreach ($listmembers[$selectedgrade_item] as $id => $membername) {
|
|
|
|
echo "<option value=\"$id\">$membername</option>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
<p>
|
2005-03-28 18:05:45 +00:00
|
|
|
<input type="submit" name="membersremove" value="<?php p($strgradeitemremovemembers) ?>"
|
2005-03-17 16:23:28 +00:00
|
|
|
onclick="updategrade_item()" />
|
|
|
|
</p>
|
|
|
|
</form>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2007-01-03 14:44:17 +00:00
|
|
|
<script type="text/javascript">
|
2005-03-17 16:23:28 +00:00
|
|
|
<!-- Begin
|
|
|
|
<?php
|
|
|
|
echo 'updateMembers('.$selectedgrade_item.');';
|
|
|
|
?>
|
2007-01-03 14:44:17 +00:00
|
|
|
//]]>
|
2005-03-17 16:23:28 +00:00
|
|
|
</script>
|