';
}
@@ -355,12 +353,13 @@ sub init_problem_globals {
if ($type eq 'problem') {
$Apache::inputtags::part='0';
@Apache::inputtags::partlist=('0');
-
- $Apache::lonhomework::problemstatus=&get_problem_status('0')
- } else {
+ $Apache::lonhomework::problemstatus=&get_problem_status('0');
+ $Apache::lonhomework::ignore_response_errors=0;
+ } elsif ($type eq 'library') {
$Apache::inputtags::part='';
@Apache::inputtags::partlist=();
$Apache::lonhomework::problemstatus='';
+ $Apache::lonhomework::ignore_response_errors=1;
}
@Apache::inputtags::responselist = ();
@Apache::inputtags::importlist = ();
@@ -673,6 +672,7 @@ sub end_problem {
$result=&Apache::response::mandatory_part_meta;
}
$result.=&Apache::response::meta_part_order();
+ $result.=&Apache::response::meta_response_order();
} elsif ($target eq 'edit') {
&Apache::lonxml::debug("in end_problem with $target, edit");
$result = &problem_edit_footer();
@@ -861,7 +861,7 @@ sub start_instructorcomment {
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
$target eq 'tex' || $target eq 'analyze') {
$result=($ENV{'request.role'}=~/^(in|cc|au|ca|li)/);
- if ( ! $result ) {
+ if ( (! $result) or ($ENV{'form.instructor_comments'} eq 'hide')) {
my $skip=&Apache::lonxml::get_all_text("/instructorcomment",
$parser,$style);
&Apache::lonxml::debug("skipping ahead :$skip: $$parser[-1]");
@@ -1041,7 +1041,11 @@ sub start_part {
@Apache::inputtags::previous_version=();
$Apache::lonhomework::problemstatus=&get_problem_status($id);
my $hidden=&Apache::loncommon::check_if_partid_hidden($Apache::inputtags::part);
+ my $newtype=&Apache::lonnet::EXT("resource.$id.type");
+ if ($newtype) { $Apache::lonhomework::type=$newtype; }
+
my $expression='$external::part=\''.$Apache::inputtags::part.'\';';
+ $expression.='$external::type=\''.$Apache::lonhomework::type.'\';';
&Apache::run::run($expression,$safeeval);
if ($target eq 'meta') {
@@ -1080,7 +1084,11 @@ sub start_part {
} else {
if ($target eq 'tex') {
if (not $ENV{'form.problem_split'}=~/yes/) {
- $result.='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent';
+ if ($$tagstack[-2] eq 'td') {
+ $result.='\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent';
+ } else {
+ $result.='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent';
+ }
}
my $weight = &Apache::lonnet::EXT("resource.$id.weight");
my $allkeys=&Apache::lonnet::metadata($ENV{'request.uri'},'packages');
@@ -1140,6 +1148,7 @@ sub end_part {
$gradestatus='';
}
$result=$gradestatus;
+ if ($$tagstack[-2] eq 'td' and $target eq 'tex') {$result.='\end{minipage}';}
} elsif ($target eq 'edit') {
$result=&Apache::edit::end_table();
}
|