--- loncom/imspackages/imsexport.pm 2004/12/23 14:00:58 1.1
+++ loncom/imspackages/imsexport.pm 2009/02/25 10:26:05 1.6
@@ -1,3 +1,7 @@
+# The LearningOnline Network
+#
+# $Id: imsexport.pm,v 1.6 2009/02/25 10:26:05 weissno Exp $
+#
# Copyright Michigan State University Board of Trustees
#
# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -27,13 +31,14 @@ use strict;
use Apache::lonnet;
sub simpleproblem {
- my ($symb,$output) = @_;
+ my ($symb) = @_;
+ my $output;
my %qparms = &Apache::lonnet::dump('resourcedata',
- $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
- $ENV{'course.'.$ENV{'request.course.id'}.'.num'},
- $ENV{'request.course.id'}.'.'.$symb);
+ $env{'course.'.$env{'request.course.id'}.'.domain'},
+ $env{'course.'.$env{'request.course.id'}.'.num'},
+ $env{'request.course.id'}.'.'.$symb);
if ($symb) {
- my $prefix=$ENV{'request.course.id'}.'.'.$symb.'.0.';
+ my $prefix=$env{'request.course.id'}.'.'.$symb.'.0.';
my $qtype=$qparms{$prefix.'questiontype'};
my $qtext=$qparms{$prefix.'questiontext'};
my $hint=$qparms{$prefix.'hinttext'};
@@ -45,58 +50,58 @@ sub simpleproblem {
if ($qtype eq 'option') {
my $options=$qparms{$prefix.'options'};
%values = &evaloptionhash($options);
- $$output .= qq|
+ $output .= qq|
|;
for (my $k=0; $k<10; $k++) {
my $iter = $k+1;
- $$output .= ' '."\n";
+ $output .= ' '."\n";
}
- chomp($$output);
- $$output .= qq|
+ chomp($output);
+ $output .= qq|
|;
if ($hint) {
- $$output .= '
+ $output .= '
'.$hint.'
';
}
- $$output .= qq|
+ $output .= qq|
|;
} else {
- $$output .= qq|
+ $output .= qq|
|;
for (my $k=0; $k<10; $k++) {
my $iter = $k+1;
- $$output .= ' '."\n";
+ $output .= ' '."\n";
}
- chomp($$output);
- $$output .= qq|
+ chomp($output);
+ $output .= qq|
|;
if ($hint) {
- $$output .= '
+ $output .= '
'.$hint.'
';
}
- $$output .= qq|
+ $output .= qq|
|;
@@ -104,26 +109,26 @@ sub simpleproblem {
} elsif ($qtype eq 'stringanswer') {
my $stringanswer = $qparms{$prefix.'stringanswer'};
my $stringtype=$qparms{$prefix.'stringtype'};
- $$output .= qq|
+ $output .= qq|
|;
if ($hint) {
- $$output .= '
+ $output .= '
'.$hint.'
';
}
- $$output .= qq|
+ $output .= qq|
|;
} else {
- $$output .= qq|
+ $output .= qq|
$qtext
@@ -133,7 +138,7 @@ sub simpleproblem {
|;
}
}
- return;
+ return $output;
}
sub evaloptionhash {
@@ -150,15 +155,15 @@ sub evaloptionhash {
sub external {
my ($symb,$title) = @_;
my $output;
- if ($symb =~ m-\.sequence___\d+___ext$-) {
- my $exturl = &Apache::lonnet::escape($1);
+ if ($symb =~ m-\.sequence___\d+___ext(.+)$-) {
+ my $exturl = &unescape($1);
$output = qq|
$title
|;
@@ -168,8 +173,8 @@ sub external {
sub templatedpage {
my ($content_type,$timestamp,$count,$uploads,$udom,$uname) = @_;
- my $cdom = $ENV{'course.'.$ENV{'request.course.id'}.'.domain'};
- my $cnum = $ENV{'course.'.$ENV{'request.course.id'}.'.num'};
+ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
my $output = '
<'.$content_type.'>';
my %syllabusdata=();
@@ -212,7 +217,7 @@ sub templatedpage {
%syllabusdata=&Apache::lonnet::dump('aboutme',$udom,$uname);
%syllabusfields=&Apache::lonlocal::texthash(
'aaa_contactinfo' => 'Contact Information',
- 'bbb_aboutme' => 'About Me',
+ 'bbb_aboutme' => 'Personal Information',
'ccc_webreferences' => 'Web References'
);
$output .= qq|
@@ -228,8 +233,8 @@ sub templatedpage {
$_>|;
}
if (defined($syllabusdata{'uploaded.photourl'})) {
- if ($syllabusdata{'uploaded.photourl'} =~ m-^/uploaded/$cdom/$cnum/$content_type/(.+)$-) {
- push @{$$uploads}, $syllabusdata{'uploaded.photourl'};
+ if ($syllabusdata{'uploaded.photourl'} =~ m-/([^/]+)$-) {
+ push @$uploads, $syllabusdata{'uploaded.photourl'};
}
$output .= '