--- loncom/publisher/testbankimport.pm 2013/10/10 00:46:50 1.43 +++ loncom/publisher/testbankimport.pm 2017/11/12 23:08:58 1.45 @@ -1,5 +1,5 @@ # Handler for parsing text upload problem descriptions into .problems -# $Id: testbankimport.pm,v 1.43 2013/10/10 00:46:50 raeburn Exp $ +# $Id: testbankimport.pm,v 1.45 2017/11/12 23:08:58 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -579,7 +579,7 @@ sub display_two { my $blocks = $env{'form.blocks'}; my $qnumformat = $env{'form.qnumformat'}; my @types = ("MC","MA","TF","Ess","FIB","Ord"); - my %typenames = ( + my %typenames = &Apache::lonlocal::texthash( MC => "Multiple Choice", TF => "True/False", MA => "Multiple Answer", @@ -1508,7 +1508,7 @@ sub create_mcq { if (-e $destdir.$libfile) { $result = 'exists'; } else { - if (open(PROB,">$destdir$libfile")) { + if (open(PROB,">",$destdir.$libfile)) { print PROB $output; close(PROB); $result = 'ok'; @@ -1586,7 +1586,7 @@ sub create_ess { if (-e $destdir.$libfile) { $result = 'exists'; } else { - if (open(PROB,">$destdir$libfile")) { + if (open(PROB,">",$destdir.$libfile)) { print PROB $output; close(PROB); $result = 'ok'; @@ -1617,7 +1617,10 @@ sub file_error { my ($r,$fn,$current_page,$webpath,$res) = @_; $r->print('
'); @@ -1633,7 +1636,7 @@ sub parse_datafile { $res = $mm->checktype_filename($dirpath.$filename); if ($env{'form.phase'} eq 'three') { if ($res eq 'text/plain') { - open(TESTBANK,"<$dirpath$filename"); + open(TESTBANK,"<",$dirpath.$filename); @{$text} =