version 1.153, 2003/11/10 16:28:10
|
version 1.154, 2003/11/10 16:35:57
|
Line 132 sub response_type {
|
Line 132 sub response_type {
|
my ($url,$symb) = shift; |
my ($url,$symb) = shift; |
$symb=($ENV{'form.symb'} ne '' ? $ENV{'form.symb'} : (&Apache::lonnet::symbread($url))) if ($symb eq ''); |
$symb=($ENV{'form.symb'} ne '' ? $ENV{'form.symb'} : (&Apache::lonnet::symbread($url))) if ($symb eq ''); |
my $allkeys = &Apache::lonnet::metadata($url,'keys'); |
my $allkeys = &Apache::lonnet::metadata($url,'keys'); |
|
my %vPart; |
|
foreach my $partid (&Apache::loncommon::get_env_multiple('form.vPart')) { |
|
$vPart{$partid}=1; |
|
} |
my %seen = (); |
my %seen = (); |
my (@partlist,%handgrade,%responseType); |
my (@partlist,%handgrade,%responseType); |
foreach (split(/,/,&Apache::lonnet::metadata($url,'packages'))) { |
foreach (split(/,/,&Apache::lonnet::metadata($url,'packages'))) { |
Line 141 sub response_type {
|
Line 145 sub response_type {
|
if (&Apache::loncommon::check_if_partid_hidden($partid,$symb)) { |
if (&Apache::loncommon::check_if_partid_hidden($partid,$symb)) { |
next; |
next; |
} |
} |
|
if (%vPart && !exists($vPart{$partid})) { |
|
next; |
|
} |
$responsetype =~ s/response$//; # make it compatible w/ navmaps - should move to that!! |
$responsetype =~ s/response$//; # make it compatible w/ navmaps - should move to that!! |
my ($value) = &Apache::lonnet::EXT('resource.'.$part.'.handgrade',$symb); |
my ($value) = &Apache::lonnet::EXT('resource.'.$part.'.handgrade',$symb); |
$handgrade{$part} = ($value eq 'yes' ? 'yes' : 'no'); |
$handgrade{$part} = ($value eq 'yes' ? 'yes' : 'no'); |
Line 157 sub response_type {
|
Line 164 sub response_type {
|
#--- Show resource title |
#--- Show resource title |
#--- and parts and response type |
#--- and parts and response type |
sub showResourceInfo { |
sub showResourceInfo { |
my ($url,$probTitle) = @_; |
my ($url,$probTitle,$checkboxes) = @_; |
|
my $col=3; |
|
if ($checkboxes) { $col=4; } |
my $result ='<table border="0">'. |
my $result ='<table border="0">'. |
'<tr><td colspan=3><font size=+1><b>Current Resource: </b>'.$probTitle.'</font></td></tr>'."\n"; |
'<tr><td colspan="'.$col.'"><font size="+1"><b>Current Resource: </b>'. |
|
$probTitle.'</font></td></tr>'."\n"; |
my ($partlist,$handgrade,$responseType) = &response_type($url); |
my ($partlist,$handgrade,$responseType) = &response_type($url); |
my %resptype = (); |
my %resptype = (); |
my $hdgrade='no'; |
my $hdgrade='no'; |
|
my %partsseen; |
for my $part_resID (sort keys(%$handgrade)) { |
for my $part_resID (sort keys(%$handgrade)) { |
my $handgrade=$$handgrade{$part_resID}; |
my $handgrade=$$handgrade{$part_resID}; |
my ($partID,$resID) = split(/_/,$part_resID); |
my ($partID,$resID) = split(/_/,$part_resID); |
my $responsetype = $responseType->{$partID}->{$resID}; |
my $responsetype = $responseType->{$partID}->{$resID}; |
$hdgrade = $handgrade if ($handgrade eq 'yes'); |
$hdgrade = $handgrade if ($handgrade eq 'yes'); |
$result.='<tr><td><b>Part </b>'.$partID.' <font color="#999999">'. |
$result.='<tr>'; |
|
if ($checkboxes) { |
|
if (exists($partsseen{$partID})) { |
|
$result.="<td> </td>"; |
|
} else { |
|
$result.="<td><input type='checkbox' name='vPart' value='$partID' checked='on' /></td>"; |
|
} |
|
$partsseen{$partID}=1; |
|
} |
|
$result.='<td><b>Part </b>'.$partID.' <font color="#999999">'. |
$resID.'</font></td>'. |
$resID.'</font></td>'. |
'<td><b>Type: </b>'.$responsetype.'</td></tr>'; |
'<td><b>Type: </b>'.$responsetype.'</td></tr>'; |
# '<td><b>Handgrade: </b>'.$handgrade.'</td></tr>'; |
# '<td><b>Handgrade: </b>'.$handgrade.'</td></tr>'; |
Line 550 sub listStudents {
|
Line 570 sub listStudents {
|
my $result='<h3><font color="#339933"> '.$viewgrade. |
my $result='<h3><font color="#339933"> '.$viewgrade. |
' Submissions for a Student or a Group of Students</font></h3>'; |
' Submissions for a Student or a Group of Students</font></h3>'; |
|
|
my ($table,undef,$hdgrade,$partlist,$handgrade) = &showResourceInfo($url,$ENV{'form.probTitle'}); |
my ($table,undef,$hdgrade,$partlist,$handgrade) = &showResourceInfo($url,$ENV{'form.probTitle'},($ENV{'form.showgrading'} eq 'yes')); |
$result.=$table; |
|
|
|
$request->print(<<LISTJAVASCRIPT); |
$request->print(<<LISTJAVASCRIPT); |
<script type="text/javascript" language="javascript"> |
<script type="text/javascript" language="javascript"> |
Line 591 LISTJAVASCRIPT
|
Line 610 LISTJAVASCRIPT
|
|
|
my $checkhdgrade = ($ENV{'form.handgrade'} eq 'yes' && scalar(@$partlist) > 1 ) ? 'checked' : ''; |
my $checkhdgrade = ($ENV{'form.handgrade'} eq 'yes' && scalar(@$partlist) > 1 ) ? 'checked' : ''; |
my $checklastsub = $checkhdgrade eq '' ? 'checked' : ''; |
my $checklastsub = $checkhdgrade eq '' ? 'checked' : ''; |
my $gradeTable='<form action="/adm/grades" method="post" name="gradesub">'."\n". |
my $gradeTable='<form action="/adm/grades" method="post" name="gradesub">'. |
|
"\n".$table. |
' <b>View Problem Text: </b><input type="radio" name="vProb" value="no" checked="on" /> no '."\n". |
' <b>View Problem Text: </b><input type="radio" name="vProb" value="no" checked="on" /> no '."\n". |
'<input type="radio" name="vProb" value="yes" /> one student '."\n". |
'<input type="radio" name="vProb" value="yes" /> one student '."\n". |
'<input type="radio" name="vProb" value="all" /> all students <br />'."\n". |
'<input type="radio" name="vProb" value="all" /> all students <br />'."\n". |
Line 1435 sub submission {
|
Line 1455 sub submission {
|
'<input type="hidden" name="msgsub" value="'.$ENV{'form.msgsub'}.'" />'."\n". |
'<input type="hidden" name="msgsub" value="'.$ENV{'form.msgsub'}.'" />'."\n". |
'<input type="hidden" name="shownSub" value="0" />'."\n". |
'<input type="hidden" name="shownSub" value="0" />'."\n". |
'<input type="hidden" name="savemsgN" value="'.$ENV{'form.savemsgN'}.'" />'."\n"); |
'<input type="hidden" name="savemsgN" value="'.$ENV{'form.savemsgN'}.'" />'."\n"); |
|
foreach my $partid (&Apache::loncommon::get_env_multiple('form.vPart')) { |
|
$request->print('<input type="hidden" name="vPart" value="'.$partid.'" />'."\n"); |
|
} |
} |
} |
|
|
my ($cts,$prnmsg) = (1,''); |
my ($cts,$prnmsg) = (1,''); |
Line 3947 sub send_header {
|
Line 3970 sub send_header {
|
#remotewindow.close(); |
#remotewindow.close(); |
#</script>"); |
#</script>"); |
$request->print(&Apache::loncommon::bodytag('Grading')); |
$request->print(&Apache::loncommon::bodytag('Grading')); |
foreach my $key (sort(keys(%ENV))) { |
|
if ($key =~ /^form\./) { |
|
Apache->request->print("$key => $ENV{$key} <br />"); |
|
} |
|
} |
|
} |
} |
|
|
sub send_footer { |
sub send_footer { |