--- loncom/publisher/testbankimport.pm 2005/11/08 17:58:35 1.7 +++ loncom/publisher/testbankimport.pm 2011/03/05 22:25:09 1.30 @@ -1,5 +1,5 @@ # Handler for parsing text upload problem descriptions into .problems -# $Id: testbankimport.pm,v 1.7 2005/11/08 17:58:35 albertel Exp $ +# $Id: testbankimport.pm,v 1.30 2011/03/05 22:25:09 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -34,7 +34,13 @@ use Apache::lonnet; use HTML::Entities(); use Apache::lonlocal; use Apache::lonupload; +use Apache::londocs; use File::Basename(); +use LONCAPA(); +use File::MMagic; +use XML::DOM; +use RTF::HTMLConverter; +use HTML::TokeParser; # ---------------------------------------------------------------- Display Control sub display_control { @@ -55,6 +61,46 @@ sub calculate_page($$) { return 0 if $dir eq 'BackToStart'; } +sub jscript_zero { + my ($webpath,$jsref) = @_; + my $start_page = + &Apache::loncommon::start_page('Create Testbank directory',undef, + {'only_body' => 1, + 'js_ready' => 1,}); + my $end_page = + &Apache::loncommon::end_page({'js_ready' => 1,}); + my %lt = &Apache::lonlocal::texthash( + loca => 'Location', + newd => 'New Directory', + ente => 'Enter the name of the new directory where you will save the converted testbank questions', + go => 'Go', + ); + $$jsref = <<"END_SCRIPT"; +function createWin() { + document.info.newdir.value = ""; + newWindow = window.open("","CreateDir","HEIGHT=400,WIDTH=750,scrollbars=yes") + newWindow.document.open() + newWindow.document.write('$start_page') + newWindow.document.write("\\n") + newWindow.document.write("
\\n") - newWindow.document.write(" | Location: $fullpathNew Directory | |
\\n") - newWindow.document.write(" |