version 1.225, 2004/11/13 09:32:49
|
version 1.241, 2005/02/01 21:06:48
|
Line 973 sub sub_page_kw_js {
|
Line 973 sub sub_page_kw_js {
|
my $iconpath = $request->dir_config('lonIconsURL'); |
my $iconpath = $request->dir_config('lonIconsURL'); |
&commonJSfunctions($request); |
&commonJSfunctions($request); |
my $docopen=&Apache::lonhtmlcommon::javascript_docopen(); |
my $docopen=&Apache::lonhtmlcommon::javascript_docopen(); |
|
$docopen=~s/^document\.//; |
$request->print(<<SUBJAVASCRIPT); |
$request->print(<<SUBJAVASCRIPT); |
<script type="text/javascript" language="javascript"> |
<script type="text/javascript" language="javascript"> |
|
|
Line 1670 KEYWORDS
|
Line 1671 KEYWORDS
|
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part:</b> '. |
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part:</b> '. |
$display_part.' <font color="#999999">( ID '.$respid. |
$display_part.' <font color="#999999">( ID '.$respid. |
' )</font> '; |
' )</font> '; |
|
my @files; |
|
if ($record{"resource.$partid.$respid.portfiles"}) { |
|
my $file_url = '/uploaded/'.$udom.'/'.$uname.'/portfolio'; |
|
foreach my $file (split(',',$record{"resource.$partid.$respid.portfiles"})) { |
|
push(@files,$file_url.$file); |
|
|
|
&Apache::lonnet::logthis("found a portfolio file".$record{"resource.$partid.$respid.portfiles"}); |
|
&Apache::lonnet::logthis("uploaded URL file".$record{"resource.$partid.$respid.uploadedurl"}); |
|
} |
|
} |
if ($record{"resource.$partid.$respid.uploadedurl"}) { |
if ($record{"resource.$partid.$respid.uploadedurl"}) { |
&Apache::lonnet::allowuploaded('/adm/grades', |
push(@files,$record{"resource.$partid.$respid.uploadedurl"}); |
$record{"resource.$partid.$respid.uploadedurl"}); |
} |
$lastsubonly.='<a href="'.$record{"resource.$partid.$respid.uploadedurl"}.'" target="lonGRDs"><img src="/adm/lonIcons/unknown.gif" border=0"> File uploaded by student</a> <font color="red" size="1">Like all files provided by users, this file may contain virusses</font><br />'; |
if (@files) { |
|
$lastsubonly.='<br /><font color="red" size="1">Like all files provided by users, this file may contain virusses</font><br />'; |
|
foreach my $file (@files) { |
|
&Apache::lonnet::allowuploaded('/adm/grades',$file); |
|
$lastsubonly.='<br /><a href="'.$file.'" target="lonGRDs"><img src="'.&Apache::loncommon::icon($file).'" border=0"> '.$file.'</a>'; |
|
} |
|
$lastsubonly.='<br />'; |
} |
} |
$lastsubonly.='<b>Submitted Answer: </b>'. |
$lastsubonly.='<b>Submitted Answer: </b>'. |
&cleanRecord($subval,$responsetype,$symb,$partid, |
&cleanRecord($subval,$responsetype,$symb,$partid, |
Line 2387 sub viewgrades {
|
Line 2404 sub viewgrades {
|
my (undef,undef,$fullname) = &getclasslist($ENV{'form.section'},'1'); |
my (undef,undef,$fullname) = &getclasslist($ENV{'form.section'},'1'); |
my $ctr = 0; |
my $ctr = 0; |
foreach (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) { |
foreach (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) { |
my $uname = $_; |
|
$uname=~s/:/_/; |
|
$result.='<input type="hidden" name="ctr'.$ctr.'" value="'.$uname.'" />'."\n"; |
|
$ctr++; |
$ctr++; |
$result.=&viewstudentgrade($url,$symb,$ENV{'request.course.id'}, |
$result.=&viewstudentgrade($url,$symb,$ENV{'request.course.id'}, |
$_,$$fullname{$_},\@parts,\%weight,$ctr); |
$_,$$fullname{$_},\@parts,\%weight,$ctr); |
Line 2413 sub viewstudentgrade {
|
Line 2427 sub viewstudentgrade {
|
my ($uname,$udom) = split(/:/,$student); |
my ($uname,$udom) = split(/:/,$student); |
$student=~s/:/_/; |
$student=~s/:/_/; |
my %record=&Apache::lonnet::restore($symb,$courseid,$udom,$uname); |
my %record=&Apache::lonnet::restore($symb,$courseid,$udom,$uname); |
my $result='<tr bgcolor="#ffffdd"><td align="right">'.$ctr.' </td><td> '. |
my $result='<tr bgcolor="#ffffdd"><td align="right">'. |
|
'<input type="hidden" name="ctr'.($ctr-1).'" value="'.$student.'" />'. |
|
"\n".$ctr.' </td><td> '. |
'<a href="javascript:viewOneStudent(\''.$uname.'\',\''.$udom. |
'<a href="javascript:viewOneStudent(\''.$uname.'\',\''.$udom. |
'\')"; TARGET=_self>'.$fullname.'</a> '. |
'\')"; TARGET=_self>'.$fullname.'</a> '. |
'<font color="#999999">('.$uname.($ENV{'user.domain'} eq $udom ? '' : ':'.$udom).')</font></td>'."\n"; |
'<font color="#999999">('.$uname.($ENV{'user.domain'} eq $udom ? '' : ':'.$udom).')</font></td>'."\n"; |
foreach my $apart (@$parts) { |
foreach my $apart (@$parts) { |
my ($part,$type) = &split_part_type($apart); |
my ($part,$type) = &split_part_type($apart); |
my $score=$record{"resource.$part.$type"}; |
my $score=$record{"resource.$part.$type"}; |
|
$result.='<td align="middle">'; |
if ($type eq 'awarded') { |
if ($type eq 'awarded') { |
my $pts = $score eq '' ? '' : $score*$$weight{$part}; |
my $pts = $score eq '' ? '' : $score*$$weight{$part}; |
$result.='<input type="hidden" name="'. |
$result.='<input type="hidden" name="'. |
'GD_'.$student.'_'.$part.'_awarded_s" value="'.$pts.'" />'."\n"; |
'GD_'.$student.'_'.$part.'_awarded_s" value="'.$pts.'" />'."\n"; |
$result.='<td align="middle"><input type="text" name="'. |
$result.='<input type="text" name="'. |
'GD_'.$student.'_'.$part.'_awarded" '. |
'GD_'.$student.'_'.$part.'_awarded" '. |
'onChange="javascript:changeSelect(\''.$part.'\',\''.$student. |
'onChange="javascript:changeSelect(\''.$part.'\',\''.$student. |
'\')" value="'.$pts.'" size="4" /></td>'."\n"; |
'\')" value="'.$pts.'" size="4" /></td>'."\n"; |
Line 2433 sub viewstudentgrade {
|
Line 2450 sub viewstudentgrade {
|
$status = 'nothing' if ($status eq ''); |
$status = 'nothing' if ($status eq ''); |
$result.='<input type="hidden" name="'.'GD_'.$student.'_'. |
$result.='<input type="hidden" name="'.'GD_'.$student.'_'. |
$part.'_solved_s" value="'.$status.'" />'."\n"; |
$part.'_solved_s" value="'.$status.'" />'."\n"; |
$result.='<td align="middle"> <select name="'. |
$result.=' <select name="'. |
'GD_'.$student.'_'.$part.'_solved" '. |
'GD_'.$student.'_'.$part.'_solved" '. |
'onChange="javascript:changeOneScore(\''.$part.'\',\''.$student.'\')" >'."\n"; |
'onChange="javascript:changeOneScore(\''.$part.'\',\''.$student.'\')" >'."\n"; |
$result.= (($status eq 'excused') ? '<option> </option><option selected="on">excused</option>' |
$result.= (($status eq 'excused') ? '<option> </option><option selected="on">excused</option>' |
Line 2444 sub viewstudentgrade {
|
Line 2461 sub viewstudentgrade {
|
$result.='<input type="hidden" name="'. |
$result.='<input type="hidden" name="'. |
'GD_'.$student.'_'.$part.'_'.$type.'_s" value="'.$score.'" />'. |
'GD_'.$student.'_'.$part.'_'.$type.'_s" value="'.$score.'" />'. |
"\n"; |
"\n"; |
$result.='<td align="middle"><input type="text" name="'. |
$result.='<input type="text" name="'. |
'GD_'.$student.'_'.$part.'_'.$type.'" '. |
'GD_'.$student.'_'.$part.'_'.$type.'" '. |
'value="'.$score.'" size="4" /></td>'."\n"; |
'value="'.$score.'" size="4" /></td>'."\n"; |
} |
} |
Line 3043 sub getSymbMap {
|
Line 3060 sub getSymbMap {
|
my $minder = 0; |
my $minder = 0; |
|
|
# Gather every sequence that has problems. |
# Gather every sequence that has problems. |
my @sequences = $navmap->retrieveResources(undef, sub { shift->is_map(); }, 1); |
my @sequences = $navmap->retrieveResources(undef, sub { shift->is_map(); }, |
|
1,0,1); |
for my $sequence ($navmap->getById('0.0'), @sequences) { |
for my $sequence ($navmap->getById('0.0'), @sequences) { |
if ($navmap->hasResource($sequence, sub { shift->is_problem(); }, 0) ) { |
if ($navmap->hasResource($sequence, sub { shift->is_problem(); }, 0) ) { |
my $title = $minder.'.'.$sequence->compTitle(); |
my $title = $minder.'.'.$sequence->compTitle(); |
Line 3122 sub displayPage {
|
Line 3140 sub displayPage {
|
if($curRes == $iterator->BEGIN_MAP) { $depth++; } |
if($curRes == $iterator->BEGIN_MAP) { $depth++; } |
if($curRes == $iterator->END_MAP) { $depth--; } |
if($curRes == $iterator->END_MAP) { $depth--; } |
|
|
if (ref($curRes) && $curRes->is_problem()) { |
if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) { |
my $parts = $curRes->parts(); |
my $parts = $curRes->parts(); |
my $title = $curRes->compTitle(); |
my $title = $curRes->compTitle(); |
my $symbx = $curRes->symb(); |
my $symbx = $curRes->symb(); |
Line 3511 sub scantron_selectphase {
|
Line 3529 sub scantron_selectphase {
|
$result.= <<SCANTRONFORM; |
$result.= <<SCANTRONFORM; |
<table width="100%" border="0"> |
<table width="100%" border="0"> |
<tr> |
<tr> |
|
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="scantron_process"> |
<td bgcolor="#777777"> |
<td bgcolor="#777777"> |
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="scantron_process"> |
|
<input type="hidden" name="command" value="scantron_warning" /> |
<input type="hidden" name="command" value="scantron_warning" /> |
$default_form_data |
$default_form_data |
<table width="100%" border="0"> |
<table width="100%" border="0"> |
Line 3549 sub scantron_selectphase {
|
Line 3567 sub scantron_selectphase {
|
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
</form> |
</td> |
</td> |
</form> |
</tr> |
</tr> |
SCANTRONFORM |
SCANTRONFORM |
|
|
Line 3606 SCANTRONFORM
|
Line 3624 SCANTRONFORM
|
} |
} |
$r->print(<<SCANTRONFORM); |
$r->print(<<SCANTRONFORM); |
<tr> |
<tr> |
<td bgcolor="#777777"> |
<form action='/adm/grades' name='scantron_download'> |
<form action='/adm/grades' name='scantron_download'> |
<td bgcolor="#777777"> |
<input type="hidden" name="command" value="scantron_download" /> |
<input type="hidden" name="command" value="scantron_download" /> |
<table width="100%" border="0"> |
<table width="100%" border="0"> |
<tr bgcolor="#e6ffff"> |
<tr bgcolor="#e6ffff"> |
Line 3624 SCANTRONFORM
|
Line 3642 SCANTRONFORM
|
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
</form> |
</td> |
</td> |
</form> |
</tr> |
</tr> |
SCANTRONFORM |
SCANTRONFORM |
|
|
$r->print(<<SCANTRONFORM); |
$r->print(<<SCANTRONFORM); |
</table> |
</table> |
</form> |
|
$grading_menu_button |
$grading_menu_button |
SCANTRONFORM |
SCANTRONFORM |
|
|
Line 3780 sub scantron_parse_scanline {
|
Line 3797 sub scantron_parse_scanline {
|
my $currentquest=substr($questions,0,$$scantron_config{'Qlength'}); |
my $currentquest=substr($questions,0,$$scantron_config{'Qlength'}); |
substr($questions,0,$$scantron_config{'Qlength'})=''; |
substr($questions,0,$$scantron_config{'Qlength'})=''; |
if (length($currentquest) < $$scantron_config{'Qlength'}) { next; } |
if (length($currentquest) < $$scantron_config{'Qlength'}) { next; } |
my @array=split($$scantron_config{'Qon'},$currentquest,-1); |
if ($$scantron_config{'Qon'} eq 'letter') { |
if (length($array[0]) eq $$scantron_config{'Qlength'}) { |
if (!$currentquest || $currentquest eq $$scantron_config{'Qoff'} || |
$record{"scantron.$questnum.answer"}=''; |
$currentquest !~ /^[A-Z]$/) { |
if (!&scan_data($scan_data,"$whichline.no_bubble.$questnum")) { |
$record{"scantron.$questnum.answer"}=''; |
push(@{$record{"scantron.missingerror"}},$questnum); |
if (!&scan_data($scan_data,"$whichline.no_bubble.$questnum")) { |
} |
push(@{$record{"scantron.missingerror"}},$questnum); |
|
} |
|
} else { |
|
$record{"scantron.$questnum.answer"}=$currentquest; |
|
} |
|
} elsif ($$scantron_config{'Qon'} eq 'number') { |
|
if (!$currentquest || $currentquest eq $$scantron_config{'Qoff'} || |
|
$currentquest !~ /^\d$/) { |
|
$record{"scantron.$questnum.answer"}=''; |
|
if (!&scan_data($scan_data,"$whichline.no_bubble.$questnum")) { |
|
push(@{$record{"scantron.missingerror"}},$questnum); |
|
} |
|
} else { |
|
$record{"scantron.$questnum.answer"}= |
|
$alphabet[$currentquest-1]; |
|
} |
} else { |
} else { |
$record{"scantron.$questnum.answer"}=$alphabet[length($array[0])]; |
my @array=split($$scantron_config{'Qon'},$currentquest,-1); |
|
if (length($array[0]) eq $$scantron_config{'Qlength'}) { |
|
$record{"scantron.$questnum.answer"}=''; |
|
if (!&scan_data($scan_data,"$whichline.no_bubble.$questnum")) { |
|
push(@{$record{"scantron.missingerror"}},$questnum); |
|
} |
|
} else { |
|
$record{"scantron.$questnum.answer"}= |
|
$alphabet[length($array[0])]; |
|
} |
|
if (scalar(@array) gt 2) { |
|
push(@{$record{'scantron.doubleerror'}},$questnum); |
|
my @ans=@array; |
|
my $i=length($ans[0]);shift(@ans); |
|
while ($#ans) { |
|
$i+=length($ans[0])+1; |
|
$record{"scantron.$questnum.answer"}.=$alphabet[$i]; |
|
shift(@ans); |
|
} |
|
} |
} |
} |
if (scalar(@array) gt 2) { |
|
push(@{$record{'scantron.doubleerror'}},$questnum); |
|
my @ans=@array; |
|
my $i=length($ans[0]);shift(@ans); |
|
while ($#ans) { |
|
$i+=length($ans[0])+1; |
|
$record{"scantron.$questnum.answer"}.=$alphabet[$i]; |
|
shift(@ans); |
|
} |
|
} |
|
} |
} |
$record{'scantron.maxquest'}=$questnum; |
$record{'scantron.maxquest'}=$questnum; |
return \%record; |
return \%record; |
Line 3963 sub scantron_do_warning {
|
Line 4004 sub scantron_do_warning {
|
if (!$symb) {return '';} |
if (!$symb) {return '';} |
my $default_form_data=&defaultFormData($symb,$url); |
my $default_form_data=&defaultFormData($symb,$url); |
$r->print(&scantron_form_start().$default_form_data); |
$r->print(&scantron_form_start().$default_form_data); |
my $warning=&scantron_warning_screen('Validate Records'); |
if ( $ENV{'form.selectpage'} eq '' || |
$r->print(<<STUFF); |
$ENV{'form.scantron_selectfile'} eq '' || |
|
$ENV{'form.scantron_format'} eq '' ) { |
|
$r->print("<p>You have forgetten to specify some information. Please go Back and try again.</p>"); |
|
if ( $ENV{'form.selectpage'} eq '') { |
|
$r->print('<p><font color="red">You have not selected a Sequence to grade</font></p>'); |
|
} |
|
if ( $ENV{'form.scantron_selectfile'} eq '') { |
|
$r->print('<p><font color="red">You have not selected a file that contains the student\'s response data.</font></p>'); |
|
} |
|
if ( $ENV{'form.scantron_format'} eq '') { |
|
$r->print('<p><font color="red">You have not selected a the format of the student\'s response data.</font></p>'); |
|
} |
|
} else { |
|
my $warning=&scantron_warning_screen('Validate Records'); |
|
$r->print(<<STUFF); |
$warning |
$warning |
<input type="submit" name="submit" value="Validate Records" /> |
<input type="submit" name="submit" value="Validate Records" /> |
<input type="hidden" name="command" value="scantron_validate" /> |
<input type="hidden" name="command" value="scantron_validate" /> |
</form> |
|
STUFF |
STUFF |
$r->print("<br />".&show_grading_menu_form($symb,$url)."</body></html>"); |
} |
|
$r->print("</form><br />".&show_grading_menu_form($symb,$url)."</body></html>"); |
return ''; |
return ''; |
} |
} |
|
|
Line 4510 sub scantron_get_maxbubble {
|
Line 4565 sub scantron_get_maxbubble {
|
my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0); |
my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0); |
&Apache::lonnet::delenv('form.counter'); |
&Apache::lonnet::delenv('form.counter'); |
foreach my $resource (@resources) { |
foreach my $resource (@resources) { |
my $result=&Apache::lonnet::ssi($resource->src()); |
my $result=&Apache::lonnet::ssi($resource->src().'?symb='.&Apache::lonnet::escape($resource->symb())); |
} |
} |
&Apache::lonnet::delenv('scantron\.'); |
&Apache::lonnet::delenv('scantron\.'); |
my $envfile=$ENV{'user.environment'}; |
my $envfile=$ENV{'user.environment'}; |
Line 4631 SCANTRONFORM
|
Line 4686 SCANTRONFORM
|
$form{'CODE'}=''; |
$form{'CODE'}=''; |
} |
} |
my $result=&Apache::lonnet::ssi($resource->src(),%form); |
my $result=&Apache::lonnet::ssi($resource->src(),%form); |
|
if ($result ne '') { |
|
&Apache::lonnet::logthis("scantron grading error -> $result"); |
|
&Apache::lonnet::logthis("scantron grading error info name $uname domain $udom course $ENV{'request.course.id'} url ".$resource->src()); |
|
} |
if (&Apache::loncommon::connection_aborted($r)) { last; } |
if (&Apache::loncommon::connection_aborted($r)) { last; } |
} |
} |
$completedstudents{$uname}={'line'=>$line}; |
$completedstudents{$uname}={'line'=>$line}; |
Line 4790 DOWNLOAD
|
Line 4849 DOWNLOAD
|
# |
# |
#------------------------------------------------------------------- |
#------------------------------------------------------------------- |
|
|
|
|
#-------------------------- Menu interface ------------------------- |
#-------------------------- Menu interface ------------------------- |
# |
# |
#--- Show a Grading Menu button - Calls the next routine --- |
#--- Show a Grading Menu button - Calls the next routine --- |
Line 4843 sub gradingmenu {
|
Line 4901 sub gradingmenu {
|
if (!checkReceiptNo(formname,'notOK')) { return false;} |
if (!checkReceiptNo(formname,'notOK')) { return false;} |
formname.submit(); |
formname.submit(); |
} |
} |
|
if (val < 7) formname.submit(); |
} |
} |
|
|
function checkReceiptNo(formname,nospace) { |
function checkReceiptNo(formname,nospace) { |
Line 4895 GRADINGMENUJS
|
Line 4954 GRADINGMENUJS
|
($saveSec eq $_ ? 'selected="on"':'').'>'.$_.'</option>'."\n"; |
($saveSec eq $_ ? 'selected="on"':'').'>'.$_.'</option>'."\n"; |
} |
} |
} |
} |
$result.= '<option value="all" '.($saveSec eq 'all' ? 'selected="on"' : ''). '>all</select> '; |
$result.= '<option value="all" '.($saveSec eq 'all' ? 'selected="on"' : ''). '>all</option></select> '; |
|
|
$result.=&mt('Student Status').':</b>'.&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,1,undef); |
$result.=&mt('Student Status').':</b>'.&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,1,undef); |
|
|
Line 4947 GRADINGMENUJS
|
Line 5006 GRADINGMENUJS
|
'-<input type="text" name="receipt" size="4" onChange="javascript:checkReceiptNo(this.form,\'OK\')">'. |
'-<input type="text" name="receipt" size="4" onChange="javascript:checkReceiptNo(this.form,\'OK\')">'. |
'</td></tr>'."\n"; |
'</td></tr>'."\n"; |
} |
} |
|
$result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="2">'. |
|
'<input type="button" onClick="javascript:this.form.action=\'/adm/helper/resettimes.helper\';this.form.submit();'. |
|
'" value="'.&mt('Manage').'" /> access times.</td></tr>'."\n"; |
|
|
$result.='</form></td></tr></table>'."\n". |
$result.='</form></td></tr></table>'."\n". |
'</td></tr></table>'."\n". |
'</td></tr></table>'."\n". |