version 1.67, 2005/05/20 18:53:53
|
version 1.71, 2006/03/09 01:11:12
|
Line 42 sub start_essayresponse {
|
Line 42 sub start_essayresponse {
|
my $id = &Apache::response::start_response($parstack,$safeeval); |
my $id = &Apache::response::start_response($parstack,$safeeval); |
if ($target eq 'meta') { |
if ($target eq 'meta') { |
$result=&Apache::response::meta_package_write('essayresponse'); |
$result=&Apache::response::meta_package_write('essayresponse'); |
} elsif ($target eq 'web') { |
} elsif ($target eq 'web' && |
|
$Apache::inputtags::status[-1] eq 'CAN_ANSWER') { |
my $part= $Apache::inputtags::part; |
my $part= $Apache::inputtags::part; |
my $ncol= &Apache::lonnet::EXT("resource.$part".'_'."$id.maxcollaborators"); |
my $ncol= &Apache::lonnet::EXT("resource.$part".'_'."$id.maxcollaborators"); |
my $coll= &HTML::Entities::encode($Apache::lonhomework::history{"resource.$part.$id.collaborators"},'<>&"'); |
my $coll= &HTML::Entities::encode($Apache::lonhomework::history{"resource.$part.$id.collaborators"},'<>&"'); |
Line 79 sub end_essayresponse {
|
Line 80 sub end_essayresponse {
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
my $part = $Apache::inputtags::part; |
my $part = $Apache::inputtags::part; |
my $id = $Apache::inputtags::response[-1]; |
my $id = $Apache::inputtags::response[-1]; |
my $increment = 1; |
my $increment = &Apache::response::repetition(); |
my $result; |
my $result; |
if ( $target eq 'grade' ) { |
if ( $target eq 'grade' ) { |
my $collaborators = $env{'form.HWCOL'.$part.'_'.$id}; |
my $collaborators = $env{'form.HWCOL'.$part.'_'.$id}; |
Line 128 sub end_essayresponse {
|
Line 129 sub end_essayresponse {
|
} |
} |
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result.=&Apache::edit::end_table(); |
$result.=&Apache::edit::end_table(); |
} elsif ($target eq 'tex') { |
|
if ($Apache::lonhomework::type eq 'exam') { |
} elsif ($target eq 'tex' |
my $repetition=&Apache::response::repetition(); |
&& $Apache::lonhomework::type eq 'exam') { |
$result.='\begin{enumerate}'; |
$result .= &Apache::inputtags::exam_score_line($target); |
if ($env{'request.state'} eq "construct" ) {$result.='\item[\strut]';} |
|
for (my $i=0;$i<$repetition;$i++) { |
} elsif ($target eq 'answer') { |
$result.='\item[\textbf{'.($Apache::lonxml::counter+$i). |
$result.=&Apache::response::answer_header($$tagstack[-1]); |
'}.]\textit{'.&mt('Leave blank on scoring form'). |
$result.=&Apache::response::answer_part($$tagstack[-1],''); |
'}\vskip 0 mm'; |
$result.=&Apache::response::answer_footer($$tagstack[-1]); |
} |
|
$result.= '\end{enumerate}'; |
|
$increment=$repetition; |
|
} |
|
} |
} |
|
|
if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || |
if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || |
$target eq 'tex' || $target eq 'analyze') { |
$target eq 'tex' || $target eq 'analyze') { |
&Apache::lonxml::increment_counter($increment); |
&Apache::lonxml::increment_counter($increment); |
Line 164 sub file_submission {
|
Line 162 sub file_submission {
|
if ($files =~ /[^\s]/) { |
if ($files =~ /[^\s]/) { |
$files =~s/,$//; |
$files =~s/,$//; |
$Apache::lonhomework::results{"resource.$part.$id.$which"}=$files; |
$Apache::lonhomework::results{"resource.$part.$id.$which"}=$files; |
my @submitted_files = split(/,/,$files); |
|
|
my @submitted_files = ($files); |
|
if ( $which eq 'portfiles' ) { |
|
@submitted_files = split(/,/,$files); |
|
} |
|
|
my $uploadedfiletypes= &Apache::lonnet::EXT("resource.$part".'_'."$id.uploadedfiletypes"); |
my $uploadedfiletypes= &Apache::lonnet::EXT("resource.$part".'_'."$id.uploadedfiletypes"); |
if ($uploadedfiletypes) { |
if ($uploadedfiletypes) { |
$uploadedfiletypes=~s/[^\w\,]//g; |
$uploadedfiletypes=~s/[^\w\,]//g; |