version 1.204, 2004/07/02 08:19:48
|
version 1.204.2.5, 2004/09/24 21:09:52
|
Line 167 sub response_type {
|
Line 167 sub response_type {
|
return \@partlist,\%handgrade,\%responseType; |
return \@partlist,\%handgrade,\%responseType; |
} |
} |
|
|
|
sub get_display_part { |
|
my ($partID,$url,$symb)=@_; |
|
if (!defined($symb) || $symb eq '') { |
|
$symb=$ENV{'form.symb'}; |
|
if ($symb eq '') { $symb=&Apache::lonnet::symbread($url) } |
|
} |
|
my $display=&Apache::lonnet::EXT('resource.'.$partID.'.display',$symb); |
|
&Apache::lonnet::logthis("\nsymb $symb\n url $url\npartID $partID\ndisplay $display \n"); |
|
if (defined($display) and $display ne '') { |
|
$display.= " (<font color=\"#999900\">id $partID</font>)"; |
|
} else { |
|
$display=$partID; |
|
} |
|
return $display; |
|
} |
#--- Show resource title |
#--- Show resource title |
#--- and parts and response type |
#--- and parts and response type |
sub showResourceInfo { |
sub showResourceInfo { |
Line 194 sub showResourceInfo {
|
Line 209 sub showResourceInfo {
|
} |
} |
$partsseen{$partID}=1; |
$partsseen{$partID}=1; |
} |
} |
$result.='<td><b>Part </b>'.$partID.' <font color="#999999">'. |
my $display_part=&get_display_part($partID,$url); |
|
$result.='<td><b>Part: </b>'.$display_part.' <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 682 LISTJAVASCRIPT
|
Line 698 LISTJAVASCRIPT
|
'<td>'.&nameUserString('header').'</td>'; |
'<td>'.&nameUserString('header').'</td>'; |
if ($ENV{'form.showgrading'} eq 'yes' && $submitonly ne 'all') { |
if ($ENV{'form.showgrading'} eq 'yes' && $submitonly ne 'all') { |
foreach (sort(@$partlist)) { |
foreach (sort(@$partlist)) { |
$gradeTable.='<td><b> Part '.(split(/_/))[0].' Status </b></td>'; |
my $display_part=&get_display_part((split(/_/))[0],$url,$symb); |
|
$gradeTable.='<td><b> Part: '.$display_part. |
|
' Status </b></td>'; |
} |
} |
} |
} |
$loop++; |
$loop++; |
Line 1084 sub sub_page_kw_js {
|
Line 1102 sub sub_page_kw_js {
|
var ypos = (screen.height-height)/2-30; |
var ypos = (screen.height-height)/2-30; |
ypos = (ypos < 0) ? '0' : ypos; |
ypos = (ypos < 0) ? '0' : ypos; |
|
|
pWin = window.open('', 'MessageCenter', 'toolbar=no,location=no,scrollbars='+scrollbar+',screenx='+xpos+',screeny='+ypos+',width=600,height='+height); |
pWin = window.open('', 'MessageCenter', 'resizable=yes,toolbar=no,location=no,scrollbars='+scrollbar+',screenx='+xpos+',screeny='+ypos+',width=600,height='+height); |
pWin.focus(); |
pWin.focus(); |
pDoc = pWin.document; |
pDoc = pWin.document; |
pDoc.open('text/html','replace'); |
pDoc.open('text/html','replace'); |
Line 1215 sub sub_page_kw_js {
|
Line 1233 sub sub_page_kw_js {
|
var ypos = (screen.height-330)/2-30; |
var ypos = (screen.height-330)/2-30; |
ypos = (ypos < 0) ? '0' : ypos; |
ypos = (ypos < 0) ? '0' : ypos; |
|
|
hwdWin = window.open('', 'KeywordHighlightCentral', 'toolbar=no,location=no,scrollbars=no,width=400,height=300,screenx='+xpos+',screeny='+ypos); |
hwdWin = window.open('', 'KeywordHighlightCentral', 'resizeable=yes,toolbar=no,location=no,scrollbars=no,width=400,height=300,screenx='+xpos+',screeny='+ypos); |
hwdWin.focus(); |
hwdWin.focus(); |
var hDoc = hwdWin.document; |
var hDoc = hwdWin.document; |
hDoc.open('text/html','replace'); |
hDoc.open('text/html','replace'); |
Line 1289 sub gradeBox {
|
Line 1307 sub gradeBox {
|
'' : $$record{'resource.'.$partid.'.awarded'}*$wgt); |
'' : $$record{'resource.'.$partid.'.awarded'}*$wgt); |
my $result='<input type="hidden" name="WGT'.$counter.'_'.$partid.'" value="'.$wgt.'" />'."\n"; |
my $result='<input type="hidden" name="WGT'.$counter.'_'.$partid.'" value="'.$wgt.'" />'."\n"; |
|
|
|
my $display_part=&get_display_part($partid,undef,$symb); |
$result.='<table border="0"><tr><td>'. |
$result.='<table border="0"><tr><td>'. |
'<b>Part </b>'.$partid.' <b>Points: </b></td><td>'."\n"; |
'<b>Part: </b>'.$display_part.' <b>Points: </b></td><td>'."\n"; |
|
|
my $ctr = 0; |
my $ctr = 0; |
$result.='<table border="0"><tr>'."\n"; # display radio buttons in a nice table 10 across |
$result.='<table border="0"><tr>'."\n"; # display radio buttons in a nice table 10 across |
Line 1622 KEYWORDS
|
Line 1641 KEYWORDS
|
my %seenparts; |
my %seenparts; |
for my $part (sort keys(%$handgrade)) { |
for my $part (sort keys(%$handgrade)) { |
my ($partid,$respid) = split(/_/,$part); |
my ($partid,$respid) = split(/_/,$part); |
|
my $display_part=&get_display_part($partid,$url,$symb); |
if ($ENV{"form.$uname:$udom:$partid:submitted_by"}) { |
if ($ENV{"form.$uname:$udom:$partid:submitted_by"}) { |
if (exists($seenparts{$partid})) { next; } |
if (exists($seenparts{$partid})) { next; } |
$seenparts{$partid}=1; |
$seenparts{$partid}=1; |
my $submitby='<b>Part '.$partid. |
my $submitby='<b>Part:</b> '.$display_part. |
' Collaborative submission by: </b>'. |
' <b>Collaborative submission by:</b> '. |
'<a href="javascript:viewSubmitter(\''. |
'<a href="javascript:viewSubmitter(\''. |
$ENV{"form.$uname:$udom:$partid:submitted_by"}. |
$ENV{"form.$uname:$udom:$partid:submitted_by"}. |
'\')"; TARGET=_self>'. |
'\')"; TARGET=_self>'. |
Line 1636 KEYWORDS
|
Line 1656 KEYWORDS
|
} |
} |
my $responsetype = $responseType->{$partid}->{$respid}; |
my $responsetype = $responseType->{$partid}->{$respid}; |
if (!exists($record{"resource.$partid.$respid.submission"})) { |
if (!exists($record{"resource.$partid.$respid.submission"})) { |
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part '. |
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part:</b> '. |
$partid.'</b> <font color="#999999">( ID '.$respid. |
$display_part.' <font color="#999999">( ID '.$respid. |
' )</font> '. |
' )</font> '. |
'<font color="red">Nothing submitted - no attempts</font><br /><br />'; |
'<font color="red">Nothing submitted - no attempts</font><br /><br />'; |
next; |
next; |
Line 1665 KEYWORDS
|
Line 1685 KEYWORDS
|
if ($ENV{'form.lastSub'} eq 'lastonly' || |
if ($ENV{'form.lastSub'} eq 'lastonly' || |
($ENV{'form.lastSub'} eq 'hdgrade' && |
($ENV{'form.lastSub'} eq 'hdgrade' && |
$$handgrade{$part} eq 'yes')) { |
$$handgrade{$part} eq 'yes')) { |
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part '. |
my $display_part=&get_display_part($partid,$url,$symb); |
$partid.'</b> <font color="#999999">( ID '.$respid. |
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part:</b> '. |
|
$display_part.' <font color="#999999">( ID '.$respid. |
' )</font> '; |
' )</font> '; |
if ($record{"resource.$partid.$respid.uploadedurl"}) { |
if ($record{"resource.$partid.$respid.uploadedurl"}) { |
&Apache::lonnet::allowuploaded('/adm/grades', |
&Apache::lonnet::allowuploaded('/adm/grades', |
Line 2326 sub viewgrades {
|
Line 2347 sub viewgrades {
|
$ctsparts.'" value="'.$partid.'" />'."\n"; |
$ctsparts.'" value="'.$partid.'" />'."\n"; |
$result.='<input type="hidden" name="weight_'. |
$result.='<input type="hidden" name="weight_'. |
$partid.'" value="'.$weight{$partid}.'" />'."\n"; |
$partid.'" value="'.$weight{$partid}.'" />'."\n"; |
$result.='<tr><td><b>Part '.$partid.' Point:</b> </td><td>'; |
my $display_part=&get_display_part($partid,$url,$symb); |
|
$result.='<tr><td><b>Part:</b> '.$display_part.' <b>Point:</b> </td><td>'; |
$result.='<table border="0"><tr>'; |
$result.='<table border="0"><tr>'; |
my $ctr = 0; |
my $ctr = 0; |
while ($ctr<=$weight{$partid}) { # display radio buttons in a nice table 10 across |
while ($ctr<=$weight{$partid}) { # display radio buttons in a nice table 10 across |
Line 2365 sub viewgrades {
|
Line 2387 sub viewgrades {
|
my $display=&Apache::lonnet::metadata($url,$part.'.display'); |
my $display=&Apache::lonnet::metadata($url,$part.'.display'); |
$display =~ s|^Number of Attempts|Tries<br />|; # makes the column narrower |
$display =~ s|^Number of Attempts|Tries<br />|; # makes the column narrower |
if (!$display) { $display = &Apache::lonnet::metadata($url,$part.'.name'); } |
if (!$display) { $display = &Apache::lonnet::metadata($url,$part.'.name'); } |
|
my ($partid) = &split_part_type($part); |
|
my $display_part=&get_display_part($partid,$url,$symb); |
if ($display =~ /^Partial Credit Factor/) { |
if ($display =~ /^Partial Credit Factor/) { |
my ($partid) = &split_part_type($part); |
$result.='<td><b>Score Part:</b> '.$display_part. |
$result.='<td><b>Score Part '.$partid.'<br />(weight = '. |
' <br /><b>(weight = '.$weight{$partid}.')</b></td>'."\n"; |
$weight{$partid}.')</b></td>'."\n"; |
|
next; |
next; |
|
} else { |
|
$display =~s/\[Part: \Q$partid\E\]/Part:<\/b> $display_part/; |
} |
} |
$display =~ s|Problem Status|Grade Status<br />|; |
$display =~ s|Problem Status|Grade Status<br />|; |
$result.='<td><b>'.$display.'</b></td>'."\n"; |
$result.='<td><b>'.$display.'</td>'."\n"; |
} |
} |
$result.='</tr>'; |
$result.='</tr>'; |
|
|
Line 2502 sub editgrades {
|
Line 2527 sub editgrades {
|
} |
} |
} |
} |
foreach my $partid (@partid) { |
foreach my $partid (@partid) { |
|
my $display_part=&get_display_part($partid,$url,$symb); |
$result .= '<td colspan="'.$columns{$partid}. |
$result .= '<td colspan="'.$columns{$partid}. |
'" align="center"><b>Part '.$partid. |
'" align="center"><b>Part:</b> '.$display_part. |
'</b> (Weight = '.$weight{$partid}.')</td>'; |
' (Weight = '.$weight{$partid}.')</td>'; |
|
|
} |
} |
$result .= '</tr><tr bgcolor="#deffff">'; |
$result .= '</tr><tr bgcolor="#deffff">'; |
Line 3213 sub displaySubByDates {
|
Line 3239 sub displaySubByDates {
|
foreach my $partid (@{$parts}) { |
foreach my $partid (@{$parts}) { |
my @matchKey = sort(grep /^resource\.\Q$partid\E\..*?\.submission$/,@versionKeys); |
my @matchKey = sort(grep /^resource\.\Q$partid\E\..*?\.submission$/,@versionKeys); |
# next if ($$record{"$version:resource.$partid.solved"} eq ''); |
# next if ($$record{"$version:resource.$partid.solved"} eq ''); |
|
my $display_part=&get_display_part($partid,undef,$symb); |
foreach my $matchKey (@matchKey) { |
foreach my $matchKey (@matchKey) { |
if (exists($$record{$version.':'.$matchKey}) && |
if (exists($$record{$version.':'.$matchKey}) && |
$$record{$version.':'.$matchKey} ne '') { |
$$record{$version.':'.$matchKey} ne '') { |
my ($responseId)=($matchKey=~ /^resource\.\Q$partid\E\.(.*?)\.submission$/); |
my ($responseId)=($matchKey=~ /^resource\.\Q$partid\E\.(.*?)\.submission$/); |
$displaySub[0].='<b>Part '.$partid.' '; |
$displaySub[0].='<b>Part:</b> '.$display_part.' '; |
$displaySub[0].='<font color="#999999">(ID '. |
$displaySub[0].='<font color="#999999">(ID '. |
$responseId.')</font> '; |
$responseId.')</font> <b>'; |
if ($$record{"$version:resource.$partid.tries"} eq '') { |
if ($$record{"$version:resource.$partid.tries"} eq '') { |
$displaySub[0].='Trial not counted'; |
$displaySub[0].='Trial not counted'; |
} else { |
} else { |
Line 3237 sub displaySubByDates {
|
Line 3264 sub displaySubByDates {
|
} |
} |
} |
} |
if (exists $$record{"$version:resource.$partid.award"}) { |
if (exists $$record{"$version:resource.$partid.award"}) { |
$displaySub[1].='<b>Part '.$partid.'</b> '. |
$displaySub[1].='<b>Part:</b> '.$display_part.' '. |
lc($$record{"$version:resource.$partid.award"}).' '. |
lc($$record{"$version:resource.$partid.award"}).' '. |
$mark{$$record{"$version:resource.$partid.solved"}}. |
$mark{$$record{"$version:resource.$partid.solved"}}. |
'<br />'; |
'<br />'; |
} |
} |
if (exists $$record{"$version:resource.$partid.regrader"}) { |
if (exists $$record{"$version:resource.$partid.regrader"}) { |
$displaySub[2].=$$record{"$version:resource.$partid.regrader"}. |
$displaySub[2].=$$record{"$version:resource.$partid.regrader"}. |
' (<b>'.&mt('Part').':</b> '.$partid.')'; |
' (<b>'.&mt('Part').':</b> '.$display_part.')'; |
} |
} |
} |
} |
# needed because old essay regrader has not parts info |
# needed because old essay regrader has not parts info |
Line 3341 sub updateGradeByPage {
|
Line 3368 sub updateGradeByPage {
|
$changeflag++; |
$changeflag++; |
$newpts = ''; |
$newpts = ''; |
} |
} |
|
my $display_part=&get_display_part($partid,undef, |
|
$curRes->symb()); |
my $oldstatus = $ENV{'form.solved'.$question.'_'.$partid}; |
my $oldstatus = $ENV{'form.solved'.$question.'_'.$partid}; |
$displayPts[0].=' <b>Part</b> '.$partid.' = '. |
$displayPts[0].=' <b>Part:</b> '.$display_part.' = '. |
(($oldstatus eq 'excused') ? 'excused' : $oldpts). |
(($oldstatus eq 'excused') ? 'excused' : $oldpts). |
' <br>'; |
' <br>'; |
$displayPts[1].=' <b>Part</b> '.$partid.' = '. |
$displayPts[1].=' <b>Part:</b> '.$display_part.' = '. |
(($score eq 'excused') ? 'excused' : $newpts). |
(($score eq 'excused') ? 'excused' : $newpts). |
' <br>'; |
' <br>'; |
|
|
Line 4443 sub scantron_validate_CODE {
|
Line 4471 sub scantron_validate_CODE {
|
$line,'incorrectCODE',\%allcodes); |
$line,'incorrectCODE',\%allcodes); |
return(1,$currentphase); |
return(1,$currentphase); |
} |
} |
if (exists($usedCODEs{$CODE}) && $ENV{'form.scantron_CODEunique'} |
if (exists($usedCODEs{$CODE}) |
|
&& $ENV{'form.scantron_CODEunique'} eq 'yes' |
&& !$$scan_record{'scantron.CODE_ignore_dup'}) { |
&& !$$scan_record{'scantron.CODE_ignore_dup'}) { |
&scantron_get_correction($r,$i,$scan_record, |
&scantron_get_correction($r,$i,$scan_record, |
\%scantron_config, |
\%scantron_config, |
Line 4610 SCANTRONFORM
|
Line 4639 SCANTRONFORM
|
$form{'CODE'}=$scan_record->{'scantron.CODE'}; |
$form{'CODE'}=$scan_record->{'scantron.CODE'}; |
} |
} |
my $result=&Apache::lonnet::ssi($resource->src(),%form); |
my $result=&Apache::lonnet::ssi($resource->src(),%form); |
|
if (&Apache::loncommon::connection_aborted($r)) { last; } |
} |
} |
$completedstudents{$uname}={'line'=>$line}; |
$completedstudents{$uname}={'line'=>$line}; |
|
if (&Apache::loncommon::connection_aborted($r)) { last; } |
} continue { |
} continue { |
&Apache::lonnet::delenv('form.counter'); |
&Apache::lonnet::delenv('form.counter'); |
&Apache::lonnet::delenv('scantron\.'); |
&Apache::lonnet::delenv('scantron\.'); |
Line 5078 sub send_header {
|
Line 5108 sub send_header {
|
|
|
sub send_footer { |
sub send_footer { |
my ($request)= @_; |
my ($request)= @_; |
$request->print('</body>'); |
$request->print('</body></html>'); |
$request->print(&Apache::lontexconvert::footer()); |
|
} |
} |
|
|
1; |
1; |