version 1.189, 2006/03/09 00:43:05
|
version 1.192, 2006/05/30 12:45:37
|
Line 31 use strict;
|
Line 31 use strict;
|
use Apache::loncommon; |
use Apache::loncommon; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonnet; |
use Apache::lonnet; |
|
use lib '/home/httpd/lib/perl/'; |
|
use LONCAPA; |
|
|
|
|
BEGIN { |
BEGIN { |
&Apache::lonxml::register('Apache::inputtags',('hiddenline','textfield','textline')); |
&Apache::lonxml::register('Apache::inputtags',('hiddenline','textfield','textline')); |
Line 149 sub start_textfield {
|
Line 152 sub start_textfield {
|
if ($addchars) { |
if ($addchars) { |
$result.=&addchars('HWVAL_'.$resid,$addchars); |
$result.=&addchars('HWVAL_'.$resid,$addchars); |
} |
} |
push @Apache::lonxml::htmlareafields,'HWVAL_'.$resid; |
&Apache::lonhtmlcommon::add_htmlareafields('HWVAL_'.$resid); |
$result.= '<textarea wrap="hard" name="HWVAL_'.$resid.'" id="HWVAL_'.$resid.'" '. |
$result.= '<textarea wrap="hard" name="HWVAL_'.$resid.'" id="HWVAL_'.$resid.'" '. |
"rows=\"$rows\" cols=\"$cols\">".$oldresponse; |
"rows=\"$rows\" cols=\"$cols\">".$oldresponse; |
if ($oldresponse ne '') { |
if ($oldresponse ne '') { |
Line 222 sub end_textfield {
|
Line 225 sub end_textfield {
|
return $result; |
return $result; |
} |
} |
|
|
sub exam_box { |
sub exam_score_line { |
my ($target) = @_; |
my ($target) = @_; |
my $result; |
|
|
|
|
my $result; |
if ($target eq 'tex') { |
if ($target eq 'tex') { |
$result.='\fbox{\fbox{\parbox{\textwidth-5mm}{\strut\\\\\strut\\\\\strut\\\\\strut\\\\}}}'; |
|
my $repetition = &Apache::response::repetition(); |
my $repetition = &Apache::response::repetition(); |
$result.='\begin{enumerate}'; |
$result.='\begin{enumerate}'; |
|
if ($env{'request.state'} eq "construct" ) {$result.='\item[\strut]';} |
foreach my $i (0..$repetition-1) { |
foreach my $i (0..$repetition-1) { |
$result.='\item[\textbf{'. |
$result.='\item[\textbf{'. |
($Apache::lonxml::counter+$i). |
($Apache::lonxml::counter+$i). |
'}.]\textit{Leave blank on scoring form}\vskip 0 mm'; |
'}.]\textit{Leave blank on scoring form}\vskip 0 mm'; |
} |
} |
$result.= '\end{enumerate}'; |
$result.= '\end{enumerate}'; |
|
} |
|
|
|
return $result; |
|
} |
|
|
|
sub exam_box { |
|
my ($target) = @_; |
|
my $result; |
|
|
|
if ($target eq 'tex') { |
|
$result .= '\fbox{\fbox{\parbox{\textwidth-5mm}{\strut\\\\\strut\\\\\strut\\\\\strut\\\\}}}'; |
|
$result .= &exam_score_line($target); |
} elsif ($target eq 'web') { |
} elsif ($target eq 'web') { |
my $id=$Apache::inputtags::response[-1]; |
my $id=$Apache::inputtags::response[-1]; |
$result.= '<br /><br /> |
$result.= '<br /><br /> |
Line 252 sub needs_exam_box {
|
Line 266 sub needs_exam_box {
|
'stringresponse', |
'stringresponse', |
'reactionresponse', |
'reactionresponse', |
'organicresponse', |
'organicresponse', |
'imageresponse', |
|
); |
); |
|
|
foreach my $tag (@tags) { |
foreach my $tag (@tags) { |
Line 421 sub file_selector {
|
Line 434 sub file_selector {
|
'<br />'; |
'<br />'; |
if ($Apache::lonhomework::history{"resource.$part.$id.portfiles"}=~/[^\s]/){ |
if ($Apache::lonhomework::history{"resource.$part.$id.portfiles"}=~/[^\s]/){ |
my (@filelist,@bad_file_list); |
my (@filelist,@bad_file_list); |
foreach my $file (split(',',&Apache::lonnet::unescape($Apache::lonhomework::history{"resource.$part.$id.portfiles"}))) { |
foreach my $file (split(',',&unescape($Apache::lonhomework::history{"resource.$part.$id.portfiles"}))) { |
my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser(); |
my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser(); |
my $url="/uploaded/$domain/$user/portfolio$file"; |
my $url="/uploaded/$domain/$user/portfolio$file"; |
my $icon=&Apache::loncommon::icon($url); |
my $icon=&Apache::loncommon::icon($url); |