--- loncom/homework/structuretags.pm 2011/02/06 18:43:10 1.487
+++ loncom/homework/structuretags.pm 2011/07/04 13:01:57 1.490
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.487 2011/02/06 18:43:10 www Exp $
+# $Id: structuretags.pm,v 1.490 2011/07/04 13:01:57 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -411,8 +411,14 @@ sub setup_rndseed {
delete($env{'form.resetdata'});
delete($env{'form.newrandomization'});
}
- if (defined($rndseed) && $rndseed ne int($rndseed)) {
- $rndseed=join(':',&Apache::lonnet::digest($rndseed));
+ $rndseed=~s/\,/\:/g;
+ $rndseed=~s/[^\w\d\:\-]//g;
+ if (defined($rndseed)) {
+ my ($c1,$c2)=split(/\:/,$rndseed);
+ unless ($c2) { $c2=0; }
+ unless (($c1==int($c1)) && ($c2==int($c2))) {
+ $rndseed=join(':',&Apache::lonnet::digest($rndseed));
+ }
}
if ($Apache::lonhomework::history{'resource.CODE'}) {
$rndseed=&Apache::lonnet::rndseed();
@@ -642,7 +648,7 @@ $show_all
-
';
@@ -1177,6 +1183,9 @@ sub start_problem {
}
}
}
+ if ($env{'form.grade_imsexport'}) {
+ $result = '';
+ }
} elsif ($target eq 'tex') {
$result .= 'INSERTTEXFRONTMATTERHERE';
@@ -1315,7 +1324,8 @@ sub end_problem {
}
} elsif ( ($target eq 'web' || $target eq 'tex') &&
$Apache::inputtags::part eq '0' &&
- $status ne 'UNCHECKEDOUT' && $status ne 'NOT_YET_VIEWED') {
+ $status ne 'UNCHECKEDOUT' && $status ne 'NOT_YET_VIEWED'
+ && !$env{'form.grade_imsexport'}) {
# if part is zero, no
s existed, so we need show the current
# grading status
my $gradestatus = &Apache::inputtags::gradestatus($Apache::inputtags::part,$target);
@@ -1325,8 +1335,9 @@ sub end_problem {
(($target eq 'web') && ($env{'request.state'} ne 'construct')) ||
($target eq 'answer') || ($target eq 'tex')
) {
- if ($target ne 'tex' &&
- $env{'form.answer_output_mode'} ne 'tex') {
+ if (($target ne 'tex') &&
+ ($env{'form.answer_output_mode'} ne 'tex') &&
+ (!$env{'form.grade_imsexport'})) {
$result.="";
}
if ($target eq 'web') {
@@ -2049,7 +2060,8 @@ sub end_part {
!$hidden && $in_order_show) {
my $gradestatus=&Apache::inputtags::gradestatus($Apache::inputtags::part,
$target);
- if ($Apache::lonhomework::type eq 'exam' && $target eq 'tex') {
+ if (($Apache::lonhomework::type eq 'exam' && $target eq 'tex') ||
+ ($env{'form.grade_imsexport'})) {
$gradestatus='';
}
$result.=$gradestatus;