version 1.20, 2002/03/06 22:34:06
|
version 1.23, 2002/04/04 20:41:17
|
Line 129 sub record_sep {
|
Line 129 sub record_sep {
|
if ($ENV{'form.upfiletype'} eq 'xml') { |
if ($ENV{'form.upfiletype'} eq 'xml') { |
} elsif ($ENV{'form.upfiletype'} eq 'space') { |
} elsif ($ENV{'form.upfiletype'} eq 'space') { |
my $i=0; |
my $i=0; |
foreach (split(/\s+/,$record) { |
foreach (split(/\s+/,$record)) { |
my $field=$_; |
my $field=$_; |
$field=~s/^(\"|\')//; |
$field=~s/^(\"|\')//; |
$field=~s/(\"|\')$//; |
$field=~s/(\"|\')$//; |
Line 227 sub menu_phase_one {
|
Line 227 sub menu_phase_one {
|
ENDUPFORM |
ENDUPFORM |
} |
} |
|
|
# ======================================================= Menu Phase Two Upload |
|
|
|
sub menu_phase_two_upload { |
|
my $r=shift; |
|
|
|
my $datatoken=&upfile_store($r); |
|
|
|
my @records=&upfile_record_sep(); |
|
my $total=$#records; |
|
my $distotal=$total+1; |
|
|
|
$ENV{'SERVER_NAME'}=~/(\w+\.\w+)$/; |
|
my $krbdefdom=$1; |
|
$krbdefdom=~tr/a-z/A-Z/; |
|
|
|
my $today=time; |
|
my $halfyear=$today+15552000; |
|
|
|
my $defdom=$r->dir_config('lonDefDomain'); |
|
|
|
|
sub phase_two_header { |
|
my ($r,$datatoken,$distotal,$krbdefdom)=@_; |
$r->print(<<ENDPICK); |
$r->print(<<ENDPICK); |
<input type=hidden name=phase value=three> |
<input type=hidden name=phase value=three> |
<input type=hidden name=datatoken value="$datatoken"> |
<input type=hidden name=datatoken value="$datatoken"> |
<input type=hidden name=upfiletype value=$ENV{'form.upfiletype'}> |
<input type=hidden name=upfiletype value=$ENV{'form.upfiletype'}> |
<hr> |
<hr> |
<h3>Identify fields</h3> |
<h3>Identify fields</h3> |
Total number of records found in file: $distotal |
Total number of records found in file: $distotal <hr /> |
|
Enter as many fields as you can. The system will inform you and bring you back |
|
to this page if the data selected is insufficient to run your class.<hr /> |
<script> |
<script> |
function verify(vf) { |
function verify(vf) { |
var founduname=0; |
var founduname=0; |
Line 423 function clickint(vf) {
|
Line 408 function clickint(vf) {
|
</script> |
</script> |
<table border=2><tr><th>Field</th><th>Samples</th></tr> |
<table border=2><tr><th>Field</th><th>Samples</th></tr> |
ENDPICK |
ENDPICK |
my %sone; my %stwo; my %sthree; |
} |
my $i=0; |
|
|
|
if ($total>=0) { |
sub phase_two_end { |
%sone=&record_sep($records[0]); |
my ($r,$i,$keyfields,$defdom,$today,$halfyear)=@_; |
if ($total>=1) { |
$r->print(<<ENDPICK); |
%stwo=&record_sep($records[1]); |
|
|
|
} |
|
if ($total>=2) { |
|
%sthree=&record_sep($records[2]); |
|
} |
|
foreach (sort keys %sone) { |
|
$r->print('<tr><td><select name=f'.$i. |
|
' onChange="flip(this.form,'.$i.');">'); |
|
foreach ('none: ','username:Username', |
|
'names:Last Name, First Names', |
|
'fname:First Name','mname:Middle Names/Initials', |
|
'lname:Last Name','gen:Generation', |
|
'id:ID/Student Number','sec:Group/Section', |
|
'ipwd:Initial Password') { |
|
my ($value,$display)=split(/\:/,$_); |
|
$r->print('<option value='.$value.'>'.$display. |
|
'</option>'); |
|
} |
|
$r->print('</select></td><td>'); |
|
if (defined($sone{$_})) { |
|
$r->print($sone{$_}."</br>\n"); |
|
} |
|
if (defined($stwo{$_})) { |
|
$r->print($stwo{$_}."</br>\n"); |
|
} |
|
if (defined($sthree{$_})) { |
|
$r->print($sthree{$_}."</br>\n"); |
|
} |
|
$r->print('</td></tr>'); |
|
$i++; |
|
} |
|
$i--; |
|
} |
|
my $keyfields=join(',',sort keys %sone); |
|
$r->print(<<ENDPICK); |
|
</table> |
</table> |
<input type=hidden name=nfields value=$i> |
<input type=hidden name=nfields value=$i> |
<input type=hidden name=keyfields value="$keyfields"> |
<input type=hidden name=keyfields value="$keyfields"> |
Line 511 Disable ID/Student Number Safeguard and
|
Line 459 Disable ID/Student Number Safeguard and
|
Note: for large courses, this operation might be time consuming. |
Note: for large courses, this operation might be time consuming. |
ENDPICK |
ENDPICK |
} |
} |
|
# ======================================================= Menu Phase Two Upload |
|
|
|
sub menu_phase_two_upload { |
|
my $r=shift; |
|
|
|
my $datatoken=&upfile_store($r); |
|
|
|
my @records=&upfile_record_sep(); |
|
my $total=$#records; |
|
my $distotal=$total+1; |
|
|
|
$ENV{'SERVER_NAME'}=~/(\w+\.\w+)$/; |
|
my $krbdefdom=$1; |
|
$krbdefdom=~tr/a-z/A-Z/; |
|
|
|
my $today=time; |
|
my $halfyear=$today+15552000; |
|
|
|
my $defdom=$r->dir_config('lonDefDomain'); |
|
|
|
&phase_two_header($r,$datatoken,$distotal,$krbdefdom); |
|
|
|
my %sone; my %stwo; my %sthree; |
|
my $i=0; |
|
|
|
if ($total>=0) { |
|
%sone=&record_sep($records[0]); |
|
if ($total>=1) { |
|
%stwo=&record_sep($records[1]); |
|
} |
|
if ($total>=2) { |
|
%sthree=&record_sep($records[2]); |
|
} |
|
foreach (sort keys %sone) { |
|
$r->print('<tr><td><select name=f'.$i. |
|
' onChange="flip(this.form,'.$i.');">'); |
|
foreach ('none: ','username:Username', |
|
'names:Last Name, First Names', |
|
'fname:First Name','mname:Middle Names/Initials', |
|
'lname:Last Name','gen:Generation', |
|
'id:ID/Student Number','sec:Group/Section', |
|
'ipwd:Initial Password') { |
|
my ($value,$display)=split(/\:/,$_); |
|
$r->print('<option value='.$value.'>'.$display. |
|
'</option>'); |
|
} |
|
$r->print('</select></td><td>'); |
|
if (defined($sone{$_})) { |
|
$r->print($sone{$_}."</br>\n"); |
|
} |
|
if (defined($stwo{$_})) { |
|
$r->print($stwo{$_}."</br>\n"); |
|
} |
|
if (defined($sthree{$_})) { |
|
$r->print($sthree{$_}."</br>\n"); |
|
} |
|
$r->print('</td></tr>'); |
|
$i++; |
|
} |
|
$i--; |
|
} |
|
my $keyfields=join(',',sort keys %sone); |
|
|
|
&phase_two_end($r,$i,$keyfields,$defdom,$today,$halfyear); |
|
} |
|
|
# ======================================================= Enroll single student |
# ======================================================= Enroll single student |
|
|