version 1.144, 2010/02/28 23:42:24
|
version 1.147, 2010/12/19 04:24:29
|
Line 105 sub start_radiobuttonresponse {
|
Line 105 sub start_radiobuttonresponse {
|
$result .= ' \renewcommand{\labelenumi}{\Alph{enumi}.}'; |
$result .= ' \renewcommand{\labelenumi}{\Alph{enumi}.}'; |
} |
} |
if($env{'form.pdfFormFields'} eq 'yes' && $Apache::inputtags::status[-1] eq 'CAN_ANSWER') { |
if($env{'form.pdfFormFields'} eq 'yes' && $Apache::inputtags::status[-1] eq 'CAN_ANSWER') { |
$result .= &Apache::lonxml::print_pdf_hiddenfield('meta', $env{'user.name'}, $env{'user.domain'}); |
$result .= '\begin{itemize}'; |
$result .= "\n\\\\\n\\\\\n"; |
|
} else { |
} else { |
$result .= '\begin{enumerate}'; |
$result .= '\begin{enumerate}'; |
} |
} |
Line 122 sub end_radiobuttonresponse {
|
Line 121 sub end_radiobuttonresponse {
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
my $result; |
my $result; |
if ($target eq 'edit') { $result=&Apache::edit::end_table(); } |
if ($target eq 'edit') { $result=&Apache::edit::end_table(); } |
if ($target eq 'tex' and ($env{'form.pdfFormFields'} ne 'yes' or $Apache::inputtags::status[-1] ne 'CAN_ANSWER')) { |
if ($target eq 'tex' ) { |
$result .= '\end{enumerate}'; |
if($env{'form.pdfFormFields'} eq 'yes' and $Apache::inputtags::status[-1] eq 'CAN_ANSWER') { |
|
$result .= '\end{itemize}'; |
|
} else { |
|
$result .= '\end{enumerate}'; |
|
} |
} |
} |
&Apache::response::end_response; |
&Apache::response::end_response; |
pop @Apache::lonxml::namespace; |
pop @Apache::lonxml::namespace; |
Line 138 sub start_foilgroup {
|
Line 141 sub start_foilgroup {
|
my $result; |
my $result; |
%Apache::response::foilgroup=(); |
%Apache::response::foilgroup=(); |
$Apache::radiobuttonresponse::conceptgroup=0; |
$Apache::radiobuttonresponse::conceptgroup=0; |
&Apache::response::pushrandomnumber(); |
&Apache::response::pushrandomnumber(undef,$target); |
if ($target eq 'tex' && $Apache::lonhomework::type eq 'exam') { |
if ($target eq 'tex' && $Apache::lonhomework::type eq 'exam') { |
$result.='\item[\textbf{'.$Apache::lonxml::counter.'}.]'; |
$result.='\item[\textbf{'.$Apache::lonxml::counter.'}.]'; |
} |
} |
Line 164 sub storesurvey {
|
Line 167 sub storesurvey {
|
if ($style eq 'anonsurvey') { |
if ($style eq 'anonsurvey') { |
$ad=$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}='ANONYMOUS'; |
$ad=$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}='ANONYMOUS'; |
} elsif ($style eq 'anonsurveycred') { |
} elsif ($style eq 'anonsurveycred') { |
$ad=$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}='ANONYMOUS_CRED'; |
$ad=$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}='ANONYMOUS_CREDIT'; |
} elsif ($style eq 'surveycred') { |
} elsif ($style eq 'surveycred') { |
$ad=$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}='SUBMITTED_CREDIT'; |
$ad=$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}='SUBMITTED_CREDIT'; |
} else { |
} else { |
Line 334 sub displayallfoils {
|
Line 337 sub displayallfoils {
|
my $id=$Apache::inputtags::response['-1']; |
my $id=$Apache::inputtags::response['-1']; |
my $part=$Apache::inputtags::part; |
my $part=$Apache::inputtags::part; |
my $lastresponse; |
my $lastresponse; |
unless ((($Apache::lonhomework::history{"resource.$part.type"} eq 'anonsurvey') || ($Apache::lonhomework::history{"resource.$part.type"} eq 'anonsurveycred')) && (defined($env{'form.grade_symb'}))) { |
my ($lastresponse,$newvariation,$showanswer); |
|
if ((($Apache::lonhomework::history{"resource.$part.type"} eq 'randomizetry') || |
|
($Apache::lonhomework::type eq 'randomizetry')) && |
|
($Apache::inputtags::status[-1] eq 'CAN_ANSWER')) { |
|
if ($env{'form.'.$part.'.rndseed'} ne |
|
$Apache::lonhomework::history{"resource.$part.rndseed"}) { |
|
$newvariation = 1; |
|
} |
|
} |
|
$showanswer = &Apache::response::show_answer(); |
|
unless ((($Apache::lonhomework::history{"resource.$part.type"} eq 'anonsurvey') || ($Apache::lonhomework::history{"resource.$part.type"} eq 'anonsurveycred')) && (defined($env{'form.grade_symb'})) || |
|
($newvariation && !$showanswer)) { |
$lastresponse = |
$lastresponse = |
$Apache::lonhomework::history{"resource.$part.$id.submission"}; |
$Apache::lonhomework::history{"resource.$part.$id.submission"}; |
} |
} |
if ($direction eq 'horizontal') { $result.='<table><tr>'; } |
if ($direction eq 'horizontal') { $result.='<table><tr>'; } |
my %lastresponse=&Apache::lonnet::str2hash($lastresponse); |
my %lastresponse=&Apache::lonnet::str2hash($lastresponse); |
if (&Apache::response::show_answer() ) { |
if ($showanswer) { |
foreach my $name (@names) { |
foreach my $name (@names) { |
if ($Apache::response::foilgroup{$name.'.value'} ne 'unused') { |
if ($Apache::response::foilgroup{$name.'.value'} ne 'unused') { |
if (($direction eq 'horizontal') && ($target ne 'tex')) { |
if (($direction eq 'horizontal') && ($target ne 'tex')) { |
Line 374 sub displayallfoils {
|
Line 388 sub displayallfoils {
|
} else { |
} else { |
if ($target eq 'tex') { |
if ($target eq 'tex') { |
if($env{'form.pdfFormFields'} eq 'yes' && $Apache::inputtags::status[-1] eq 'CAN_ANSWER') { |
if($env{'form.pdfFormFields'} eq 'yes' && $Apache::inputtags::status[-1] eq 'CAN_ANSWER') { |
my $fieldname = $env{'request.symb'}. |
my $fieldname = $env{'request.symb'}.'&part_'. $Apache::inputtags::part |
'&part_'. $Apache::inputtags::part. |
.'&radiobuttonresponse'.'&HWVAL_'.$Apache::inputtags::response['-1']; |
'&radiobuttonresponse'. |
$result .= '\item[{'.&Apache::lonxml::print_pdf_radiobutton($fieldname,$temp).'}]' |
'&HWVAL_' . $Apache::inputtags::response['-1']; |
.$Apache::response::foilgroup{$name.'.text'}."\n"; |
my $value = $temp; |
|
my $text = $Apache::response::foilgroup{$name.'.text'}; |
|
$result .= &Apache::lonxml::print_pdf_radiobutton($fieldname, |
|
$value, |
|
$text)."\n"; |
|
} else { |
} else { |
$result .= '\item \vskip -2mm '; |
$result .= '\item \vskip -2mm '; |
} |
} |
Line 402 sub displayallfoils {
|
Line 411 sub displayallfoils {
|
type=\"radio\" |
type=\"radio\" |
name=\"HWVAL_$Apache::inputtags::response['-1']\" |
name=\"HWVAL_$Apache::inputtags::response['-1']\" |
value=\"$temp\""; |
value=\"$temp\""; |
|
|
if (defined($lastresponse{$name})) { $result .= ' checked="checked"'; } |
if (defined($lastresponse{$name})) { $result .= ' checked="checked"'; } |
$result .= ' />'.$Apache::response::foilgroup{$name.'.text'}. |
$result .= ' />'.$Apache::response::foilgroup{$name.'.text'}. |
'</label>'; |
'</label>'; |
Line 619 sub displayfoils {
|
Line 629 sub displayfoils {
|
my $temp=0; |
my $temp=0; |
my $id=$Apache::inputtags::response['-1']; |
my $id=$Apache::inputtags::response['-1']; |
my $part=$Apache::inputtags::part; |
my $part=$Apache::inputtags::part; |
my $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"}; |
my ($lastresponse,$newvariation); |
|
if ((($Apache::lonhomework::history{"resource.$part.type"} eq 'randomizetry') || |
|
($Apache::lonhomework::type eq 'randomizetry')) && |
|
($Apache::inputtags::status[-1] eq 'CAN_ANSWER')) { |
|
if ($env{'form.'.$part.'.rndseed'} ne |
|
$Apache::lonhomework::history{"resource.$part.rndseed"}) { |
|
$newvariation = 1; |
|
} |
|
} |
|
unless ($newvariation) { |
|
$lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"}; |
|
} |
my %lastresponse=&Apache::lonnet::str2hash($lastresponse); |
my %lastresponse=&Apache::lonnet::str2hash($lastresponse); |
if ($target ne 'tex' && $direction eq 'horizontal') { |
if ($target ne 'tex' && $direction eq 'horizontal') { |
$result.="<table><tr>"; |
$result.="<table><tr>"; |
Line 653 sub displayfoils {
|
Line 674 sub displayfoils {
|
$i++; |
$i++; |
$bubble_number++; |
$bubble_number++; |
} else { |
} else { |
if($env{'form.pdfFormFields'} eq 'yes' && $Apache::inputtags::status[-1] eq 'CAN_ANSWER') { |
if($env{'form.pdfFormFields'} eq 'yes' && $Apache::inputtags::status[-1] eq 'CAN_ANSWER') { |
|
my $fieldname = $env{'request.symb'}.'&part_'. $Apache::inputtags::part |
my $fieldname = $env{'request.symb'}. |
.'&radiobuttonresponse'.'&HWVAL_'.$Apache::inputtags::response['-1']; |
'&part_'. $Apache::inputtags::part. |
$result .= '\item[{'.&Apache::lonxml::print_pdf_radiobutton($fieldname,$temp).'}]' |
'&radiobuttonresponse'. |
.$Apache::response::foilgroup{$name.'.text'}."\n"; |
'&HWVAL_' . $Apache::inputtags::response['-1']; |
} else { |
my $value = $temp; |
$result .= '\vspace*{-2 mm}\item '.$Apache::response::foilgroup{$name.'.text'}; |
my $text = $Apache::response::foilgroup{$name.'.text'}; |
} |
$result .= &Apache::lonxml::print_pdf_radiobutton($fieldname, $value, $text).'\newline'."\n"; |
|
} else { |
|
$result .= '\vspace*{-2 mm}\item '.$Apache::response::foilgroup{$name.'.text'}; |
|
} |
|
} |
} |
} |
} |
if ($target ne 'tex' && $direction eq 'horizontal') { |
if ($target ne 'tex' && $direction eq 'horizontal') { |