');
- hDoc.write("$lt{'txtc'}<\\/b><\\/td> $lt{'font'}<\\/b><\\/td> $lt{'fnst'}<\\/td><\\/tr>");
+ hDoc.write(" Text Color<\\/b><\\/td> Font Size<\\/b><\\/td> Font Style<\\/td><\\/tr>");
}
function highlightbody(clrval,clrtxt,clrsel,szval,sztxt,szsel,syval,sytxt,sysel) {
@@ -1736,14 +1665,13 @@ INNERJS
var hDoc = hwdWin.document;
hDoc.write("<\\/table>");
hDoc.write("<\\/td><\\/tr><\\/table> ");
- hDoc.write(" ");
- hDoc.write(" ");
+ hDoc.write(" ");
+ hDoc.write(" ");
hDoc.write("<\\/form>");
hDoc.write('$end_page_highlight_central');
hDoc.close();
}
-
SUBJAVASCRIPT
}
@@ -1853,7 +1781,7 @@ sub handback_box {
my ($symb,$uname,$udom,$counter,$partid,$record,$res_error) = @_;
my ($partlist,$handgrade,$responseType) = &response_type($symb,$res_error);
my (@respids);
- my @part_response_id = &flatten_responseType($responseType);
+ my @part_response_id = &flatten_responseType($responseType);
foreach my $part_response_id (@part_response_id) {
my ($part,$resp) = @{ $part_response_id };
if ($part eq $partid) {
@@ -1865,10 +1793,9 @@ sub handback_box {
my $prefix = $counter.'_'.$partid.'_'.$respid.'_';
my $files=&get_submitted_files($udom,$uname,$partid,$respid,$record);
next if (!@$files);
- my $file_counter = 0;
+ my $file_counter = 1;
foreach my $file (@$files) {
if ($file =~ /\/portfolio\//) {
- $file_counter++;
my ($file_path, $file_disp) = ($file =~ m|(.+/)(.+)$|);
my ($name,$version,$ext) = &file_name_version_ext($file_disp);
$file_disp = "$name.$ext";
@@ -1876,14 +1803,11 @@ sub handback_box {
$result.=&mt('Return commented version of [_1] to student.',
''.$file_disp.' ');
$result.=' '."\n";
- $result.=' '."\n";
+ $result.=' ';
+ $result.='('.&mt('File will be uploaded when you click on Save & Next below.').') ';
+ $file_counter++;
}
}
- if ($file_counter) {
- $result .= ' '."\n".
- ''.
- '('.&mt('File(s) will be uploaded when you click on Save & Next below.',$file_counter).') ';
- }
}
return $result;
}
@@ -2105,22 +2029,15 @@ sub submission {
$request->print($prnmsg);
if ($env{'form.handgrade'} eq 'yes' && $env{'form.showgrading'} eq 'yes') {
-
- my %lt = &Apache::lonlocal::texthash(
- keyw => 'Keyword Options',
- list => 'List',
- past => 'Paste Selection to List',
- high => 'Highlight Attribute',
- );
#
# Print out the keyword options line
#
$request->print(<$lt{'keyw'}:
-$lt{'list'}
+ Keyword Options:
+List
$lt{'past'}
-$lt{'high'}
+ CLASS="page">Paste Selection to List
+Highlight Attribute
KEYWORDS
#
# Load the other essays for similarity check
@@ -2247,7 +2164,7 @@ KEYWORDS
$lastsubonly.="\n".''.
''.&mt('Part: [_1]',$display_part).' '.
' '.
- '('.&mt('Response ID: [_1]',$respid).')'.
+ '('.&mt('Part ID: [_1]',$respid).')'.
' '.
''.&mt('Nothing submitted - no attempts.').'
';
next;
@@ -2258,12 +2175,6 @@ KEYWORDS
my ($ressub,$hide,$subval) = split(/:/,$submission,3);
# Similarity check
my $similar='';
- my ($type,$trial,$rndseed);
- if ($hide eq 'rand') {
- $type = 'randomizetry';
- $trial = $record{"resource.$partid.tries"};
- $rndseed = $record{"resource.$partid.rndseed"};
- }
if($env{'form.checkPlag'}){
my ($oname,$odom,$ocrsid,$oessay,$osim)=
&most_similar($uname,$udom,$subval,\%old_essays);
@@ -2273,7 +2184,7 @@ KEYWORDS
&Apache::lonnet::coursedescription($ocrsid,
{'one_time' => 1});
- if ($hide eq 'anon') {
+ if ($hide) {
$similar=''.&mt("Essay was found to be similar to another essay submitted for this assignment.").' '.
&mt('As the current submission is for an anonymous survey, no other details are available.').' ';
} else {
@@ -2290,8 +2201,7 @@ KEYWORDS
}
}
}
- my $order=&get_order($partid,$respid,$symb,$uname,$udom,
- undef,$type,$trial,$rndseed);
+ my $order=&get_order($partid,$respid,$symb,$uname,$udom);
if ($env{'form.lastSub'} eq 'lastonly' ||
($env{'form.lastSub'} eq 'hdgrade' &&
$$handgrade{$$part[0].'_'.$$part[1]} eq 'yes')) {
@@ -2299,11 +2209,11 @@ KEYWORDS
$lastsubonly.=''.
''.&mt('Part: [_1]',$display_part).' '.
' '.
- '('.&mt('Response ID: [_1]',$respid).')'.
+ '('.&mt('Part ID: [_1]',$respid).')'.
' ';
my $files=&get_submitted_files($udom,$uname,$partid,$respid,\%record);
if (@$files) {
- if ($hide eq 'anon') {
+ if ($hide) {
$lastsubonly.=' '.&mt('[quant,_1,file] uploaded to this anonymous survey',scalar(@{$files}));
} else {
$lastsubonly.=''.&mt('Like all files provided by users, this file may contain viruses').' ';
@@ -2314,12 +2224,12 @@ KEYWORDS
}
$lastsubonly.=' ';
}
- if ($hide eq 'anon') {
+ if ($hide) {
$lastsubonly.=''.&mt('Anonymous Survey').' ';
} else {
$lastsubonly.=''.&mt('Submitted Answer:').' '.
&cleanRecord($subval,$responsetype,$symb,$partid,
- $respid,\%record,$order,undef,$uname,$udom,$type,$trial,$rndseed);
+ $respid,\%record,$order,undef,$uname,$udom);
}
if ($similar) {$lastsubonly.=" $similar\n";}
$lastsubonly.='
';
@@ -2330,7 +2240,9 @@ KEYWORDS
}
$request->print($lastsubonly);
} 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));
} elsif ($env{'form.lastSub'} =~ /^(last|all)$/) {
$request->print(&Apache::loncommon::get_previous_attempt($symb,$uname,$udom,
@@ -2469,10 +2381,10 @@ sub check_collaborators {
next if ($record->{'resource.'.$part.'.collaborators'} eq '');
my (@good_collaborators, @bad_collaborators);
foreach my $possible_collaborator
- (split(/[,;\s]+/,$record->{'resource.'.$part.'.collaborators'})) {
+ (split(/,?\s+/,$record->{'resource.'.$part.'.collaborators'})) {
$possible_collaborator =~ s/[\$\^\(\)]//g;
next if ($possible_collaborator eq '');
- my ($co_name,$co_dom) = split(/:/,$possible_collaborator);
+ my ($co_name,$co_dom) = split(/\@|:/,$possible_collaborator);
$co_dom = $udom if (! defined($co_dom) || $co_dom =~ /^domain$/i);
next if ($co_name eq $uname && $co_dom eq $udom);
# Doing this grep allows 'fuzzy' specification
@@ -2485,13 +2397,13 @@ sub check_collaborators {
}
}
if (scalar(@good_collaborators) != 0) {
- $result.=' '.&mt('Collaborators:').'';
+ $result.=' '.&mt('Collaborators: ');
foreach my $name (@good_collaborators) {
my ($lastname,$givenn) = split(/,/,$$fullname{$name});
push(@col_fullnames, $givenn.' '.$lastname);
- $result.=''.$fullname->{$name}.' ';
+ $result.=$fullname->{$name}.' ';
}
- $result.=' '."\n";
+ $result.=' '."\n";
my ($part)=split(/\./,$part);
$result.=' '.
@@ -2527,51 +2439,35 @@ sub get_last_submission {
&Apache::lonlocal::locallocaltime($$returnhash{$version.':timestamp'});
}
}
- my (%typeparts,%randombytry);
+ 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') ||
- ($lasthash{$key} eq 'randomizetry')) {
+ ($lasthash{$key} eq 'anonsurveycred')) {
my ($ign,@parts) = split(/\./,$key);
pop(@parts);
- my $id = join('.',@parts);
- if ($lasthash{$key} eq 'randomizetry') {
- $randombytry{$ign.'.'.$id} = $lasthash{$key};
- } else {
- unless ($showsurv) {
- $typeparts{$ign.'.'.$id} = $lasthash{$key};
- }
+ unless ($showsurv) {
+ my $id = join(',',@parts);
+ $typeparts{$ign.'.'.$id} = $lasthash{$key};
}
delete($lasthash{$key});
}
}
}
my @hidden = keys(%typeparts);
- my @randomize = keys(%randombytry);
foreach my $key (keys(%lasthash)) {
next if ($key !~ /\.submission$/);
my $hide;
if (@hidden) {
foreach my $id (@hidden) {
if ($key =~ /^\Q$id\E/) {
- $hide = 'anon';
+ $hide = 1;
last;
}
}
}
- unless ($hide) {
- if (@randomize) {
- foreach my $id (@hidden) {
- if ($key =~ /^\Q$id\E/) {
- $hide = 'rand';
- last;
- }
- }
- }
- }
my ($partid,$foo) = split(/submission$/,$key);
my $draft = $lasthash{$partid.'awarddetail'} eq 'DRAFT' ?
'Draft Copy ' : '';
@@ -2650,7 +2546,7 @@ sub processHandGrade {
undef,undef,$showsymb,
$restitle);
$request->print(' '.&mt('Sending message to [_1]',$uname.':'.$udom).': '.
- $msgstatus.' ');
+ $msgstatus);
}
if ($env{'form.collaborator'.$ctr}) {
my @collabstrs=&Apache::loncommon::get_env_multiple("form.collaborator$ctr");
@@ -2742,7 +2638,7 @@ sub processHandGrade {
# Go directly to grade student - from submission or link from chart page
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'}};
($env{'form.student'},$env{'form.userdom'}) = split(/:/,$processUser);
$env{'form.fullname'} = $$fullname{$processUser};
@@ -2836,7 +2732,7 @@ sub processHandGrade {
}
if ($total < 0) {
my $the_end = ''.&mt('LON-CAPA User Message').' '."\n";
- $the_end.=''.&mt('[_1]Message:[_2] No more students for this section or class.','',' ').'
'."\n";
+ $the_end.=&mt('Message: No more students for this section or class.').' '."\n";
$the_end.=&mt('Click on the button below to return to the grading menu.').' '."\n";
$the_end.=&show_grading_menu_form($symb);
$request->print($the_end);
@@ -2989,79 +2885,64 @@ sub handback_files {
$request->print(' '.&navmap_errormsg().' ');
return;
}
- my @handedback;
- my $file_msg;
my @part_response_id = &flatten_responseType($responseType);
foreach my $part_response_id (@part_response_id) {
my ($part_id,$resp_id) = @{ $part_response_id };
my $part_resp = join('_',@{ $part_response_id });
- if (($env{'form.'.$newflg.'_'.$part_resp.'_countreturndoc'} =~ /^\d+$/) & ($new_part eq $part_id)) {
- for (my $counter=1; $counter<=$env{'form.'.$newflg.'_'.$part_resp.'_countreturndoc'}; $counter++) {
+ if (($env{'form.'.$newflg.'_'.$part_resp.'_returndoc1'}) && ($new_part == $part_id)) {
# if multiple files are uploaded names will be 'returndoc2','returndoc3'
- if ($env{'form.'.$newflg.'_'.$part_resp.'_returndoc'.$counter}) {
- my $fname=$env{'form.'.$newflg.'_'.$part_resp.'_returndoc'.$counter.'.filename'};
+ my $file_counter = 1;
+ my $file_msg;
+ while ($env{'form.'.$newflg.'_'.$part_resp.'_returndoc'.$file_counter}) {
+ my $fname=$env{'form.'.$newflg.'_'.$part_resp.'_returndoc'.$file_counter.'.filename'};
my ($directory,$answer_file) =
- ($env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$counter} =~ /^(.*?)([^\/]*)$/);
+ ($env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$file_counter} =~ /^(.*?)([^\/]*)$/);
my ($answer_name,$answer_ver,$answer_ext) =
&file_name_version_ext($answer_file);
my ($portfolio_path) = ($directory =~ /^.+$stuname\/portfolio(.*)/);
my $getpropath = 1;
- my ($dir_list,$listerror) =
- &Apache::lonnet::dirlist($portfolio_root.$portfolio_path,
- $domain,$stuname,$getpropath);
- my $version = &get_next_version($answer_name,$answer_ext,$dir_list);
+ my @dir_list = &Apache::lonnet::dirlist($portfolio_root.$portfolio_path,$domain,$stuname,$getpropath);
+ my $version = &get_next_version($answer_name, $answer_ext, \@dir_list);
# fix file name
my ($save_file_name) = (($directory.$answer_name.".$version.".$answer_ext) =~ /^.+\/${stuname}\/(.*)/);
my $result=&Apache::lonnet::finishuserfileupload($stuname,$domain,
- $newflg.'_'.$part_resp.'_returndoc'.$counter,
+ $newflg.'_'.$part_resp.'_returndoc'.$file_counter,
$save_file_name);
if ($result !~ m|^/uploaded/|) {
$request->print(''.
&mt('An error occurred ([_1]) while trying to upload [_2].',
- $result,$newflg.'_'.$part_resp.'_returndoc'.$counter).
+ $result,$newflg.'_'.$part_resp.'_returndoc'.$file_counter).
' ');
} else {
# mark the file as read only
- push(@handedback,$save_file_name);
+ my @files = ($save_file_name);
+ my @what = ($symb,$env{'request.course.id'},'handback');
+ &Apache::lonnet::mark_as_readonly($domain,$stuname,\@files,\@what);
if (exists($$newrecord{"resource.$new_part.$resp_id.handback"})) {
$$newrecord{"resource.$new_part.$resp_id.handback"}.=',';
}
$$newrecord{"resource.$new_part.$resp_id.handback"} .= $save_file_name;
- $file_msg.=''.$save_file_name." ";
+ $file_msg.= "\n".''.$save_file_name." ";
}
- $request->print(' '.&mt('[_1] will be the uploaded file name [_2]',''.$fname.' ',''.$env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$counter}.' '));
+ $request->print(" ".$fname." will be the uploaded file name");
+ $request->print(" ".$env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$file_counter});
+ $file_counter++;
}
+ my $subject = "File Handed Back by Instructor ";
+ my $message = "A file has been returned that was originally submitted in reponse to: ";
+ $message .= "".&Apache::lonnet::gettitle($symb)." ";
+ $message .= ' The returned file(s) are named: '. $file_msg;
+ $message .= " and can be found in your portfolio space.";
+ my ($feedurl,$showsymb) =
+ &get_feedurl_and_symb($symb,$domain,$stuname);
+ my $restitle = &Apache::lonnet::gettitle($symb);
+ my $msgstatus =
+ &Apache::lonmsg::user_normal_msg($stuname,$domain,$subject.
+ ' (File Returned) ['.$restitle.']',$message,undef,
+ $feedurl,undef,undef,undef,$showsymb,$restitle);
}
}
- }
- if (@handedback > 0) {
- $request->print(' ');
- my @what = ($symb,$env{'request.course.id'},'handback');
- &Apache::lonnet::mark_as_readonly($domain,$stuname,\@handedback,\@what);
- my $user_lh = &Apache::loncommon::user_lang($stuname,$domain,$env{'request.course.id'});
- my ($subject,$message);
- if (scalar(@handedback) == 1) {
- $subject = &mt_user($user_lh,'File Handed Back by Instructor');
- } else {
- $subject = &mt_user($user_lh,'Files Handed Back by Instructor');
- $message = &mt_user($user_lh,'Files have been returned that were originally submitted in response to: ');
- }
- $message .= "".&Apache::lonnet::gettitle($symb)."
";
- $message .= &mt_user($user_lh,'The returned file(s) are named: [_1]'," $file_msg ").
- &mt_user($user_lh,'The file(s) can be found in your [_1]portfolio[_2].','',' ');
- my ($feedurl,$showsymb) =
- &get_feedurl_and_symb($symb,$domain,$stuname);
- my $restitle = &Apache::lonnet::gettitle($symb);
- $subject .= ' '.&mt_user($user_lh,'(File Returned)').' ['.$restitle.']';
- my $msgstatus =
- &Apache::lonmsg::user_normal_msg($stuname,$domain,$subject,
- $message,undef,$feedurl,undef,undef,undef,$showsymb,
- $restitle);
- if ($msgstatus) {
- $request->print(&mt('Notification message status: [_1]',''.$msgstatus.' ').' ');
- }
- }
return;
}
@@ -3169,11 +3050,9 @@ sub version_portfiles {
my ($directory,$answer_file) =($file =~ /^(.*?)([^\/]*)$/);
my ($answer_name,$answer_ver,$answer_ext) =
&file_name_version_ext($answer_file);
- my $getpropath = 1;
- my ($dir_list,$listerror) =
- &Apache::lonnet::dirlist($portfolio_root.$directory,$domain,
- $stu_name,$getpropath);
- my $version = &get_next_version($answer_name,$answer_ext,$dir_list);
+ my $getpropath = 1;
+ my @dir_list = &Apache::lonnet::dirlist($portfolio_root.$directory,$domain,$stu_name,$getpropath);
+ my $version = &get_next_version($answer_name, $answer_ext, \@dir_list);
my $new_answer = &version_selected_portfile($domain, $stu_name, $directory, $answer_file, $version);
if ($new_answer ne 'problem getting file') {
push(@versioned_portfiles, $directory.$new_answer);
@@ -3192,24 +3071,21 @@ sub version_portfiles {
sub get_next_version {
my ($answer_name, $answer_ext, $dir_list) = @_;
my $version;
- if (ref($dir_list) eq 'ARRAY') {
- foreach my $row (@{$dir_list}) {
- my ($file) = split(/\&/,$row,2);
- my ($file_name,$file_version,$file_ext) =
- &file_name_version_ext($file);
- if (($file_name eq $answer_name) &&
- ($file_ext eq $answer_ext)) {
- # gets here if filename and extension match,
- # regardless of version
+ foreach my $row (@$dir_list) {
+ my ($file) = split(/\&/,$row,2);
+ my ($file_name,$file_version,$file_ext) =
+ &file_name_version_ext($file);
+ if (($file_name eq $answer_name) &&
+ ($file_ext eq $answer_ext)) {
+ # gets here if filename and extension match, regardless of version
if ($file_version ne '') {
- # a versioned file is found so save it for later
- if ($file_version > $version) {
- $version = $file_version;
- }
+ # a versioned file is found so save it for later
+ if ($file_version > $version) {
+ $version = $file_version;
}
}
}
- }
+ }
$version ++;
return($version);
}
@@ -3256,8 +3132,7 @@ sub viewgrades_js {
my ($request) = shift;
my $alertmsg = &mt('A number equal or greater than 0 is expected. Entered value = ');
- $request->print(<
+ $request->print(&Apache::lonhtmlcommon::scripttag(<
VIEWJAVASCRIPT
}
@@ -3994,7 +3868,8 @@ sub csvuploadmap_header {
$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 $ignore=&mt('Ignore First Line');
$symb = &Apache::lonenc::check_encrypt($symb);
@@ -4021,10 +3896,8 @@ to this page if the data selected is ins
-
ENDPICK
+ $request->print(&Apache::lonhtmlcommon::scripttag($javascript));
return '';
}
@@ -4069,8 +3942,7 @@ ENDPICK
sub checkforfile_js {
my $alertmsg = &mt('Please use the browse button to select a file from your local directory.');
- my $result =<
+ my $result = &Apache::lonhtmlcommon::scripttag(<
CSVFORMJS
return $result;
}
@@ -4089,13 +3960,13 @@ sub upcsvScores_form {
if (!$symb) {return '';}
my $result=&checkforfile_js();
$env{'form.probTitle'} = &Apache::lonnet::gettitle($symb);
- my ($table) = &showResourceInfo($symb,$env{'form.probTitle'});
- $result.=$table;
+# my ($table) = &showResourceInfo($symb,$env{'form.probTitle'});
+# $result.=$table;
$result.=''."\n";
$result.=''."\n";
$result.=' '.&mt('Specify a file containing the class scores for current resource.').
' '."\n";
- $result.=''."\n";
+ $result.=' '."\n";
my $upload=&mt("Upload Scores");
my $upfile_select=&Apache::loncommon::upfile_select_html();
my $ignore=&mt('Ignore First Line');
@@ -4243,7 +4114,6 @@ sub csvuploadassign {
my ($classlist) = &getclasslist('all',0);
my @notallowed;
my @skipped;
- my @warnings;
my $countdone=0;
foreach my $grade (@gradedata) {
my %entries=&Apache::loncommon::record_sep($grade);
@@ -4292,9 +4162,6 @@ sub csvuploadassign {
my $pcr=$entries{$fields{$dest}} / $wgt;
my $award=($pcr == 0) ? 'incorrect_by_override'
: 'correct_by_override';
- if ($pcr>1) {
- push(@warnings,&mt("[_1]: point value larger than weight","$username:$domain"));
- }
$grades{"resource.$part.awarded"}=$pcr;
$grades{"resource.$part.solved"}=$award;
$points{$part}=1;
@@ -4323,11 +4190,6 @@ sub csvuploadassign {
$domain,$username);
if ($result eq 'ok') {
$request->print('.');
-# Remove from grading queue
- &Apache::bridgetask::remove_from_queue('gradingqueue',$symb,
- $env{'course.'.$env{'request.course.id'}.'.domain'},
- $env{'course.'.$env{'request.course.id'}.'.num'},
- $domain,$username);
} else {
$request->print("".
&mt("Failed to save data for student [_1]. Message when trying to save was: [_2]",
@@ -4338,10 +4200,6 @@ sub csvuploadassign {
}
}
$request->print(' '.&Apache::lonhtmlcommon::confirm_success(&mt("Saved scores for [quant,_1,student]",$countdone),$countdone==0));
- if (@warnings) {
- $request->print(' '.&Apache::lonhtmlcommon::confirm_success(&mt('Warnings generated for the following saved scores:'),1).' ');
- $request->print(join(', ',@warnings));
- }
if (@skipped) {
$request->print(' '.&Apache::lonhtmlcommon::confirm_success(&mt('No scores stored for the following username(s):'),1).' ');
$request->print(join(', ',@skipped));
@@ -4365,8 +4223,7 @@ sub pickStudentPage {
my ($request) = shift;
my $alertmsg = &mt('Please select the student you wish to grade.');
- $request->print(<
+ $request->print(&Apache::lonhtmlcommon::scripttag(<
LISTJAVASCRIPT
&commonJSfunctions($request);
my ($symb) = &get_symb($request);
@@ -4614,8 +4470,8 @@ sub displayPage {
&Apache::loncommon::start_data_table_row().
''.$prob.
(scalar(@{$parts}) == 1 ? ''
- : ' ('.&mt('[_1]parts)',
- scalar(@{$parts}).' ')
+ : ' ('.&mt('[_1] parts)',
+ scalar(@{$parts}))
).
' ';
$studentTable.='';
@@ -4710,7 +4566,6 @@ sub displaySubByDates {
my $interaction;
my $no_increment = 1;
- my %lastrndseed;
for ($version=1;$version<=$$record{'version'};$version++) {
my $timestamp =
&Apache::lonlocal::locallocaltime($$record{$version.':timestamp'});
@@ -4728,9 +4583,9 @@ sub displaySubByDates {
my @versionKeys = split(/\:/,$$record{$version.':keys'});
my @displaySub = ();
foreach my $partid (@{$parts}) {
- my ($hidden,$type);
- $type = $$record{$version.':resource.'.$partid.'.type'};
- if (($type eq 'anonsurvey') || ($type eq 'anonsurveycred')) {
+ 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)
@@ -4747,39 +4602,29 @@ sub displaySubByDates {
$displaySub[0].=''.&mt('Part: [_1]',$display_part).''
.' '
- .'('.&mt('Response ID: [_1]',$responseId).')'
+ .'('.&mt('Part ID: [_1]',$responseId).')'
.' '
.' ';
if ($hidden) {
$displaySub[0].= &mt('Anonymous Survey').' ';
} else {
- my ($trial,$rndseed,$newvariation);
- if ($type eq 'randomizetry') {
- $trial = $$record{"$where.$partid.tries"};
- $rndseed = $$record{"$where.$partid.rndseed"};
- }
if ($$record{"$where.$partid.tries"} eq '') {
$displaySub[0].=&mt('Trial not counted');
} else {
$displaySub[0].=&mt('Trial: [_1]',
$$record{"$where.$partid.tries"});
- if ($rndseed || $lastrndseed{$partid}) {
- if ($rndseed ne $lastrndseed{$partid}) {
- $newvariation = ' ('.&mt('New variation this try').')';
- }
- }
}
my $responseType=($isTask ? 'Task'
: $responseType->{$partid}->{$responseId});
if (!exists($orders{$partid})) { $orders{$partid}={}; }
- if ((!exists($orders{$partid}->{$responseId})) || ($trial)) {
+ if (!exists($orders{$partid}->{$responseId})) {
$orders{$partid}->{$responseId}=
&get_order($partid,$responseId,$symb,$uname,$udom,
- $no_increment,$type,$trial,$rndseed);
+ $no_increment);
}
- $displaySub[0].=''.$newvariation.' '; # /nobreak
+ $displaySub[0].=''; # /nobreak
$displaySub[0].=' '.
- &cleanRecord($$record{$version.':'.$matchKey},$responseType,$symb,$partid,$responseId,$record,$orders{$partid}->{$responseId},"$version:",$uname,$udom,$type,$trial,$rndseed).' ';
+ &cleanRecord($$record{$version.':'.$matchKey},$responseType,$symb,$partid,$responseId,$record,$orders{$partid}->{$responseId},"$version:",$uname,$udom).' ';
}
}
}
@@ -4881,7 +4726,7 @@ sub updateGradeByPage {
&Apache::loncommon::start_data_table_row().
' '.$prob.
(scalar(@{$parts}) == 1 ? ''
- : ' ('.&mt('[quant,_1,part]',scalar(@{$parts}))
+ : ' ('.&mt('[quant,_1, part]',scalar(@{$parts}))
.')').' ';
$studentTable.=' '.$title.' ';
@@ -5004,12 +4849,12 @@ sub updateGradeByPage {
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 bubblesheet
+ representing the line of bubbles that are on the physical bubble sheet
-The overall process is that a scanned in bubblesheet data is uploaded
+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 bubblesheet info, and pick
+sequence/folder of resources, a file of bubble sheet info, and pick
one of the predefined configurations for what each scanline looks
like.
@@ -5025,14 +4870,14 @@ username:domain.
During the validation phase the instructor can choose to skip scanlines.
-After the validation phase, there are now 3 bubblesheet files
+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 bubblesheet
+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
@@ -5168,16 +5013,14 @@ sub scantron_filenames {
my $cdom=$env{'course.'.$env{'request.course.id'}.'.domain'};
my $cname=$env{'course.'.$env{'request.course.id'}.'.num'};
my $getpropath = 1;
- my ($dirlist,$listerror) = &Apache::lonnet::dirlist('userfiles',$cdom,
- $cname,$getpropath);
+ my @files=&Apache::lonnet::dirlist('userfiles',$cdom,$cname,
+ $getpropath);
my @possiblenames;
- if (ref($dirlist) eq 'ARRAY') {
- foreach my $filename (sort(@{$dirlist})) {
- ($filename)=split(/&/,$filename);
- if ($filename!~/^scantron_orig_/) { next ; }
- $filename=~s/^scantron_orig_//;
- push(@possiblenames,$filename);
- }
+ foreach my $filename (sort(@files)) {
+ ($filename)=split(/&/,$filename);
+ if ($filename!~/^scantron_orig_/) { next ; }
+ $filename=~s/^scantron_orig_//;
+ push(@possiblenames,$filename);
}
return @possiblenames;
}
@@ -5331,7 +5174,7 @@ sub scantron_CODEunique {
=item scantron_selectphase
- Generates the initial screen to start the bubblesheet process.
+ Generates the initial screen to start the bubble sheet process.
Allows for - starting a grading run.
- downloading existing scan data (original, corrected
or skipped info)
@@ -5364,54 +5207,6 @@ sub scantron_selectphase {
$ssi_error = 0;
- if (&Apache::lonnet::allowed('usc',$env{'request.role.domain'}) ||
- &Apache::lonnet::allowed('usc',$env{'request.course.id'})) {
-
- # Chunk of form to prompt for a scantron file upload.
-
- $r->print('
-
- '.&Apache::loncommon::start_data_table('LC_scantron_action').'
- '.&Apache::loncommon::start_data_table_header_row().'
-
- '.&mt('Specify a bubblesheet data file to upload.').'
-
- '.&Apache::loncommon::end_data_table_header_row().'
- '.&Apache::loncommon::start_data_table_row().'
-
-');
- my $default_form_data=&defaultFormData(&get_symb($r,1));
- my $cdom= $env{'course.'.$env{'request.course.id'}.'.domain'};
- my $cnum= $env{'course.'.$env{'request.course.id'}.'.num'};
- $r->print('
-
-
-
-');
-
- $r->print('
-
- '.&Apache::loncommon::end_data_table_row().'
- '.&Apache::loncommon::end_data_table().'
-');
- }
-
# Chunk of form to prompt for a file to grade and how:
$result.= '
@@ -5459,6 +5254,52 @@ sub scantron_selectphase {
$r->print($result);
+ if (&Apache::lonnet::allowed('usc',$env{'request.role.domain'}) ||
+ &Apache::lonnet::allowed('usc',$env{'request.course.id'})) {
+
+ # Chunk of form to prompt for a scantron file upload.
+
+ $r->print('
+
+ '.&Apache::loncommon::start_data_table('LC_scantron_action').'
+ '.&Apache::loncommon::start_data_table_header_row().'
+
+ '.&mt('Specify a bubblesheet data file to upload.').'
+
+ '.&Apache::loncommon::end_data_table_header_row().'
+ '.&Apache::loncommon::start_data_table_row().'
+
+');
+ my $default_form_data=&defaultFormData(&get_symb($r,1));
+ my $cdom= $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $cnum= $env{'course.'.$env{'request.course.id'}.'.num'};
+ $r->print(&Apache::lonhtmlcommon::scripttag('
+ function checkUpload(formname) {
+ if (formname.upfile.value == "") {
+ alert("'.&mt('Please use the browse button to select a file from your local directory.').'");
+ return false;
+ }
+ formname.submit();
+ }'));
+ $r->print('
+
+');
+
+ $r->print('
+
+ '.&Apache::loncommon::end_data_table_row().'
+ '.&Apache::loncommon::end_data_table().'
+');
+ }
+
# Chunk of the form that prompts to view a scoring office file,
# corrected file, skipped records in a file.
@@ -5575,8 +5416,6 @@ sub scantron_selectphase {
LastName - column that the last name starts in
LastNameLength - number of columns that the last name spans
- BubblesPerRow - number of bubbles available in each row used to
- bubble an answer. (If not specified, 10 assumed).
=cut
@@ -5607,7 +5446,6 @@ sub get_scantron_config {
$config{'FirstNamelength'}=$config[14];
$config{'LastName'}=$config[15];
$config{'LastNamelength'}=$config[16];
- $config{'BubblesPerRow'}=$config[17];
last;
}
return %config;
@@ -6357,7 +6195,7 @@ sub remember_current_skipped {
=item check_for_error
Checks if there was an error when attempting to remove a specific
- scantron_.. bubblesheet data file. Prints out an error if
+ scantron_.. bubble sheet data file. Prints out an error if
something went wrong.
=cut
@@ -6428,15 +6266,15 @@ sub scantron_do_warning {
if ( $env{'form.selectpage'} eq '' ||
$env{'form.scantron_selectfile'} eq '' ||
$env{'form.scantron_format'} eq '' ) {
- $r->print("".&mt('You have forgotten to specify some information. Please go Back and try again.')."
");
+ $r->print("".&mt('You have forgetten to specify some information. Please go Back and try again.')."
");
if ( $env{'form.selectpage'} eq '') {
$r->print(''.&mt('You have not selected a Sequence to grade').'
');
}
if ( $env{'form.scantron_selectfile'} eq '') {
- $r->print(''.&mt("You have not selected a file that contains the student's response data.").'
');
+ $r->print(''.&mt('You have not selected a file that contains the student\'s response data.').'
');
}
if ( $env{'form.scantron_format'} eq '') {
- $r->print(''.&mt("You have not selected the format of the student's response data.").'
');
+ $r->print(''.&mt('You have not selected a the format of the student\'s response data.').'
');
}
} else {
my $warning=&scantron_warning_screen('Grading: Validate Records');
@@ -6493,7 +6331,7 @@ SCANTRONFORM
=item scantron_validate_file
- Dispatch routine for doing validation of a bubblesheet data 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,
@@ -6531,8 +6369,7 @@ sub scantron_validate_file {
#get the student pick code ready
$r->print(&Apache::loncommon::studentbrowser_javascript());
my $nav_error;
- my %scantron_config=&get_scantron_config($env{'form.scantron_format'});
- my $max_bubble=&scantron_get_maxbubble(\$nav_error,\%scantron_config);
+ my $max_bubble=&scantron_get_maxbubble(\$nav_error);
if ($nav_error) {
$r->print(&navmap_errormsg());
return '';
@@ -6605,7 +6442,7 @@ sub scantron_validate_file {
=item scantron_remove_file
- Removes the requested bubblesheet data file, makes sure that
+ Removes the requested bubble sheet data file, makes sure that
scantron_original_ is never removed
@@ -6630,7 +6467,7 @@ sub scantron_remove_file {
=item scantron_remove_scan_data
- Removes all scan_data correction for the requested bubblesheet
+ 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.)
@@ -6667,7 +6504,7 @@ sub scantron_remove_scan_data {
=item scantron_getfile
- Fetches the requested bubblesheet data file (all 3 versions), and
+ Fetches the requested bubble sheet data file (all 3 versions), and
the scan_data hash
Arguments:
@@ -6767,7 +6604,7 @@ sub lonnet_putfile {
=item scantron_putfile
- Stores the current version of the bubblesheet data files, and the
+ 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.
@@ -6861,7 +6698,7 @@ sub get_todo_count {
=item scantron_put_line
- Updates the 'corrected' or 'skipped' versions of the bubblesheet
+ Updates the 'corrected' or 'skipped' versions of the bubble sheet
data file.
Arguments:
@@ -6985,7 +6822,7 @@ sub scantron_validate_ID {
my ($scanlines,$scan_data)=&scantron_getfile();
my $nav_error;
- &scantron_get_maxbubble(\$nav_error,\%scantron_config); # parse needs the bubble_lines.. array.
+ &scantron_get_maxbubble(\$nav_error); # parse needs the bubble_lines.. array.
if ($nav_error) {
$r->print(&navmap_errormsg());
return(1,$currentphase);
@@ -7050,28 +6887,19 @@ sub scantron_get_correction {
#the previous one or the current one
if ( $$scan_record{'scantron.PaperID'} =~ /\S/) {
- $r->print(
- ''
- .&mt('An error was detected ([_1]) for PaperID [_2]',
- "$error ",
- ''.$$scan_record{'scantron.PaperID'}.' ')
- ."
\n");
+ $r->print("".&mt("An error was detected ($error) ".
+ " for PaperID [_1] ",
+ $$scan_record{'scantron.PaperID'})."
\n");
} else {
- $r->print(
- ''
- .&mt('An error was detected ([_1]) in scanline [_2] [_3]',
- "$error ", $i, "
$line ")
- ."
\n");
- }
- my $message =
- ''
- .&mt('The ID on the form is [_1]',
- "$$scan_record{'scantron.ID'} ")
- .' '
- .&mt('The name on the paper is [_1], [_2]',
- $$scan_record{'scantron.LastName'},
- $$scan_record{'scantron.FirstName'})
- .'
';
+ $r->print("".&mt("An error was detected ($error) ".
+ " in scanline [_1]
[_2] ",
+ $i,$line)." \n");
+ }
+ my $message="".&mt("The ID on the form is [_1] ".
+ "The name on the paper is [_2],[_3]",
+ $$scan_record{'scantron.ID'},
+ $$scan_record{'scantron.LastName'},
+ $$scan_record{'scantron.FirstName'})."
";
$r->print(' '."\n");
$r->print(' '."\n");
@@ -7081,10 +6909,10 @@ sub scantron_get_correction {
if ($error =~ /ID$/) {
if ($error eq 'incorrectID') {
- $r->print(''.&mt("The encoded ID is not in the classlist").
+ $r->print("
".&mt("The encoded ID is not in the classlist").
"
\n");
} elsif ($error eq 'duplicateID') {
- $r->print(''.&mt("The encoded ID has also been used by a previous paper [_1]",$arg)."
\n");
+ $r->print("".&mt("The encoded ID has also been used by a previous paper [_1]",$arg)."
\n");
}
$r->print($message);
$r->print("".&mt("How should I handle this?")." \n");
@@ -7100,15 +6928,14 @@ sub scantron_get_correction {
$r->print('');
} elsif ($error =~ /CODE$/) {
if ($error eq 'incorrectCODE') {
- $r->print('
'.&mt("The encoded CODE is not in the list of possible CODEs.")."
\n");
+ $r->print("".&mt("The encoded CODE is not in the list of possible CODEs.")."
\n");
} elsif ($error eq 'duplicateCODE') {
- $r->print(''.&mt("The encoded CODE has also been used by a previous paper [_1], and CODEs are supposed to be unique.",join(', ',@{$arg}))."
\n");
+ $r->print("".&mt("The encoded CODE has also been used by a previous paper [_1], and CODEs are supposed to be unique.",join(', ',@{$arg}))."
\n");
}
- $r->print("".&mt('The CODE on the form is [_1]',
- "'$$scan_record{'scantron.CODE'}' ")
- ."
\n");
+ $r->print("".&mt("The CODE on the form is '[_1]' ",
+ $$scan_record{'scantron.CODE'})." \n");
$r->print($message);
- $r->print("
".&mt("How should I handle this?")."
\n");
+ $r->print("".&mt("How should I handle this?")." \n");
$r->print("\n ");
my $i=0;
if ($error eq 'incorrectCODE'
@@ -7135,14 +6962,13 @@ sub scantron_get_correction {
$r->print("
- ".&mt("Use the CODE [_1] that was on the paper, ignoring the error.",
+ ".&mt("Use the CODE [_1] that is was on the paper, ignoring the error.",
"".$$scan_record{'scantron.CODE'}." ")."
");
$r->print("\n ");
}
- $r->print(<
+ $r->print(&Apache::lonhtmlcommon::scripttag(<
ENDSCRIPT
my $href="/adm/pickcode?".
"form=".&escape("scantronupload").
@@ -7175,7 +7000,7 @@ ENDSCRIPT
" "));
$r->print("\n ");
} elsif ($error eq 'doublebubble') {
- $r->print(''.&mt("There have been multiple bubbles scanned for some question(s)")."
\n");
+ $r->print("".&mt("There have been multiple bubbles scanned for some question(s)")."
\n");
# The form field scantron_questions is acutally a list of line numbers.
# represented by this form so:
@@ -7193,7 +7018,7 @@ ENDSCRIPT
}
$r->print(&verify_bubbles_checked(@lines_to_correct));
} elsif ($error eq 'missingbubble') {
- $r->print(''.&mt("There have been [_1]no[_2] bubbles scanned for some question(s)",'',' ')."
\n");
+ $r->print("".&mt("There have been no bubbles scanned for some question(s)")."
\n");
$r->print($message);
$r->print("".&mt("Please indicate which bubble should be used for grading.")."
");
$r->print(&mt("Some questions have no scanned bubbles.")."\n");
@@ -7222,8 +7047,7 @@ sub verify_bubbles_checked {
my (@ansnums) = @_;
my $ansnumstr = join('","',@ansnums);
my $warning = &mt("A bubble or 'No bubble' selection has not been made for one or more lines.");
- my $output = (<
+ my $output = &Apache::lonhtmlcommon::scripttag((<
ENDSCRIPT
return $output;
}
@@ -7398,19 +7221,7 @@ sub scantron_bubble_selector {
my $max=$$scan_config{'Qlength'};
my $scmode=$$scan_config{'Qon'};
- if ($scmode eq 'number' || $scmode eq 'letter') {
- if (($$scan_config{'BubblesPerRow'} =~ /^\d+$/) &&
- ($$scan_config{'BubblesPerRow'} > 0)) {
- $max=$$scan_config{'BubblesPerRow'};
- if (($scmode eq 'number') && ($max > 10)) {
- $max = 10;
- } elsif (($scmode eq 'letter') && $max > 26) {
- $max = 26;
- }
- } else {
- $max = 10;
- }
- }
+ if ($scmode eq 'number' || $scmode eq 'letter') { $max=10; }
my @alphabet=('A'..'Z');
$r->print(&Apache::loncommon::start_data_table().
@@ -7565,7 +7376,7 @@ sub scantron_validate_CODE {
my %allcodes=&get_codes();
my $nav_error;
- &scantron_get_maxbubble(\$nav_error,\%scantron_config); # parse needs the lines per response array.
+ &scantron_get_maxbubble(\$nav_error); # parse needs the lines per response array.
if ($nav_error) {
$r->print(&navmap_errormsg());
return(1,$currentphase);
@@ -7624,7 +7435,7 @@ sub scantron_validate_doublebubble {
my %scantron_config=&get_scantron_config($env{'form.scantron_format'});
my ($scanlines,$scan_data)=&scantron_getfile();
my $nav_error;
- &scantron_get_maxbubble(\$nav_error,\%scantron_config); # parse needs the bubble line array.
+ &scantron_get_maxbubble(\$nav_error); # parse needs the bubble line array.
if ($nav_error) {
$r->print(&navmap_errormsg());
return(1,$currentphase);
@@ -7646,7 +7457,7 @@ sub scantron_validate_doublebubble {
sub scantron_get_maxbubble {
- my ($nav_error,$scantron_config) = @_;
+ my ($nav_error) = @_;
if (defined($env{'form.scantron_maxbubble'}) &&
$env{'form.scantron_maxbubble'}) {
&restore_bubble_lines();
@@ -7665,7 +7476,6 @@ sub scantron_get_maxbubble {
}
my $map=$navmap->getResourceByUrl($sequence);
my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0);
- my $bubbles_per_row = &bubblesheet_bubbles_per_row($scantron_config);
&Apache::lonxml::clear_problem_counter();
@@ -7681,8 +7491,7 @@ sub scantron_get_maxbubble {
my $response_number = 0;
my $bubble_line = 0;
foreach my $resource (@resources) {
- my ($analysis,$parts) = &scantron_partids_tograde($resource,$cid,$uname,
- $udom,$bubbles_per_row);
+ my ($analysis,$parts) = &scantron_partids_tograde($resource,$cid,$uname,$udom);
if ((ref($analysis) eq 'HASH') && (ref($parts) eq 'ARRAY')) {
foreach my $part_id (@{$parts}) {
my $lines;
@@ -7711,10 +7520,9 @@ sub scantron_get_maxbubble {
if (ref($analysis->{$part_id.'.shown'}) eq 'ARRAY') {
$numshown = scalar(@{$analysis->{$part_id.'.shown'}});
}
- my $bubbles_per_row =
- &bubblesheet_bubbles_per_row($scantron_config);
- my $inner_bubble_lines = int($numbub/$bubbles_per_row);
- if (($numbub % $bubbles_per_row) != 0) {
+ my $bubbles_per_line = 10;
+ my $inner_bubble_lines = int($numbub/$bubbles_per_line);
+ if (($numbub % $bubbles_per_line) != 0) {
$inner_bubble_lines++;
}
for (my $i=0; $i<$numshown; $i++) {
@@ -7725,7 +7533,7 @@ sub scantron_get_maxbubble {
$lines = $numshown * $inner_bubble_lines;
} else {
$lines = $analysis->{"$part_id.bubble_lines"};
- }
+ }
$first_bubble_line{$response_number} = $bubble_line;
$bubble_lines_per_response{$response_number} = $lines;
@@ -7746,18 +7554,6 @@ sub scantron_get_maxbubble {
return $env{'form.scantron_maxbubble'};
}
-sub bubblesheet_bubbles_per_row {
- my ($scantron_config) = @_;
- my $bubbles_per_row;
- if (ref($scantron_config) eq 'HASH') {
- $bubbles_per_row = $scantron_config->{'BubblesPerRow'};
- }
- if ((!$bubbles_per_row) || ($bubbles_per_row < 1)) {
- $bubbles_per_row = 10;
- }
- return $bubbles_per_row;
-}
-
sub scantron_validate_missingbubbles {
my ($r,$currentphase) = @_;
#get student info
@@ -7768,7 +7564,7 @@ sub scantron_validate_missingbubbles {
my %scantron_config=&get_scantron_config($env{'form.scantron_format'});
my ($scanlines,$scan_data)=&scantron_getfile();
my $nav_error;
- my $max_bubble=&scantron_get_maxbubble(\$nav_error,\%scantron_config);
+ my $max_bubble=&scantron_get_maxbubble(\$nav_error);
if ($nav_error) {
return(1,$currentphase);
}
@@ -7851,8 +7647,7 @@ sub scantron_process_students {
}
my ($analysis,$parts) =
&scantron_partids_tograde($resource,$env{'request.course.id'},
- $env{'user.name'},$env{'user.domain'},
- 1,$bubbles_per_row);
+ $env{'user.name'},$env{'user.domain'},1);
$grader_partids_by_symb{$ressymb} = $parts;
if (ref($analysis) eq 'HASH') {
if (ref($analysis->{'parts_withrandomlist'}) eq 'ARRAY') {
@@ -7890,7 +7685,7 @@ SCANTRONFORM
my $started;
my $nav_error;
- &scantron_get_maxbubble(\$nav_error,\%scantron_config); # Need the bubble lines array to parse.
+ &scantron_get_maxbubble(\$nav_error); # Need the bubble lines array to parse.
if ($nav_error) {
$r->print(&navmap_errormsg());
return '';
@@ -7947,8 +7742,7 @@ SCANTRONFORM
if ((exists($grader_randomlists_by_symb{$ressymb})) ||
(ref($grader_partids_by_symb{$ressymb}) ne 'ARRAY')) {
my ($analysis,$parts) =
- &scantron_partids_tograde($resource,$env{'request.course.id'},
- $uname,$udom,undef,$bubbles_per_row);
+ &scantron_partids_tograde($resource,$env{'request.course.id'},$uname,$udom);
$partids_by_symb{$ressymb} = $parts;
} else {
$partids_by_symb{$ressymb} = $grader_partids_by_symb{$ressymb};
@@ -7977,8 +7771,7 @@ SCANTRONFORM
}
if (&grade_student_bubbles($r,$uname,$udom,$scan_record,$scancode,
- \@resources,\%partids_by_symb,
- $bubbles_per_row) eq 'ssi_error') {
+ \@resources,\%partids_by_symb) eq 'ssi_error') {
$ssi_error = 0; # So end of handler error message does not trigger.
$r->print("");
&ssi_print_error($r);
@@ -8006,8 +7799,7 @@ SCANTRONFORM
if ($studentrecord ne $studentdata) {
&Apache::lonxml::clear_problem_counter();
if (&grade_student_bubbles($r,$uname,$udom,$scan_record,$scancode,
- \@resources,\%partids_by_symb,
- $bubbles_per_row) eq 'ssi_error') {
+ \@resources,\%partids_by_symb) eq 'ssi_error') {
$ssi_error = 0; # So end of handler error message does not trigger.
$r->print("");
&ssi_print_error($r);
@@ -8027,12 +7819,12 @@ SCANTRONFORM
$studentrecord .= $recording;
}
if ($studentrecord ne $studentdata) {
- $r->print('');
+ $r->print('');
if ($scancode eq '') {
- $r->print(&mt('Mismatch grading bubblesheet for user: [_1] with ID: [_2].',
+ $r->print(&mt('Mismatch grading bubble sheet for user: [_1] with ID: [_2].',
$uname.':'.$udom,$scan_record->{'scantron.ID'}));
} else {
- $r->print(&mt('Mismatch grading bubblesheet for user: [_1] with ID: [_2] and CODE: [_3].',
+ $r->print(&mt('Mismatch grading bubble sheet for user: [_1] with ID: [_2] and CODE: [_3].',
$uname.':'.$udom,$scan_record->{'scantron.ID'},$scancode));
}
$r->print(' '.&Apache::loncommon::start_data_table()."\n".
@@ -8040,11 +7832,11 @@ SCANTRONFORM
'
'.&mt('Source').' '.&mt('Bubbled responses').' '.
&Apache::loncommon::end_data_table_header_row()."\n".
&Apache::loncommon::start_data_table_row().
- ''.&mt('Bubblesheet').' '.
+ ''.&mt('Bubble Sheet').' '.
''.$studentdata.' '.
&Apache::loncommon::end_data_table_row().
&Apache::loncommon::start_data_table_row().
- ''.&mt('Stored submissions').' '.
+ 'Stored submissions '.
''.$studentrecord.' '."\n".
&Apache::loncommon::end_data_table_row().
&Apache::loncommon::end_data_table().'
');
@@ -8079,8 +7871,7 @@ sub graders_resources_pass {
my $ressymb = $resource->symb();
my ($analysis,$parts) =
&scantron_partids_tograde($resource,$env{'request.course.id'},
- $env{'user.name'},$env{'user.domain'},
- 1,$bubbles_per_row);
+ $env{'user.name'},$env{'user.domain'},1);
$grader_partids_by_symb->{$ressymb} = $parts;
if (ref($analysis) eq 'HASH') {
if (ref($analysis->{'parts_withrandomlist'}) eq 'ARRAY') {
@@ -8094,7 +7885,7 @@ sub graders_resources_pass {
}
sub grade_student_bubbles {
- my ($r,$uname,$udom,$scan_record,$scancode,$resources,$parts,$bubbles_per_row) = @_;
+ my ($r,$uname,$udom,$scan_record,$scancode,$resources,$parts) = @_;
if (ref($resources) eq 'ARRAY') {
my $count = 0;
foreach my $resource (@{$resources}) {
@@ -8107,9 +7898,6 @@ sub grade_student_bubbles {
'grade_symb' => $ressymb,
'CODE' => $scancode
);
- if ($bubbles_per_row ne '') {
- $form{'bubbles_per_row'} = $bubbles_per_row;
- }
if (ref($parts) eq 'HASH') {
if (ref($parts->{$ressymb}) eq 'ARRAY') {
foreach my $part (@{$parts->{$ressymb}}) {
@@ -8140,8 +7928,7 @@ sub scantron_upload_scantron_data {
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 $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('
-
-
-'.&mt('Send bubblesheet data to a course').'
+'));
+ $r->print('
+'.&mt('Send scanned bubblesheet data to a course').'
\n";
- my $receiptalert = &mt("Please enter a receipt number given by a student in the receipt box.");
- $request->print(<
- 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;
- if (val < 5) formname.submit();
- if (val == 5) {
- if (!checkReceiptNo(formname,'notOK')) {
- return false;
- } else {
- 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
+sub ungraded {
+ my ($request)=@_;
+ &submit_options($request);
+}
+
+sub submit_options_sequence {
+ my ($request) = @_;
+ my ($symb)=&get_symb($request);
+ if (!$symb) {return '';}
&commonJSfunctions($request);
- return $Str;
+ my $result;
+
+ $result.='';
+ $result .= &show_grading_menu_form($symb);
+ return $result;
+}
+
+sub submit_options_table {
+ my ($request) = @_;
+ my ($symb)=&get_symb($request);
+ if (!$symb) {return '';}
+ &commonJSfunctions($request);
+ my $result;
+
+ $result.='';
+ $result .= &show_grading_menu_form($symb);
+ return $result;
}
+
#--- Displays the submissions first page -------
sub submit_options {
my ($request) = @_;
@@ -8840,89 +8652,39 @@ sub submit_options {
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(<
- 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.=''.$section.' '."\n";
- }
- }
$result.='';
+ $result .= &show_grading_menu_form($symb);
+ return $result;
+}
-
+sub selectfield {
+ my ($full)=@_;
+ my $result='
'.&mt('Sections').'
- '."\n";
- $result.= $selsec;
- $result.= 'all ';
- $result.='
+ '.&Apache::lonstatistics::SectionSelect('section','multiple',5).'
@@ -8936,63 +8698,25 @@ GRADINGMENUJS
'.&mt('Access Status').'
- '.&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,5,undef,'mult').'
-
-
+ '.&Apache::lonhtmlcommon::StatusOptions(undef,undef,5,undef,'mult').'
+ ';
+ if ($full) {
+ $result.='
'.&mt('Submission Status').'
-
-
- '.&mt('with submissions').'
- '.&mt('in grading queue').'
- '.&mt('with ungraded submissions').'
- '.&mt('with incorrect submissions').'
- '.&mt('with any status').'
-
-
-
-
-
-
-
-
-
-
- '.&mt('Grade Complete Folder for One Student').'
-
-
- ';
- $result .= &show_grading_menu_form($symb);
+ '.
+ &Apache::loncommon::select_form('all','submitonly',
+ (&Apache::lonlocal::texthash(
+ 'yes' => 'with submissions',
+ 'queued' => 'in grading queue',
+ 'graded' => 'with ungraded submissions',
+ 'incorrect' => 'with incorrect submissions',
+ 'all' => 'with any status'),
+ 'select_form_order' => ['yes','queued','graded','incorrect','all'])).
+ '';
+ }
+ $result.='
';
return $result;
}
@@ -9085,8 +8809,6 @@ sub process_clicker {
if (!$symb) {return '';}
my $result=&checkforfile_js();
$env{'form.probTitle'} = &Apache::lonnet::gettitle($symb);
- my ($table) = &showResourceInfo($symb,$env{'form.probTitle'});
- $result.=$table;
$result.=''."\n";
$result.=''."\n".
'
'."\n";
@@ -9195,8 +8917,8 @@ sub process_clicker_file {
my %Saveable_Parameters=&clicker_grading_parameters();
&Apache::loncommon::store_course_settings('grades_clicker',
\%Saveable_Parameters);
-
- my ($result) = &showResourceInfo($symb,$env{'form.probTitle'});
+ my $result='';
+# my ($result) = &showResourceInfo($symb,$env{'form.probTitle'});
if (($env{'form.gradingmechanism'} eq 'specific') && ($env{'form.specificid'}!~/\w/)) {
$result.=''.&mt('You need to specify a clicker ID for the correct answer').' ';
return $result.&show_grading_menu_form($symb);
@@ -9209,7 +8931,7 @@ sub process_clicker_file {
if ($env{'form.gradingmechanism'} eq 'given') {
$env{'form.givenanswer'}=~s/^\s*//gs;
$env{'form.givenanswer'}=~s/\s*$//gs;
- $env{'form.givenanswer'}=~s/[^a-zA-Z0-9\.\*\-\+]+/\,/g;
+ $env{'form.givenanswer'}=~s/[^a-zA-Z0-9\.\*\-]+/\,/g;
$env{'form.givenanswer'}=uc($env{'form.givenanswer'});
my @answers=split(/\,/,$env{'form.givenanswer'});
$foundgiven=$#answers+1;
@@ -9269,7 +8991,7 @@ sub process_clicker_file {
$result.=(<