--- loncom/publisher/testbankimport.pm 2006/04/10 22:30:31 1.10 +++ loncom/publisher/testbankimport.pm 2008/04/17 15:58:45 1.13 @@ -1,5 +1,5 @@ # Handler for parsing text upload problem descriptions into .problems -# $Id: testbankimport.pm,v 1.10 2006/04/10 22:30:31 albertel Exp $ +# $Id: testbankimport.pm,v 1.13 2008/04/17 15:58:45 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -35,6 +35,7 @@ use HTML::Entities(); use Apache::lonlocal; use Apache::lonupload; use File::Basename(); +use LONCAPA(); # ---------------------------------------------------------------- Display Control sub display_control { @@ -392,7 +393,7 @@ function createWin() { newWindow.document.write("

Location: $fullpath

New Directory

\\n") newWindow.document.write("  \\n") newWindow.document.write("
\\n") - newWindow.document.write("Enter the name of the new directory where you will store the converted testbank questions

") + newWindow.document.write("Enter the name of the new directory where you will save the converted testbank questions

") newWindow.document.write("") newWindow.document.write("") newWindow.document.write("") @@ -469,7 +470,7 @@ Five steps are involved in the import pr $r->print(qq|
  • Provide information about the question format - i.e., question numbering style, and the number of blocks of questions of each question type.
  • Provide information about the questions in each block, including question type, start and end question numbers for each block, and foil labelling style and answer format where required.
  • -
  • Create a new directory where you will store the converted testbank questions.
  • +
  • Create a new directory where you will save the converted testbank questions.
  • Complete the import of questions to the selected pool.
  • @@ -1029,7 +1030,7 @@ END_OF_ONE    - Create a directory to store your testbank questions. + Create a directory to save your testbank questions. @@ -1039,7 +1040,7 @@ END_OF_ONE   -Please choose a destination LON-CAPA directory in which to store your uploaded questions.   +Please choose a destination LON-CAPA directory in which to save your uploaded questions.   @@ -1665,7 +1666,9 @@ sub create_ess { + $answertxt + |; } elsif ($qtype eq "TF") { @@ -1736,7 +1739,7 @@ sub handler { $fn=$env{'form.filename'}; $fn=~s/^http\:\/\/[^\/]+\///; $fn=~s/^\///; - $fn=~s/(\~|priv\/)(\w+)//; + $fn=~s{(~|priv/)($LONCAPA::username_re)}{}; $fn=~s/\/+/\//g; } else { $r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}.