--- loncom/interface/Attic/lonspreadsheet.pm 2001/03/08 23:22:11 1.40 +++ loncom/interface/Attic/lonspreadsheet.pm 2001/03/10 22:30:18 1.42 @@ -4,7 +4,7 @@ # 11/11,11/15,11/27,12/04,12/05,12/06,12/07, # 12/08,12/09,12/11,12/12,12/15,12/16,12/18,12/19,12/30, # 01/01/01,02/01,03/01,19/01,20/01,22/01, -# 03/05,03/08 Gerd Kortemeyer +# 03/05,03/08,03/10 Gerd Kortemeyer package Apache::lonspreadsheet; @@ -326,7 +326,8 @@ sub sett { } keys %f; map { if (($f{$_}) && ($_!~/template\_/)) { - if ($_=~/^$pattern/) { + my $matches=($_=~/^$pattern(\d+)/); + if (($matches) && ($1)) { unless ($f{$_}=~/^\!/) { $t{$_}=$c{$_}; } @@ -1200,16 +1201,21 @@ sub loadstudent { map { if ($_=~/^A(\d+)/) { my $row=$1; - unless ($f{$_}=~/^\!/) { + unless (($f{$_}=~/^\!/) || ($row==0)) { @assessdata=&exportsheet(&getuname($safeeval), &getudom($safeeval), 'assesscalc',$f{$_}); my $index=0; map { if ($assessdata[$index]) { - $c{$_.$row}=$assessdata[$index]; - unless ($_ eq 'A') { - $f{$_.$row}='import'; + my $col=$_; + if ($assessdata[$index]=~/\D/) { + $c{$col.$row}="'".$assessdata[$index]."'"; + } else { + $c{$col.$row}=$assessdata[$index]; + } + unless ($col eq 'A') { + $f{$col.$row}='import'; } } $index++; @@ -1246,14 +1252,15 @@ sub loadcourse { '
'+ '
'+ ''); - popwin.document.close; + popwin.document.close(); + popwin.close(); ENDPOP $r->rflush(); map { if ($_=~/^A(\d+)/) { my $row=$1; - unless ($f{$_}=~/^\!/) { + unless (($f{$_}=~/^\!/) || ($row==0)) { my @studentdata=&exportsheet(split(/\:/,$f{$_}), 'studentcalc'); undef %userrdatas; @@ -1266,9 +1273,14 @@ ENDPOP my $index=0; map { if ($studentdata[$index]) { - $c{$_.$row}=$studentdata[$index]; - unless ($_ eq 'A') { - $f{$_.$row}='import'; + my $col=$_; + if ($studentdata[$index]=~/\D/) { + $c{$col.$row}="'".$studentdata[$index]."'"; + } else { + $c{$col.$row}=$studentdata[$index]; + } + unless ($col eq 'A') { + $f{$col.$row}='import'; } } $index++;