version 1.28, 2001/12/07 23:58:35
|
version 1.31, 2002/01/17 12:23:31
|
Line 30 package Apache::optionresponse;
|
Line 30 package Apache::optionresponse;
|
use strict; |
use strict; |
use Apache::response; |
use Apache::response; |
|
|
sub BEGIN { |
BEGIN { |
&Apache::lonxml::register('Apache::optionresponse',('optionresponse')); |
&Apache::lonxml::register('Apache::optionresponse',('optionresponse')); |
} |
} |
|
|
sub start_optionresponse { |
sub start_optionresponse { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
my $result=''; |
my $result=''; |
#when in a radiobutton response use these |
#when in a option response use these |
&Apache::lonxml::register('Apache::optionresponse',('foilgroup','foil','conceptgroup')); |
&Apache::lonxml::register('Apache::optionresponse',('foilgroup','foil','conceptgroup')); |
push (@Apache::lonxml::namespace,'optionresponse'); |
push (@Apache::lonxml::namespace,'optionresponse'); |
my $id = &Apache::response::start_response($parstack,$safeeval); |
my $id = &Apache::response::start_response($parstack,$safeeval); |
if ($target eq 'edit') { |
if ($target eq 'edit') { |
$result.=&Apache::edit::start_table($token). |
$result.=&Apache::edit::start_table($token). |
"<tr><td>Multiple Option Response Question</td><td>Delete:". |
"<tr><td>Multiple Option Response Question</td><td>Delete:". |
&Apache::edit::deletelist($target,$token) |
&Apache::edit::deletelist($target,$token) |
."</td><td> </td></tr><tr><td colspan=\"3\">\n"; |
."</td><td> ". |
|
&Apache::edit::end_row(). |
|
&Apache::edit::start_spanning_row(). |
|
"\n"; |
$result.=&Apache::edit::text_arg('Max Number Of Foils:','max',$token,'4'). |
$result.=&Apache::edit::text_arg('Max Number Of Foils:','max',$token,'4'). |
"</td></tr>"; |
&Apache::edit::end_row(). |
$result.="<tr><td colspan=\"3\">\n"; |
&Apache::edit::start_spanning_row(); |
} |
} |
if ($target eq 'modified') { |
if ($target eq 'modified') { |
my $constructtag=&Apache::edit::get_new_args($token,$parstack, |
my $constructtag=&Apache::edit::get_new_args($token,$parstack, |
Line 65 sub end_optionresponse {
|
Line 68 sub end_optionresponse {
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
&Apache::response::end_response; |
&Apache::response::end_response; |
pop @Apache::lonxml::namespace; |
pop @Apache::lonxml::namespace; |
|
&Apache::lonxml::deregister('Apache::optionresponse',('foilgroup','foil','conceptgroup')); |
my $result; |
my $result; |
if ($target eq 'edit') { $result=&Apache::edit::end_table(); } |
if ($target eq 'edit') { $result=&Apache::edit::end_table(); } |
return $result; |
return $result; |
Line 97 sub start_foilgroup {
|
Line 101 sub start_foilgroup {
|
</td> |
</td> |
<td>Delete an Option: |
<td>Delete an Option: |
<select name="$Apache::lonxml::curdepth.deleteopt">$optionlist</select> |
<select name="$Apache::lonxml::curdepth.deleteopt">$optionlist</select> |
</td> |
|
</tr> |
|
<tr><td colspan="3">$insertlist<br /> |
|
ENDTABLE |
ENDTABLE |
|
$result.= &Apache::edit::end_row(); |
|
$result.= &Apache::edit::start_spanning_row(); |
|
$result.= $insertlist.'<br />'; |
} |
} |
if ($target eq 'modified') { |
if ($target eq 'modified') { |
my @options; |
my @options; |
Line 280 sub start_conceptgroup {
|
Line 284 sub start_conceptgroup {
|
my $result; |
my $result; |
if ($target eq 'edit') { |
if ($target eq 'edit') { |
$result.=&Apache::edit::tag_start($target,$token,"Concept Grouped Foils"); |
$result.=&Apache::edit::tag_start($target,$token,"Concept Grouped Foils"); |
$result.=&Apache::edit::text_arg('Concept:','concept',$token,'50')."</td></tr>"; |
$result.=&Apache::edit::text_arg('Concept:','concept',$token,'50'). |
$result.="<tr><td colspan=\"3\">\n"; |
&Apache::edit::end_row().&Apache::edit::start_spanning_row(); |
} |
} |
if ($target eq 'modified') { |
if ($target eq 'modified') { |
my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'concept'); |
my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'concept'); |
Line 332 sub start_foil {
|
Line 336 sub start_foil {
|
eval '@opt ='.&Apache::lonxml::get_param('options',$parstack,$safeeval,$level); |
eval '@opt ='.&Apache::lonxml::get_param('options',$parstack,$safeeval,$level); |
$result.=&Apache::edit::text_arg('Name:','name',$token); |
$result.=&Apache::edit::text_arg('Name:','name',$token); |
$result.= &Apache::edit::select_or_text_arg('Correct Option:','value',['unused',(@opt)],$token,'15'); |
$result.= &Apache::edit::select_or_text_arg('Correct Option:','value',['unused',(@opt)],$token,'15'); |
$result .= '</td></tr><tr><td colspan="3">'; |
$result .=&Apache::edit::end_row().&Apache::edit::start_spanning_row(); |
} elsif ($target eq 'modified') { |
} elsif ($target eq 'modified') { |
my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'value','name'); |
my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'value','name'); |
if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); } |
if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); } |