--- loncom/homework/essayresponse.pm 2010/12/31 02:40:14 1.113 +++ loncom/homework/essayresponse.pm 2011/01/29 19:41:41 1.114 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # essay (ungraded) style responses # -# $Id: essayresponse.pm,v 1.113 2010/12/31 02:40:14 raeburn Exp $ +# $Id: essayresponse.pm,v 1.114 2011/01/29 19:41:41 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -58,22 +58,18 @@ sub start_essayresponse { if (!defined($maxfilesize)) { $maxfilesize = 10.0; #FIXME This should become a domain configuration } + my $hiddendraft; if (($Apache::lonhomework::type eq 'survey') || ($Apache::lonhomework::type eq 'surveycred') || ($Apache::lonhomework::type eq 'anonsurvey') || ($Apache::lonhomework::type eq 'anonsurveycred')) { - $result.= ''; - } - my $status_text = &mt('Submission type'); - if ($Apache::lonhomework::history{"resource.$part.award"} eq 'DRAFT') { - $status_text .= '
'.&mt('(Currently -- draft)'); - } - $result.= '
'.&Apache::lonhtmlcommon::start_pick_box(). - &Apache::lonhtmlcommon::row_title($status_text); - if (($Apache::lonhomework::type ne 'survey') && - ($Apache::lonhomework::type ne 'surveycred') && - ($Apache::lonhomework::type ne 'anonsurvey') && - ($Apache::lonhomework::type ne 'anonsurveycred')) { + $hiddendraft = ''; + } else { + my $status_text = &mt('Submission type'); + if ($Apache::lonhomework::history{"resource.$part.award"} eq 'DRAFT') { + $status_text .= '
'.&mt('(Currently -- draft)'); + } + $result = &Apache::lonhtmlcommon::row_title($status_text); my $closure; unless ($ncol || $uploadedfiletypes) { $closure = 1; @@ -111,7 +107,15 @@ sub start_essayresponse { } $result.=&Apache::inputtags::file_selector($part,$id,$uploadedfiletypes, $filesfrom,undef,$maxfilesize); - $result.=&Apache::lonhtmlcommon::end_pick_box().'
'; + if ($result) { + $result = + '
'.$hiddendraft. + &Apache::lonhtmlcommon::start_pick_box(). + $result. + &Apache::lonhtmlcommon::end_pick_box().'
'; + } else { + $result = $hiddendraft; + } } elsif ($target eq 'web' && $Apache::inputtags::status[-1] ne 'CAN_ANSWER') { my $part= $Apache::inputtags::part;