version 1.79, 2003/03/28 18:15:24
|
version 1.80, 2003/03/28 20:49:55
|
Line 343 LISTJAVASCRIPT
|
Line 343 LISTJAVASCRIPT
|
my $checklastsub = $ENV{'form.handgrade'} eq 'yes' ? '' : 'checked'; |
my $checklastsub = $ENV{'form.handgrade'} eq 'yes' ? '' : 'checked'; |
|
|
my $gradeTable='<form action="/adm/grades" method="post" name="gradesub">'."\n". |
my $gradeTable='<form action="/adm/grades" method="post" name="gradesub">'."\n". |
' <b>View Problem: </b><input type="radio" name="vProb" value="no" /> no '."\n". |
' <b>View Problem: </b><input type="radio" name="vProb" value="no" checked /> no '."\n". |
'<input type="radio" name="vProb" value="yes" checked /> one student '."\n". |
'<input type="radio" name="vProb" value="yes" /> one student '."\n". |
'<input type="radio" name="vProb" value="all" /> all students <br />'."\n". |
'<input type="radio" name="vProb" value="all" /> all students <br />'."\n". |
' <b>Submissions: </b>'."\n"; |
' <b>Submissions: </b>'."\n"; |
if ($ENV{'form.handgrade'} eq 'yes') { |
if ($ENV{'form.handgrade'} eq 'yes') { |
Line 628 SUBJAVASCRIPT
|
Line 628 SUBJAVASCRIPT
|
#--- javascript for essay type problem -- |
#--- javascript for essay type problem -- |
sub sub_page_kw_js { |
sub sub_page_kw_js { |
my $request = shift; |
my $request = shift; |
|
my $iconpath = $request->dir_config('lonIconsURL'); |
$request->print(<<SUBJAVASCRIPT); |
$request->print(<<SUBJAVASCRIPT); |
<script type="text/javascript" language="javascript"> |
<script type="text/javascript" language="javascript"> |
|
|
Line 675 sub sub_page_kw_js {
|
Line 676 sub sub_page_kw_js {
|
} |
} |
|
|
//====================== Script for composing message ============== |
//====================== Script for composing message ============== |
|
// preload images |
|
img1 = new Image(); |
|
img1.src = "$iconpath/mailbkgrd.gif"; |
|
img2 = new Image(); |
|
img2.src = "$iconpath/mailto.gif"; |
|
|
function msgCenter(msgform,usrctr,fullname) { |
function msgCenter(msgform,usrctr,fullname) { |
var Nmsg = msgform.savemsgN.value; |
var Nmsg = msgform.savemsgN.value; |
savedMsgHeader(Nmsg,usrctr,fullname); |
savedMsgHeader(Nmsg,usrctr,fullname); |
Line 729 sub sub_page_kw_js {
|
Line 736 sub sub_page_kw_js {
|
pDoc.write(" if (document.msgcenter.subchk.checked) {"); |
pDoc.write(" if (document.msgcenter.subchk.checked) {"); |
pDoc.write(" msgchk = \\"msgsub,\\";"); |
pDoc.write(" msgchk = \\"msgsub,\\";"); |
pDoc.write(" }"); |
pDoc.write(" }"); |
pDoc.write( "for (var i=1; i<=nmsg; i++) {"); |
pDoc.write(" var includemsg = 0;"); |
|
pDoc.write(" for (var i=1; i<=nmsg; i++) {"); |
pDoc.write(" var opnmsg = eval(\\"opener.document.SCORE.savemsg\\"+i);"); |
pDoc.write(" var opnmsg = eval(\\"opener.document.SCORE.savemsg\\"+i);"); |
pDoc.write(" var frmmsg = eval(\\"document.msgcenter.msg\\"+i);"); |
pDoc.write(" var frmmsg = eval(\\"document.msgcenter.msg\\"+i);"); |
pDoc.write(" opnmsg.value = frmmsg.value;"); |
pDoc.write(" opnmsg.value = frmmsg.value;"); |
pDoc.write(" var chkbox = eval(\\"document.msgcenter.msgn\\"+i);"); |
pDoc.write(" var chkbox = eval(\\"document.msgcenter.msgn\\"+i);"); |
pDoc.write(" if (chkbox.checked) {"); |
pDoc.write(" if (chkbox.checked) {"); |
pDoc.write(" msgchk += \\"savemsg\\"+i+\\",\\";"); |
pDoc.write(" msgchk += \\"savemsg\\"+i+\\",\\";"); |
|
pDoc.write(" includemsg = 1;"); |
pDoc.write(" }"); |
pDoc.write(" }"); |
pDoc.write(" }"); |
pDoc.write(" }"); |
pDoc.write(" if (document.msgcenter.newmsgchk.checked) {"); |
pDoc.write(" if (document.msgcenter.newmsgchk.checked) {"); |
pDoc.write(" msgchk += \\"newmsg\\"+usrctr;"); |
pDoc.write(" msgchk += \\"newmsg\\"+usrctr;"); |
|
pDoc.write(" includemsg = 1;"); |
|
pDoc.write(" }"); |
|
pDoc.write(" imgformname = eval(\\"opener.document.SCORE.mailicon\\"+usrctr);"); |
|
pDoc.write(" if (includemsg) {"); |
|
pDoc.write(" imgformname.src = \\"$iconpath/mailto.gif\\";"); |
|
pDoc.write(" } else {"); |
|
pDoc.write(" imgformname.src = \\"$iconpath/mailbkgrd.gif\\";"); |
pDoc.write(" }"); |
pDoc.write(" }"); |
pDoc.write(" var includemsg = eval(\\"opener.document.SCORE.includemsg\\"+usrctr);"); |
pDoc.write(" var includemsg = eval(\\"opener.document.SCORE.includemsg\\"+usrctr);"); |
pDoc.write(" includemsg.value = msgchk;"); |
pDoc.write(" includemsg.value = msgchk;"); |
Line 1030 sub submission {
|
Line 1046 sub submission {
|
|
|
$request->print('<form action="/adm/grades" method="post" name="SCORE">'."\n". |
$request->print('<form action="/adm/grades" method="post" name="SCORE">'."\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="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". |
'<input type="hidden" name="symb" value="'.$symb.'" />'."\n". |
'<input type="hidden" name="symb" value="'.$symb.'" />'."\n". |
Line 1054 sub submission {
|
Line 1070 sub submission {
|
my ($cts,$prnmsg) = (1,''); |
my ($cts,$prnmsg) = (1,''); |
while ($cts <= $ENV{'form.savemsgN'}) { |
while ($cts <= $ENV{'form.savemsgN'}) { |
$prnmsg.='<input type="hidden" name="savemsg'.$cts.'" value="'. |
$prnmsg.='<input type="hidden" name="savemsg'.$cts.'" value="'. |
($keyhash{$symb.'_savemsg'.$cts} eq '' ? $ENV{'form.savemsg'.$cts} : $keyhash{$symb.'_savemsg'.$cts}). |
($keyhash{$symb.'_savemsg'.$cts} eq '' ? |
|
&Apache::lonfeedback::clear_out_html($ENV{'form.savemsg'.$cts}) : |
|
&Apache::lonfeedback::clear_out_html($keyhash{$symb.'_savemsg'.$cts})). |
'" />'."\n"; |
'" />'."\n"; |
$cts++; |
$cts++; |
} |
} |
Line 1095 KEYWORDS
|
Line 1113 KEYWORDS
|
my ($classlist,$fullname); |
my ($classlist,$fullname); |
if ($ENV{'form.handgrade'} eq 'yes') { |
if ($ENV{'form.handgrade'} eq 'yes') { |
my @col_list; |
my @col_list; |
($classlist,undef,$fullname) = &getclasslist('all',$ENV{'form.showgrading'} eq 'yes' ? '1' : '0'); |
($classlist,undef,$fullname) = &getclasslist('all','0'); |
for (keys (%$handgrade)) { |
for (keys (%$handgrade)) { |
my $ncol = &Apache::lonnet::EXT('resource.'.$_. |
my $ncol = &Apache::lonnet::EXT('resource.'.$_. |
'.maxcollaborators', |
'.maxcollaborators', |
Line 1103 KEYWORDS
|
Line 1121 KEYWORDS
|
next if ($ncol <= 0); |
next if ($ncol <= 0); |
s/\_/\./g; |
s/\_/\./g; |
next if ($record{'resource.'.$_.'.collaborators'} eq ''); |
next if ($record{'resource.'.$_.'.collaborators'} eq ''); |
my (@collaborators) = split(/,?\s+/, |
my (@colList) = split(/,?\s+/, |
$record{'resource.'.$_.'.collaborators'}); |
$record{'resource.'.$_.'.collaborators'}); |
|
my @collaborators = (); |
|
foreach (@colList) { #pre-filter list - throw out submitter |
|
my ($co_name,$co_dom) = split /\@|:/,$_; |
|
$co_dom = $udom if (! defined($co_dom)); |
|
next if ($co_name eq $uname && $co_dom eq $udom); |
|
push @collaborators, $_; |
|
} |
my (@badcollaborators); |
my (@badcollaborators); |
if (scalar(@collaborators) != 0) { |
if (scalar(@collaborators) != 0) { |
$result.='<b>Collaborators: </b>'; |
$result.='<b>Collaborators: </b>'; |
foreach my $collaborator (@collaborators) { |
foreach my $collaborator (@collaborators) { |
my ($co_name,$co_dom) = split /\@|:/,$collaborator; |
my ($co_name,$co_dom) = split /\@|:/,$collaborator; |
$co_dom = $udom if (! defined($co_dom)); |
$co_dom = $udom if (! defined($co_dom)); |
next if ($co_name eq $uname && $co_dom eq $udom); |
|
# Doing this grep allows 'fuzzy' specification |
# Doing this grep allows 'fuzzy' specification |
my @Matches = grep /^$co_name:$co_dom/i, |
my @Matches = grep /^$co_name:$co_dom$/i, |
keys %$classlist; |
keys %$classlist; |
if (! scalar(@Matches)) { |
if (! scalar(@Matches)) { |
push @badcollaborators,$collaborator; |
push @badcollaborators,':'.$collaborator.':'; |
next; |
next; |
} |
} |
push @col_list, @Matches; |
push @col_list, @Matches; |
Line 1229 KEYWORDS
|
Line 1253 KEYWORDS
|
$result.='<tr><td bgcolor="#ffffff">'."\n". |
$result.='<tr><td bgcolor="#ffffff">'."\n". |
' <a href="javascript:msgCenter(document.SCORE,'.$counter. |
' <a href="javascript:msgCenter(document.SCORE,'.$counter. |
',\''.$msgfor.'\')"; TARGET=_self>'. |
',\''.$msgfor.'\')"; TARGET=_self>'. |
'Compose Message to student'.(scalar(@col_fullnames) >= 1 ? 's' : '').'</a>'. |
'Compose Message to student'.(scalar(@col_fullnames) >= 1 ? 's' : '').'</a> '. |
|
'<img src="'.$request->dir_config('lonIconsURL'). |
|
'/mailbkgrd.gif" width="14" height="10" name="mailicon'.$counter.'" />'."\n". |
'<br /> (Message will be sent when you click on Save & Next below.)'."\n" |
'<br /> (Message will be sent when you click on Save & Next below.)'."\n" |
if ($ENV{'form.handgrade'} eq 'yes'); |
if ($ENV{'form.handgrade'} eq 'yes'); |
$request->print($result); |
$request->print($result); |
Line 1348 sub processHandGrade {
|
Line 1374 sub processHandGrade {
|
$ctr++; |
$ctr++; |
next; |
next; |
} |
} |
|
|
my $includemsg = $ENV{'form.includemsg'.$ctr}; |
my $includemsg = $ENV{'form.includemsg'.$ctr}; |
my ($subject,$message,$msgstatus) = ('','',''); |
my ($subject,$message,$msgstatus) = ('','',''); |
if ($includemsg =~ /savemsg|newmsg\Q$ctr\E/) { |
if ($includemsg =~ /savemsg|newmsg\Q$ctr\E/) { |
Line 1357 sub processHandGrade {
|
Line 1382 sub processHandGrade {
|
foreach (@msgnum) { |
foreach (@msgnum) { |
$message.=$ENV{'form.'.$_} if ($_ =~ /savemsg|newmsg/ && $_ ne ''); |
$message.=$ENV{'form.'.$_} if ($_ =~ /savemsg|newmsg/ && $_ ne ''); |
} |
} |
$message =~ s/<([^>]|\n)*>//g; # removes html codes Or should this be lonnet::escape ?? |
$message =&Apache::lonfeedback::clear_out_html($message); |
$message.="\n\nPoint".($pts > 1 ? 's':'').' awarded = '.$pts.' out of '.$wgt; |
$message.="\n\nPoint".($pts > 1 ? 's':'').' awarded = '.$pts.' out of '.$wgt; |
$message.=" for <a href=\"$url?symb=$symb\">$ENV{'form.probTitle'}</a>"; |
$message.=" for <a href=\"". |
|
&Apache::lonnet::clutter($url). |
|
"?symb=$symb\">$ENV{'form.probTitle'}</a>"; |
$msgstatus = &Apache::lonmsg::user_normal_msg ($uname,$udom, |
$msgstatus = &Apache::lonmsg::user_normal_msg ($uname,$udom, |
$ENV{'form.msgsub'},$message); |
$ENV{'form.msgsub'},$message); |
} |
} |
Line 2343 LISTJAVASCRIPT
|
Line 2370 LISTJAVASCRIPT
|
my $result='<h3><font color="#339933"> '. |
my $result='<h3><font color="#339933"> '. |
'Manual Grading by Page or Sequence</font></h3>'; |
'Manual Grading by Page or Sequence</font></h3>'; |
|
|
$result.='<form action="/adm/grades" method="post" name="displayPage">'."<br>\n"; |
$result.='<form action="/adm/grades" method="post" name="displayPage">'."\n"; |
$result.=' <b>Problems from:</b> <select name="selectpage">'."\n"; |
$result.=' <b>Problems from:</b> <select name="selectpage">'."\n"; |
my ($titles,$symbx) = &getSymbMap($request); |
my ($titles,$symbx) = &getSymbMap($request); |
my ($curpage,$type,$mapId) = ($symb =~ /(.*?\.(page|sequence))___(\d+)___/); |
my ($curpage,$type,$mapId) = ($symb =~ /(.*?\.(page|sequence))___(\d+)___/); |
Line 2377 LISTJAVASCRIPT
|
Line 2404 LISTJAVASCRIPT
|
$result.='<input type="hidden" name="section" value="'.$getsec.'" />'."\n". |
$result.='<input type="hidden" name="section" value="'.$getsec.'" />'."\n". |
'<input type="hidden" name="command" value="displayPage" />'."\n". |
'<input type="hidden" name="command" value="displayPage" />'."\n". |
'<input type="hidden" name="url" value="'.$url.'" />'."\n". |
'<input type="hidden" name="url" value="'.$url.'" />'."\n". |
'<input type="hidden" name="symb" value="'.$symb.'" />'."<br><br>\n". |
'<input type="hidden" name="symb" value="'.$symb.'" />'."\n". |
'<input type="hidden" name="saveState" value="'.$ENV{'form.saveState'}.'" />'."\n"; |
'<input type="hidden" name="saveState" value="'.$ENV{'form.saveState'}.'" />'."<br />\n"; |
|
|
$result.='<br /> <input type="button" '. |
$result.=' <input type="button" '. |
'onClick="javascript:checkPickOne(this.form);"value="Submit" /><br />'."\n"; |
'onClick="javascript:checkPickOne(this.form);"value="Submit" /><br />'."\n"; |
|
|
$request->print($result); |
$request->print($result); |
Line 2540 sub displayPage {
|
Line 2567 sub displayPage {
|
} else { |
} else { |
my $companswer = &Apache::loncommon::get_student_answers( |
my $companswer = &Apache::loncommon::get_student_answers( |
$symbx,$uname,$udom,$ENV{'request.course.id'}); |
$symbx,$uname,$udom,$ENV{'request.course.id'}); |
$companswer=~s|<form(.*?)>||g; |
$companswer =~ s|<form(.*?)>||g; |
$companswer=~s|</form>||g; |
$companswer =~ s|</form>||g; |
|
|
# while ($companswer =~ /(<a href\=\"javascript:newWindow.*?Script Vars<\/a>)/s) { #<a href="javascript:newWindow</a> |
# while ($companswer =~ /(<a href\=\"javascript:newWindow.*?Script Vars<\/a>)/s) { #<a href="javascript:newWindow</a> |
# $request->print('match='.$1.'<br>'); |
# $request->print('match='.$1.'<br>'); |
Line 2574 sub displayPage {
|
Line 2601 sub displayPage {
|
# next if ($record{"$version:resource.$partid.award"} eq 'APPROX_ANS' && |
# next if ($record{"$version:resource.$partid.award"} eq 'APPROX_ANS' && |
# $record{"$version:resource.$partid.solved"} eq ''); |
# $record{"$version:resource.$partid.solved"} eq ''); |
$displaySub[0].=(exists $record{$version.':'.$matchKey[0]}) ? |
$displaySub[0].=(exists $record{$version.':'.$matchKey[0]}) ? |
'<b>Trial '.$version.' Part '.$partid.'</b> ' |
'<b>Part '.$partid.' '. |
.$record{$version.':'.$matchKey[0]}.'<br />' : ''; |
($record{"$version:resource.$partid.tries"} eq '' ? 'Trial not counted' : |
|
'Trial '.$record{"$version:resource.$partid.tries"}).'</b> '. |
|
$record{$version.':'.$matchKey[0]}.'<br />' : ''; |
$displaySub[1].=(exists $record{"$version:resource.$partid.award"}) ? |
$displaySub[1].=(exists $record{"$version:resource.$partid.award"}) ? |
'<b>Part '.$partid.'</b> '. |
'<b>Part '.$partid.'</b> '. |
$record{"$version:resource.$partid.award"}.'/'. |
$record{"$version:resource.$partid.award"}.'/'. |