--- loncom/homework/essayresponse.pm 2006/05/30 12:45:36 1.72 +++ loncom/homework/essayresponse.pm 2006/10/16 09:27:54 1.76 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # essay (ungraded) style responses # -# $Id: essayresponse.pm,v 1.72 2006/05/30 12:45:36 www Exp $ +# $Id: essayresponse.pm,v 1.76 2006/10/16 09:27:54 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -52,17 +52,23 @@ sub start_essayresponse { my $coll= &HTML::Entities::encode($Apache::lonhomework::history{"resource.$part.$id.collaborators"},'<>&"'); my $uploadedfiletypes= &Apache::lonnet::EXT("resource.$part".'_'."$id.uploadedfiletypes"); $uploadedfiletypes=~s/[^\w\,]//g; - $result='
'; - $result.=''; + if ( $Apache::lonhomework::type eq 'survey' ) { + $result.= ' '; + } + $result.='
'. - '
'. - ''. - '
'; + if ( $Apache::lonhomework::type ne 'survey' ) { + $result.= ''; + } + if ($ncol > 0) { $result .=''; + } + + my $file_submission = + &Apache::inputtags::show_past_file_submission($part,$id); + if ($file_submission) { + $result .= ''; + } + + my $port_submission = + &Apache::inputtags::show_past_portfile_submission($part,$id); + if ($port_submission) { + $result .= ''; + } + + if ($result ne '') { + $result = + '
'. + '
'. + ''. + '
'.''.&mt('Collaborated with [_1]',$coll).''.$file_submission.''.$port_submission.'
'.$result. + '
'; + } } return $result; } @@ -138,9 +170,18 @@ sub end_essayresponse { $result .= &Apache::inputtags::exam_score_line($target); } elsif ($target eq 'answer') { - $result.=&Apache::response::answer_header($$tagstack[-1]); - $result.=&Apache::response::answer_part($$tagstack[-1],''); - $result.=&Apache::response::answer_footer($$tagstack[-1]); + if ($env{'form.answer_output_mode'} eq 'tex') { + $result .= '\begin{tabular}{|l|}'; + $result .= '\hline'; + $result .= ' Answer for essay will be hand graded \\\\ '; + $result .= '\\hline'; + $result .= '\end{tabular}'; + $result .= '\vskip 3mm'; + } else { + $result.=&Apache::response::answer_header($$tagstack[-1]); + $result.=&Apache::response::answer_part($$tagstack[-1],''); + $result.=&Apache::response::answer_footer($$tagstack[-1]); + } } if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || @@ -168,7 +209,7 @@ sub file_submission { my @submitted_files = ($files); if ( $which eq 'portfiles' ) { - @submitted_files = split(/,/,$files); + @submitted_files = split(/\s*,\s*/,$files); } my $uploadedfiletypes= &Apache::lonnet::EXT("resource.$part".'_'."$id.uploadedfiletypes");