--- loncom/publisher/testbankimport.pm 2004/08/05 21:08:24 1.5
+++ loncom/publisher/testbankimport.pm 2008/12/19 03:53:00 1.19
@@ -1,5 +1,5 @@
# Handler for parsing text upload problem descriptions into .problems
-# $Id: testbankimport.pm,v 1.5 2004/08/05 21:08:24 raeburn Exp $
+# $Id: testbankimport.pm,v 1.19 2008/12/19 03:53:00 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -30,18 +30,23 @@ 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 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;
}
@@ -56,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(" |