--- loncom/publisher/testbankimport.pm 2011/01/31 17:49:13 1.29
+++ loncom/publisher/testbankimport.pm 2012/10/29 17:38:55 1.35
@@ -1,5 +1,5 @@
# Handler for parsing text upload problem descriptions into .problems
-# $Id: testbankimport.pm,v 1.29 2011/01/31 17:49:13 raeburn Exp $
+# $Id: testbankimport.pm,v 1.35 2012/10/29 17:38:55 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -28,7 +28,6 @@ package Apache::testbankimport;
use strict;
use Apache::Constants qw(:common :http :methods);
-use Apache::loncacc;
use Apache::loncommon();
use Apache::lonnet;
use HTML::Entities();
@@ -485,7 +484,7 @@ function backPage() {
# ---------------------------------------------------------------- Display Zero
sub display_zero {
- my ($r,$uname,$fn,$page,$webpath) = @_;
+ my ($r,$fn,$page,$webpath) = @_;
my $go_default = 'NextPage';
if ($fn eq '') {
$r->print(''.&mt('Incomplete file upload').' '.&mt('Return to the [_1]construction space menu[_2] to upload a file','',''));
@@ -512,14 +511,14 @@ sub display_zero {
&Apache::lonhtmlcommon::topic_bar(1,&mt('Optional: create a sub-directory in which the testbank questions will be saved')).
&mt('By default, LON-CAPA problems generated from the testbank file will be stored in the current directory.').' '.&mt('To store them in a new sub-directory:').
' '.
- &page_footer($env{'form.newdir'},$uname,$fn,$page,$webpath).'
+ &page_footer($env{'form.newdir'},$fn,$page,$webpath).'
');
}
# ---------------------------------------------------------------- Display One
sub display_one {
- my ($r,$uname,$fn,$page,$textref,$header) = @_;
+ my ($r,$fn,$page,$textref,$header) = @_;
my %topics;
$topics{2} = &mt('Select the format of the question number - e.g., 1, 1., 1), (1 or (1) - ').'
'.
&mt('You will indicate the question type and the question number range for each of the blocks on the next page.').'
'.
- &page_footer($env{'form.newdir'},$uname,$fn,$page).'
+ &page_footer($env{'form.newdir'},$fn,$page).'
');
return;
}
@@ -574,7 +573,7 @@ sub display_one {
# ---------------------------------------------------------------- Display Two
sub display_two {
- my ($r,$uname,$fn,$page,$textref,$header,$qcount) = @_;
+ my ($r,$fn,$page,$textref,$header,$qcount) = @_;
my $blocks = $env{'form.blocks'};
my $qnumformat = $env{'form.qnumformat'};
my @types = ("MC","MA","TF","Ess","FIB","Ord");
@@ -658,14 +657,14 @@ sub display_two {
&mt('For ranking questions you must use the Answer format column to choose the separator used between the (ranked) answers.').'
'.
- &page_footer($env{'form.newdir'},$uname,$fn,$page).'
+ &page_footer($env{'form.newdir'},$fn,$page).'
');
return;
}
# ---------------------------------------------------------------- Display Three
sub display_three {
- my ($r,$uname,$fn,$page,$textref,$res,$header,$urlpath,$qcount) = @_;
+ my ($r,$fn,$page,$textref,$res,$header,$webpath,$qcount) = @_;
my $qnumformat = $env{'form.qnumformat'};
my $filename = $env{'form.filename'};
my $source = $env{'form.go'};
@@ -715,7 +714,7 @@ sub display_three {
if ($header ne '') {
$showheader = &HTML::Entities::decode($header);
if ($res eq 'text/html') {
- $showheader = &build_image_url($urlpath,$showheader);
+ $showheader = &build_image_url($webpath,$showheader);
}
}
}
@@ -764,7 +763,7 @@ sub display_three {
if (($res eq 'application/rtf') || ($res eq 'text/html')) {
$showqn = &HTML::Entities::decode($showqn);
if ($res eq 'text/html') {
- $showqn = &build_image_url($urlpath,$showqn);
+ $showqn = &build_image_url($webpath,$showqn);
}
}
$r->print(&Apache::loncommon::start_data_table_row().
@@ -808,7 +807,7 @@ sub display_three {
if ($res eq 'application/rtf' || $res eq 'text/html') {
$showfoil = &HTML::Entities::decode($showfoil);
if ($res eq 'text/html') {
- $showfoil = &build_image_url($urlpath,$showfoil);
+ $showfoil = &build_image_url($webpath,$showfoil);
}
}
$r->print("$foiltag $showfoil \n");
@@ -859,13 +858,13 @@ sub display_three {
');
}
}
- $r->print(''.&page_footer($env{'form.newdir'},$uname,$fn,$page).'
+ $r->print(''.&page_footer($env{'form.newdir'},$fn,$page).'
');
}
# ---------------------------------------------------------------- Final Display
sub final_display {
- my ($r,$uname,$fn,$page,$textref,$res,$header,$css,$js,$webpath,$dirpath,$subdir) = @_;
+ my ($r,$fn,$page,$textref,$res,$header,$css,$js,$webpath,$dirpath,$subdir) = @_;
my $qnumformat = $env{'form.qnumformat'};
my $blocks = $env{'form.blocks'};
my $question_id = '';
@@ -1042,7 +1041,7 @@ sub final_display {
if (@createprobs == 0) {
$state = 'unchecked';
$r->print('
'.&mt('No questions were selected for conversion.').'
'.
- &page_footer($env{'form.newdir'},$uname,$fn,$page,$webpath,$subdir,$state).'');
+ &page_footer($env{'form.newdir'},$fn,$page,$webpath,$subdir,$state).'');
} elsif (($destdir ne '') && (-e $destdir)) {
my (@qn_file,@result,@numid);
my $qcount = 0;
@@ -1130,11 +1129,11 @@ sub final_display {
$r->print('
'.&mt('The following files already existed, and were not overwritten so these problems generated from the testbank have not been saved:').' '.$existing.'