version 1.755, 2019/01/27 23:16:25
|
version 1.759, 2019/02/09 04:02:09
|
Line 5902 sub scantron_selectphase {
|
Line 5902 sub scantron_selectphase {
|
|
|
$r->print(' |
$r->print(' |
<br />'); |
<br />'); |
my $default_form_data=&defaultFormData($symb); |
|
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'}; |
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.'); |
Line 5915 sub scantron_selectphase {
|
Line 5914 sub scantron_selectphase {
|
return false; |
return false; |
} |
} |
formname.submit(); |
formname.submit(); |
}'.$formatjs)); |
}'."\n".$formatjs)); |
$r->print(' |
$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.' |
Line 9099 END
|
Line 9098 END
|
if (keys(%{$domconfig{'scantron'}{'config'}}) > 1) { |
if (keys(%{$domconfig{'scantron'}{'config'}}) > 1) { |
if (($domconfig{'scantron'}{'config'}{'dat'}) && |
if (($domconfig{'scantron'}{'config'}{'dat'}) && |
(ref($domconfig{'scantron'}{'config'}{'csv'}) eq 'HASH')) { |
(ref($domconfig{'scantron'}{'config'}{'csv'}) eq 'HASH')) { |
if (keys(%{$domconfig{'scantron'}{'config'}{'csv'}})) { |
if (ref($domconfig{'scantron'}{'config'}{'csv'}{'fields'}) eq 'HASH') { |
my ($onclick,$formatextra,$singleline); |
if (keys(%{$domconfig{'scantron'}{'config'}{'csv'}{'fields'}})) { |
my @lines = &Apache::lonnet::get_scantronformat_file(); |
my ($onclick,$formatextra,$singleline); |
my $count = 0; |
my @lines = &Apache::lonnet::get_scantronformat_file(); |
foreach my $line (@lines) { |
my $count = 0; |
next if ($line =~ /^#/); |
foreach my $line (@lines) { |
$singleline = $line; |
next if ($line =~ /^#/); |
$count ++; |
$singleline = $line; |
} |
$count ++; |
if ($count > 1) { |
} |
$formatextra = '<div style="display:none" id="bubbletype">'. |
if ($count > 1) { |
&scantron_scantab().'</div>'; |
$formatextra = '<div style="display:none" id="bubbletype">'. |
$onclick = ' onclick="toggleScantab(this.form);"'; |
'<span class="LC_nobreak">'. |
$formatjs = <<"END"; |
&mt('Bubblesheet type:').' '. |
|
&scantron_scantab().'</span></div>'; |
|
$onclick = ' onclick="toggleScantab(this.form);"'; |
|
$formatjs = <<"END"; |
function toggleScantab(form) { |
function toggleScantab(form) { |
var divid = 'bubbletype'; |
var divid = 'bubbletype'; |
if (document.getElementById(divid)) { |
if (document.getElementById(divid)) { |
Line 9125 function toggleScantab(form) {
|
Line 9127 function toggleScantab(form) {
|
if (chosen == 'dat') { |
if (chosen == 'dat') { |
document.getElementById(divid).style.display = 'none'; |
document.getElementById(divid).style.display = 'none'; |
} else if (chosen == 'csv') { |
} else if (chosen == 'csv') { |
document.getElementById(divid).style.display = 'inline-block'; |
document.getElementById(divid).style.display = 'block'; |
} |
} |
} |
} |
} |
} |
Line 9135 function toggleScantab(form) {
|
Line 9137 function toggleScantab(form) {
|
} |
} |
|
|
END |
END |
} elsif ($count == 1) { |
} elsif ($count == 1) { |
my $formatname = (split(/:/,$singleline,2))[0]; |
my $formatname = (split(/:/,$singleline,2))[0]; |
$formatextra = '<input type="hidden" name="scantron_format" value="'.$formatname.'" />'; |
$formatextra = '<input type="hidden" name="scantron_format" value="'.$formatname.'" />'; |
|
} |
|
$formattitle = &mt('File format'); |
|
$formatoptions = '<label><input name="fileformat" type="radio" value="dat" checked="checked"'.$onclick.' />'. |
|
&mt('Plain Text (no delimiters)'). |
|
'</label>'.(' 'x2). |
|
'<label><input name="fileformat" type="radio" value="csv"'.$onclick.' />'. |
|
&mt('Comma separated values').'</label>'.$formatextra; |
} |
} |
$formattitle = &mt('File format'); |
|
$formatoptions = '<label><input name="fileformat" type="radio" value="dat" checked="checked"'.$onclick.' />'. |
|
&mt('Plain Text (no delimiters)'). |
|
'</label>'.(' 'x2). |
|
'<label><input name="fileformat" type="radio" value="csv"'.$onclick.' />'. |
|
&mt('Comma separated values').'</label>'.$formatextra; |
|
} |
} |
} |
} |
} elsif (keys(%{$domconfig{'scantron'}{'config'}}) == 1) { |
} elsif (keys(%{$domconfig{'scantron'}{'config'}}) == 1) { |
if (keys(%{$domconfig{'scantron'}{'config'}{'csv'}})) { |
if (ref($domconfig{'scantron'}{'config'}{'csv'}{'fields'}) eq 'HASH') { |
$formattitle = &mt('Format of bubblesheet data file:'); |
if (keys(%{$domconfig{'scantron'}{'config'}{'csv'}{'fields'}})) { |
$formatoptions = &scantron_scantab(); |
$formattitle = &mt('Bubblesheet type'); |
|
$formatoptions = &scantron_scantab(); |
|
} |
} |
} |
} |
} |
} |
} |
Line 9192 sub scantron_upload_scantron_data_save {
|
Line 9197 sub scantron_upload_scantron_data_save {
|
if (@possibles > 1) { |
if (@possibles > 1) { |
if ($env{'form.fileformat'} eq 'csv') { |
if ($env{'form.fileformat'} eq 'csv') { |
if (ref($domconfig{'scantron'}{'config'}{'csv'}) eq 'HASH') { |
if (ref($domconfig{'scantron'}{'config'}{'csv'}) eq 'HASH') { |
if (keys(%{$domconfig{'scantron'}{'config'}{'csv'}}) > 1) { |
if (ref($domconfig{'scantron'}{'config'}{'csv'}{'fields'}) eq 'HASH') { |
$is_csv = 1; |
if (keys(%{$domconfig{'scantron'}{'config'}{'csv'}{'fields'}}) > 1) { |
|
$is_csv = 1; |
|
} |
} |
} |
} |
} |
} |
} |
} elsif (@possibles == 1) { |
} elsif (@possibles == 1) { |
if (ref($domconfig{'scantron'}{'config'}{'csv'}) eq 'HASH') { |
if (ref($domconfig{'scantron'}{'config'}{'csv'}) eq 'HASH') { |
if (keys(%{$domconfig{'scantron'}{'config'}{'csv'}}) > 1) { |
if (ref($domconfig{'scantron'}{'config'}{'csv'}{'fields'}) eq 'HASH') { |
$is_csv = 1; |
if (keys(%{$domconfig{'scantron'}{'config'}{'csv'}{'fields'}}) > 1) { |
|
$is_csv = 1; |
|
} |
} |
} |
} |
} |
} |
} |
Line 10629 sub startpage {
|
Line 10638 sub startpage {
|
} |
} |
if ($nomenu) { |
if ($nomenu) { |
$args{'only_body'} = 1; |
$args{'only_body'} = 1; |
$r->print(&Apache::loncommon::start_page("Student's Version",$js,\%args); |
$r->print(&Apache::loncommon::start_page("Student's Version",$js,\%args)); |
} else { |
} else { |
unshift(@$crumbs,{href=>&href_symb_cmd($symb,'gradingmenu'),text=>"Grading"}); |
unshift(@$crumbs,{href=>&href_symb_cmd($symb,'gradingmenu'),text=>"Grading"}); |
$args{'bread_crumbs'} = $crumbs; |
$args{'bread_crumbs'} = $crumbs; |
Line 10637 sub startpage {
|
Line 10646 sub startpage {
|
&Apache::lonquickgrades::startGradeScreen($r,($env{'form.symb'}?'probgrading':'grading')); |
&Apache::lonquickgrades::startGradeScreen($r,($env{'form.symb'}?'probgrading':'grading')); |
} |
} |
unless ($nodisplayflag) { |
unless ($nodisplayflag) { |
$r->print(&Apache::lonhtmlcommon::resource_info_box($symb,$onlyfolderflag,$stuvcurrent,$stuvdisp)); |
$r->print(&Apache::lonhtmlcommon::resource_info_box($symb,$onlyfolderflag,$stuvcurrent,$stuvdisp)); |
} |
} |
} |
} |
|
|
Line 11016 Side Effects: None.
|
Line 11025 Side Effects: None.
|
$r - Apache request object |
$r - Apache request object |
$i - number of the current scanline |
$i - number of the current scanline |
$scan_record - hash ref as returned from &scantron_parse_scanline() |
$scan_record - hash ref as returned from &scantron_parse_scanline() |
$scan_config - hash ref as returned from &get_scantron_config() |
$scan_config - hash ref as returned from &Apache::lonnet::get_scantron_config() |
$line - full contents of the current scanline |
$line - full contents of the current scanline |
$error - error condition, valid values are |
$error - error condition, valid values are |
'incorrectCODE', 'duplicateCODE', |
'incorrectCODE', 'duplicateCODE', |