version 1.108, 2003/06/24 15:45:17
|
version 1.110, 2003/07/11 12:54:07
|
Line 367 sub listStudents {
|
Line 367 sub listStudents {
|
|
|
$request->print(<<LISTJAVASCRIPT); |
$request->print(<<LISTJAVASCRIPT); |
<script type="text/javascript" language="javascript"> |
<script type="text/javascript" language="javascript"> |
function checkSelect(checkBox) { |
function checkSelect(checkBox) { |
var ctr=0; |
var ctr=0; |
var sense=""; |
var sense=""; |
if (checkBox.length > 1) { |
if (checkBox.length > 1) { |
for (var i=0; i<checkBox.length; i++) { |
for (var i=0; i<checkBox.length; i++) { |
if (checkBox[i].checked) { |
if (checkBox[i].checked) { |
ctr++; |
ctr++; |
} |
} |
} |
} |
sense = "a student or group of students"; |
sense = "a student or group of students"; |
} else { |
} else { |
if (checkBox.checked) { |
if (checkBox.checked) { |
ctr = 1; |
ctr = 1; |
} |
} |
sense = "the student"; |
sense = "the student"; |
} |
} |
if (ctr == 0) { |
if (ctr == 0) { |
alert("Please select "+sense+" before clicking on the $viewgrade button."); |
alert("Please select "+sense+" before clicking on the $viewgrade button."); |
return false; |
return false; |
|
} |
|
document.gradesub.submit(); |
|
} |
|
|
|
function reLoadList(formname) { |
|
if (formname.saveStatusOld.value == pullDownSelection(formname.status)) {return;} |
|
formname.command.value = 'submission'; |
|
formname.submit(); |
|
} |
|
|
|
function pullDownSelection(selectOne) { |
|
var selection=""; |
|
if (selectOne.length > 1) { |
|
for (var i=0; i<selectOne.length; i++) { |
|
if (selectOne[i].selected) { |
|
return selectOne[i].value; |
|
} |
|
} |
|
} else { |
|
if (selectOne.selected) return selectOne.value; |
|
} |
} |
} |
document.gradesub.submit(); |
|
} |
|
</script> |
</script> |
LISTJAVASCRIPT |
LISTJAVASCRIPT |
|
|
Line 405 LISTJAVASCRIPT
|
Line 424 LISTJAVASCRIPT
|
if ($ENV{'form.handgrade'} eq 'yes') { |
if ($ENV{'form.handgrade'} eq 'yes') { |
$gradeTable.='<input type="radio" name="lastSub" value="hdgrade" '.$checkhdgrade.' /> handgrade only'."\n"; |
$gradeTable.='<input type="radio" name="lastSub" value="hdgrade" '.$checkhdgrade.' /> handgrade only'."\n"; |
} |
} |
|
|
|
my $saveStatus = $ENV{'form.status'} eq '' ? 'Active' : $ENV{'form.status'}; |
|
$ENV{'form.status'} = $saveStatus; |
|
|
$gradeTable.='<input type="radio" name="lastSub" value="lastonly" '.$checklastsub.' /> last sub only'."\n". |
$gradeTable.='<input type="radio" name="lastSub" value="lastonly" '.$checklastsub.' /> last sub only'."\n". |
'<input type="radio" name="lastSub" value="last" /> last sub & parts info'."\n". |
'<input type="radio" name="lastSub" value="last" /> last sub & parts info'."\n". |
'<input type="radio" name="lastSub" value="all" /> all details'."\n". |
'<input type="radio" name="lastSub" value="all" /> all details'."\n". |
Line 417 LISTJAVASCRIPT
|
Line 440 LISTJAVASCRIPT
|
'<input type="hidden" name="probTitle" value="'.$ENV{'form.probTitle'}.'" />'."\n". |
'<input type="hidden" name="probTitle" value="'.$ENV{'form.probTitle'}.'" />'."\n". |
'<input type="hidden" name="url" value="'.$url.'" />'."\n". |
'<input type="hidden" name="url" value="'.$url.'" />'."\n". |
'<input type="hidden" name="symb" value="'.$symb.'" />'."\n". |
'<input type="hidden" name="symb" value="'.$symb.'" />'."\n". |
'To '.lc($viewgrade).' a submission, click on the check box next to the student\'s name. Then '."\n". |
'<input type="hidden" name="saveStatusOld" value="'.$saveStatus.'" />'."\n"; |
|
|
|
$gradeTable.='<b>Student Status:</b> <select onchange="javascript:reLoadList(this.form);" name="status">'. |
|
'<option value="Active" '.($saveStatus eq 'Active' ? 'selected' : '').'>Active</option>'. |
|
'<option value="Expired" '.($saveStatus eq 'Expired' ? 'selected' : '').'>Expired</option>'. |
|
'<option value="Any" '.($saveStatus eq 'Any' ? 'selected' : '').'>Any</option>'. |
|
'</select><br />'."\n"; |
|
|
|
$gradeTable.='To '.lc($viewgrade).' a submission, click on the check box next to the student\'s name. Then '."\n". |
'click on the '.$viewgrade.' button. To view the submissions for a group of students, click'."\n". |
'click on the '.$viewgrade.' button. To view the submissions for a group of students, click'."\n". |
' on the check boxes for the group of students.<br />'."\n". |
' on the check boxes for the group of students.<br />'."\n". |
'<input type="hidden" name="command" value="processGroup" />'."\n". |
'<input type="hidden" name="command" value="processGroup" />'."\n"; |
'<input type="button" '."\n". |
$gradeTable.='<input type="button" '."\n". |
'onClick="javascript:checkSelect(this.form.stuinfo);" '."\n". |
'onClick="javascript:checkSelect(this.form.stuinfo);" '."\n". |
'value="'.$viewgrade.'" />'."\n"; |
'value="'.$viewgrade.'" />'."\n"; |
|
|
my (undef,undef,$fullname) = &getclasslist($getsec,$ENV{'form.showgrading'} eq 'yes' ? '1' : '0'); |
my (undef, undef, $fullname) = &getclasslist($getsec,'1'); |
|
|
$gradeTable.='<table border="0"><tr><td bgcolor="#777777">'. |
$gradeTable.='<table border="0"><tr><td bgcolor="#777777">'. |
'<table border="0"><tr bgcolor="#e6ffff">'. |
'<table border="0"><tr bgcolor="#e6ffff">'; |
'<td><b> Select </b></td><td><b> Fullname </b></td>'. |
my $loop = 0; |
'<td><b> Username </b></td><td><b> Domain </b></td>'; |
while ($loop < 2) { |
foreach (sort(@$partlist)) { |
$gradeTable.='<td><b> Select </b></td><td><b> Fullname </b>'. |
$gradeTable.='<td><b> Part '.(split(/_/))[0].' Status </b></td>'; |
'<font color="#999999">(Username)</font> </td>'; |
|
if ($ENV{'form.showgrading'} eq 'yes' && $submitonly ne 'all') { |
|
foreach (sort(@$partlist)) { |
|
$gradeTable.='<td><b> Part '.(split(/_/))[0].' Status </b></td>'; |
|
} |
|
} |
|
$loop++; |
} |
} |
$gradeTable.='</tr>'."\n"; |
$gradeTable.='</tr>'."\n"; |
|
|
my $ctr = 0; |
my $ctr = 0; |
foreach my $student (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) { |
foreach my $student (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) { |
my ($uname,$udom) = split(/:/,$student); |
my ($uname,$udom) = split(/:/,$student); |
my (%status) =&student_gradeStatus($url,$symb,$udom,$uname,$partlist); |
my %status = (); |
my $statusflg = ''; |
if ($ENV{'form.showgrading'} eq 'yes' && $submitonly ne 'all') { |
foreach (keys(%status)) { |
(%status) =&student_gradeStatus($url,$symb,$udom,$uname,$partlist); |
$statusflg = 1 if ($status{$_} ne 'nothing'); |
my $statusflg = ''; |
my ($foo,$partid,$foo1) = split(/\./,$_); |
foreach (keys(%status)) { |
if ($status{'resource.'.$partid.'.submitted_by'} ne '') { |
$statusflg = 1 if ($status{$_} ne 'nothing'); |
$statusflg = ''; |
my ($foo,$partid,$foo1) = split(/\./,$_); |
$gradeTable.='<input type="hidden" name="'. |
if ($status{'resource.'.$partid.'.submitted_by'} ne '') { |
$student.':submitted_by" value="'. |
$statusflg = ''; |
$status{'resource.'.$partid.'.submitted_by'}.'" />'; |
$gradeTable.='<input type="hidden" name="'. |
|
$student.':submitted_by" value="'. |
|
$status{'resource.'.$partid.'.submitted_by'}.'" />'; |
|
} |
} |
} |
|
next if ($statusflg eq '' && $submitonly eq 'yes'); |
} |
} |
next if ($statusflg eq '' && $submitonly eq 'yes'); |
|
|
|
$ctr++; |
$ctr++; |
if ( $perm{'vgr'} eq 'F' ) { |
if ( $perm{'vgr'} eq 'F' ) { |
$gradeTable.='<tr bgcolor="#ffffe6">'. |
$gradeTable.='<tr bgcolor="#ffffe6">' if ($ctr%2 ==1); |
'<td align="center"><input type=checkbox name="stuinfo" value="'. |
$gradeTable.='<td align="center"><input type=checkbox name="stuinfo" value="'. |
$student.':'.$$fullname{$student}.'"></td>'."\n". |
$student.':'.$$fullname{$student}.' "></td>'."\n". |
'<td> '.$$fullname{$student}.' </td>'."\n". |
'<td> '.$$fullname{$student}.' '."\n". |
'<td> '.$uname.' </td>'."\n". |
'<font color="#999999">('.$uname.')</font></td>'."\n"; |
'<td align="middle"> '.$udom.' </td>'."\n"; |
|
|
if ($ENV{'form.showgrading'} eq 'yes' && $submitonly ne 'all') { |
foreach (sort keys(%status)) { |
foreach (sort keys(%status)) { |
next if (/^resource.*?submitted_by$/); |
next if (/^resource.*?submitted_by$/); |
$gradeTable.='<td align="middle"> '.$status{$_}.' </td>'."\n"; |
$gradeTable.='<td align="middle"> '.$status{$_}.' </td>'."\n"; |
|
} |
} |
} |
$gradeTable.='</tr>'."\n"; |
$gradeTable.='</tr>'."\n" if ($ctr%2 ==0); |
} |
} |
} |
} |
|
if ($ctr%2 ==1) { |
|
$gradeTable.='<td> </td><td> </td>'; |
|
if ($ENV{'form.showgrading'} eq 'yes' && $submitonly ne 'all') { |
|
foreach (@$partlist) { |
|
$gradeTable.='<td> </td>'; |
|
} |
|
} |
|
$gradeTable.='</tr>'; |
|
} |
|
|
$gradeTable.='</table></td></tr></table>'. |
$gradeTable.='</table></td></tr></table>'. |
'<input type="button" '. |
'<input type="button" '. |
'onClick="javascript:checkSelect(this.form.stuinfo);" '. |
'onClick="javascript:checkSelect(this.form.stuinfo);" '. |
Line 479 LISTJAVASCRIPT
|
Line 529 LISTJAVASCRIPT
|
$gradeTable='<br /> <font color="red">There are no students currently enrolled.</font>'; |
$gradeTable='<br /> <font color="red">There are no students currently enrolled.</font>'; |
} else { |
} else { |
$gradeTable='<br /> <font color="red">'. |
$gradeTable='<br /> <font color="red">'. |
'No submissions found for this resource for any students. ('.$num_students.' checked for submissions</font><br />'; |
'No submissions found for this resource for any students. ('.$num_students. |
|
' checked for submissions</font><br />'; |
} |
} |
} elsif ($ctr == 1) { |
} elsif ($ctr == 1) { |
$gradeTable =~ s/type=checkbox/type=checkbox checked/; |
$gradeTable =~ s/type=checkbox/type=checkbox checked/; |
Line 1673 sub viewgrades_js {
|
Line 1724 sub viewgrades_js {
|
var textbox = eval("document.classgrade.TEXTVAL_"+partid); |
var textbox = eval("document.classgrade.TEXTVAL_"+partid); |
if (point == "textval") { |
if (point == "textval") { |
var point = eval("document.classgrade.TEXTVAL_"+partid+".value"); |
var point = eval("document.classgrade.TEXTVAL_"+partid+".value"); |
if (isNaN(point) || point < 0) { |
if (isNaN(point) || parseFloat(point) < 0) { |
alert("A number equal or greater than 0 is expected. Entered value = "+point); |
alert("A number equal or greater than 0 is expected. Entered value = "+parseFloat(point)); |
var resetbox = false; |
var resetbox = false; |
for (var i=0; i<radioButton.length; i++) { |
for (var i=0; i<radioButton.length; i++) { |
if (radioButton[i].checked) { |
if (radioButton[i].checked) { |
Line 1687 sub viewgrades_js {
|
Line 1738 sub viewgrades_js {
|
} |
} |
return; |
return; |
} |
} |
if (point > weight) { |
if (parseFloat(point) > parseFloat(weight)) { |
var resp = confirm("You entered a value ("+point+ |
var resp = confirm("You entered a value ("+parseFloat(point)+ |
") greater than the weight for the part. Accept?"); |
") greater than the weight for the part. Accept?"); |
if (resp == false) { |
if (resp == false) { |
textbox.value = ""; |
textbox.value = ""; |
Line 1697 sub viewgrades_js {
|
Line 1748 sub viewgrades_js {
|
} |
} |
for (var i=0; i<radioButton.length; i++) { |
for (var i=0; i<radioButton.length; i++) { |
radioButton[i].checked=false; |
radioButton[i].checked=false; |
if (point == i) { |
if (parseFloat(point) == i) { |
radioButton[i].checked=true; |
radioButton[i].checked=true; |
} |
} |
} |
} |
Line 1771 sub viewgrades_js {
|
Line 1822 sub viewgrades_js {
|
var point = textbox.value; |
var point = textbox.value; |
var weight = eval("document.classgrade.weight_"+partid+".value"); |
var weight = eval("document.classgrade.weight_"+partid+".value"); |
|
|
if (isNaN(point) || point < 0) { |
if (isNaN(point) || parseFloat(point) < 0) { |
alert("A number equal or greater than 0 is expected. Entered value = "+point); |
alert("A number equal or greater than 0 is expected. Entered value = "+parseFloat(point)); |
textbox.value = ""; |
textbox.value = ""; |
return; |
return; |
} |
} |
if (point > weight) { |
if (parseFloat(point) > parseFloat(weight)) { |
var resp = confirm("You entered a value ("+point+ |
var resp = confirm("You entered a value ("+parseFloat(point)+ |
") greater than the weight of the part. Accept?"); |
") greater than the weight of the part. Accept?"); |
if (resp == false) { |
if (resp == false) { |
textbox.value = ""; |
textbox.value = ""; |