--- loncom/publisher/testbankimport.pm 2004/02/17 23:03:34 1.1 +++ loncom/publisher/testbankimport.pm 2008/06/17 13:00:19 1.15 @@ -1,21 +1,52 @@ +# Handler for parsing text upload problem descriptions into .problems +# $Id: testbankimport.pm,v 1.15 2008/06/17 13:00:19 raeburn Exp $ +# +# Copyright Michigan State University Board of Trustees +# +# This file is part of the LearningOnline Network with CAPA (LON-CAPA). +# +# LON-CAPA is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# LON-CAPA is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LON-CAPA; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# /home/httpd/html/adm/gpl.txt +# +# http://www.lon-capa.org/ +# + package Apache::testbankimport; - use strict; - use Apache::Constants qw(:common :http :methods); - use Apache::loncacc; - use Apache::loncommon(); - use Apache::Log(); - use Apache::lonnet; - use HTML::Entities(); - use Apache::lonlocal; - use Apache::lonupload; - use File::Basename(); +use strict; +use Apache::Constants qw(:common :http :methods); +use Apache::loncacc; +use Apache::loncommon(); +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 { # figure out what page we're on and where we're heading. - my $page = $ENV{'form.page'}; - my $command = $ENV{'form.go'}; + my $page = $env{'form.page'}; + my $command = $env{'form.go'}; my $current_page = &calculate_page($page,$command); return $current_page; } @@ -30,6 +61,45 @@ 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(" |