--- loncom/publisher/testbankimport.pm 2008/07/08 07:17:46 1.16 +++ loncom/publisher/testbankimport.pm 2009/03/26 16:50:12 1.20 @@ -1,5 +1,5 @@ # Handler for parsing text upload problem descriptions into .problems -# $Id: testbankimport.pm,v 1.16 2008/07/08 07:17:46 raeburn Exp $ +# $Id: testbankimport.pm,v 1.20 2009/03/26 16:50:12 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1163,8 +1163,8 @@ sub page_footer { my $nextval = &mt('Next Page'); my $prevclick = 'javascript:backPage();'; my $nextclick = 'javascript:nextPage();'; - my $go = ''; - if ($page == 0) { + my $go = ''; + if (($page == 0) || ($state eq 'badfile')) { $go = 'NextPage'; $prevval = &mt('Exit Now'); $prevclick = 'javascript:location.href='."'$webpath';"; @@ -1187,7 +1187,8 @@ sub page_footer { - '; + + '; if ($page ne '') { $output .= '
'; - if ($page < 4) { + if (($page < 4) && ($state ne 'badfile')) { $output .= ' |
@@ -1327,7 +1328,6 @@ sub create_mcq {
my $qstn = ${$qstnref}[0];
my $numfoils = scalar(@{$qstnref}) - 1;
my $datestamp = localtime;
- my $timestamp = time;
my $numansrs = scalar(@{$answerref});
my $output = ''.&mt('Co-Author').': '.$uname. - &mt(' at ').$udom.''; + $output .= '' + .&mt('Co-Author [_1]:[_2]',$uname,$udom) + .' '; } return $output; } @@ -1806,7 +1818,7 @@ sub handler { my ($fn,$filename); if ($env{'form.filename'}) { $fn=$env{'form.filename'}; - $fn=~s/^http\:\/\/[^\/]+\///; + $fn=~s/^https?\:\/\/[^\/]+\///; $fn=~s/^\///; $fn=~s{(~|priv/)($LONCAPA::username_re)}{}; $fn=~s/\/+/\//g; @@ -1830,6 +1842,9 @@ sub handler { $current_page = &display_control(); my @pages = ('Welcome','Blocks','Format','Target','Confirmation'); $page_name = $pages[$current_page]; + if ($env{'form.timestamp'} eq '') { + $env{'form.timestamp'} = time; + } if ($env{'form.newdir'} ne '') { if ($env{'form.newdir'} =~ /^\Q$dirpath\E(.+)$/) { $subdir = $1; @@ -1837,7 +1852,7 @@ sub handler { } ($res,$badfile,$textref,$header,$css,$js) = &parse_datafile($r,$uname,$filename,$pathname,$dirpath,$urlpath, - $page_name,$subdir); + $page_name,$subdir,$env{'form.timestamp'}); if ($page_name eq 'Welcome') { &jscript_zero($webpath,\$javascript); } elsif ($page_name eq 'Blocks') { @@ -1875,7 +1890,7 @@ sub handler { $r->print(&Apache::lonupload::phasethree($r,$fn,$uname,$udom,'testbank')); } if ($badfile) { - &file_error($r,$uname,$fn,$current_page); + &file_error($r,$uname,$fn,$current_page,$webpath,$res); } else { &display_zero ($r,$uname,$fn,$current_page,$webpath) if $page_name eq 'Welcome'; &display_one ($r,$uname,$fn,$current_page,$textref,$header) if $page_name eq 'Blocks'; |