version 1.423, 2007/07/24 21:21:31
|
version 1.445, 2007/10/08 21:05:54
|
Line 45 use LONCAPA;
|
Line 45 use LONCAPA;
|
|
|
use POSIX qw(floor); |
use POSIX qw(floor); |
|
|
my %oldessays=(); |
|
my %perm=(); |
my %perm=(); |
|
my %bubble_lines_per_response; # no. bubble lines for each response. |
|
# index is "symb.part_id" |
|
|
|
|
# ----- These first few routines are general use routines.---- |
# ----- These first few routines are general use routines.---- |
# |
# |
# --- Retrieve the parts from the metadata file.--- |
# --- Retrieve the parts from the metadata file.--- |
sub getpartlist { |
sub getpartlist { |
my ($symb) = @_; |
my ($symb) = @_; |
my (undef,undef,$url) = &Apache::lonnet::decode_symb($symb); |
|
my $partorder = &Apache::lonnet::metadata($url, 'partorder'); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my @parts; |
my $res = $navmap->getBySymb($symb); |
if ($partorder) { |
my $partlist = $res->parts(); |
for my $part (split (/,/,$partorder)) { |
my $url = $res->src(); |
if (!&Apache::loncommon::check_if_partid_hidden($part,$symb)) { |
my @metakeys = split(/,/,&Apache::lonnet::metadata($url,'keys')); |
push(@parts, $part); |
|
} |
|
} |
|
} else { |
|
my $metadata = &Apache::lonnet::metadata($url, 'packages'); |
|
foreach (split(/\,/,$metadata)) { |
|
if ($_ =~ /^part_(.*)$/) { |
|
if (!&Apache::loncommon::check_if_partid_hidden($1,$symb)) { |
|
push(@parts, $1); |
|
} |
|
} |
|
} |
|
} |
|
my @stores; |
my @stores; |
foreach my $part (@parts) { |
foreach my $part (@{ $partlist }) { |
my (@metakeys) = split(/,/,&Apache::lonnet::metadata($url,'keys')); |
|
foreach my $key (@metakeys) { |
foreach my $key (@metakeys) { |
if ($key =~ m/^stores_\Q$part\E_/) { push(@stores,$key); } |
if ($key =~ m/^stores_\Q$part\E_/) { push(@stores,$key); } |
} |
} |
Line 195 sub showResourceInfo {
|
Line 185 sub showResourceInfo {
|
return $result,$responseType,$hdgrade,$partlist,$handgrade; |
return $result,$responseType,$hdgrade,$partlist,$handgrade; |
} |
} |
|
|
|
sub reset_caches { |
|
&reset_analyze_cache(); |
|
&reset_perm(); |
|
} |
|
|
sub get_order { |
{ |
my ($partid,$respid,$symb,$uname,$udom)=@_; |
my %analyze_cache; |
my (undef,undef,$url)=&Apache::lonnet::decode_symb($symb); |
|
$url=&Apache::lonnet::clutter($url); |
sub reset_analyze_cache { |
my $subresult=&Apache::lonnet::ssi($url, |
undef(%analyze_cache); |
('grade_target' => 'analyze'), |
} |
('grade_domain' => $udom), |
|
('grade_symb' => $symb), |
sub get_analyze { |
('grade_courseid' => |
my ($symb,$uname,$udom)=@_; |
$env{'request.course.id'}), |
my $key = "$symb\0$uname\0$udom"; |
('grade_username' => $uname)); |
return $analyze_cache{$key} if (exists($analyze_cache{$key})); |
(undef,$subresult)=split(/_HASH_REF__/,$subresult,2); |
|
my %analyze=&Apache::lonnet::str2hash($subresult); |
my (undef,undef,$url)=&Apache::lonnet::decode_symb($symb); |
return ($analyze{"$partid.$respid.shown"}); |
$url=&Apache::lonnet::clutter($url); |
|
my $subresult=&Apache::lonnet::ssi($url, |
|
('grade_target' => 'analyze'), |
|
('grade_domain' => $udom), |
|
('grade_symb' => $symb), |
|
('grade_courseid' => |
|
$env{'request.course.id'}), |
|
('grade_username' => $uname)); |
|
(undef,$subresult)=split(/_HASH_REF__/,$subresult,2); |
|
my %analyze=&Apache::lonnet::str2hash($subresult); |
|
return $analyze_cache{$key} = \%analyze; |
|
} |
|
|
|
sub get_order { |
|
my ($partid,$respid,$symb,$uname,$udom)=@_; |
|
my $analyze = &get_analyze($symb,$uname,$udom); |
|
return $analyze->{"$partid.$respid.shown"}; |
|
} |
|
|
|
sub get_radiobutton_correct_foil { |
|
my ($partid,$respid,$symb,$uname,$udom)=@_; |
|
my $analyze = &get_analyze($symb,$uname,$udom); |
|
foreach my $foil (@{&get_order($partid,$respid,$symb,$uname,$udom)}) { |
|
if ($analyze->{"$partid.$respid.foil.value.$foil"} eq 'true') { |
|
return $foil; |
|
} |
|
} |
|
} |
} |
} |
|
|
#--- Clean response type for display |
#--- Clean response type for display |
#--- Currently filters option/rank/radiobutton/match/essay/Task |
#--- Currently filters option/rank/radiobutton/match/essay/Task |
# response types only. |
# response types only. |
Line 259 sub cleanRecord {
|
Line 281 sub cleanRecord {
|
} elsif ($response eq 'radiobutton') { |
} elsif ($response eq 'radiobutton') { |
my %answer=&Apache::lonnet::str2hash($answer); |
my %answer=&Apache::lonnet::str2hash($answer); |
my ($toprow,$bottomrow); |
my ($toprow,$bottomrow); |
my $correct=($order->[0])+1; |
my $correct = |
for (my $i=1;$i<=$#$order;$i++) { |
&get_radiobutton_correct_foil($partid,$respid,$symb,$uname,$udom); |
my $foil=$order->[$i]; |
foreach my $foil (@$order) { |
if (exists($answer{$foil})) { |
if (exists($answer{$foil})) { |
if ($i == $correct) { |
if ($foil eq $correct) { |
$toprow.='<td><b>true</b></td>'; |
$toprow.='<td><b>true</b></td>'; |
} else { |
} else { |
$toprow.='<td><i>true</i></td>'; |
$toprow.='<td><i>true</i></td>'; |
Line 327 sub cleanRecord {
|
Line 349 sub cleanRecord {
|
$result.='</ul>'; |
$result.='</ul>'; |
return $result; |
return $result; |
} |
} |
|
} elsif ( $response =~ m/(?:numerical|formula)/) { |
|
$answer = |
|
&Apache::loncommon::format_previous_attempt_value('submission', |
|
$answer); |
} |
} |
return $answer; |
return $answer; |
} |
} |
Line 373 COMMONJSFUNCTIONS
|
Line 398 COMMONJSFUNCTIONS
|
sub getclasslist { |
sub getclasslist { |
my ($getsec,$filterlist) = @_; |
my ($getsec,$filterlist) = @_; |
my @getsec; |
my @getsec; |
|
my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status')); |
if (!ref($getsec)) { |
if (!ref($getsec)) { |
if ($getsec ne '' && $getsec ne 'all') { |
if ($getsec ne '' && $getsec ne 'all') { |
@getsec=($getsec); |
@getsec=($getsec); |
Line 402 sub getclasslist {
|
Line 428 sub getclasslist {
|
my $status = |
my $status = |
$classlist->{$student}->[&Apache::loncoursedata::CL_STATUS()]; |
$classlist->{$student}->[&Apache::loncoursedata::CL_STATUS()]; |
# filter students according to status selected |
# filter students according to status selected |
if ($filterlist && $env{'form.Status'} ne 'Any') { |
if ($filterlist && (!($stu_status =~ /Any/))) { |
if ($env{'form.Status'} ne $status) { |
if (!($stu_status =~ $status)) { |
delete ($classlist->{$student}); |
delete ($classlist->{$student}); |
next; |
next; |
} |
} |
Line 485 sub student_gradeStatus {
|
Line 511 sub student_gradeStatus {
|
# Shows a student's view of problem and submission |
# Shows a student's view of problem and submission |
sub jscriptNform { |
sub jscriptNform { |
my ($symb) = @_; |
my ($symb) = @_; |
|
my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status')); |
my $jscript='<script type="text/javascript" language="javascript">'."\n". |
my $jscript='<script type="text/javascript" language="javascript">'."\n". |
' function viewOneStudent(user,domain) {'."\n". |
' function viewOneStudent(user,domain) {'."\n". |
' document.onestudent.student.value = user;'."\n". |
' document.onestudent.student.value = user;'."\n". |
Line 496 sub jscriptNform {
|
Line 523 sub jscriptNform {
|
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n". |
'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n". |
'<input type="hidden" name="probTitle" value="'.$env{'form.probTitle'}.'" />'."\n". |
'<input type="hidden" name="probTitle" value="'.$env{'form.probTitle'}.'" />'."\n". |
'<input type="hidden" name="Status" value="'.$env{'form.Status'}.'" />'."\n". |
'<input type="hidden" name="Status" value="'.$stu_status.'" />'."\n". |
'<input type="hidden" name="command" value="submission" />'."\n". |
'<input type="hidden" name="command" value="submission" />'."\n". |
'<input type="hidden" name="student" value="" />'."\n". |
'<input type="hidden" name="student" value="" />'."\n". |
'<input type="hidden" name="userdom" value="" />'."\n". |
'<input type="hidden" name="userdom" value="" />'."\n". |
Line 538 sub compute_points {
|
Line 565 sub compute_points {
|
# |
# |
|
|
sub most_similar { |
sub most_similar { |
my ($uname,$udom,$uessay)=@_; |
my ($uname,$udom,$uessay,$old_essays)=@_; |
|
|
# ignore spaces and punctuation |
# ignore spaces and punctuation |
|
|
Line 555 sub most_similar {
|
Line 582 sub most_similar {
|
my $scrsid=''; |
my $scrsid=''; |
my $sessay=''; |
my $sessay=''; |
# go through all essays ... |
# go through all essays ... |
foreach my $tkey (keys %oldessays) { |
foreach my $tkey (keys(%$old_essays)) { |
my ($tname,$tdom,$tcrsid)=split(/\./,$tkey); |
my ($tname,$tdom,$tcrsid)=map {&unescape($_)} (split(/\./,$tkey)); |
# ... except the same student |
# ... except the same student |
if (($tname ne $uname) || ($tdom ne $udom)) { |
next if (($tname eq $uname) && ($tdom eq $udom)); |
my $tessay=$oldessays{$tkey}; |
my $tessay=$old_essays->{$tkey}; |
$tessay=~s/\W+/ /gs; |
$tessay=~s/\W+/ /gs; |
# String similarity gives up if not even limit |
# String similarity gives up if not even limit |
my $tsimilar=&String::Similarity::similarity($uessay,$tessay,$limit); |
my $tsimilar=&String::Similarity::similarity($uessay,$tessay,$limit); |
# Found one |
# Found one |
if ($tsimilar>$limit) { |
if ($tsimilar>$limit) { |
$limit=$tsimilar; |
$limit=$tsimilar; |
$sname=$tname; |
$sname=$tname; |
$sdom=$tdom; |
$sdom=$tdom; |
$scrsid=$tcrsid; |
$scrsid=$tcrsid; |
$sessay=$oldessays{$tkey}; |
$sessay=$old_essays->{$tkey}; |
} |
} |
} |
|
} |
} |
if ($limit>0.6) { |
if ($limit>0.6) { |
return ($sname,$sdom,$scrsid,$sessay,$limit); |
return ($sname,$sdom,$scrsid,$sessay,$limit); |
Line 722 LISTJAVASCRIPT
|
Line 748 LISTJAVASCRIPT
|
if ($env{'form.handgrade'} eq 'yes' && scalar(@$partlist) > 1) { |
if ($env{'form.handgrade'} eq 'yes' && scalar(@$partlist) > 1) { |
$gradeTable.='<label><input type="radio" name="lastSub" value="hdgrade" '.$checkhdgrade.' /> essay part only </label>'."\n"; |
$gradeTable.='<label><input type="radio" name="lastSub" value="hdgrade" '.$checkhdgrade.' /> essay part only </label>'."\n"; |
} |
} |
|
my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status')); |
my $saveStatus = $env{'form.Status'} eq '' ? 'Active' : $env{'form.Status'}; |
my $saveStatus = $stu_status eq '' ? 'Active' : $stu_status; |
$env{'form.Status'} = $saveStatus; |
$env{'form.Status'} = $saveStatus; |
|
|
$gradeTable.='<label><input type="radio" name="lastSub" value="lastonly" '.$checklastsub.' /> last submission only </label>'."\n". |
$gradeTable.='<label><input type="radio" name="lastSub" value="lastonly" '.$checklastsub.' /> last submission only </label>'."\n". |
'<label><input type="radio" name="lastSub" value="last" /> last submission & parts info </label>'."\n". |
'<label><input type="radio" name="lastSub" value="last" /> last submission & parts info </label>'."\n". |
'<label><input type="radio" name="lastSub" value="datesub" /> by dates and submissions </label>'."\n". |
'<label><input type="radio" name="lastSub" value="datesub" /> by dates and submissions </label>'."\n". |
Line 736 LISTJAVASCRIPT
|
Line 761 LISTJAVASCRIPT
|
'<option value=".25">Quarter Points</option>'. |
'<option value=".25">Quarter Points</option>'. |
'<option value=".1">Tenths of a Point</option>'. |
'<option value=".1">Tenths of a Point</option>'. |
'</select>'. |
'</select>'. |
|
&build_section_inputs(). |
'<input type="hidden" name="section" value="'.$getsec.'" />'."\n". |
|
'<input type="hidden" name="submitonly" value="'.$submitonly.'" />'."\n". |
'<input type="hidden" name="submitonly" value="'.$submitonly.'" />'."\n". |
'<input type="hidden" name="handgrade" value="'.$env{'form.handgrade'}.'" /><br />'."\n". |
'<input type="hidden" name="handgrade" value="'.$env{'form.handgrade'}.'" /><br />'."\n". |
'<input type="hidden" name="showgrading" value="'.$env{'form.showgrading'}.'" /><br />'."\n". |
'<input type="hidden" name="showgrading" value="'.$env{'form.showgrading'}.'" /><br />'."\n". |
Line 747 LISTJAVASCRIPT
|
Line 771 LISTJAVASCRIPT
|
'<input type="hidden" name="saveStatusOld" value="'.$saveStatus.'" />'."\n"; |
'<input type="hidden" name="saveStatusOld" value="'.$saveStatus.'" />'."\n"; |
|
|
if (exists($env{'form.gradingMenu'}) && exists($env{'form.Status'})) { |
if (exists($env{'form.gradingMenu'}) && exists($env{'form.Status'})) { |
$gradeTable.='<input type="hidden" name="Status" value="'.$env{'form.Status'}.'" />'."\n"; |
$gradeTable.='<input type="hidden" name="Status" value="'.$stu_status.'" />'."\n"; |
} else { |
} else { |
$gradeTable.='<b>Student Status:</b> '. |
$gradeTable.='<b>Student Status:</b> '. |
&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,1,'javascript:reLoadList(this.form);').'<br />'; |
&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,1,'javascript:reLoadList(this.form);').'<br />'; |
Line 1663 sub download_all_link {
|
Line 1687 sub download_all_link {
|
return |
return |
} |
} |
|
|
|
sub build_section_inputs { |
|
my $section_inputs; |
|
if ($env{'form.section'} eq '') { |
|
$section_inputs .= '<input type="hidden" name="section" value="all" />'."\n"; |
|
} else { |
|
my @sections = &Apache::loncommon::get_env_multiple('form.section'); |
|
foreach my $section (@sections) { |
|
$section_inputs .= '<input type="hidden" name="section" value="'.$section.'" />'."\n"; |
|
} |
|
} |
|
return $section_inputs; |
|
} |
|
|
# --------------------------- show submissions of a student, option to grade |
# --------------------------- show submissions of a student, option to grade |
sub submission { |
sub submission { |
my ($request,$counter,$total) = @_; |
my ($request,$counter,$total) = @_; |
Line 1671 sub submission {
|
Line 1708 sub submission {
|
$udom = ($udom eq '' ? $env{'user.domain'} : $udom); #has form.userdom changed for a student? |
$udom = ($udom eq '' ? $env{'user.domain'} : $udom); #has form.userdom changed for a student? |
my $usec = &Apache::lonnet::getsection($udom,$uname,$env{'request.course.id'}); |
my $usec = &Apache::lonnet::getsection($udom,$uname,$env{'request.course.id'}); |
$env{'form.fullname'} = &Apache::loncommon::plainname($uname,$udom,'lastname') if $env{'form.fullname'} eq ''; |
$env{'form.fullname'} = &Apache::loncommon::plainname($uname,$udom,'lastname') if $env{'form.fullname'} eq ''; |
|
|
my $symb = &get_symb($request); |
my $symb = &get_symb($request); |
if ($symb eq '') { $request->print("Unable to handle ambiguous references:."); return ''; } |
if ($symb eq '') { $request->print("Unable to handle ambiguous references:."); return ''; } |
|
|
Line 1691 sub submission {
|
Line 1727 sub submission {
|
'" src="'.$request->dir_config('lonIconsURL'). |
'" src="'.$request->dir_config('lonIconsURL'). |
'/check.gif" height="16" border="0" />'; |
'/check.gif" height="16" border="0" />'; |
|
|
|
my %old_essays; |
# header info |
# header info |
if ($counter == 0) { |
if ($counter == 0) { |
&sub_page_js($request); |
&sub_page_js($request); |
Line 1723 sub submission {
|
Line 1760 sub submission {
|
&Apache::lonxml::clear_problem_counter(); |
&Apache::lonxml::clear_problem_counter(); |
$request->print(&show_problem($request,$symb,$uname,$udom,0,1,$mode)); |
$request->print(&show_problem($request,$symb,$uname,$udom,0,1,$mode)); |
} |
} |
|
|
# kwclr is the only variable that is guaranteed to be non blank |
# kwclr is the only variable that is guaranteed to be non blank |
# if this subroutine has been called once. |
# if this subroutine has been called once. |
my %keyhash = (); |
my %keyhash = (); |
Line 1742 sub submission {
|
Line 1779 sub submission {
|
$env{'form.savemsgN'} = $keyhash{$symb.'_savemsgN'} ne '' ? $keyhash{$symb.'_savemsgN'} : '0'; |
$env{'form.savemsgN'} = $keyhash{$symb.'_savemsgN'} ne '' ? $keyhash{$symb.'_savemsgN'} : '0'; |
} |
} |
my $overRideScore = $env{'form.overRideScore'} eq '' ? 'no' : $env{'form.overRideScore'}; |
my $overRideScore = $env{'form.overRideScore'} eq '' ? 'no' : $env{'form.overRideScore'}; |
|
my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status')); |
$request->print('<form action="/adm/grades" method="post" name="SCORE" enctype="multipart/form-data">'."\n". |
$request->print('<form action="/adm/grades" method="post" name="SCORE" enctype="multipart/form-data">'."\n". |
'<input type="hidden" name="command" value="handgrade" />'."\n". |
'<input type="hidden" name="command" value="handgrade" />'."\n". |
'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n". |
'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n". |
'<input type="hidden" name="Status" value="'.$env{'form.Status'}.'" />'."\n". |
'<input type="hidden" name="Status" value="'.$stu_status.'" />'."\n". |
'<input type="hidden" name="overRideScore" value="'.$overRideScore.'" />'."\n". |
'<input type="hidden" name="overRideScore" value="'.$overRideScore.'" />'."\n". |
'<input type="hidden" name="probTitle" value="'.$env{'form.probTitle'}.'" />'."\n". |
'<input type="hidden" name="probTitle" value="'.$env{'form.probTitle'}.'" />'."\n". |
'<input type="hidden" name="refresh" value="off" />'."\n". |
'<input type="hidden" name="refresh" value="off" />'."\n". |
Line 1757 sub submission {
|
Line 1794 sub submission {
|
'<input type="hidden" name="vProb" value="'.$env{'form.vProb'}.'" />'."\n". |
'<input type="hidden" name="vProb" value="'.$env{'form.vProb'}.'" />'."\n". |
'<input type="hidden" name="vAns" value="'.$env{'form.vAns'}.'" />'."\n". |
'<input type="hidden" name="vAns" value="'.$env{'form.vAns'}.'" />'."\n". |
'<input type="hidden" name="lastSub" value="'.$env{'form.lastSub'}.'" />'."\n". |
'<input type="hidden" name="lastSub" value="'.$env{'form.lastSub'}.'" />'."\n". |
'<input type="hidden" name="section" value="'.$env{'form.section'}.'" />'."\n". |
&build_section_inputs(). |
'<input type="hidden" name="submitonly" value="'.$env{'form.submitonly'}.'" />'."\n". |
'<input type="hidden" name="submitonly" value="'.$env{'form.submitonly'}.'" />'."\n". |
'<input type="hidden" name="handgrade" value="'.$env{'form.handgrade'}.'" />'."\n". |
'<input type="hidden" name="handgrade" value="'.$env{'form.handgrade'}.'" />'."\n". |
'<input type="hidden" name="NCT"'. |
'<input type="hidden" name="NCT"'. |
Line 1805 KEYWORDS
|
Line 1842 KEYWORDS
|
my ($adom,$aname,$apath)=($essayurl=~/^($LONCAPA::domain_re)\/($LONCAPA::username_re)\/(.*)$/); |
my ($adom,$aname,$apath)=($essayurl=~/^($LONCAPA::domain_re)\/($LONCAPA::username_re)\/(.*)$/); |
$apath=&escape($apath); |
$apath=&escape($apath); |
$apath=~s/\W/\_/gs; |
$apath=~s/\W/\_/gs; |
%oldessays=&Apache::lonnet::dump('nohist_essay_'.$apath,$adom,$aname); |
%old_essays=&Apache::lonnet::dump('nohist_essay_'.$apath,$adom,$aname); |
} |
} |
} |
} |
|
|
|
# This is where output for one specific student would start |
|
my $bgcolor='#DDEEDD'; |
|
if (int($counter/2) eq $counter) { $bgcolor='#DDDDEE'; } |
|
$request->print("\n\n". |
|
'<p><table border="2"><tr><th bgcolor="'.$bgcolor.'">'.$env{'form.fullname'}.'</th></tr><tr><td bgcolor="'.$bgcolor.'">'); |
|
|
if ($env{'form.vProb'} eq 'all' or $env{'form.vAns'} eq 'all') { |
if ($env{'form.vProb'} eq 'all' or $env{'form.vAns'} eq 'all') { |
$request->print('<br /><br /><br />') if ($counter > 0); |
|
my $mode; |
my $mode; |
if ($env{'form.vProb'} eq 'all' && $env{'form.vAns'} eq 'all') { |
if ($env{'form.vProb'} eq 'all' && $env{'form.vAns'} eq 'all') { |
$mode='both'; |
$mode='both'; |
Line 1943 KEYWORDS
|
Line 1985 KEYWORDS
|
my $similar=''; |
my $similar=''; |
if($env{'form.checkPlag'}){ |
if($env{'form.checkPlag'}){ |
my ($oname,$odom,$ocrsid,$oessay,$osim)= |
my ($oname,$odom,$ocrsid,$oessay,$osim)= |
&most_similar($uname,$udom,$subval); |
&most_similar($uname,$udom,$subval,\%old_essays); |
if ($osim) { |
if ($osim) { |
$osim=int($osim*100.0); |
$osim=int($osim*100.0); |
$similar="<hr /><h3><span class=\"LC_warning\">Essay". |
my %old_course_desc = |
" is $osim% similar to an essay by ". |
&Apache::lonnet::coursedescription($ocrsid, |
&Apache::loncommon::plainname($oname,$odom). |
{'one_time' => 1}); |
|
|
|
$similar="<hr /><h3><span class=\"LC_warning\">". |
|
&mt('Essay is [_1]% similar to an essay by [_2] ([_3]:[_4]) in course [_5] (course id [_6]:[_7])', |
|
$osim, |
|
&Apache::loncommon::plainname($oname,$odom), |
|
$oname,$odom, |
|
$old_course_desc{'description'}, |
|
$old_course_desc{'num'}, |
|
$old_course_desc{'domain'}). |
'</span></h3><blockquote><i>'. |
'</span></h3><blockquote><i>'. |
&keywords_highlight($oessay). |
&keywords_highlight($oessay). |
'</i></blockquote><hr />'; |
'</i></blockquote><hr />'; |
Line 2071 KEYWORDS
|
Line 2122 KEYWORDS
|
} |
} |
$request->print($result.'</td></tr></table></td></tr></table>'."\n"); |
$request->print($result.'</td></tr></table></td></tr></table>'."\n"); |
|
|
|
# Done with printing info for one student |
|
|
|
$request->print('</td></tr></table></p>'); |
|
|
|
|
# print end of form |
# print end of form |
if ($counter == $total) { |
if ($counter == $total) { |
my $endform='<table border="0"><tr><td>'."\n"; |
my $endform='<table border="0"><tr><td>'."\n"; |
Line 2954 sub viewgrades {
|
Line 3010 sub viewgrades {
|
$result.=&jscriptNform($symb); |
$result.=&jscriptNform($symb); |
|
|
#beginning of class grading form |
#beginning of class grading form |
|
my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status')); |
$result.= '<form action="/adm/grades" method="post" name="classgrade">'."\n". |
$result.= '<form action="/adm/grades" method="post" name="classgrade">'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="command" value="editgrades" />'."\n". |
'<input type="hidden" name="command" value="editgrades" />'."\n". |
'<input type="hidden" name="section" value="'.$env{'form.section'}.'" />'."\n". |
&build_section_inputs(). |
'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n". |
'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n". |
'<input type="hidden" name="Status" value="'.$env{'form.Status'}.'" />'."\n". |
'<input type="hidden" name="Status" value="'.$env{'stu_status'}.'" />'."\n". |
'<input type="hidden" name="probTitle" value="'.$env{'form.probTitle'}.'" />'."\n"; |
'<input type="hidden" name="probTitle" value="'.$env{'form.probTitle'}.'" />'."\n"; |
|
|
my $sectionClass; |
my $sectionClass; |
|
my $section_display = join (", ",&Apache::loncommon::get_env_multiple('form.section')); |
if ($env{'form.section'} eq 'all') { |
if ($env{'form.section'} eq 'all') { |
$sectionClass='Class </h3>'; |
$sectionClass='Class </h3>'; |
} elsif ($env{'form.section'} eq 'none') { |
} elsif ($env{'form.section'} eq 'none') { |
$sectionClass='Students in no Section </h3>'; |
$sectionClass=&mt('Students in no Section').'</h3>'; |
} else { |
} else { |
$sectionClass='Students in Section '.$env{'form.section'}.'</h3>'; |
$sectionClass=&mt('Students in Section(s) [_1]',$section_display).'</h3>'; |
} |
} |
$result.='<h3>Assign Common Grade To '.$sectionClass; |
$result.='<h3>'.&mt('Assign Common Grade To [_1]',$sectionClass); |
$result.= '<table border=0><tr><td bgcolor="#777777">'."\n". |
$result.= '<table border=0><tr><td bgcolor="#777777">'."\n". |
'<table border=0><tr bgcolor="#ffffdd"><td>'; |
'<table border=0><tr bgcolor="#ffffdd"><td>'; |
#radio buttons/text box for assigning points for a section or class. |
#radio buttons/text box for assigning points for a section or class. |
Line 3076 sub viewgrades {
|
Line 3134 sub viewgrades {
|
'onClick="javascript:submit();" target="_self" /></form>'."\n"; |
'onClick="javascript:submit();" target="_self" /></form>'."\n"; |
if (scalar(%$fullname) eq 0) { |
if (scalar(%$fullname) eq 0) { |
my $colspan=3+scalar(@parts); |
my $colspan=3+scalar(@parts); |
$result='<span class="LC_warning">There are no students in section "'.$env{'form.section'}. |
my $section_display = join (", ",&Apache::loncommon::get_env_multiple('form.section')); |
'" with enrollment status "'.$env{'form.Status'}.'" to modify or grade.</span>'; |
my $stu_status = join(' or ',&Apache::loncommon::get_env_multiple('form.Status')); |
|
$result='<span class="LC_warning">'. |
|
&mt('There are no students in section(s) [_1] with enrollment status [_2] to modify or grade', |
|
$section_display, $stu_status). |
|
'</span>'; |
} |
} |
$result.=&show_grading_menu_form($symb); |
$result.=&show_grading_menu_form($symb); |
return $result; |
return $result; |
Line 3154 sub editgrades {
|
Line 3216 sub editgrades {
|
my ($request) = @_; |
my ($request) = @_; |
|
|
my $symb=&get_symb($request); |
my $symb=&get_symb($request); |
my $title='<h3><span class="LC_info">Current Grade Status</span></h3>'; |
my $section_display = join (", ",&Apache::loncommon::get_env_multiple('form.section')); |
$title.='<h4><b>Current Resource: </b>'.$env{'form.probTitle'}.'</h4><br />'."\n"; |
my $title='<h3><span class="LC_info">'.&mt('Current Grade Status').'</span></h3>'; |
$title.='<h4><b>Section: </b>'.$env{'form.section'}.'</h4>'."\n"; |
$title.='<h4>'.&mt('<b>Current Resource: </b>[_1]',$env{'form.probTitle'}).'</h4><br />'."\n"; |
|
$title.='<h4>'.&mt('<b>Section: </b>[_1]',$section_display).'</h4>'."\n"; |
|
|
my $result= '<table border="0"><tr><td bgcolor="#777777">'."\n"; |
my $result= '<table border="0"><tr><td bgcolor="#777777">'."\n"; |
$result.= '<table border="0"><tr bgcolor="#deffff">'. |
$result.= '<table border="0"><tr bgcolor="#deffff">'. |
Line 3354 sub split_part_type {
|
Line 3417 sub split_part_type {
|
my ($partstr) = @_; |
my ($partstr) = @_; |
my ($temp,@allparts)=split(/_/,$partstr); |
my ($temp,@allparts)=split(/_/,$partstr); |
my $type=pop(@allparts); |
my $type=pop(@allparts); |
my $part=join('.',@allparts); |
my $part=join('_',@allparts); |
return ($part,$type); |
return ($part,$type); |
} |
} |
|
|
Line 3857 LISTJAVASCRIPT
|
Line 3920 LISTJAVASCRIPT
|
'<label><input type="radio" name="lastSub" value="none" /> none</label>'."\n". |
'<label><input type="radio" name="lastSub" value="none" /> none</label>'."\n". |
'<label><input type="radio" name="lastSub" value="datesub" checked="checked" /> by dates and submissions</label>'."\n". |
'<label><input type="radio" name="lastSub" value="datesub" checked="checked" /> by dates and submissions</label>'."\n". |
'<label><input type="radio" name="lastSub" value="all" /> all details</label>'."\n"; |
'<label><input type="radio" name="lastSub" value="all" /> all details</label>'."\n"; |
|
|
$result.='<input type="hidden" name="section" value="'.$getsec.'" />'."\n". |
$result.=&build_section_inputs(); |
'<input type="hidden" name="Status" value="'.$env{'form.Status'}.'" />'."\n". |
my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status')); |
|
$result.='<input type="hidden" name="Status" value="'.$stu_status.'" />'."\n". |
'<input type="hidden" name="command" value="displayPage" />'."\n". |
'<input type="hidden" name="command" value="displayPage" />'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."<br />\n"; |
'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."<br />\n"; |
Line 4357 sub updateGradeByPage {
|
Line 4421 sub updateGradeByPage {
|
|
|
=head1 Bubble sheet grading routines |
=head1 Bubble sheet grading routines |
|
|
(For this documentation 'scanline' refers to the full line of characters |
For this documentation: |
from the file that we are parsing 'bubble line' refers to the data |
|
representing the line of bubbles that are on the physical bubble sheet) |
'scanline' refers to the full line of characters |
|
from the file that we are parsing that represents one entire sheet |
|
|
|
'bubble line' refers to the data |
|
representing the line of bubbles that are on the physical bubble sheet |
|
|
|
|
|
The overall process is that a scanned in bubble sheet data is uploaded |
|
into a course. When a user wants to grade, they select a |
|
sequence/folder of resources, a file of bubble sheet info, and pick |
|
one of the predefined configurations for what each scanline looks |
|
like. |
|
|
|
Next each scanline is checked for any errors of either 'missing |
|
bubbles' (it's an error because it may have been mis-scanned |
|
because too light bubbling), 'double bubble' (each bubble line should |
|
have no more that one letter picked), invalid or duplicated CODE, |
|
invalid student ID |
|
|
|
If the CODE option is used that determines the randomization of the |
|
homework problems, either way the student ID is looked up into a |
|
username:domain. |
|
|
|
During the validation phase the instructor can choose to skip scanlines. |
|
|
|
After the validation phase, there are now 3 bubble sheet files |
|
|
|
scantron_original_filename (unmodified original file) |
|
scantron_corrected_filename (file where the corrected information has replaced the original information) |
|
scantron_skipped_filename (contains the exact text of scanlines that where skipped) |
|
|
|
Also there is a separate hash nohist_scantrondata that contains extra |
|
correction information that isn't representable in the bubble sheet |
|
file (see &scantron_getfile() for more information) |
|
|
|
After all scanlines are either valid, marked as valid or skipped, then |
|
foreach line foreach problem in the picked sequence, an ssi request is |
|
made that simulates a user submitting their selected letter(s) against |
|
the homework problem. |
|
|
=over 4 |
=over 4 |
|
|
Line 4531 sub scantron_CODEunique {
|
Line 4633 sub scantron_CODEunique {
|
|
|
Generates the initial screen to start the bubble sheet process. |
Generates the initial screen to start the bubble sheet process. |
Allows for - starting a grading run. |
Allows for - starting a grading run. |
- downloading exisiting scan data (original, corrected |
- downloading existing scan data (original, corrected |
or skipped info) |
or skipped info) |
|
|
- uploading new scan data |
- uploading new scan data |
Line 4589 sub scantron_selectphase {
|
Line 4691 sub scantron_selectphase {
|
<td> Options: </td> |
<td> Options: </td> |
<td> |
<td> |
<label><input type="checkbox" name="scantron_options_redo" value="redo_skipped"/> Do only previously skipped records</label> <br /> |
<label><input type="checkbox" name="scantron_options_redo" value="redo_skipped"/> Do only previously skipped records</label> <br /> |
<label><input type="checkbox" name="scantron_options_ignore" value="ignore_corrections"/> Remove all exisiting corrections</label> <br /> |
<label><input type="checkbox" name="scantron_options_ignore" value="ignore_corrections"/> Remove all existing corrections</label> <br /> |
<label><input type="checkbox" name="scantron_options_hidden" value="ignore_hidden"/> Skip hidden resources when grading</label> |
<label><input type="checkbox" name="scantron_options_hidden" value="ignore_hidden"/> Skip hidden resources when grading</label> |
</td> |
</td> |
</tr> |
</tr> |
Line 4732 SCANTRONFORM
|
Line 4834 SCANTRONFORM
|
'questions' start |
'questions' start |
Qlength - number of columns comprising a single bubble line from |
Qlength - number of columns comprising a single bubble line from |
the sheet. (usually either 1 or 10) |
the sheet. (usually either 1 or 10) |
Qon - either a single charater representing the character used |
Qon - either a single character representing the character used |
to signal a bubble was chosen in the positional setup, or |
to signal a bubble was chosen in the positional setup, or |
the string 'letter' if the letter of the chosen bubble is |
the string 'letter' if the letter of the chosen bubble is |
in the final, or 'number' if a number representing the |
in the final, or 'number' if a number representing the |
chosen bubble is in the file (1->A 0->J) |
chosen bubble is in the file (1->A 0->J) |
Qoff - the character used to represent that a buble was left blank |
Qoff - the character used to represent that a bubble was |
|
left blank |
PaperID - if the scanning process generates a unique number for each |
PaperID - if the scanning process generates a unique number for each |
sheet scanned the column that this ID number starts in |
sheet scanned the column that this ID number starts in |
PaperIDlength - number of columns that comprise the unique ID number |
PaperIDlength - number of columns that comprise the unique ID number |
for the sheet of paper |
for the sheet of paper |
FirstName - column that the firs tname starts in |
FirstName - column that the first name starts in |
FirstNameLength - number of columns that the first name spans |
FirstNameLength - number of columns that the first name spans |
|
|
LastName - column that the last name starts in |
LastName - column that the last name starts in |
Line 4793 sub get_scantron_config {
|
Line 4896 sub get_scantron_config {
|
|
|
$classlist - reference to the class list hash. This is a hash |
$classlist - reference to the class list hash. This is a hash |
keyed by student name:domain whose elements are references |
keyed by student name:domain whose elements are references |
to arrays containng various chunks of information |
to arrays containing various chunks of information |
about the student. (See loncoursedata for more info). |
about the student. (See loncoursedata for more info). |
|
|
Returns |
Returns |
Line 4813 sub username_to_idmap {
|
Line 4916 sub username_to_idmap {
|
|
|
=pod |
=pod |
|
|
=item scatron_fixup_scanline |
=item scantron_fixup_scanline |
|
|
Process a requested correction to a scanline. |
Process a requested correction to a scanline. |
|
|
Line 4832 sub username_to_idmap {
|
Line 4935 sub username_to_idmap {
|
$args - hash of additional info, |
$args - hash of additional info, |
- 'ID' |
- 'ID' |
'newid' -> studentID to use in replacement |
'newid' -> studentID to use in replacement |
of exisiting one |
of existing one |
- 'CODE' |
- 'CODE' |
'CODE_ignore_dup' - set to true if duplicates |
'CODE_ignore_dup' - set to true if duplicates |
should be ignored. |
should be ignored. |
'CODE' - is new code or 'use_unfound' |
'CODE' - is new code or 'use_unfound' |
if the exisitng unfound code should |
if the existing unfound code should |
be used as is |
be used as is |
- 'answer' |
- 'answer' |
'response' - new answer or 'none' if blank |
'response' - new answer or 'none' if blank |
Line 4920 sub scantron_fixup_scanline {
|
Line 5023 sub scantron_fixup_scanline {
|
Arguments: |
Arguments: |
$scan_data - The hash (see scantron_getfile) |
$scan_data - The hash (see scantron_getfile) |
$key - shorthand of the key to edit (actual key is |
$key - shorthand of the key to edit (actual key is |
scatronfilename_key). |
scantronfilename_key). |
$data - New value of the hash entry. |
$data - New value of the hash entry. |
$delete - If true, the entry is removed from the hash. |
$delete - If true, the entry is removed from the hash. |
|
|
Line 5107 sub scantron_parse_scanline {
|
Line 5210 sub scantron_parse_scanline {
|
queue of messages to be shown after grading pass is complete |
queue of messages to be shown after grading pass is complete |
|
|
Arguments: |
Arguments: |
$delayqueue - arrary ref of hash ref of erro messages |
$delayqueue - arrary ref of hash ref of error messages |
$scanline - the scanline that caused the error |
$scanline - the scanline that caused the error |
$errormesage - the error message |
$errormesage - the error message |
$errorcode - a numeric code for the error |
$errorcode - a numeric code for the error |
|
|
Side Effects: |
Side Effects: |
updates the $dealyqueue to have a new hash ref of the error |
updates the $delayqueue to have a new hash ref of the error |
|
|
=cut |
=cut |
|
|
Line 5129 sub scantron_add_delay {
|
Line 5232 sub scantron_add_delay {
|
|
|
=item scantron_find_student |
=item scantron_find_student |
|
|
|
Finds the username for the current scanline |
|
|
|
Arguments: |
|
$scantron_record - hash result from scantron_parse_scanline |
|
$scan_data - hash of correction information |
|
(see &scantron_getfile() form more information) |
|
$idmap - hash from &username_to_idmap() |
|
$line - number of current scanline |
|
|
|
Returns: |
|
Either 'username:domain' or undef if unknown |
|
|
=cut |
=cut |
|
|
sub scantron_find_student { |
sub scantron_find_student { |
Line 5149 sub scantron_find_student {
|
Line 5264 sub scantron_find_student {
|
|
|
=item scantron_filter |
=item scantron_filter |
|
|
|
Filter sub for lonnavmaps, filters out hidden resources if ignore |
|
hidden resources was selected |
|
|
=cut |
=cut |
|
|
sub scantron_filter { |
sub scantron_filter { |
Line 5171 sub scantron_filter {
|
Line 5289 sub scantron_filter {
|
|
|
=item scantron_process_corrections |
=item scantron_process_corrections |
|
|
|
Gets correction information out of submitted form data and corrects |
|
the scanline |
|
|
=cut |
=cut |
|
|
sub scantron_process_corrections { |
sub scantron_process_corrections { |
Line 5234 sub scantron_process_corrections {
|
Line 5355 sub scantron_process_corrections {
|
|
|
=item reset_skipping_status |
=item reset_skipping_status |
|
|
|
Forgets the current set of remember skipped scanlines (and thus |
|
reverts back to considering all lines in the |
|
scantron_skipped_<filename> file) |
|
|
=cut |
=cut |
|
|
sub reset_skipping_status { |
sub reset_skipping_status { |
Line 5246 sub reset_skipping_status {
|
Line 5371 sub reset_skipping_status {
|
|
|
=item start_skipping |
=item start_skipping |
|
|
|
Marks a scanline to be skipped. |
|
|
=cut |
=cut |
|
|
sub start_skipping { |
sub start_skipping { |
Line 5263 sub start_skipping {
|
Line 5390 sub start_skipping {
|
|
|
=item should_be_skipped |
=item should_be_skipped |
|
|
|
Checks whether a scanline should be skipped. |
|
|
=cut |
=cut |
|
|
sub should_be_skipped { |
sub should_be_skipped { |
Line 5284 sub should_be_skipped {
|
Line 5413 sub should_be_skipped {
|
|
|
=item remember_current_skipped |
=item remember_current_skipped |
|
|
|
Discovers what scanlines are in the scantron_skipped_<filename> |
|
file and remembers them into scan_data for later use. |
|
|
=cut |
=cut |
|
|
sub remember_current_skipped { |
sub remember_current_skipped { |
Line 5303 sub remember_current_skipped {
|
Line 5435 sub remember_current_skipped {
|
|
|
=item check_for_error |
=item check_for_error |
|
|
|
Checks if there was an error when attempting to remove a specific |
|
scantron_.. bubble sheet data file. Prints out an error if |
|
something went wrong. |
|
|
=cut |
=cut |
|
|
sub check_for_error { |
sub check_for_error { |
Line 5316 sub check_for_error {
|
Line 5452 sub check_for_error {
|
|
|
=item scantron_warning_screen |
=item scantron_warning_screen |
|
|
|
Interstitial screen to make sure the operator has selected the |
|
correct options before we start the validation phase. |
|
|
=cut |
=cut |
|
|
sub scantron_warning_screen { |
sub scantron_warning_screen { |
Line 5354 STUFF
|
Line 5493 STUFF
|
|
|
=item scantron_do_warning |
=item scantron_do_warning |
|
|
|
Check if the operator has picked something for all required |
|
fields. Error out if something is missing. |
|
|
=cut |
=cut |
|
|
sub scantron_do_warning { |
sub scantron_do_warning { |
Line 5391 STUFF
|
Line 5533 STUFF
|
|
|
=item scantron_form_start |
=item scantron_form_start |
|
|
|
html hidden input for remembering all selected grading options |
|
|
=cut |
=cut |
|
|
sub scantron_form_start { |
sub scantron_form_start { |
Line 5414 SCANTRONFORM
|
Line 5558 SCANTRONFORM
|
|
|
=item scantron_validate_file |
=item scantron_validate_file |
|
|
|
Dispatch routine for doing validation of a bubble sheet data file. |
|
|
|
Also processes any necessary information resets that need to |
|
occur before validation begins (ignore previous corrections, |
|
restarting the skipped records processing) |
|
|
=cut |
=cut |
|
|
sub scantron_validate_file { |
sub scantron_validate_file { |
Line 5423 sub scantron_validate_file {
|
Line 5573 sub scantron_validate_file {
|
my $default_form_data=&defaultFormData($symb); |
my $default_form_data=&defaultFormData($symb); |
|
|
# do the detection of only doing skipped records first befroe we delete |
# do the detection of only doing skipped records first befroe we delete |
# them when doing the corrections reset |
# them when doing the corrections reset |
if ($env{'form.scantron_options_redo'} ne 'redo_skipped_ready') { |
if ($env{'form.scantron_options_redo'} ne 'redo_skipped_ready') { |
&reset_skipping_status(); |
&reset_skipping_status(); |
} |
} |
Line 5442 sub scantron_validate_file {
|
Line 5592 sub scantron_validate_file {
|
if ($env{'form.scantron_corrections'}) { |
if ($env{'form.scantron_corrections'}) { |
&scantron_process_corrections($r); |
&scantron_process_corrections($r); |
} |
} |
$r->print("<p>Gathering neccessary info.</p>");$r->rflush(); |
$r->print("<p>Gathering necessary info.</p>");$r->rflush(); |
#get the student pick code ready |
#get the student pick code ready |
$r->print(&Apache::loncommon::studentbrowser_javascript()); |
$r->print(&Apache::loncommon::studentbrowser_javascript()); |
my $max_bubble=&scantron_get_maxbubble(); |
my $max_bubble=&scantron_get_maxbubble(); |
Line 5504 STUFF
|
Line 5654 STUFF
|
|
|
=item scantron_remove_file |
=item scantron_remove_file |
|
|
|
Removes the requested bubble sheet data file, makes sure that |
|
scantron_original_<filename> is never removed |
|
|
|
|
=cut |
=cut |
|
|
sub scantron_remove_file { |
sub scantron_remove_file { |
Line 5525 sub scantron_remove_file {
|
Line 5679 sub scantron_remove_file {
|
|
|
=item scantron_remove_scan_data |
=item scantron_remove_scan_data |
|
|
|
Removes all scan_data correction for the requested bubble sheet |
|
data file. (In the case that both the are doing skipped records we need |
|
to remember the old skipped lines for the time being so that element |
|
persists for a while.) |
|
|
=cut |
=cut |
|
|
sub scantron_remove_scan_data { |
sub scantron_remove_scan_data { |
Line 5554 sub scantron_remove_scan_data {
|
Line 5713 sub scantron_remove_scan_data {
|
|
|
=item scantron_getfile |
=item scantron_getfile |
|
|
|
Fetches the requested bubble sheet data file (all 3 versions), and |
|
the scan_data hash |
|
|
|
Arguments: |
|
None |
|
|
|
Returns: |
|
2 hash references |
|
|
|
- first one has |
|
orig - |
|
corrected - |
|
skipped - each of which points to an array ref of the specified |
|
file broken up into individual lines |
|
count - number of scanlines |
|
|
|
- second is the scan_data hash possible keys are |
|
($number refers to scanline numbered $number and thus the key affects |
|
only that scanline |
|
$bubline refers to the specific bubble line element and the aspects |
|
refers to that specific bubble line element) |
|
|
|
$number.user - username:domain to use |
|
$number.CODE_ignore_dup |
|
- ignore the duplicate CODE error |
|
$number.useCODE |
|
- use the CODE in the scanline as is |
|
$number.no_bubble.$bubline |
|
- it is valid that there is no bubbled in bubble |
|
at $number $bubline |
|
remember_skipping |
|
- a frozen hash containing keys of $number and values |
|
of either |
|
1 - we are on a 'do skipped records pass' and plan |
|
on processing this line |
|
2 - we are on a 'do skipped records pass' and this |
|
scanline has been marked to skip yet again |
|
|
=cut |
=cut |
|
|
sub scantron_getfile { |
sub scantron_getfile { |
Line 5592 sub scantron_getfile {
|
Line 5789 sub scantron_getfile {
|
|
|
=item lonnet_putfile |
=item lonnet_putfile |
|
|
|
Wrapper routine to call &Apache::lonnet::finishuserfileupload |
|
|
|
Arguments: |
|
$contents - data to store |
|
$filename - filename to store $contents into |
|
|
|
Returns: |
|
result value from &Apache::lonnet::finishuserfileupload |
|
|
=cut |
=cut |
|
|
sub lonnet_putfile { |
sub lonnet_putfile { |
Line 5607 sub lonnet_putfile {
|
Line 5813 sub lonnet_putfile {
|
|
|
=item scantron_putfile |
=item scantron_putfile |
|
|
|
Stores the current version of the bubble sheet data files, and the |
|
scan_data hash. (Does not modify the original version only the |
|
corrected and skipped versions. |
|
|
|
Arguments: |
|
$scanlines - hash ref that looks like the first return value from |
|
&scantron_getfile() |
|
$scan_data - hash ref that looks like the second return value from |
|
&scantron_getfile() |
|
|
=cut |
=cut |
|
|
sub scantron_putfile { |
sub scantron_putfile { |
Line 5633 sub scantron_putfile {
|
Line 5849 sub scantron_putfile {
|
|
|
=item scantron_get_line |
=item scantron_get_line |
|
|
|
Returns the correct version of the scanline |
|
|
|
Arguments: |
|
$scanlines - hash ref that looks like the first return value from |
|
&scantron_getfile() |
|
$scan_data - hash ref that looks like the second return value from |
|
&scantron_getfile() |
|
$i - number of the requested line (starts at 0) |
|
|
|
Returns: |
|
A scanline, (either the original or the corrected one if it |
|
exists), or undef if the requested scanline should be |
|
skipped. (Either because it's an skipped scanline, or it's an |
|
unskipped scanline and we are not doing a 'do skipped scanlines' |
|
pass. |
|
|
=cut |
=cut |
|
|
sub scantron_get_line { |
sub scantron_get_line { |
Line 5647 sub scantron_get_line {
|
Line 5879 sub scantron_get_line {
|
|
|
=item scantron_todo_count |
=item scantron_todo_count |
|
|
|
Counts the number of scanlines that need processing. |
|
|
|
Arguments: |
|
$scanlines - hash ref that looks like the first return value from |
|
&scantron_getfile() |
|
$scan_data - hash ref that looks like the second return value from |
|
&scantron_getfile() |
|
|
|
Returns: |
|
$count - number of scanlines to process |
|
|
=cut |
=cut |
|
|
sub get_todo_count { |
sub get_todo_count { |
Line 5664 sub get_todo_count {
|
Line 5907 sub get_todo_count {
|
|
|
=item scantron_put_line |
=item scantron_put_line |
|
|
|
Updates the 'corrected' or 'skipped' versions of the bubble sheet |
|
data file. |
|
|
|
Arguments: |
|
$scanlines - hash ref that looks like the first return value from |
|
&scantron_getfile() |
|
$scan_data - hash ref that looks like the second return value from |
|
&scantron_getfile() |
|
$i - line number to update |
|
$newline - contents of the updated scanline |
|
$skip - if true make the line for skipping and update the |
|
'skipped' file |
|
|
=cut |
=cut |
|
|
sub scantron_put_line { |
sub scantron_put_line { |
Line 5680 sub scantron_put_line {
|
Line 5936 sub scantron_put_line {
|
|
|
=item scantron_clear_skip |
=item scantron_clear_skip |
|
|
|
Remove a line from the 'skipped' file |
|
|
|
Arguments: |
|
$scanlines - hash ref that looks like the first return value from |
|
&scantron_getfile() |
|
$scan_data - hash ref that looks like the second return value from |
|
&scantron_getfile() |
|
$i - line number to update |
|
|
=cut |
=cut |
|
|
sub scantron_clear_skip { |
sub scantron_clear_skip { |
Line 5695 sub scantron_clear_skip {
|
Line 5960 sub scantron_clear_skip {
|
|
|
=item scantron_filter_not_exam |
=item scantron_filter_not_exam |
|
|
|
Filter routine used by &Apache::lonnavmaps::retrieveResources(), to |
|
filter out resources that are not marked as 'exam' mode |
|
|
=cut |
=cut |
|
|
sub scantron_filter_not_exam { |
sub scantron_filter_not_exam { |
Line 5717 sub scantron_filter_not_exam {
|
Line 5985 sub scantron_filter_not_exam {
|
|
|
=item scantron_validate_sequence |
=item scantron_validate_sequence |
|
|
|
Validates the selected sequence, checking for resource that are |
|
not set to exam mode. |
|
|
=cut |
=cut |
|
|
sub scantron_validate_sequence { |
sub scantron_validate_sequence { |
Line 5746 sub scantron_validate_sequence {
|
Line 6017 sub scantron_validate_sequence {
|
|
|
=item scantron_validate_ID |
=item scantron_validate_ID |
|
|
|
Validates all scanlines in the selected file to not have any |
|
invalid or underspecified student IDs |
|
|
=cut |
=cut |
|
|
sub scantron_validate_ID { |
sub scantron_validate_ID { |
Line 5814 sub scantron_validate_ID {
|
Line 6088 sub scantron_validate_ID {
|
|
|
=item scantron_get_correction |
=item scantron_get_correction |
|
|
|
Builds the interface screen to interact with the operator to fix a |
|
specific error condition in a specific scanline |
|
|
|
Arguments: |
|
$r - Apache request object |
|
$i - number of the current scanline |
|
$scan_record - hash ref as returned from &scantron_parse_scanline() |
|
$scan_config - hash ref as returned from &get_scantron_config() |
|
$line - full contents of the current scanline |
|
$error - error condition, valid values are |
|
'incorrectCODE', 'duplicateCODE', |
|
'doublebubble', 'missingbubble', |
|
'duplicateID', 'incorrectID' |
|
$arg - extra information needed |
|
For errors: |
|
- duplicateID - paper number that this studentID was seen before on |
|
- duplicateCODE - array ref of the paper numbers this CODE was |
|
seen on before |
|
- incorrectCODE - current incorrect CODE |
|
- doublebubble - array ref of the bubble lines that have double |
|
bubble errors |
|
- missingbubble - array ref of the bubble lines that have missing |
|
bubble errors |
|
|
=cut |
=cut |
|
|
sub scantron_get_correction { |
sub scantron_get_correction { |
Line 5945 ENDSCRIPT
|
Line 6243 ENDSCRIPT
|
=item scantron_bubble_selector |
=item scantron_bubble_selector |
|
|
Generates the html radiobuttons to correct a single bubble line |
Generates the html radiobuttons to correct a single bubble line |
possibly showing the exisiting the selected bubbles if known |
possibly showing the existing the selected bubbles if known |
|
|
Arguments: |
Arguments: |
$r - Apache request object |
$r - Apache request object |
Line 6021 sub scantron_bubble_selector {
|
Line 6319 sub scantron_bubble_selector {
|
|
|
=item num_matches |
=item num_matches |
|
|
|
Counts the number of characters that are the same between the two arguments. |
|
|
|
Arguments: |
|
$orig - CODE from the scanline |
|
$code - CODE to match against |
|
|
|
Returns: |
|
$count - integer count of the number of same characters between the |
|
two arguments |
|
|
=cut |
=cut |
|
|
sub num_matches { |
sub num_matches { |
Line 6038 sub num_matches {
|
Line 6346 sub num_matches {
|
|
|
=item scantron_get_closely_matching_CODEs |
=item scantron_get_closely_matching_CODEs |
|
|
|
Cycles through all CODEs and finds the set that has the greatest |
|
number of same characters as the provided CODE |
|
|
|
Arguments: |
|
$allcodes - hash ref returned by &get_codes() |
|
$CODE - CODE from the current scanline |
|
|
|
Returns: |
|
2 element list |
|
- first elements is number of how closely matching the best fit is |
|
(5 means best set has 5 matching characters) |
|
- second element is an arrary ref containing the set of valid CODEs |
|
that best fit the passed in CODE |
|
|
=cut |
=cut |
|
|
sub scantron_get_closely_matching_CODEs { |
sub scantron_get_closely_matching_CODEs { |
Line 6054 sub scantron_get_closely_matching_CODEs
|
Line 6376 sub scantron_get_closely_matching_CODEs
|
|
|
=item get_codes |
=item get_codes |
|
|
|
Builds a hash which has keys of all of the valid CODEs from the selected |
|
set of remembered CODEs. |
|
|
|
Arguments: |
|
$old_name - name of the set of remembered CODEs |
|
$cdom - domain of the course |
|
$cnum - internal course name |
|
|
|
Returns: |
|
%allcodes - keys are the valid CODEs, values are all 1 |
|
|
=cut |
=cut |
|
|
sub get_codes { |
sub get_codes { |
Line 6082 sub get_codes {
|
Line 6415 sub get_codes {
|
|
|
=item scantron_validate_CODE |
=item scantron_validate_CODE |
|
|
|
Validates all scanlines in the selected file to not have any |
|
invalid or underspecified CODEs and that none of the codes are |
|
duplicated if this was requested. |
|
|
=cut |
=cut |
|
|
sub scantron_validate_CODE { |
sub scantron_validate_CODE { |
Line 6139 sub scantron_validate_CODE {
|
Line 6476 sub scantron_validate_CODE {
|
|
|
=item scantron_validate_doublebubble |
=item scantron_validate_doublebubble |
|
|
|
Validates all scanlines in the selected file to not have any |
|
bubble lines with multiple bubbles marked. |
|
|
=cut |
=cut |
|
|
sub scantron_validate_doublebubble { |
sub scantron_validate_doublebubble { |
Line 6168 sub scantron_validate_doublebubble {
|
Line 6508 sub scantron_validate_doublebubble {
|
|
|
=item scantron_get_maxbubble |
=item scantron_get_maxbubble |
|
|
|
Returns the maximum number of bubble lines that are expected to |
|
occur. Does this by walking the selected sequence rendering the |
|
resource and then checking &Apache::lonxml::get_problem_counter() |
|
for what the current value of the problem counter is. |
|
|
|
Caches the result to $env{'form.scantron_maxbubble'} |
|
|
=cut |
=cut |
|
|
sub scantron_get_maxbubble { |
sub scantron_get_maxbubble { |
|
|
if (defined($env{'form.scantron_maxbubble'}) && |
if (defined($env{'form.scantron_maxbubble'}) && |
$env{'form.scantron_maxbubble'}) { |
$env{'form.scantron_maxbubble'}) { |
return $env{'form.scantron_maxbubble'}; |
return $env{'form.scantron_maxbubble'}; |
Line 6185 sub scantron_get_maxbubble {
|
Line 6533 sub scantron_get_maxbubble {
|
|
|
&Apache::lonxml::clear_problem_counter(); |
&Apache::lonxml::clear_problem_counter(); |
|
|
|
my $uname = $env{'form.student'}; |
|
my $udom = $env{'form.userdom'}; |
|
my $cid = $env{'request.course.id'}; |
|
my $total_lines = 0; |
|
%bubble_lines_per_response = (); |
|
|
foreach my $resource (@resources) { |
foreach my $resource (@resources) { |
|
my $symb = $resource->symb(); |
my $result=&Apache::lonnet::ssi($resource->src(), |
my $result=&Apache::lonnet::ssi($resource->src(), |
('symb' => $resource->symb())); |
('symb' => $resource->symb()), |
|
('grade_target' => 'analyze'), |
|
('grade_courseid' => $cid), |
|
('grade_domain' => $udom), |
|
('grade_username' => $uname)); |
|
my (undef, $an) = |
|
split(/_HASH_REF__/,$result, 2); |
|
|
|
my %analysis = &Apache::lonnet::str2hash($an); |
|
|
|
|
|
|
|
foreach my $part_id (@{$analysis{'parts'}}) { |
|
my $bubble_lines = $analysis{"$part_id.bubble_lines"}[0]; |
|
if (!$bubble_lines) { |
|
$bubble_lines = 1; |
|
} |
|
$bubble_lines_per_response{"$symb.$part_id"} = $bubble_lines; |
|
$total_lines = $total_lines + $bubble_lines; |
|
} |
|
|
} |
} |
&Apache::lonnet::delenv('scantron\.'); |
&Apache::lonnet::delenv('scantron\.'); |
$env{'form.scantron_maxbubble'} = |
$env{'form.scantron_maxbubble'} = |
&Apache::lonxml::get_problem_counter()-1; |
$total_lines; |
|
|
return $env{'form.scantron_maxbubble'}; |
return $env{'form.scantron_maxbubble'}; |
} |
} |
|
|
Line 6200 sub scantron_get_maxbubble {
|
Line 6574 sub scantron_get_maxbubble {
|
|
|
=item scantron_validate_missingbubbles |
=item scantron_validate_missingbubbles |
|
|
|
Validates all scanlines in the selected file to not have any |
|
bubble lines with missing bubbles that haven't been verified as missing. |
|
|
=cut |
=cut |
|
|
sub scantron_validate_missingbubbles { |
sub scantron_validate_missingbubbles { |
Line 6474 sub scantron_upload_scantron_data_save {
|
Line 6851 sub scantron_upload_scantron_data_save {
|
|
|
=item valid_file |
=item valid_file |
|
|
Vaildates that the requested bubble data file has exists in the course. |
Validates that the requested bubble data file exists in the course. |
|
|
=cut |
=cut |
|
|
Line 6568 sub savedState {
|
Line 6945 sub savedState {
|
return \%savedState; |
return \%savedState; |
} |
} |
|
|
#--- Displays the main menu page ------- |
sub grading_menu { |
sub gradingmenu { |
my ($request) = @_; |
|
my ($symb)=&get_symb($request); |
|
if (!$symb) {return '';} |
|
my $probTitle = &Apache::lonnet::gettitle($symb); |
|
my ($table,undef,$hdgrade) = &showResourceInfo($symb,$probTitle); |
|
|
|
# |
|
# Define menu data |
|
$env{'form.probTitle'} = &Apache::lonnet::gettitle($symb); |
|
my ($table) = &showResourceInfo($symb,$env{'form.probTitle'}); |
|
$request->print($table); |
|
my %fields = ('symb'=>&Apache::lonenc::check_encrypt($symb), |
|
'handgrade'=>$hdgrade, |
|
'probTitle'=>$probTitle, |
|
'command'=>'submit_options', |
|
'saveState'=>"", |
|
'gradingMenu'=>1, |
|
'showgrading'=>"yes"); |
|
my $url = &Apache::lonhtmlcommon::build_url('grades/',\%fields); |
|
my @menu = ({ url => $url, |
|
name => &mt('Manual Grading/View Submissions'), |
|
short_description => |
|
&mt('Start the process of hand grading submissions.'), |
|
}); |
|
$fields{'command'} = 'csvform'; |
|
$url = &Apache::lonhtmlcommon::build_url('grades/',\%fields); |
|
push (@menu, { url => $url, |
|
name => &mt('Upload Scores'), |
|
short_description => |
|
&mt('Specify a file containing the class scores for current resource.')}); |
|
$fields{'command'} = 'processclicker'; |
|
$url = &Apache::lonhtmlcommon::build_url('grades/',\%fields); |
|
push (@menu, { url => $url, |
|
name => &mt('Process Clicker'), |
|
short_description => |
|
&mt('Specify a file containing the clicker information for this resource.')}); |
|
$fields{'command'} = 'scantron_selectphase'; |
|
$url = &Apache::lonhtmlcommon::build_url('grades/',\%fields); |
|
push (@menu, { url => $url, |
|
name => &mt('Grade Scantron Forms'), |
|
short_description => |
|
&mt('')}); |
|
$fields{'command'} = 'verify'; |
|
$url = &Apache::lonhtmlcommon::build_url('grades/',\%fields); |
|
push (@menu, { url => "", |
|
jscript => ' onClick="javascript:checkChoice2(document.forms.gradingMenu,\'5\',\'verify\')" ', |
|
name => &mt('Verify Receipt'), |
|
short_description => |
|
&mt('')}); |
|
$fields{'command'} = 'manage'; |
|
$url = &Apache::lonhtmlcommon::build_url('/adm/helper/resettimes.helper',\%fields); |
|
push (@menu, { url => $url, |
|
name => &mt('Manage Access Times'), |
|
short_description => |
|
&mt('')}); |
|
$fields{'command'} = 'view'; |
|
$url = &Apache::lonhtmlcommon::build_url('/adm/pickcode',\%fields); |
|
push (@menu, { url => $url, |
|
name => &mt('View Saved CODEs'), |
|
short_description => |
|
&mt('')}); |
|
|
|
# |
|
# Create the menu |
|
my $Str; |
|
# $Str .= '<h2>'.&mt('Please select a grading task').'</h2>'; |
|
$Str .= '<form method="post" action="" name="gradingMenu">'; |
|
$Str .= '<input type="hidden" name="command" value="" />'. |
|
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
|
'<input type="hidden" name="handgrade" value="'.$hdgrade.'" />'."\n". |
|
'<input type="hidden" name="probTitle" value="'.$probTitle.'" ue="" />'."\n". |
|
'<input type="hidden" name="saveState" value="" />'."\n". |
|
'<input type="hidden" name="gradingMenu" value="1" />'."\n". |
|
'<input type="hidden" name="showgrading" value="yes" />'."\n"; |
|
|
|
foreach my $menudata (@menu) { |
|
if ($menudata->{'name'} ne &mt('Verify Receipt')) { |
|
$Str .=' <h3><a '. |
|
$menudata->{'jscript'}. |
|
' href="'. |
|
$menudata->{'url'}.'" >'. |
|
$menudata->{'name'}."</a></h3>\n"; |
|
} else { |
|
$Str .=' <h3><a '. |
|
$menudata->{'jscript'}. |
|
' nohref="nohref" >'. |
|
$menudata->{'name'}."</a></h3>\n"; |
|
$Str .= ' receipt: '.&Apache::lonnet::recprefix($env{'request.course.id'}). |
|
'-<input type="text" name="receipt" size="4" onChange="javascript:checkReceiptNo(this.form,\'OK\')" />'; |
|
} |
|
$Str .= ' '.(' 'x8).$menudata->{'short_description'}. |
|
"\n"; |
|
} |
|
$Str .="</dl>\n"; |
|
$Str .="</form>\n"; |
|
$request->print(<<GRADINGMENUJS); |
|
<script type="text/javascript" language="javascript"> |
|
function checkChoice(formname,val,cmdx) { |
|
if (val <= 2) { |
|
var cmd = radioSelection(formname.radioChoice); |
|
var cmdsave = cmd; |
|
} else { |
|
cmd = cmdx; |
|
cmdsave = 'submission'; |
|
} |
|
formname.command.value = cmd; |
|
formname.saveState.value = "saveCmd="+cmdsave+":saveSec="+pullDownSelection(formname.section)+ |
|
":saveSub="+pullDownSelection(formname.submitonly)+":saveStatus="+pullDownSelection(formname.Status); |
|
if (val < 5) formname.submit(); |
|
if (val == 5) { |
|
if (!checkReceiptNo(formname,'notOK')) { return false;} |
|
formname.submit(); |
|
} |
|
if (val < 7) formname.submit(); |
|
} |
|
function checkChoice2(formname,val,cmdx) { |
|
if (val <= 2) { |
|
var cmd = radioSelection(formname.radioChoice); |
|
var cmdsave = cmd; |
|
} else { |
|
cmd = cmdx; |
|
cmdsave = 'submission'; |
|
} |
|
formname.command.value = cmd; |
|
if (val < 5) formname.submit(); |
|
if (val == 5) { |
|
if (!checkReceiptNo(formname,'notOK')) { return false;} |
|
formname.submit(); |
|
} |
|
if (val < 7) formname.submit(); |
|
} |
|
|
|
function checkReceiptNo(formname,nospace) { |
|
var receiptNo = formname.receipt.value; |
|
var checkOpt = false; |
|
if (nospace == "OK" && isNaN(receiptNo)) {checkOpt = true;} |
|
if (nospace == "notOK" && (isNaN(receiptNo) || receiptNo == "")) {checkOpt = true;} |
|
if (checkOpt) { |
|
alert("Please enter a receipt number given by a student in the receipt box."); |
|
formname.receipt.value = ""; |
|
formname.receipt.focus(); |
|
return false; |
|
} |
|
return true; |
|
} |
|
</script> |
|
GRADINGMENUJS |
|
&commonJSfunctions($request); |
|
my $result='<h3> <span class="LC_info">Manual Grading/View Submission</span></h3>'; |
|
$result.=$table; |
|
my (undef,$sections) = &getclasslist('all','0'); |
|
my $savedState = &savedState(); |
|
my $saveCmd = ($$savedState{'saveCmd'} eq '' ? 'submission' : $$savedState{'saveCmd'}); |
|
my $saveSec = ($$savedState{'saveSec'} eq '' ? 'all' : $$savedState{'saveSec'}); |
|
my $saveSub = ($$savedState{'saveSub'} eq '' ? 'all' : $$savedState{'saveSub'}); |
|
my $saveStatus = ($$savedState{'saveStatus'} eq '' ? 'Active' : $$savedState{'saveStatus'}); |
|
|
|
$result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n". |
|
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
|
'<input type="hidden" name="handgrade" value="'.$hdgrade.'" />'."\n". |
|
'<input type="hidden" name="probTitle" value="'.$probTitle.'" ue="" />'."\n". |
|
'<input type="hidden" name="saveState" value="" />'."\n". |
|
'<input type="hidden" name="gradingMenu" value="1" />'."\n". |
|
'<input type="hidden" name="showgrading" value="yes" />'."\n"; |
|
|
|
$result.='<table width="100%" border="0"><tr><td bgcolor=#777777>'."\n". |
|
'<table width="100%" border="0"><tr bgcolor="#e6ffff"><td colspan="2">'."\n". |
|
' <b>Select a Grading/Viewing Option</b></td></tr>'."\n". |
|
'<tr bgcolor="#ffffe6" valign="top"><td>'."\n"; |
|
|
|
$result.='<table width="100%" border="0">'; |
|
$result.='<tr bgcolor="#ffffe6" valign="top">'."\n"; |
|
$result.='<td><b>'.&mt('Sections').'</b></td>'; |
|
# $result.='<td>Groups</td>'; |
|
$result.='<td><b>'.&mt('Access Status').'</td>'."\n"; |
|
$result.='</tr>'; |
|
$result.='<tr bgcolor="#ffffe6" valign="top"><td>'."\n". |
|
' <select name="section" multiple="multiple" size="3">'."\n"; |
|
if (ref($sections)) { |
|
foreach (sort (@$sections)) { |
|
$result.='<option value="'.$_.'" '. |
|
($saveSec eq $_ ? 'selected="selected"':'').'>'.$_.'</option>'."\n"; |
|
} |
|
} |
|
$result.= '<option value="all" '.($saveSec eq 'all' ? 'selected="selected"' : ''). '>all</option></select> '; |
|
return $Str; |
|
} |
|
|
|
|
|
#--- Displays the submissions first page ------- |
|
sub submit_options { |
my ($request) = @_; |
my ($request) = @_; |
my ($symb)=&get_symb($request); |
my ($symb)=&get_symb($request); |
if (!$symb) {return '';} |
if (!$symb) {return '';} |
Line 6637 GRADINGMENUJS
|
Line 7204 GRADINGMENUJS
|
'<tr bgcolor="#ffffe6" valign="top"><td>'."\n"; |
'<tr bgcolor="#ffffe6" valign="top"><td>'."\n"; |
|
|
$result.='<table width="100%" border="0">'; |
$result.='<table width="100%" border="0">'; |
|
$result.='<tr bgcolor="#ffffe6" valign="top">'."\n"; |
|
$result.='<td><b>'.&mt('Sections').'</b></td>'; |
|
# $result.='<td>Groups</td>'; |
|
$result.='<td><b>'.&mt('Access Status').'</td>'."\n"; |
|
$result.='</tr>'; |
$result.='<tr bgcolor="#ffffe6" valign="top"><td>'."\n". |
$result.='<tr bgcolor="#ffffe6" valign="top"><td>'."\n". |
' '.&mt('Select Section').': <select name="section">'."\n"; |
' <select name="section" multiple="multiple" size="3">'."\n"; |
if (ref($sections)) { |
if (ref($sections)) { |
foreach (sort (@$sections)) { |
foreach (sort (@$sections)) { |
$result.='<option value="'.$_.'" '. |
$result.='<option value="'.$_.'" '. |
Line 6646 GRADINGMENUJS
|
Line 7218 GRADINGMENUJS
|
} |
} |
} |
} |
$result.= '<option value="all" '.($saveSec eq 'all' ? 'selected="selected"' : ''). '>all</option></select> '; |
$result.= '<option value="all" '.($saveSec eq 'all' ? 'selected="selected"' : ''). '>all</option></select> '; |
|
# $result.= '</td><td>'."\n"; |
$result.=&mt('Student Status').':'.&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,1,undef); |
# $result.='Put group select here'."\n"; |
|
$result.='</td><td>'."\n"; |
|
$result.=&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,3,undef,'mult'); |
|
|
$result.='</td></tr>'; |
$result.='</td></tr>'; |
|
|
$result.='<tr bgcolor="#ffffe6"valign="top"><td><label>'. |
$result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="3"><label>'. |
'<input type="radio" name="radioChoice" value="submission" '. |
'<input type="radio" name="radioChoice" value="submission" '. |
($saveCmd eq 'submission' ? 'checked="checked"' : '').' /> '.'<b>'.&mt('Current Resource').':</b> '.&mt('For one or more students'). |
($saveCmd eq 'submission' ? 'checked="checked"' : '').' /> '.'<b>'.&mt('Current Resource').':</b> '.&mt('For one or more students'). |
'</label> <select name="submitonly">'. |
'</label> <select name="submitonly">'. |
Line 6666 GRADINGMENUJS
|
Line 7240 GRADINGMENUJS
|
'<option value="all" '. |
'<option value="all" '. |
($saveSub eq 'all' ? 'selected="selected"' : '').'>'.&mt('with any status').'</option></select></td></tr>'."\n"; |
($saveSub eq 'all' ? 'selected="selected"' : '').'>'.&mt('with any status').'</option></select></td></tr>'."\n"; |
|
|
$result.='<tr bgcolor="#ffffe6"valign="top"><td>'. |
$result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="2">'. |
'<label><input type="radio" name="radioChoice" value="viewgrades" '. |
'<label><input type="radio" name="radioChoice" value="viewgrades" '. |
($saveCmd eq 'viewgrades' ? 'checked="checked"' : '').' /> '. |
($saveCmd eq 'viewgrades' ? 'checked="checked"' : '').' /> '. |
'<b>Current Resource:</b> For all students in selected section or course</label></td></tr>'."\n"; |
'<b>Current Resource:</b> For all students in selected section or course</label></td></tr>'."\n"; |
|
|
$result.='<tr bgcolor="#ffffe6" valign="top"><td>'. |
$result.='<tr bgcolor="#ffffe6" valign="top"><td colspan="2">'. |
'<label><input type="radio" name="radioChoice" value="pickStudentPage" '. |
'<label><input type="radio" name="radioChoice" value="pickStudentPage" '. |
($saveCmd eq 'pickStudentPage' ? 'checked="checked"' : '').' /> '. |
($saveCmd eq 'pickStudentPage' ? 'checked="checked"' : '').' /> '. |
'The <b>complete</b> set/page/sequence: For one student</label></td></tr>'."\n"; |
'The <b>complete</b> set/page/sequence: For one student</label></td></tr>'."\n"; |
|
|
$result.='<tr bgcolor="#ffffe6"><td><br />'. |
$result.='<tr bgcolor="#ffffe6"><td colspan="2"><br />'. |
'<input type="button" onClick="javascript:checkChoice(this.form,\'2\');" value="Next->" />'. |
'<input type="button" onClick="javascript:checkChoice(this.form,\'2\');" value="Next->" />'. |
'</td></tr></table>'."\n"; |
'</td></tr></table>'."\n"; |
|
|
Line 6746 sub gather_clicker_ids {
|
Line 7320 sub gather_clicker_ids {
|
# Set up a couple variables. |
# Set up a couple variables. |
my $username_idx = &Apache::loncoursedata::CL_SNAME(); |
my $username_idx = &Apache::loncoursedata::CL_SNAME(); |
my $domain_idx = &Apache::loncoursedata::CL_SDOM(); |
my $domain_idx = &Apache::loncoursedata::CL_SDOM(); |
|
my $status_idx = &Apache::loncoursedata::CL_STATUS(); |
|
|
foreach my $student (keys(%$classlist)) { |
foreach my $student (keys(%$classlist)) { |
|
if ($classlist->{$student}->[$status_idx] ne 'Active') { next; } |
my $username = $classlist->{$student}->[$username_idx]; |
my $username = $classlist->{$student}->[$username_idx]; |
my $domain = $classlist->{$student}->[$domain_idx]; |
my $domain = $classlist->{$student}->[$domain_idx]; |
my $clickers = |
my $clickers = |
Line 6990 ENDHEADER
|
Line 7565 ENDHEADER
|
} |
} |
$result.='<br />'.&mt('Found [_1] question(s)',$number).'<br />'. |
$result.='<br />'.&mt('Found [_1] question(s)',$number).'<br />'. |
'<input type="hidden" name="number" value="'.$number.'" />'. |
'<input type="hidden" name="number" value="'.$number.'" />'. |
|
&mt('Awarding [_1] percent for corrion(s)',$number).'<br />'. |
|
'<input type="hidden" name="number" value="'.$number.'" />'. |
&mt('Awarding [_1] percent for correct and [_2] percent for incorrect responses', |
&mt('Awarding [_1] percent for correct and [_2] percent for incorrect responses', |
$env{'form.pcorrect'},$env{'form.pincorrect'}). |
$env{'form.pcorrect'},$env{'form.pincorrect'}). |
'<br />'; |
'<br />'; |
Line 7009 ENDHEADER
|
Line 7586 ENDHEADER
|
$result.="\n".'<input type="hidden" name="correct:'.$correct_count.':'.$correct_ids{$id}.'" value="'.$responses{$id}.'" />'; |
$result.="\n".'<input type="hidden" name="correct:'.$correct_count.':'.$correct_ids{$id}.'" value="'.$responses{$id}.'" />'; |
$correct_count++; |
$correct_count++; |
} elsif ($clicker_ids{$id}) { |
} elsif ($clicker_ids{$id}) { |
$result.="\n".'<input type="hidden" name="student:'.$clicker_ids{$id}.'" value="'.$responses{$id}.'" />'; |
if ($clicker_ids{$id}=~/\,/) { |
$student_count++; |
# More than one user with the same clicker! |
|
$result.="\n<hr />".&mt('Clicker registered more than once').": <tt>".$id."</tt><br />"; |
|
$result.="\n".'<input type="hidden" name="unknown:'.$id.'" value="'.$responses{$id}.'" />'. |
|
"<select name='multi".$id."'>"; |
|
foreach my $reguser (sort(split(/\,/,$clicker_ids{$id}))) { |
|
$result.="<option value='".$reguser."'>".&Apache::loncommon::plainname(split(/\:/,$reguser)).' ('.$reguser.')</option>'; |
|
} |
|
$result.='</select>'; |
|
$unknown_count++; |
|
} else { |
|
# Good: found one and only one user with the right clicker |
|
$result.="\n".'<input type="hidden" name="student:'.$clicker_ids{$id}.'" value="'.$responses{$id}.'" />'; |
|
$student_count++; |
|
} |
} else { |
} else { |
$result.="\n<hr />".&mt('Unregistered Clicker')." <tt>".$id."</tt><br />"; |
$result.="\n<hr />".&mt('Unregistered Clicker')." <tt>".$id."</tt><br />"; |
$result.="\n".'<input type="hidden" name="unknown:'.$id.'" value="'.$responses{$id}.'" />'. |
$result.="\n".'<input type="hidden" name="unknown:'.$id.'" value="'.$responses{$id}.'" />'. |
Line 7030 ENDHEADER
|
Line 7620 ENDHEADER
|
$result.='<br /><span class="LC_warning">'.&mt("Found [_1] entries for grading!",$correct_count).'</span>'; |
$result.='<br /><span class="LC_warning">'.&mt("Found [_1] entries for grading!",$correct_count).'</span>'; |
} |
} |
} |
} |
|
if ($number<1) { |
|
$errormsg.="Found no questions."; |
|
} |
if ($errormsg) { |
if ($errormsg) { |
$result.='<br /><span class="LC_error">'.&mt($errormsg).'</span>'; |
$result.='<br /><span class="LC_error">'.&mt($errormsg).'</span>'; |
} else { |
} else { |
Line 7158 ENDHEADER
|
Line 7751 ENDHEADER
|
my $id=$1; |
my $id=$1; |
if (($env{'form.uname'.$id}) && ($env{'form.udom'.$id})) { |
if (($env{'form.uname'.$id}) && ($env{'form.udom'.$id})) { |
$user=$env{'form.uname'.$id}.':'.$env{'form.udom'.$id}; |
$user=$env{'form.uname'.$id}.':'.$env{'form.udom'.$id}; |
|
} elsif ($env{'form.multi'.$id}) { |
|
$user=$env{'form.multi'.$id}; |
} |
} |
} |
} |
if ($user) { |
if ($user) { |
Line 7203 ENDHEADER
|
Line 7798 ENDHEADER
|
sub handler { |
sub handler { |
my $request=$_[0]; |
my $request=$_[0]; |
|
|
&reset_perm(); |
&reset_caches(); |
if ($env{'browser.mathml'}) { |
if ($env{'browser.mathml'}) { |
&Apache::loncommon::content_type($request,'text/xml'); |
&Apache::loncommon::content_type($request,'text/xml'); |
} else { |
} else { |
Line 7212 sub handler {
|
Line 7807 sub handler {
|
$request->send_http_header; |
$request->send_http_header; |
return '' if $request->header_only; |
return '' if $request->header_only; |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}); |
|
&Apache::lonnet::logthis("receipt is ".$env{'form.receipt'}); |
my $symb=&get_symb($request,1); |
my $symb=&get_symb($request,1); |
my @commands=&Apache::loncommon::get_env_multiple('form.command'); |
my @commands=&Apache::loncommon::get_env_multiple('form.command'); |
my $command=$commands[0]; |
my $command=$commands[0]; |
Line 7258 sub handler {
|
Line 7854 sub handler {
|
} elsif ($command eq 'processGroup' && $perm{'vgr'}) { |
} elsif ($command eq 'processGroup' && $perm{'vgr'}) { |
&processGroup($request); |
&processGroup($request); |
} elsif ($command eq 'gradingmenu' && $perm{'vgr'}) { |
} elsif ($command eq 'gradingmenu' && $perm{'vgr'}) { |
$request->print(&gradingmenu($request)); |
$request->print(&grading_menu($request)); |
|
} elsif ($command eq 'submit_options' && $perm{'vgr'}) { |
|
$request->print(&submit_options($request)); |
} elsif ($command eq 'viewgrades' && $perm{'vgr'}) { |
} elsif ($command eq 'viewgrades' && $perm{'vgr'}) { |
$request->print(&viewgrades($request)); |
$request->print(&viewgrades($request)); |
} elsif ($command eq 'handgrade' && $perm{'mgr'}) { |
} elsif ($command eq 'handgrade' && $perm{'mgr'}) { |
Line 7316 sub handler {
|
Line 7914 sub handler {
|
} |
} |
} |
} |
$request->print(&Apache::loncommon::end_page()); |
$request->print(&Apache::loncommon::end_page()); |
|
&reset_caches(); |
return ''; |
return ''; |
} |
} |
|
|