--- loncom/publisher/testbankimport.pm 2010/11/27 22:43:32 1.26 +++ loncom/publisher/testbankimport.pm 2010/11/28 00:04:10 1.27 @@ -1,5 +1,5 @@ # Handler for parsing text upload problem descriptions into .problems -# $Id: testbankimport.pm,v 1.26 2010/11/27 22:43:32 raeburn Exp $ +# $Id: testbankimport.pm,v 1.27 2010/11/28 00:04:10 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1906,15 +1906,32 @@ sub handler { } $r->print(&print_header($uname,$udom,$javascript,\%loadentries,$title, - $current_page,\@pages,\%names)); + $current_page,\@pages,\%names)); - if ($env{'form.phase'} eq 'three') { - if ($env{'form.action'} eq 'upload_embedded') { - $r->print(&Apache::lonupload::phasethree($r,$fn,$uname,$udom,'testbank')); + if (($env{'form.phase'} eq 'four') || ($env{'form.phase'} eq 'three')) { + if ($env{'form.phase'} eq 'four') { + $r->print(&Apache::lonupload::phasefour($r,$fn,$uname,$udom,'testbank')); + my $current_page = 0; + my $js; + &jscript_zero($webpath,\$js); + $js = ''; + $r->print($js); + &display_zero($r,$uname,$fn,$current_page,$webpath); + } elsif ($env{'form.phase'} eq 'three') { + if ($env{'form.action'} eq 'upload_embedded') { + my ($result,$flag) = + &Apache::lonupload::phasethree($r,$fn,$uname,$udom,'testbank'); + $r->print($result); + if ($flag eq 'modify_orightml') { + undef($page_name); + $r->print('
'. + &page_footer('',$uname,$fn).'
'); + } + } } if ($badfile) { &file_error($r,$uname,$fn,$current_page,$webpath,$res); - } else { + } 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'; &display_two ($r,$uname,$fn,$current_page,$textref,$header,$qcount) if $page_name eq 'Format'; @@ -1925,7 +1942,6 @@ sub handler { my ($result,$flag) = &Apache::lonupload::phasetwo($r,$fn,$uname,$udom,'testbank'); $r->print($result); if ($flag eq 'ok') { - my $current_page = 0; my $js; &jscript_zero($webpath,\$js); $js = '';