version 1.755, 2019/01/27 23:16:25
|
version 1.756, 2019/01/28 21:36:53
|
Line 5915 sub scantron_selectphase {
|
Line 5915 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 9099 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);"'; |
&scantron_scantab().'</div>'; |
$formatjs = <<"END"; |
$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 9135 function toggleScantab(form) {
|
Line 9136 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('Format of bubblesheet data file:'); |
|
$formatoptions = &scantron_scantab(); |
|
} |
} |
} |
} |
} |
} |
} |
Line 9192 sub scantron_upload_scantron_data_save {
|
Line 9196 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; |
|
} |
} |
} |
} |
} |
} |
} |