version 1.593, 2010/02/08 01:09:36
|
version 1.599, 2010/03/19 21:22:34
|
Line 96 sub ssi_print_error {
|
Line 96 sub ssi_print_error {
|
|
|
# |
# |
# --- Retrieve the parts from the metadata file.--- |
# --- Retrieve the parts from the metadata file.--- |
|
# Returns an array of everything that the resources stores away |
|
# |
|
|
sub getpartlist { |
sub getpartlist { |
my ($symb,$errorref) = @_; |
my ($symb,$errorref) = @_; |
|
|
Line 121 sub getpartlist {
|
Line 124 sub getpartlist {
|
} |
} |
|
|
# --- Get the symbolic name of a problem and the url |
# --- Get the symbolic name of a problem and the url |
|
# Generate an error message if symb could not be found unless silent flag is set |
|
# Takes $env{'form.symb'} by default; if not present, takes $env{'form.url'} and tries to get symb from that |
|
# |
|
|
sub get_symb { |
sub get_symb { |
my ($request,$silent) = @_; |
my ($request,$silent) = @_; |
(my $url=$env{'form.url'}) =~ s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--; |
(my $url=$env{'form.url'}) =~ s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--; |
my $symb=($env{'form.symb'} ne '' ? $env{'form.symb'} : (&Apache::lonnet::symbread($url))); |
my $symb=($env{'form.symb'} ne '' ? $env{'form.symb'} : (&Apache::lonnet::symbread($url))); |
if ($symb eq '') { |
if ($symb eq '') { |
if (!$silent) { |
if (!$silent) { |
$request->print("Unable to handle ambiguous references:$url:."); |
$request->print(&mt("Unable to handle ambiguous references: [_1].",$url)); |
return (); |
return (); |
} |
} |
} |
} |
Line 209 sub get_display_part {
|
Line 216 sub get_display_part {
|
|
|
#--- Show resource title |
#--- Show resource title |
#--- and parts and response type |
#--- and parts and response type |
sub showResourceInfo { |
#sub showResourceInfo { |
my ($symb,$probTitle,$checkboxes,$res_error) = @_; |
# my ($symb,$probTitle,$checkboxes,$res_error) = @_; |
my $result = '<h3>'.&mt('Current Resource').': '.$probTitle.'</h3>'."\n"; |
# my $result = '<h3>'.&mt('Current Resource').': '.$probTitle.'</h3>'."\n"; |
my ($partlist,$handgrade,$responseType) = &response_type($symb,$res_error); |
# my ($partlist,$handgrade,$responseType) = &response_type($symb,$res_error); |
if (ref($res_error)) { |
# if (ref($res_error)) { |
if ($$res_error) { |
# if ($$res_error) { |
return; |
# return; |
} |
# } |
} |
# } |
$result.=&Apache::loncommon::start_data_table() |
# $result.=&Apache::loncommon::start_data_table() |
.&Apache::loncommon::start_data_table_header_row(); |
# .&Apache::loncommon::start_data_table_header_row(); |
if ($checkboxes) { |
# if ($checkboxes) { |
$result.='<th> </th>'; |
# $result.='<th> </th>'; |
} |
# } |
$result.='<th>'.&mt('Problem Part').'</th>' |
# $result.='<th>'.&mt('Problem Part').'</th>' |
.'<th>'.&mt('Res. ID').'</th>' |
# .'<th>'.&mt('Res. ID').'</th>' |
.'<th>'.&mt('Type').'</th>' |
# .'<th>'.&mt('Type').'</th>' |
.&Apache::loncommon::end_data_table_header_row(); |
# .&Apache::loncommon::end_data_table_header_row(); |
my %resptype = (); |
# my %resptype = (); |
my $hdgrade='no'; |
# my $hdgrade='no'; |
my %partsseen; |
# my %partsseen; |
foreach my $partID (sort(keys(%$responseType))) { |
# foreach my $partID (sort(keys(%$responseType))) { |
foreach my $resID (sort(keys(%{ $responseType->{$partID} }))) { |
# foreach my $resID (sort(keys(%{ $responseType->{$partID} }))) { |
my $handgrade=$$handgrade{$partID.'_'.$resID}; |
# my $handgrade=$$handgrade{$partID.'_'.$resID}; |
my $responsetype = $responseType->{$partID}->{$resID}; |
# my $responsetype = $responseType->{$partID}->{$resID}; |
$hdgrade = $handgrade if ($handgrade eq 'yes'); |
# $hdgrade = $handgrade if ($handgrade eq 'yes'); |
$result.=&Apache::loncommon::start_data_table_row(); |
# $result.=&Apache::loncommon::start_data_table_row(); |
if ($checkboxes) { |
# if ($checkboxes) { |
if (exists($partsseen{$partID})) { |
# if (exists($partsseen{$partID})) { |
$result.="<td> </td>"; |
# $result.="<td> </td>"; |
} else { |
# } else { |
$result.="<td><input type='checkbox' name='vPart' value='$partID' checked='checked' /></td>"; |
# $result.="<td><input type='checkbox' name='vPart' value='$partID' checked='checked' /></td>"; |
} |
# } |
$partsseen{$partID}=1; |
# $partsseen{$partID}=1; |
} |
# } |
my $display_part=&get_display_part($partID,$symb); |
# my $display_part=&get_display_part($partID,$symb); |
$result.='<td>'.$display_part.'</td>' |
# $result.='<td>'.$display_part.'</td>' |
.'<td>'.'<span class="LC_internal_info">'.$resID.'</span></td>' |
# .'<td>'.'<span class="LC_internal_info">'.$resID.'</span></td>' |
.'<td>'.&mt($responsetype).'</td>' |
# .'<td>'.&mt($responsetype).'</td>' |
# .'<td>'.&mt('<b>Handgrade: </b>[_1]',$handgrade).'</td>' |
# .'<td>'.&mt('<b>Handgrade: </b>[_1]',$handgrade).'</td>' |
.&Apache::loncommon::end_data_table_row(); |
# .&Apache::loncommon::end_data_table_row(); |
} |
# } |
} |
# } |
$result.=&Apache::loncommon::end_data_table(); |
# $result.=&Apache::loncommon::end_data_table(); |
return $result,$responseType,$hdgrade,$partlist,$handgrade; |
# return $result,$responseType,$hdgrade,$partlist,$handgrade; |
} |
#} |
|
|
sub reset_caches { |
sub reset_caches { |
&reset_analyze_cache(); |
&reset_analyze_cache(); |
Line 425 sub cleanRecord {
|
Line 432 sub cleanRecord {
|
return '<blockquote><table border="1">'. |
return '<blockquote><table border="1">'. |
'<tr valign="top"><td>'.&mt('Answer').'</td>'.$toprow.'</tr>'. |
'<tr valign="top"><td>'.&mt('Answer').'</td>'.$toprow.'</tr>'. |
'<tr valign="top"><td>'.$grayFont.&mt('Option ID').'</span></td>'. |
'<tr valign="top"><td>'.$grayFont.&mt('Option ID').'</span></td>'. |
$grayFont.$bottomrow.'</tr>'.'</table></blockquote>'; |
$bottomrow.'</tr>'.'</table></blockquote>'; |
} elsif ($response eq 'essay') { |
} elsif ($response eq 'essay') { |
if (! exists ($env{'form.'.$symb})) { |
if (! exists ($env{'form.'.$symb})) { |
my (%keyhash) = &Apache::lonnet::dump('nohist_handgrade', |
my (%keyhash) = &Apache::lonnet::dump('nohist_handgrade', |
Line 487 sub cleanRecord {
|
Line 494 sub cleanRecord {
|
#-- A couple of common js functions |
#-- A couple of common js functions |
sub commonJSfunctions { |
sub commonJSfunctions { |
my $request = shift; |
my $request = shift; |
$request->print(<<COMMONJSFUNCTIONS); |
$request->print(&Apache::lonhtmlcommon::scripttag(<<COMMONJSFUNCTIONS)); |
<script type="text/javascript" language="javascript"> |
|
function radioSelection(radioButton) { |
function radioSelection(radioButton) { |
var selection=null; |
var selection=null; |
if (radioButton.length > 1) { |
if (radioButton.length > 1) { |
Line 516 sub commonJSfunctions {
|
Line 522 sub commonJSfunctions {
|
return selectOne.value; |
return selectOne.value; |
} |
} |
} |
} |
</script> |
|
COMMONJSFUNCTIONS |
COMMONJSFUNCTIONS |
} |
} |
|
|
Line 671 sub student_gradeStatus {
|
Line 676 sub student_gradeStatus {
|
sub jscriptNform { |
sub jscriptNform { |
my ($symb) = @_; |
my ($symb) = @_; |
my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status')); |
my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status')); |
my $jscript='<script type="text/javascript" language="javascript">'."\n". |
my $jscript= &Apache::lonhtmlcommon::scripttag( |
' function viewOneStudent(user,domain) {'."\n". |
' function viewOneStudent(user,domain) {'."\n". |
' document.onestudent.student.value = user;'."\n". |
' document.onestudent.student.value = user;'."\n". |
' document.onestudent.userdom.value = domain;'."\n". |
' document.onestudent.userdom.value = domain;'."\n". |
' document.onestudent.submit();'."\n". |
' document.onestudent.submit();'."\n". |
' }'."\n". |
' }'."\n". |
'</script>'."\n"; |
"\n"); |
$jscript.= '<form action="/adm/grades" method="post" name="onestudent">'."\n". |
$jscript.= '<form action="/adm/grades" method="post" name="onestudent">'."\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'}.'" />'."\n". |
'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n". |
Line 734 sub most_similar {
|
Line 739 sub most_similar {
|
|
|
# ignore empty submissions (occuring when only files are sent) |
# ignore empty submissions (occuring when only files are sent) |
|
|
unless ($uessay=~/\w+/) { return ''; } |
unless ($uessay=~/\w+/s) { return ''; } |
|
|
# these will be returned. Do not care if not at least 50 percent similar |
# these will be returned. Do not care if not at least 50 percent similar |
my $limit=0.6; |
my $limit=0.6; |
Line 880 sub listStudents {
|
Line 885 sub listStudents {
|
.&mt("$viewgrade Submissions for a Student or a Group of Students") |
.&mt("$viewgrade Submissions for a Student or a Group of Students") |
.'</span></h3>'; |
.'</span></h3>'; |
|
|
my ($table,undef,$hdgrade,$partlist,$handgrade) = &showResourceInfo($symb,$env{'form.probTitle'},($env{'form.showgrading'} eq 'yes')); |
# my ($table,undef,$hdgrade,$partlist,$handgrade) = &showResourceInfo($symb,$env{'form.probTitle'},($env{'form.showgrading'} eq 'yes')); |
|
my ($partlist,$handgrade,$responseType) = &response_type($symb |
|
#,$res_error |
|
); |
|
|
my %lt = &Apache::lonlocal::texthash ( |
my %lt = &Apache::lonlocal::texthash ( |
'multiple' => 'Please select a student or group of students before clicking on the Next button.', |
'multiple' => 'Please select a student or group of students before clicking on the Next button.', |
'single' => 'Please select the student before clicking on the Next button.', |
'single' => 'Please select the student before clicking on the Next button.', |
); |
); |
$request->print(<<LISTJAVASCRIPT); |
$request->print(&Apache::lonhtmlcommon::scripttag(<<LISTJAVASCRIPT)); |
<script type="text/javascript" language="javascript"> |
|
function checkSelect(checkBox) { |
function checkSelect(checkBox) { |
var ctr=0; |
var ctr=0; |
var sense=""; |
var sense=""; |
Line 916 sub listStudents {
|
Line 923 sub listStudents {
|
formname.command.value = 'submission'; |
formname.command.value = 'submission'; |
formname.submit(); |
formname.submit(); |
} |
} |
</script> |
|
LISTJAVASCRIPT |
LISTJAVASCRIPT |
|
|
&commonJSfunctions($request); |
&commonJSfunctions($request); |
Line 925 LISTJAVASCRIPT
|
Line 931 LISTJAVASCRIPT
|
my $checkhdgrade = ($env{'form.handgrade'} eq 'yes' && scalar(@$partlist) > 1 ) ? 'checked="checked"' : ''; |
my $checkhdgrade = ($env{'form.handgrade'} eq 'yes' && scalar(@$partlist) > 1 ) ? 'checked="checked"' : ''; |
my $checklastsub = $checkhdgrade eq '' ? 'checked="checked"' : ''; |
my $checklastsub = $checkhdgrade eq '' ? 'checked="checked"' : ''; |
my $gradeTable='<form action="/adm/grades" method="post" name="gradesub">'. |
my $gradeTable='<form action="/adm/grades" method="post" name="gradesub">'. |
"\n".$table; |
"\n"; |
|
|
$gradeTable .= &Apache::lonhtmlcommon::start_pick_box(); |
$gradeTable .= &Apache::lonhtmlcommon::start_pick_box(); |
$gradeTable .= &Apache::lonhtmlcommon::row_title(&mt('View Problem Text')) |
$gradeTable .= &Apache::lonhtmlcommon::row_title(&mt('View Problem Text')) |
Line 1152 LISTJAVASCRIPT
|
Line 1158 LISTJAVASCRIPT
|
|
|
sub check_script { |
sub check_script { |
my ($form, $type)=@_; |
my ($form, $type)=@_; |
my $chkallscript='<script type="text/javascript"> |
my $chkallscript= &Apache::lonhtmlcommon::scripttag(' |
function checkall() { |
function checkall() { |
for (i=0; i<document.forms.'.$form.'.elements.length; i++) { |
for (i=0; i<document.forms.'.$form.'.elements.length; i++) { |
ele = document.forms.'.$form.'.elements[i]; |
ele = document.forms.'.$form.'.elements[i]; |
Line 1183 sub check_script {
|
Line 1189 sub check_script {
|
} |
} |
} |
} |
|
|
</script>'."\n"; |
'."\n"); |
return $chkallscript; |
return $chkallscript; |
} |
} |
|
|
Line 1222 sub processGroup {
|
Line 1228 sub processGroup {
|
sub sub_page_js { |
sub sub_page_js { |
my $request = shift; |
my $request = shift; |
my $alertmsg = &mt('A number equal or greater than 0 is expected. Entered value = '); |
my $alertmsg = &mt('A number equal or greater than 0 is expected. Entered value = '); |
$request->print(<<SUBJAVASCRIPT); |
$request->print(&Apache::lonhtmlcommon::scripttag(<<SUBJAVASCRIPT)); |
<script type="text/javascript" language="javascript"> |
|
function updateRadio(formname,id,weight) { |
function updateRadio(formname,id,weight) { |
var gradeBox = formname["GD_BOX"+id]; |
var gradeBox = formname["GD_BOX"+id]; |
var radioButton = formname["RADVAL"+id]; |
var radioButton = formname["RADVAL"+id]; |
Line 1391 sub sub_page_js {
|
Line 1396 sub sub_page_js {
|
|
|
formname.submit(); |
formname.submit(); |
} |
} |
</script> |
|
SUBJAVASCRIPT |
SUBJAVASCRIPT |
} |
} |
|
|
Line 1401 sub sub_page_kw_js {
|
Line 1405 sub sub_page_kw_js {
|
my $iconpath = $request->dir_config('lonIconsURL'); |
my $iconpath = $request->dir_config('lonIconsURL'); |
&commonJSfunctions($request); |
&commonJSfunctions($request); |
|
|
my $inner_js_msg_central=<<INNERJS; |
my $inner_js_msg_central= &Apache::lonhtmlcommon::scripttag(<<INNERJS); |
<script text="text/javascript"> |
|
function checkInput() { |
function checkInput() { |
opener.document.SCORE.msgsub.value = opener.checkEntities(document.msgcenter.msgsub.value); |
opener.document.SCORE.msgsub.value = opener.checkEntities(document.msgcenter.msgsub.value); |
var nmsg = opener.document.SCORE.savemsgN.value; |
var nmsg = opener.document.SCORE.savemsgN.value; |
Line 1439 sub sub_page_kw_js {
|
Line 1442 sub sub_page_kw_js {
|
self.close() |
self.close() |
|
|
} |
} |
</script> |
|
INNERJS |
INNERJS |
|
|
my $inner_js_highlight_central=<<INNERJS; |
my $inner_js_highlight_central= &Apache::lonhtmlcommon::scripttag(<<INNERJS); |
<script type="text/javascript"> |
|
function updateChoice(flag) { |
function updateChoice(flag) { |
opener.document.SCORE.kwclr.value = opener.radioSelection(document.hlCenter.kwdclr); |
opener.document.SCORE.kwclr.value = opener.radioSelection(document.hlCenter.kwdclr); |
opener.document.SCORE.kwsize.value = opener.radioSelection(document.hlCenter.kwdsize); |
opener.document.SCORE.kwsize.value = opener.radioSelection(document.hlCenter.kwdsize); |
Line 1454 INNERJS
|
Line 1455 INNERJS
|
} |
} |
self.close() |
self.close() |
} |
} |
</script> |
|
INNERJS |
INNERJS |
|
|
my $start_page_msg_central = |
my $start_page_msg_central = |
Line 1478 INNERJS
|
Line 1478 INNERJS
|
my $docopen=&Apache::lonhtmlcommon::javascript_docopen(); |
my $docopen=&Apache::lonhtmlcommon::javascript_docopen(); |
$docopen=~s/^document\.//; |
$docopen=~s/^document\.//; |
my $alertmsg = &mt('Please select a word or group of words from document and then click this link.'); |
my $alertmsg = &mt('Please select a word or group of words from document and then click this link.'); |
$request->print(<<SUBJAVASCRIPT); |
$request->print(&Apache::lonhtmlcommon::scripttag(<<SUBJAVASCRIPT)); |
<script type="text/javascript" language="javascript"> |
|
|
|
//===================== Show list of keywords ==================== |
//===================== Show list of keywords ==================== |
function keywords(formname) { |
function keywords(formname) { |
Line 1710 INNERJS
|
Line 1709 INNERJS
|
hDoc.close(); |
hDoc.close(); |
} |
} |
|
|
</script> |
|
SUBJAVASCRIPT |
SUBJAVASCRIPT |
} |
} |
|
|
Line 2204 KEYWORDS
|
Line 2202 KEYWORDS
|
$lastsubonly.="\n".'<div class="LC_grade_submission_part">'. |
$lastsubonly.="\n".'<div class="LC_grade_submission_part">'. |
'<b>'.&mt('Part: [_1]',$display_part).'</b>'. |
'<b>'.&mt('Part: [_1]',$display_part).'</b>'. |
' <span class="LC_internal_info">'. |
' <span class="LC_internal_info">'. |
'('.&mt('Part ID: [_1]',$respid).')</b>'. |
'('.&mt('Part ID: [_1]',$respid).')'. |
'</span> '. |
'</span> '. |
'<span class="LC_warning">'.&mt('Nothing submitted - no attempts.').'</span><br /><br /></div>'; |
'<span class="LC_warning">'.&mt('Nothing submitted - no attempts.').'</span><br /><br /></div>'; |
next; |
next; |
Line 2212 KEYWORDS
|
Line 2210 KEYWORDS
|
foreach my $submission (@$string) { |
foreach my $submission (@$string) { |
my ($partid,$respid) = ($submission =~ /^resource\.([^\.]*)\.([^\.]*)\.submission/); |
my ($partid,$respid) = ($submission =~ /^resource\.([^\.]*)\.([^\.]*)\.submission/); |
if (join('_',@{$part}) ne ($partid.'_'.$respid)) { next; } |
if (join('_',@{$part}) ne ($partid.'_'.$respid)) { next; } |
my ($ressub,$subval) = split(/:/,$submission,2); |
my ($ressub,$hide,$subval) = split(/:/,$submission,3); |
# Similarity check |
# Similarity check |
my $similar=''; |
my $similar=''; |
if($env{'form.checkPlag'}){ |
if($env{'form.checkPlag'}){ |
Line 2224 KEYWORDS
|
Line 2222 KEYWORDS
|
&Apache::lonnet::coursedescription($ocrsid, |
&Apache::lonnet::coursedescription($ocrsid, |
{'one_time' => 1}); |
{'one_time' => 1}); |
|
|
$similar="<hr /><h3><span class=\"LC_warning\">". |
if ($hide) { |
&mt('Essay is [_1]% similar to an essay by [_2] in course [_3] (course id [_4]:[_5])', |
$similar='<hr /><span class="LC_warning">'.&mt("Essay was found to be similar to another essay submitted for this assignment.").'<br />'. |
$osim, |
&mt('As the current submission is for an anonymous survey, no other details are available.').'</span><hr />'; |
&Apache::loncommon::plainname($oname,$odom).' ('.$oname.':'.$odom.')', |
} else { |
$old_course_desc{'description'}, |
$similar="<hr /><h3><span class=\"LC_warning\">". |
$old_course_desc{'num'}, |
&mt('Essay is [_1]% similar to an essay by [_2] in course [_3] (course id [_4]:[_5])', |
$old_course_desc{'domain'}). |
$osim, |
'</span></h3><blockquote><i>'. |
&Apache::loncommon::plainname($oname,$odom).' ('.$oname.':'.$odom.')', |
&keywords_highlight($oessay). |
$old_course_desc{'description'}, |
'</i></blockquote><hr />'; |
$old_course_desc{'num'}, |
|
$old_course_desc{'domain'}). |
|
'</span></h3><blockquote><i>'. |
|
&keywords_highlight($oessay). |
|
'</i></blockquote><hr />'; |
|
} |
} |
} |
} |
} |
my $order=&get_order($partid,$respid,$symb,$uname,$udom); |
my $order=&get_order($partid,$respid,$symb,$uname,$udom); |
Line 2245 KEYWORDS
|
Line 2248 KEYWORDS
|
'<b>'.&mt('Part: [_1]',$display_part).'</b>'. |
'<b>'.&mt('Part: [_1]',$display_part).'</b>'. |
' <span class="LC_internal_info">'. |
' <span class="LC_internal_info">'. |
'('.&mt('Part ID: [_1]',$respid).')'. |
'('.&mt('Part ID: [_1]',$respid).')'. |
'</b></span> '; |
'</span> '; |
my $files=&get_submitted_files($udom,$uname,$partid,$respid,\%record); |
my $files=&get_submitted_files($udom,$uname,$partid,$respid,\%record); |
if (@$files) { |
if (@$files) { |
$lastsubonly.='<br /><span class="LC_warning">'.&mt('Like all files provided by users, this file may contain viruses').'</span><br />'; |
if ($hide) { |
my $file_counter = 0; |
$lastsubonly.='<br />'.&mt('[quant,_1,file] uploaded to this anonymous survey',scalar(@{$files})); |
foreach my $file (@$files) { |
} else { |
$file_counter++; |
$lastsubonly.='<br /><span class="LC_warning">'.&mt('Like all files provided by users, this file may contain viruses').'</span><br />'; |
&Apache::lonnet::allowuploaded('/adm/grades',$file); |
foreach my $file (@$files) { |
$lastsubonly.='<br /><a href="'.$file.'?rawmode=1" target="lonGRDs"><img src="'.&Apache::loncommon::icon($file).'" border="0" /> '.$file.'</a>'; |
&Apache::lonnet::allowuploaded('/adm/grades',$file); |
} |
$lastsubonly.='<br /><a href="'.$file.'?rawmode=1" target="lonGRDs"><img src="'.&Apache::loncommon::icon($file).'" border="0" /> '.$file.'</a>'; |
|
} |
|
} |
$lastsubonly.='<br />'; |
$lastsubonly.='<br />'; |
} |
} |
$lastsubonly.='<b>'.&mt('Submitted Answer:').' </b>'. |
if ($hide) { |
&cleanRecord($subval,$responsetype,$symb,$partid, |
$lastsubonly.='<b>'.&mt('Anonymous Survey').'</b>'; |
$respid,\%record,$order,undef,$uname,$udom); |
} else { |
|
$lastsubonly.='<b>'.&mt('Submitted Answer:').' </b>'. |
|
&cleanRecord($subval,$responsetype,$symb,$partid, |
|
$respid,\%record,$order,undef,$uname,$udom); |
|
} |
if ($similar) {$lastsubonly.="<br /><br />$similar\n";} |
if ($similar) {$lastsubonly.="<br /><br />$similar\n";} |
$lastsubonly.='</div>'; |
$lastsubonly.='</div>'; |
} |
} |
Line 2269 KEYWORDS
|
Line 2278 KEYWORDS
|
} |
} |
$request->print($lastsubonly); |
$request->print($lastsubonly); |
} elsif ($env{'form.lastSub'} eq 'datesub') { |
} elsif ($env{'form.lastSub'} eq 'datesub') { |
my (undef,$responseType,undef,$parts) = &showResourceInfo($symb); |
# my (undef,$responseType,undef,$parts) = &showResourceInfo($symb); |
|
my ($parts,$handgrade,$responseType) = &response_type($symb); |
|
|
$request->print(&displaySubByDates($symb,\%record,$parts,$responseType,$checkIcon,$uname,$udom)); |
$request->print(&displaySubByDates($symb,\%record,$parts,$responseType,$checkIcon,$uname,$udom)); |
} elsif ($env{'form.lastSub'} =~ /^(last|all)$/) { |
} elsif ($env{'form.lastSub'} =~ /^(last|all)$/) { |
$request->print(&Apache::loncommon::get_previous_attempt($symb,$uname,$udom, |
$request->print(&Apache::loncommon::get_previous_attempt($symb,$uname,$udom, |
Line 2454 sub check_collaborators {
|
Line 2465 sub check_collaborators {
|
#--- Retrieve the last submission for all the parts |
#--- Retrieve the last submission for all the parts |
sub get_last_submission { |
sub get_last_submission { |
my ($returnhash)=@_; |
my ($returnhash)=@_; |
my (@string,$timestamp); |
my (@string,$timestamp,%lasthidden); |
if ($$returnhash{'version'}) { |
if ($$returnhash{'version'}) { |
my %lasthash=(); |
my %lasthash=(); |
my ($version); |
my ($version); |
Line 2466 sub get_last_submission {
|
Line 2477 sub get_last_submission {
|
&Apache::lonlocal::locallocaltime($$returnhash{$version.':timestamp'}); |
&Apache::lonlocal::locallocaltime($$returnhash{$version.':timestamp'}); |
} |
} |
} |
} |
|
my %typeparts; |
|
my $showsurv = |
|
&Apache::lonnet::allowed('vas',$env{'request.course.id'}); |
|
foreach my $key (sort(keys(%lasthash))) { |
|
if ($key =~ /\.type$/) { |
|
if (($lasthash{$key} eq 'anonsurvey') || |
|
($lasthash{$key} eq 'anonsurveycred')) { |
|
my ($ign,@parts) = split(/\./,$key); |
|
pop(@parts); |
|
unless ($showsurv) { |
|
my $id = join(',',@parts); |
|
$typeparts{$ign.'.'.$id} = $lasthash{$key}; |
|
} |
|
delete($lasthash{$key}); |
|
} |
|
} |
|
} |
|
my @hidden = keys(%typeparts); |
foreach my $key (keys(%lasthash)) { |
foreach my $key (keys(%lasthash)) { |
next if ($key !~ /\.submission$/); |
next if ($key !~ /\.submission$/); |
|
my $hide; |
|
if (@hidden) { |
|
foreach my $id (@hidden) { |
|
if ($key =~ /^\Q$id\E/) { |
|
$hide = 1; |
|
last; |
|
} |
|
} |
|
} |
my ($partid,$foo) = split(/submission$/,$key); |
my ($partid,$foo) = split(/submission$/,$key); |
my $draft = $lasthash{$partid.'awarddetail'} eq 'DRAFT' ? |
my $draft = $lasthash{$partid.'awarddetail'} eq 'DRAFT' ? |
'<span class="LC_warning">Draft Copy</span> ' : ''; |
'<span class="LC_warning">Draft Copy</span> ' : ''; |
push(@string, join(':', $key, $draft.$lasthash{$key})); |
push(@string, join(':', $key, $hide, $draft.$lasthash{$key})); |
} |
} |
} |
} |
if (!@string) { |
if (!@string) { |
Line 2639 sub processHandGrade {
|
Line 2676 sub processHandGrade {
|
|
|
# Go directly to grade student - from submission or link from chart page |
# Go directly to grade student - from submission or link from chart page |
if ($button eq 'Grade Student') { |
if ($button eq 'Grade Student') { |
(undef,undef,$env{'form.handgrade'},undef,undef) = &showResourceInfo($symb); |
# (undef,undef,$env{'form.handgrade'},undef,undef) = &showResourceInfo($symb); |
my $processUser = $env{'form.unamedom'.$env{'form.studentNo'}}; |
my $processUser = $env{'form.unamedom'.$env{'form.studentNo'}}; |
($env{'form.student'},$env{'form.userdom'}) = split(/:/,$processUser); |
($env{'form.student'},$env{'form.userdom'}) = split(/:/,$processUser); |
$env{'form.fullname'} = $$fullname{$processUser}; |
$env{'form.fullname'} = $$fullname{$processUser}; |
Line 3133 sub viewgrades_js {
|
Line 3170 sub viewgrades_js {
|
my ($request) = shift; |
my ($request) = shift; |
|
|
my $alertmsg = &mt('A number equal or greater than 0 is expected. Entered value = '); |
my $alertmsg = &mt('A number equal or greater than 0 is expected. Entered value = '); |
$request->print(<<VIEWJAVASCRIPT); |
$request->print(&Apache::lonhtmlcommon::scripttag(<<VIEWJAVASCRIPT)); |
<script type="text/javascript" language="javascript"> |
|
function writePoint(partid,weight,point) { |
function writePoint(partid,weight,point) { |
var radioButton = document.classgrade["RADVAL_"+partid]; |
var radioButton = document.classgrade["RADVAL_"+partid]; |
var textbox = document.classgrade["TEXTVAL_"+partid]; |
var textbox = document.classgrade["TEXTVAL_"+partid]; |
Line 3295 sub viewgrades_js {
|
Line 3331 sub viewgrades_js {
|
} |
} |
} |
} |
|
|
</script> |
|
VIEWJAVASCRIPT |
VIEWJAVASCRIPT |
} |
} |
|
|
Line 3561 sub editgrades {
|
Line 3596 sub editgrades {
|
'incorrect'=>'incorrect_by_override', |
'incorrect'=>'incorrect_by_override', |
'excused' =>'excused', |
'excused' =>'excused', |
'ungraded' =>'ungraded_attempted', |
'ungraded' =>'ungraded_attempted', |
|
'credited' =>'credit_attempted', |
'nothing' => '', |
'nothing' => '', |
); |
); |
my ($classlist,undef,$fullname) = &getclasslist($env{'form.section'},'0'); |
my ($classlist,undef,$fullname) = &getclasslist($env{'form.section'},'0'); |
Line 3870 sub csvuploadmap_header {
|
Line 3906 sub csvuploadmap_header {
|
$javascript=&csvupload_javascript_forward_associate(); |
$javascript=&csvupload_javascript_forward_associate(); |
} |
} |
|
|
my ($result) = &showResourceInfo($symb,$env{'form.probTitle'}); |
# my ($result) = &showResourceInfo($symb,$env{'form.probTitle'}); |
|
my $result=''; |
my $checked=(($env{'form.noFirstLine'})?' checked="checked"':''); |
my $checked=(($env{'form.noFirstLine'})?' checked="checked"':''); |
my $ignore=&mt('Ignore First Line'); |
my $ignore=&mt('Ignore First Line'); |
$symb = &Apache::lonenc::check_encrypt($symb); |
$symb = &Apache::lonenc::check_encrypt($symb); |
Line 3897 to this page if the data selected is ins
|
Line 3934 to this page if the data selected is ins
|
<input type="hidden" name="probTitle" value="$env{'form.probTitle'}" /> |
<input type="hidden" name="probTitle" value="$env{'form.probTitle'}" /> |
<input type="hidden" name="command" value="csvuploadoptions" /> |
<input type="hidden" name="command" value="csvuploadoptions" /> |
<hr /> |
<hr /> |
<script type="text/javascript" language="Javascript"> |
|
$javascript |
|
</script> |
|
ENDPICK |
ENDPICK |
|
$request->print(&Apache::lonhtmlcommon::scripttag($javascript)); |
return ''; |
return ''; |
|
|
} |
} |
Line 3945 ENDPICK
|
Line 3980 ENDPICK
|
|
|
sub checkforfile_js { |
sub checkforfile_js { |
my $alertmsg = &mt('Please use the browse button to select a file from your local directory.'); |
my $alertmsg = &mt('Please use the browse button to select a file from your local directory.'); |
my $result =<<CSVFORMJS; |
my $result = &Apache::lonhtmlcommon::scripttag(<<CSVFORMJS); |
<script type="text/javascript" language="javascript"> |
|
function checkUpload(formname) { |
function checkUpload(formname) { |
if (formname.upfile.value == "") { |
if (formname.upfile.value == "") { |
alert("$alertmsg"); |
alert("$alertmsg"); |
Line 3954 sub checkforfile_js {
|
Line 3988 sub checkforfile_js {
|
} |
} |
formname.submit(); |
formname.submit(); |
} |
} |
</script> |
|
CSVFORMJS |
CSVFORMJS |
return $result; |
return $result; |
} |
} |
Line 3965 sub upcsvScores_form {
|
Line 3998 sub upcsvScores_form {
|
if (!$symb) {return '';} |
if (!$symb) {return '';} |
my $result=&checkforfile_js(); |
my $result=&checkforfile_js(); |
$env{'form.probTitle'} = &Apache::lonnet::gettitle($symb); |
$env{'form.probTitle'} = &Apache::lonnet::gettitle($symb); |
my ($table) = &showResourceInfo($symb,$env{'form.probTitle'}); |
# my ($table) = &showResourceInfo($symb,$env{'form.probTitle'}); |
$result.=$table; |
# $result.=$table; |
$result.='<br /><table width="100%" border="0"><tr><td bgcolor="#777777">'."\n"; |
$result.='<br /><table width="100%" border="0"><tr><td bgcolor="#777777">'."\n"; |
$result.='<table width="100%" border="0"><tr bgcolor="#e6ffff"><td>'."\n"; |
$result.='<table width="100%" border="0"><tr bgcolor="#e6ffff"><td>'."\n"; |
$result.=' <b>'.&mt('Specify a file containing the class scores for current resource.'). |
$result.=' <b>'.&mt('Specify a file containing the class scores for current resource.'). |
Line 4228 sub pickStudentPage {
|
Line 4261 sub pickStudentPage {
|
my ($request) = shift; |
my ($request) = shift; |
|
|
my $alertmsg = &mt('Please select the student you wish to grade.'); |
my $alertmsg = &mt('Please select the student you wish to grade.'); |
$request->print(<<LISTJAVASCRIPT); |
$request->print(&Apache::lonhtmlcommon::scripttag(<<LISTJAVASCRIPT)); |
<script type="text/javascript" language="javascript"> |
|
|
|
function checkPickOne(formname) { |
function checkPickOne(formname) { |
if (radioSelection(formname.student) == null) { |
if (radioSelection(formname.student) == null) { |
Line 4242 function checkPickOne(formname) {
|
Line 4274 function checkPickOne(formname) {
|
formname.submit(); |
formname.submit(); |
} |
} |
|
|
</script> |
|
LISTJAVASCRIPT |
LISTJAVASCRIPT |
&commonJSfunctions($request); |
&commonJSfunctions($request); |
my ($symb) = &get_symb($request); |
my ($symb) = &get_symb($request); |
Line 4452 sub displayPage {
|
Line 4483 sub displayPage {
|
my $checkIcon = '<img alt="'.&mt('Check Mark'). |
my $checkIcon = '<img alt="'.&mt('Check Mark'). |
'" src="'.&Apache::loncommon::lonhttpdurl($request->dir_config('lonIconsURL').'/check.gif').'" height="16" border="0" />'; |
'" src="'.&Apache::loncommon::lonhttpdurl($request->dir_config('lonIconsURL').'/check.gif').'" height="16" border="0" />'; |
|
|
$studentTable.=' '.&mt('<b>Note:</b> Problems graded correct by the computer are marked with a [_1] symbol.',$checkIcon)."\n". |
$studentTable.=' <span class="LC_info">'. |
|
&mt('Problems graded correct by the computer are marked with a [_1] symbol.',$checkIcon). |
|
'</span>'."\n". |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_header_row(). |
&Apache::loncommon::start_data_table_header_row(). |
'<th align="center"> Prob. </th>'. |
'<th align="center"> Prob. </th>'. |
Line 4588 sub displaySubByDates {
|
Line 4621 sub displaySubByDates {
|
my @versionKeys = split(/\:/,$$record{$version.':keys'}); |
my @versionKeys = split(/\:/,$$record{$version.':keys'}); |
my @displaySub = (); |
my @displaySub = (); |
foreach my $partid (@{$parts}) { |
foreach my $partid (@{$parts}) { |
|
my $hidden; |
|
if (($$record{$version.':resource.'.$partid.'.type'} eq 'anonsurvey') || |
|
($$record{$version.':resource.'.$partid.'.type'} eq 'anonsurveycred')) { |
|
$hidden = 1; |
|
} |
my @matchKey = ($isTask ? sort(grep /^resource\.\d+\.\Q$partid\E\.award$/,@versionKeys) |
my @matchKey = ($isTask ? sort(grep /^resource\.\d+\.\Q$partid\E\.award$/,@versionKeys) |
: sort(grep /^resource\.\Q$partid\E\..*?\.submission$/,@versionKeys)); |
: sort(grep /^resource\.\Q$partid\E\..*?\.submission$/,@versionKeys)); |
|
|
|
|
# next if ($$record{"$version:resource.$partid.solved"} eq ''); |
# next if ($$record{"$version:resource.$partid.solved"} eq ''); |
my $display_part=&get_display_part($partid,$symb); |
my $display_part=&get_display_part($partid,$symb); |
foreach my $matchKey (@matchKey) { |
foreach my $matchKey (@matchKey) { |
if (exists($$record{$version.':'.$matchKey}) && |
if (exists($$record{$version.':'.$matchKey}) && |
$$record{$version.':'.$matchKey} ne '') { |
$$record{$version.':'.$matchKey} ne '') { |
|
|
my ($responseId)= ($isTask ? ($matchKey=~ /^resource\.(.*?)\.\Q$partid\E\.award$/) |
my ($responseId)= ($isTask ? ($matchKey=~ /^resource\.(.*?)\.\Q$partid\E\.award$/) |
: ($matchKey=~ /^resource\.\Q$partid\E\.(.*?)\.submission$/)); |
: ($matchKey=~ /^resource\.\Q$partid\E\.(.*?)\.submission$/)); |
$displaySub[0].='<span class="LC_nobreak"'; |
$displaySub[0].='<span class="LC_nobreak"'; |
Line 4606 sub displaySubByDates {
|
Line 4643 sub displaySubByDates {
|
.'('.&mt('Part ID: [_1]',$responseId).')' |
.'('.&mt('Part ID: [_1]',$responseId).')' |
.'</span>' |
.'</span>' |
.' <b>'; |
.' <b>'; |
if ($$record{"$where.$partid.tries"} eq '') { |
if ($hidden) { |
$displaySub[0].=&mt('Trial not counted'); |
$displaySub[0].= &mt('Anonymous Survey').'</b>'; |
} else { |
} else { |
$displaySub[0].=&mt('Trial: [_1]', |
if ($$record{"$where.$partid.tries"} eq '') { |
|
$displaySub[0].=&mt('Trial not counted'); |
|
} else { |
|
$displaySub[0].=&mt('Trial: [_1]', |
$$record{"$where.$partid.tries"}); |
$$record{"$where.$partid.tries"}); |
} |
} |
my $responseType=($isTask ? 'Task' |
my $responseType=($isTask ? 'Task' |
: $responseType->{$partid}->{$responseId}); |
: $responseType->{$partid}->{$responseId}); |
if (!exists($orders{$partid})) { $orders{$partid}={}; } |
if (!exists($orders{$partid})) { $orders{$partid}={}; } |
if (!exists($orders{$partid}->{$responseId})) { |
if (!exists($orders{$partid}->{$responseId})) { |
$orders{$partid}->{$responseId}= |
$orders{$partid}->{$responseId}= |
&get_order($partid,$responseId,$symb,$uname,$udom, |
&get_order($partid,$responseId,$symb,$uname,$udom, |
$no_increment); |
$no_increment); |
} |
} |
$displaySub[0].='</b></span>'; # /nobreak |
$displaySub[0].='</b></span>'; # /nobreak |
$displaySub[0].=' '. |
$displaySub[0].=' '. |
&cleanRecord($$record{$version.':'.$matchKey},$responseType,$symb,$partid,$responseId,$record,$orders{$partid}->{$responseId},"$version:",$uname,$udom).'<br />'; |
&cleanRecord($$record{$version.':'.$matchKey},$responseType,$symb,$partid,$responseId,$record,$orders{$partid}->{$responseId},"$version:",$uname,$udom).'<br />'; |
|
} |
} |
} |
} |
} |
if (exists($$record{"$where.$partid.checkedin"})) { |
if (exists($$record{"$where.$partid.checkedin"})) { |
Line 5270 sub scantron_selectphase {
|
Line 5311 sub scantron_selectphase {
|
my $default_form_data=&defaultFormData(&get_symb($r,1)); |
my $default_form_data=&defaultFormData(&get_symb($r,1)); |
my $cdom= $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdom= $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cnum= $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cnum= $env{'course.'.$env{'request.course.id'}.'.num'}; |
$r->print(' |
$r->print(&Apache::lonhtmlcommon::scripttag(' |
<script type="text/javascript" language="javascript"> |
|
function checkUpload(formname) { |
function checkUpload(formname) { |
if (formname.upfile.value == "") { |
if (formname.upfile.value == "") { |
alert("'.&mt('Please use the browse button to select a file from your local directory.').'"); |
alert("'.&mt('Please use the browse button to select a file from your local directory.').'"); |
return false; |
return false; |
} |
} |
formname.submit(); |
formname.submit(); |
} |
}')); |
</script> |
$r->print(' |
|
|
<form enctype="multipart/form-data" action="/adm/grades" name="rules" method="post"> |
<form enctype="multipart/form-data" action="/adm/grades" name="rules" method="post"> |
'.$default_form_data.' |
'.$default_form_data.' |
<input name="courseid" type="hidden" value="'.$cnum.'" /> |
<input name="courseid" type="hidden" value="'.$cnum.'" /> |
Line 6967 sub scantron_get_correction {
|
Line 7006 sub scantron_get_correction {
|
$r->print("\n<br />"); |
$r->print("\n<br />"); |
} |
} |
|
|
$r->print(<<ENDSCRIPT); |
$r->print(&Apache::lonhtmlcommon::scripttag(<<ENDSCRIPT)); |
<script type="text/javascript"> |
|
function change_radio(field) { |
function change_radio(field) { |
var slct=document.scantronupload.scantron_CODE_resolution; |
var slct=document.scantronupload.scantron_CODE_resolution; |
var i; |
var i; |
Line 6976 function change_radio(field) {
|
Line 7014 function change_radio(field) {
|
if (slct[i].value==field) { slct[i].checked=true; } |
if (slct[i].value==field) { slct[i].checked=true; } |
} |
} |
} |
} |
</script> |
|
ENDSCRIPT |
ENDSCRIPT |
my $href="/adm/pickcode?". |
my $href="/adm/pickcode?". |
"form=".&escape("scantronupload"). |
"form=".&escape("scantronupload"). |
Line 7048 sub verify_bubbles_checked {
|
Line 7085 sub verify_bubbles_checked {
|
my (@ansnums) = @_; |
my (@ansnums) = @_; |
my $ansnumstr = join('","',@ansnums); |
my $ansnumstr = join('","',@ansnums); |
my $warning = &mt("A bubble or 'No bubble' selection has not been made for one or more lines."); |
my $warning = &mt("A bubble or 'No bubble' selection has not been made for one or more lines."); |
my $output = (<<ENDSCRIPT); |
my $output = &Apache::lonhtmlcommon::scripttag((<<ENDSCRIPT)); |
<script type="text/javascript"> |
|
function verify_bubble_radio(form) { |
function verify_bubble_radio(form) { |
var ansnumArray = new Array ("$ansnumstr"); |
var ansnumArray = new Array ("$ansnumstr"); |
var need_bubble_count = 0; |
var need_bubble_count = 0; |
Line 7072 function verify_bubble_radio(form) {
|
Line 7108 function verify_bubble_radio(form) {
|
} |
} |
form.submit(); |
form.submit(); |
} |
} |
</script> |
|
ENDSCRIPT |
ENDSCRIPT |
return $output; |
return $output; |
} |
} |
Line 7931 sub scantron_upload_scantron_data {
|
Line 7966 sub scantron_upload_scantron_data {
|
my $default_form_data=&defaultFormData(&get_symb($r,1)); |
my $default_form_data=&defaultFormData(&get_symb($r,1)); |
my $nofile_alert = &mt('Please use the browse button to select a file from your local directory.'); |
my $nofile_alert = &mt('Please use the browse button to select a file from your local directory.'); |
my $nocourseid_alert = &mt("Please use the 'Select Course' link to open a separate window where you can search for a course to which a file can be uploaded."); |
my $nocourseid_alert = &mt("Please use the 'Select Course' link to open a separate window where you can search for a course to which a file can be uploaded."); |
$r->print(' |
$r->print(&Apache::lonhtmlcommon::scripttag(' |
<script type="text/javascript" language="javascript"> |
|
function checkUpload(formname) { |
function checkUpload(formname) { |
if (formname.upfile.value == "") { |
if (formname.upfile.value == "") { |
alert("'.$nofile_alert.'"); |
alert("'.$nofile_alert.'"); |
Line 7959 sub scantron_upload_scantron_data {
|
Line 7993 sub scantron_upload_scantron_data {
|
return; |
return; |
} |
} |
|
|
</script> |
')); |
|
$r->print(' |
<h3>'.&mt('Send scanned bubblesheet data to a course').'</h3> |
<h3>'.&mt('Send scanned bubblesheet data to a course').'</h3> |
|
|
<form enctype="multipart/form-data" action="/adm/grades" name="rules" method="post"> |
<form enctype="multipart/form-data" action="/adm/grades" name="rules" method="post"> |
Line 8498 sub grading_menu {
|
Line 8532 sub grading_menu {
|
my ($symb)=&get_symb($request); |
my ($symb)=&get_symb($request); |
if (!$symb) {return '';} |
if (!$symb) {return '';} |
my $probTitle = &Apache::lonnet::gettitle($symb); |
my $probTitle = &Apache::lonnet::gettitle($symb); |
my ($table,undef,$hdgrade) = &showResourceInfo($symb,$probTitle); |
|
|
|
$request->print($table); |
# $request->print($table); |
my %fields = ('symb'=>&Apache::lonenc::check_encrypt($symb), |
my %fields = ('symb'=>&Apache::lonenc::check_encrypt($symb), |
'handgrade'=>$hdgrade, |
|
'probTitle'=>$probTitle, |
'probTitle'=>$probTitle, |
'command'=>'submit_options', |
'command'=>'individual', |
'saveState'=>"", |
'saveState'=>"", |
'gradingMenu'=>1, |
'gradingMenu'=>1, |
'showgrading'=>"yes"); |
'showgrading'=>"yes"); |
|
|
my $url1 = &Apache::lonhtmlcommon::build_url('grades/',\%fields); |
my $url1a = &Apache::lonhtmlcommon::build_url('grades/',\%fields); |
|
|
|
$fields{'command'}='ungraded'; |
|
my $url1b=&Apache::lonhtmlcommon::build_url('grades/',\%fields); |
|
|
|
$fields{'command'}='table'; |
|
my $url1c=&Apache::lonhtmlcommon::build_url('grades/',\%fields); |
|
|
|
$fields{'command'}='all_for_one'; |
|
my $url1d=&Apache::lonhtmlcommon::build_url('grades/',\%fields); |
|
|
$fields{'command'} = 'csvform'; |
$fields{'command'} = 'csvform'; |
my $url2 = &Apache::lonhtmlcommon::build_url('grades/',\%fields); |
my $url2 = &Apache::lonhtmlcommon::build_url('grades/',\%fields); |
|
|
Line 8520 sub grading_menu {
|
Line 8561 sub grading_menu {
|
$fields{'command'} = 'scantron_selectphase'; |
$fields{'command'} = 'scantron_selectphase'; |
my $url4 = &Apache::lonhtmlcommon::build_url('grades/',\%fields); |
my $url4 = &Apache::lonhtmlcommon::build_url('grades/',\%fields); |
|
|
my @menu = ({ categorytitle=>'Course Grading', |
my @menu = ({ categorytitle=>'Hand Grading', |
items =>[ |
items =>[ |
{ linktext => 'Manual Grading/View Submissions', |
{ linktext => 'Select individual students to grade', |
url => $url1, |
url => $url1a, |
permission => 'F', |
permission => 'F', |
icon => 'edit-find-replace.png', |
icon => 'edit-find-replace.png', |
linktitle => 'Start the process of hand grading submissions.' |
linktitle => 'Grade current resource for a selection of students.' |
|
}, |
|
{ linktext => 'Grade ungraded submissions.', |
|
url => $url1b, |
|
permission => 'F', |
|
icon => 'edit-find-replace.png', |
|
linktitle => 'Grade all submissions that have not been graded yet.' |
|
}, |
|
|
|
{ linktext => 'Grading table', |
|
url => $url1c, |
|
permission => 'F', |
|
icon => 'edit-find-replace.png', |
|
linktitle => 'Grade current resource for all students.' |
}, |
}, |
|
{ linktext => 'Grade complete page/sequence/folder for one student.', |
|
url => $url1d, |
|
permission => 'F', |
|
icon => 'edit-find-replace.png', |
|
linktitle => 'Grade all resources in current page/sequence/folder for one student.' |
|
}]}, |
|
{ categorytitle=>'Automated Grading', |
|
items =>[ |
|
|
{ linktext => 'Upload Scores', |
{ linktext => 'Upload Scores', |
url => $url2, |
url => $url2, |
permission => 'F', |
permission => 'F', |
Line 8558 sub grading_menu {
|
Line 8621 sub grading_menu {
|
$Str .= '<form method="post" action="" name="gradingMenu">'; |
$Str .= '<form method="post" action="" name="gradingMenu">'; |
$Str .= '<input type="hidden" name="command" value="" />'. |
$Str .= '<input type="hidden" name="command" value="" />'. |
'<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="handgrade" value="'.$hdgrade.'" />'."\n". |
# '<input type="hidden" name="handgrade" value="'.$hdgrade.'" />'."\n". |
'<input type="hidden" name="probTitle" value="'.$probTitle.'" />'."\n". |
'<input type="hidden" name="probTitle" value="'.$probTitle.'" />'."\n". |
'<input type="hidden" name="saveState" value="" />'."\n". |
'<input type="hidden" name="saveState" value="" />'."\n". |
'<input type="hidden" name="gradingMenu" value="1" />'."\n". |
'<input type="hidden" name="gradingMenu" value="1" />'."\n". |
Line 8574 sub grading_menu {
|
Line 8637 sub grading_menu {
|
|
|
$Str .="</form>\n"; |
$Str .="</form>\n"; |
my $receiptalert = &mt("Please enter a receipt number given by a student in the receipt box."); |
my $receiptalert = &mt("Please enter a receipt number given by a student in the receipt box."); |
$request->print(<<GRADINGMENUJS); |
$request->print(&Apache::lonhtmlcommon::scripttag(<<GRADINGMENUJS)); |
<script type="text/javascript" language="javascript"> |
|
function checkChoice(formname,val,cmdx) { |
function checkChoice(formname,val,cmdx) { |
if (val <= 2) { |
if (val <= 2) { |
var cmd = radioSelection(formname.radioChoice); |
var cmd = radioSelection(formname.radioChoice); |
Line 8608 sub grading_menu {
|
Line 8670 sub grading_menu {
|
} |
} |
return true; |
return true; |
} |
} |
</script> |
|
GRADINGMENUJS |
GRADINGMENUJS |
&commonJSfunctions($request); |
&commonJSfunctions($request); |
return $Str; |
return $Str; |
} |
} |
|
|
|
sub individual { |
|
my ($request)=@_; |
|
&submit_options($request); |
|
} |
|
|
|
sub ungraded { |
|
my ($request)=@_; |
|
&submit_options($request); |
|
} |
|
|
|
sub table { |
|
my ($request)=@_; |
|
&submit_options($request); |
|
} |
|
|
|
sub all_for_one { |
|
my ($request)=@_; |
|
&submit_options($request); |
|
} |
|
|
|
sub submit_options_sequence { |
|
my ($request) = @_; |
|
my ($symb)=&get_symb($request); |
|
if (!$symb) {return '';} |
|
my $probTitle = &Apache::lonnet::gettitle($symb); |
|
|
|
my $receiptalert = &mt("Please enter a receipt number given by a student in the receipt box."); |
|
$request->print(&Apache::lonhtmlcommon::scripttag(<<GRADINGMENUJS)); |
|
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 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("$receiptalert"); |
|
formname.receipt.value = ""; |
|
formname.receipt.focus(); |
|
return false; |
|
} |
|
return true; |
|
} |
|
GRADINGMENUJS |
|
&commonJSfunctions($request); |
|
# my ($table,undef,$hdgrade) = &showResourceInfo($symb,$probTitle); |
|
my $result; |
|
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'}); |
|
|
|
# Preselect sections |
|
my $selsec=""; |
|
if (ref($sections)) { |
|
foreach my $section (sort(@$sections)) { |
|
$selsec.='<option value="'.$section.'" '. |
|
($saveSec eq $section ? 'selected="selected"':'').'>'.$section.'</option>'."\n"; |
|
} |
|
} |
|
|
|
$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="probTitle" value="'.$probTitle.'" />'."\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.=' |
|
<h2> |
|
'.&mt('Grade Complete Folder for One Student').' |
|
</h2> |
|
|
|
<div class="LC_columnSection"> |
|
|
|
<fieldset> |
|
<legend> |
|
'.&mt('Sections').' |
|
</legend> |
|
<select name="section" multiple="multiple" size="5">'."\n"; |
|
$result.= $selsec; |
|
$result.= '<option value="all" '.($saveSec eq 'all' ? 'selected="selected"' : ''). '>all</option></select> '; |
|
$result.=' |
|
</fieldset> |
|
|
|
<fieldset> |
|
<legend> |
|
'.&mt('Groups').' |
|
</legend> |
|
'.&Apache::lonstatistics::GroupSelect('group','multiple',5).' |
|
</fieldset> |
|
|
|
<fieldset> |
|
<legend> |
|
'.&mt('Access Status').' |
|
</legend> |
|
'.&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,5,undef,'mult').' |
|
</fieldset> |
|
|
|
</div> |
|
|
|
<br /> |
|
|
|
<input type="hidden" name="command" value="pickStudentPage" /> |
|
<div> |
|
<input type="submit" value="'.&mt('Next').' →" /> |
|
</div> |
|
</div> |
|
</form>'; |
|
$result .= &show_grading_menu_form($symb); |
|
return $result; |
|
} |
|
|
#--- Displays the submissions first page ------- |
#--- Displays the submissions first page ------- |
sub submit_options { |
sub submit_options { |
Line 8623 sub submit_options {
|
Line 8815 sub submit_options {
|
my $probTitle = &Apache::lonnet::gettitle($symb); |
my $probTitle = &Apache::lonnet::gettitle($symb); |
|
|
my $receiptalert = &mt("Please enter a receipt number given by a student in the receipt box."); |
my $receiptalert = &mt("Please enter a receipt number given by a student in the receipt box."); |
$request->print(<<GRADINGMENUJS); |
$request->print(&Apache::lonhtmlcommon::scripttag(<<GRADINGMENUJS)); |
<script type="text/javascript" language="javascript"> |
|
function checkChoice(formname,val,cmdx) { |
function checkChoice(formname,val,cmdx) { |
if (val <= 2) { |
if (val <= 2) { |
var cmd = radioSelection(formname.radioChoice); |
var cmd = radioSelection(formname.radioChoice); |
Line 8657 sub submit_options {
|
Line 8848 sub submit_options {
|
} |
} |
return true; |
return true; |
} |
} |
</script> |
|
GRADINGMENUJS |
GRADINGMENUJS |
&commonJSfunctions($request); |
&commonJSfunctions($request); |
my ($table,undef,$hdgrade) = &showResourceInfo($symb,$probTitle); |
# my ($table,undef,$hdgrade) = &showResourceInfo($symb,$probTitle); |
my $result; |
my $result; |
my (undef,$sections) = &getclasslist('all','0'); |
my (undef,$sections) = &getclasslist('all','0'); |
my $savedState = &savedState(); |
my $savedState = &savedState(); |
Line 8680 GRADINGMENUJS
|
Line 8870 GRADINGMENUJS
|
|
|
$result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n". |
$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="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="handgrade" value="'.$hdgrade.'" />'."\n". |
# '<input type="hidden" name="handgrade" value="'.$hdgrade.'" />'."\n". |
'<input type="hidden" name="probTitle" value="'.$probTitle.'" />'."\n". |
'<input type="hidden" name="probTitle" value="'.$probTitle.'" />'."\n". |
'<input type="hidden" name="command" value="" />'."\n". |
'<input type="hidden" name="command" value="" />'."\n". |
'<input type="hidden" name="saveState" value="" />'."\n". |
'<input type="hidden" name="saveState" value="" />'."\n". |
Line 8691 GRADINGMENUJS
|
Line 8881 GRADINGMENUJS
|
<h2> |
<h2> |
'.&mt('Grade Current Resource').' |
'.&mt('Grade Current Resource').' |
</h2> |
</h2> |
<div> |
|
'.$table.' |
|
</div> |
|
|
|
<div class="LC_columnSection"> |
<div class="LC_columnSection"> |
|
|
Line 8758 GRADINGMENUJS
|
Line 8945 GRADINGMENUJS
|
</div> |
</div> |
|
|
|
|
<h2> |
|
'.&mt('Grade Complete Folder for One Student').' |
|
</h2> |
|
<div> |
|
<div> |
|
<label> |
|
<input type="radio" name="radioChoice" value="pickStudentPage" '. |
|
($saveCmd eq 'pickStudentPage' ? 'checked="checked"' : '').' /> '. |
|
&mt('The <b>complete</b> page/sequence/folder: For one student').' |
|
</label> |
|
</div> |
|
<div> |
|
<input type="button" onclick="javascript:checkChoice(this.form,\'2\');" value="'.&mt('Next').' →" /> |
|
</div> |
|
</div> |
|
</form>'; |
</form>'; |
$result .= &show_grading_menu_form($symb); |
$result .= &show_grading_menu_form($symb); |
return $result; |
return $result; |
Line 8867 sub process_clicker {
|
Line 9039 sub process_clicker {
|
if (!$symb) {return '';} |
if (!$symb) {return '';} |
my $result=&checkforfile_js(); |
my $result=&checkforfile_js(); |
$env{'form.probTitle'} = &Apache::lonnet::gettitle($symb); |
$env{'form.probTitle'} = &Apache::lonnet::gettitle($symb); |
my ($table) = &showResourceInfo($symb,$env{'form.probTitle'}); |
# my ($table) = &showResourceInfo($symb,$env{'form.probTitle'}); |
$result.=$table; |
# $result.=$table; |
$result.='<br /><table width="100%" border="0"><tr><td bgcolor="#777777">'."\n"; |
$result.='<br /><table width="100%" border="0"><tr><td bgcolor="#777777">'."\n"; |
$result.='<table width="100%" border="0"><tr bgcolor="#e6ffff"><td>'."\n"; |
$result.='<table width="100%" border="0"><tr bgcolor="#e6ffff"><td>'."\n"; |
$result.=' <b>'.&mt('Specify a file containing the clicker information for this resource.'). |
$result.=' <b>'.&mt('Specify a file containing the clicker information for this resource.'). |
Line 8903 sub process_clicker {
|
Line 9075 sub process_clicker {
|
('iclicker' => 'i>clicker', |
('iclicker' => 'i>clicker', |
'interwrite' => 'interwrite PRS')); |
'interwrite' => 'interwrite PRS')); |
$symb = &Apache::lonenc::check_encrypt($symb); |
$symb = &Apache::lonenc::check_encrypt($symb); |
$result.=<<ENDUPFORM; |
$result.= &Apache::lonhtmlcommon::scripttag(<<ENDUPFORM); |
<script type="text/javascript"> |
|
function sanitycheck() { |
function sanitycheck() { |
// Accept only integer percentages |
// Accept only integer percentages |
document.forms.gradesupload.pcorrect.value=Math.round(document.forms.gradesupload.pcorrect.value); |
document.forms.gradesupload.pcorrect.value=Math.round(document.forms.gradesupload.pcorrect.value); |
Line 8942 function sanitycheck() {
|
Line 9113 function sanitycheck() {
|
// Remember the old state |
// Remember the old state |
document.forms.gradesupload.waschecked.value=newgradingchoice; |
document.forms.gradesupload.waschecked.value=newgradingchoice; |
} |
} |
</script> |
ENDUPFORM |
|
$result.= <<ENDUPFORM; |
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload"> |
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload"> |
<input type="hidden" name="symb" value="$symb" /> |
<input type="hidden" name="symb" value="$symb" /> |
<input type="hidden" name="command" value="processclickerfile" /> |
<input type="hidden" name="command" value="processclickerfile" /> |
Line 8961 function sanitycheck() {
|
Line 9133 function sanitycheck() {
|
<br /><label>$pcorrect: <input type="text" name="pcorrect" size="4" value="$env{'form.pcorrect'}" onchange="sanitycheck()" /></label> |
<br /><label>$pcorrect: <input type="text" name="pcorrect" size="4" value="$env{'form.pcorrect'}" onchange="sanitycheck()" /></label> |
<br /><label>$pincorrect: <input type="text" name="pincorrect" size="4" value="$env{'form.pincorrect'}" onchange="sanitycheck()" /></label> |
<br /><label>$pincorrect: <input type="text" name="pincorrect" size="4" value="$env{'form.pincorrect'}" onchange="sanitycheck()" /></label> |
<br /><input type="button" onclick="javascript:checkUpload(this.form);" value="$upload" /> |
<br /><input type="button" onclick="javascript:checkUpload(this.form);" value="$upload" /> |
</form> |
</form>' |
ENDUPFORM |
ENDUPFORM |
$result.='</td></tr></table>'."\n". |
$result.='</td></tr></table>'."\n". |
'</td></tr></table><br /><br />'."\n"; |
'</td></tr></table><br /><br />'."\n"; |
Line 8977 sub process_clicker_file {
|
Line 9149 sub process_clicker_file {
|
my %Saveable_Parameters=&clicker_grading_parameters(); |
my %Saveable_Parameters=&clicker_grading_parameters(); |
&Apache::loncommon::store_course_settings('grades_clicker', |
&Apache::loncommon::store_course_settings('grades_clicker', |
\%Saveable_Parameters); |
\%Saveable_Parameters); |
|
my $result=''; |
my ($result) = &showResourceInfo($symb,$env{'form.probTitle'}); |
# my ($result) = &showResourceInfo($symb,$env{'form.probTitle'}); |
if (($env{'form.gradingmechanism'} eq 'specific') && ($env{'form.specificid'}!~/\w/)) { |
if (($env{'form.gradingmechanism'} eq 'specific') && ($env{'form.specificid'}!~/\w/)) { |
$result.='<span class="LC_error">'.&mt('You need to specify a clicker ID for the correct answer').'</span>'; |
$result.='<span class="LC_error">'.&mt('You need to specify a clicker ID for the correct answer').'</span>'; |
return $result.&show_grading_menu_form($symb); |
return $result.&show_grading_menu_form($symb); |
Line 9217 sub assign_clicker_grades {
|
Line 9389 sub assign_clicker_grades {
|
# FIXME: This should probably look for the first handgradeable part |
# FIXME: This should probably look for the first handgradeable part |
my $part=$$partlist[0]; |
my $part=$$partlist[0]; |
# Start screen output |
# Start screen output |
my ($result) = &showResourceInfo($symb,$env{'form.probTitle'}); |
my $result=''; |
|
# my ($result) = &showResourceInfo($symb,$env{'form.probTitle'}); |
|
|
my $heading=&mt('Assigning grades based on clicker file'); |
my $heading=&mt('Assigning grades based on clicker file'); |
$result.=(<<ENDHEADER); |
$result.=(<<ENDHEADER); |
Line 9320 ENDHEADER
|
Line 9493 ENDHEADER
|
sub navmap_errormsg { |
sub navmap_errormsg { |
return '<div class="LC_error">'. |
return '<div class="LC_error">'. |
&mt('An error occurred retrieving information about resources in the course.').'<br />'. |
&mt('An error occurred retrieving information about resources in the course.').'<br />'. |
&mt('It is recommended that you [_1]re-initialize the course[_2] and then return to this grading page..','<a href="/adm/roles?selectrole=1&newrole='.$env{'request.role'}.'">','</a>'). |
&mt('It is recommended that you [_1]re-initialize the course[_2] and then return to this grading page.','<a href="/adm/roles?selectrole=1&newrole='.$env{'request.role'}.'">','</a>'). |
'</div>'; |
'</div>'; |
} |
} |
|
|
Line 9387 sub handler {
|
Line 9560 sub handler {
|
&processGroup($request); |
&processGroup($request); |
} elsif ($command eq 'gradingmenu' && $perm{'vgr'}) { |
} elsif ($command eq 'gradingmenu' && $perm{'vgr'}) { |
$request->print(&grading_menu($request)); |
$request->print(&grading_menu($request)); |
} elsif ($command eq 'submit_options' && $perm{'vgr'}) { |
} elsif ($command eq 'individual' && $perm{'vgr'}) { |
$request->print(&submit_options($request)); |
$request->print(&individual($request)); |
|
} elsif ($command eq 'ungraded' && $perm{'vgr'}) { |
|
$request->print(&submit_options($request)); |
|
} elsif ($command eq 'table' && $perm{'vgr'}) { |
|
$request->print(&submit_options($request)); |
|
} elsif ($command eq 'all_for_one' && $perm{'vgr'}) { |
|
$request->print(&submit_options_sequence($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'}) { |