version 1.380, 2007/06/11 20:52:29
|
version 1.387, 2007/08/08 19:13:19
|
Line 47 BEGIN {
|
Line 47 BEGIN {
|
|
|
sub start_web { |
sub start_web { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
my $bodytext=&Apache::lonxml::get_all_text("/web",$parser,$style); |
if ($target ne 'edit' && $target ne 'modified') { |
if ($target eq 'web' || $target eq 'webgrade') { |
my $bodytext=&Apache::lonxml::get_all_text("/web",$parser,$style); |
return $bodytext; |
if ($target eq 'web' || $target eq 'webgrade') { |
|
return $bodytext; |
|
} |
|
} elsif ($target eq "edit" ) { |
|
my $bodytext = |
|
&Apache::lonxml::get_all_text_unbalanced("/web",$parser); |
|
my $result = &Apache::edit::tag_start($target,$token); |
|
$result .= &Apache::edit::editfield($token->[1],$bodytext,'',80,1); |
|
return $result; |
|
} elsif ( $target eq "modified" ) { |
|
return $token->[4].&Apache::edit::modifiedfield("/web",$parser); |
} |
} |
return ''; |
return ''; |
} |
} |
Line 61 sub end_web {
|
Line 71 sub end_web {
|
sub start_tex { |
sub start_tex { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
my $result=''; |
my $result=''; |
my $bodytext=&Apache::lonxml::get_all_text("/tex",$parser,$style); |
if ($target ne 'edit' && $target ne 'modified') { |
if ($target eq 'tex') { |
my $bodytext=&Apache::lonxml::get_all_text("/tex",$parser,$style); |
return $bodytext.' '; |
if ($target eq 'tex') { |
|
return $bodytext.' '; |
|
} |
|
} elsif ($target eq "edit" ) { |
|
my $bodytext = |
|
&Apache::lonxml::get_all_text_unbalanced("/tex",$parser); |
|
my $result = &Apache::edit::tag_start($target,$token); |
|
$result .= &Apache::edit::editfield($token->[1],$bodytext,'',80,1); |
|
return $result; |
|
} elsif ( $target eq "modified" ) { |
|
return $token->[4].&Apache::edit::modifiedfield("/tex",$parser); |
} |
} |
return $result;; |
return $result;; |
} |
} |
Line 105 function setSubmittedPart (part) {
|
Line 125 function setSubmittedPart (part) {
|
|
|
$extra_head .= &Apache::londefdef::generate_css_links(); |
$extra_head .= &Apache::londefdef::generate_css_links(); |
|
|
if ($target eq 'edit') { |
if ($env{'request.state'} eq 'construct') { |
$extra_head.=&Apache::edit::js_change_detection(). |
$extra_head.=&Apache::edit::js_change_detection(). |
"<script type=\"text/javascript\">\n". |
"<script type=\"text/javascript\">\n". |
"if (typeof swmenu != 'undefined') {swmenu.currentURL=null;}\n". |
"if (typeof swmenu != 'undefined') {swmenu.currentURL=null;}\n". |
Line 289 sub problem_web_to_edit_header {
|
Line 309 sub problem_web_to_edit_header {
|
<input type="text" name="rndseed" size="10" value="'. |
<input type="text" name="rndseed" size="10" value="'. |
$rndseed.'" |
$rndseed.'" |
onchange="javascript:document.lonhomework.changerandseed.click()" /></nobr> |
onchange="javascript:document.lonhomework.changerandseed.click()" /></nobr> |
<label><input type="checkbox" name="showallfoils" '; |
<span class="LC_nobreak"><label><input type="checkbox" name="showallfoils" '; |
my $show_all_foils_text = |
my $show_all_foils_text = |
($Apache::lonhomework::parsing_a_task) ? |
($Apache::lonhomework::parsing_a_task) ? |
&mt(' Show All Instances') |
&mt(' Show All Instances') |
: &mt(' Show All Foils'); |
: &mt(' Show All Foils'); |
|
|
if (defined($env{'form.showallfoils'})) { $result.='checked="on"'; } |
if (defined($env{'form.showallfoils'})) { $result.='checked="on"'; } |
$result.= ' />'.$show_all_foils_text.'</label>'. |
$result.= ' />'.$show_all_foils_text.'</label></span>'. |
&Apache::loncommon::help_open_topic('Problem_Editor_Testing_Area','Testing Problems'). |
&Apache::loncommon::help_open_topic('Problem_Editor_Testing_Area','Testing Problems'). |
'<hr />'; |
'<hr />'; |
|
$result.=&mt('Apply style file: ').' |
|
<input type="text" name="style_file" value="'.&HTML::Entities::encode($env{'construct.style'},'"<>&').'" /> |
|
<a href="javascript:openbrowser(\'lonhomework\',\'style_file\',\'sty\')">'.&mt('Select').'</a> |
|
<input type="submit" name="clear_style_file" value="'.&mt('Clear').'" /> |
|
<br />'; |
|
|
if (!$Apache::lonhomework::parsing_a_task) { |
if (!$Apache::lonhomework::parsing_a_task) { |
$result.=" |
$result.=" |
<nobr> |
<nobr> |
Line 432 sub finalize_storage {
|
Line 458 sub finalize_storage {
|
} |
} |
return $result; |
return $result; |
} |
} |
use Data::Dumper; |
|
|
|
# -------------------------------------------------------------store_aggregates |
# -------------------------------------------------------------store_aggregates |
# Sends hash of values to be incremented in nohist_resourcetracker.db |
# Sends hash of values to be incremented in nohist_resourcetracker.db |
Line 880 sub end_problem {
|
Line 905 sub end_problem {
|
if ($Apache::lonhomework::type eq 'exam' and $allow_print_points==1) { $frontmatter .= '\fbox{\textit{'.$weight.' pt}}';} |
if ($Apache::lonhomework::type eq 'exam' and $allow_print_points==1) { $frontmatter .= '\fbox{\textit{'.$weight.' pt}}';} |
} |
} |
} else { |
} else { |
$frontmatter .= '\vskip 1mm\textit{Due date: '.$duedate.'} \\\\\\\\'; |
$frontmatter .= '\vskip 1mm\textit{Due date: '.$duedate.'} \\\\\\\\'.$startminipage; |
} |
} |
} else { |
} else { |
if (not $env{'request.symb'} =~ m/\.page_/) { |
if (not $env{'request.symb'} =~ m/\.page_/) { |
$frontmatter .= $begin_doc.$toc_line; |
$frontmatter .= $begin_doc.$toc_line; |
if (($Apache::lonhomework::type eq 'exam') and ($allow_print_points==1)) { $frontmatter .= '\fbox{\textit{'.$weight.' pt}}';} |
if (($Apache::lonhomework::type eq 'exam') and ($allow_print_points==1)) { $frontmatter .= '\fbox{\textit{'.$weight.' pt}}';} |
} else { |
} else { |
$frontmatter .= '\vskip 1mm \\\\\\\\'; |
$frontmatter .= '\vskip 1mm \\\\\\\\'.$startminipage; |
} |
} |
} |
} |
$result =~ s/INSERTTEXFRONTMATTERHERE/$frontmatter/; |
$result =~ s/INSERTTEXFRONTMATTERHERE/$frontmatter/; |
Line 937 sub end_problem {
|
Line 962 sub end_problem {
|
if (not $env{'request.symb'} =~ m/\.page_/) { |
if (not $env{'request.symb'} =~ m/\.page_/) { |
$result .= $endminipage.'\end{document} '; |
$result .= $endminipage.'\end{document} '; |
} else { |
} else { |
$result .= ''; |
$result .= $endminipage; |
} |
} |
} |
} |
} |
} |
Line 1055 sub start_block {
|
Line 1080 sub start_block {
|
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || |
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || |
$target eq 'tex' || $target eq 'analyze' || $target eq 'webgrade') { |
$target eq 'tex' || $target eq 'analyze' || $target eq 'webgrade') { |
my $code = $token->[2]->{'condition'}; |
my $code = $token->[2]->{'condition'}; |
if (defined($code)) { |
if (defined($code) && $code ne '') { |
if (!$Apache::lonxml::default_homework_loaded) { |
if (!$Apache::lonxml::default_homework_loaded) { |
&Apache::lonxml::default_homework_load($safeeval); |
&Apache::lonxml::default_homework_load($safeeval); |
} |
} |
Line 1349 sub start_part {
|
Line 1374 sub start_part {
|
# duedates. |
# duedates. |
} |
} |
my $result=''; |
my $result=''; |
my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); |
my $id= &Apache::lonxml::get_id($parstack,$safeeval); |
if ($id =~ /^\s*$/) { $id = $Apache::lonxml::curdepth; } |
|
$Apache::inputtags::part=$id; |
$Apache::inputtags::part=$id; |
push(@Apache::inputtags::partlist,$id); |
push(@Apache::inputtags::partlist,$id); |
@Apache::inputtags::response=(); |
@Apache::inputtags::response=(); |