version 1.1, 2004/02/17 23:03:34
|
version 1.3, 2004/02/20 18:18:27
|
Line 1
|
Line 1
|
|
# Handler for parsing text upload problem descriptions into .problems |
|
# $Id$ |
|
# |
|
# 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; |
package Apache::testbankimport; |
|
|
use strict; |
use strict; |
use Apache::Constants qw(:common :http :methods); |
use Apache::Constants qw(:common :http :methods); |
use Apache::loncacc; |
use Apache::loncacc; |
use Apache::loncommon(); |
use Apache::loncommon(); |
use Apache::Log(); |
use Apache::Log(); |
use Apache::lonnet; |
use Apache::lonnet; |
use HTML::Entities(); |
use HTML::Entities(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonupload; |
use Apache::lonupload; |
use File::Basename(); |
use File::Basename(); |
|
|
# ---------------------------------------------------------------- Display Control |
# ---------------------------------------------------------------- Display Control |
sub display_control { |
sub display_control { |
Line 1521 sub create_mcq {
|
Line 1547 sub create_mcq {
|
$tol = 5; |
$tol = 5; |
$numans = $$answerref[0]; |
$numans = $$answerref[0]; |
} else { |
} else { |
my $min = 0; |
my $min = $$answerref[0]; |
my $max = 0; |
my $max = $$answerref[0]; |
for (my $i=0; $i<@{$answerref}; $i++) { |
for (my $i=1; $i<@{$answerref}; $i++) { |
if ($$answerref[$i]<$min) { |
if ($$answerref[$i]<=$min) { |
$min = $$answerref[$i]; |
$min = $$answerref[$i]; |
} elsif ($$answerref[$i] > $max) { |
} elsif ($$answerref[$i] >= $max) { |
$max = $$answerref[$i]; |
$max = $$answerref[$i]; |
} |
} |
} |
} |