version 1.120, 2002/10/01 20:44:44
|
version 1.126, 2002/10/14 20:48:36
|
Line 163 sub problem_web_to_edit_header {
|
Line 163 sub problem_web_to_edit_header {
|
if (defined($ENV{'form.showallfoils'})) { $result.='checked="on"'; } |
if (defined($ENV{'form.showallfoils'})) { $result.='checked="on"'; } |
$result.= ' /> Show All Foils |
$result.= ' /> Show All Foils |
<hr />'; |
<hr />'; |
|
my $numtoanalyze=$ENV{'form.numtoanalyze'}; |
|
if (!$numtoanalyze) { $numtoanalyze=100; } |
|
#DISABLED for now. |
|
#$result.= '<input type="submit" name="problemmode" value="Answer Distribution" /> |
|
# <input type="text" name="numtoanalyze" value="'. |
|
# $numtoanalyze.'" size="5" /> <hr />'; |
} |
} |
|
|
sub initialize_storage { |
sub initialize_storage { |
Line 389 sub end_problem {
|
Line 395 sub end_problem {
|
$status ne 'UNCHECKEDOUT') { |
$status ne 'UNCHECKEDOUT') { |
# if part is zero, no <part>s existed, so we need show the current |
# if part is zero, no <part>s existed, so we need show the current |
# grading status |
# grading status |
my $gradestatus = &Apache::inputtags::gradestatus($Apache::inputtags::part); |
my $gradestatus = &Apache::inputtags::gradestatus($Apache::inputtags::part,$target); |
#FIXME this is ugly we should just generate tex in inputtags |
|
if ($target eq 'tex') { $gradestatus=&html_to_tex($gradestatus); } |
|
if ($Apache::lonhomework::type ne 'exam') {$result.= $gradestatus;} |
if ($Apache::lonhomework::type ne 'exam') {$result.= $gradestatus;} |
} |
} |
if ( |
if ( |
Line 434 sub end_problem {
|
Line 438 sub end_problem {
|
return $result; |
return $result; |
} |
} |
|
|
#FIXME I am ugly shoot me |
|
sub html_to_tex { |
|
my ($string)=@_; |
|
$string =~ s/<table>//; |
|
$string =~ s/<\/table>//; |
|
$string =~ s/<tr([^>]*)>//g; |
|
$string =~ s/<\/tr>//g; |
|
$string =~ s/<td([^>]*)>//g; |
|
$string =~ s/<\/td>//g; |
|
$string =~ s/<b>/\\textbf{/g; |
|
$string =~ s/<\/b>/}/g; |
|
$string =~ s/<br \/>/\\vskip 0 mm /g; |
|
$string =~ s/<input([^>]*)>//g; |
|
return $string; |
|
} |
|
|
|
sub start_library { |
sub start_library { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
Line 493 sub end_library {
|
Line 482 sub end_library {
|
sub start_block { |
sub start_block { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
|
|
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex') { |
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex' || $targer eq 'analyze') { |
my $code = @$parstack[$#$parstack]; |
my $code = @$parstack[$#$parstack]; |
$code =~ s/\"//g; |
$code =~ s/\"//g; |
$code .=';return $condition;'; |
$code .=';return $condition;'; |
Line 550 sub start_randomlist {
|
Line 539 sub start_randomlist {
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my $result; |
my $result; |
if ($target eq 'answer' || $target eq 'grade' || $target eq 'web' || |
if ($target eq 'answer' || $target eq 'grade' || $target eq 'web' || |
$target eq 'tex') { |
$target eq 'tex' || $target eq 'analyze') { |
my $body= &Apache::lonxml::get_all_text("/randomlist",$$parser[$#$parser]); |
my $body= &Apache::lonxml::get_all_text("/randomlist",$$parser[$#$parser]); |
my $b_parser= HTML::TokeParser->new(\$body); |
my $b_parser= HTML::TokeParser->new(\$body); |
my $b_tok; |
my $b_tok; |
Line 640 sub start_part {
|
Line 629 sub start_part {
|
if ( $target eq "web" ) { |
if ( $target eq "web" ) { |
$result="<br />Part is not open to be viewed. It $accessmsg<br />"; |
$result="<br />Part is not open to be viewed. It $accessmsg<br />"; |
} elsif ( $target eq 'tex' ) { |
} elsif ( $target eq 'tex' ) { |
$result="\\vskip 0 mm Part is not open to be viewed. It $accessmsg \\\\"; |
$result="\\end{minipage}\\vskip 0 mm Part is not open to be viewed. It $accessmsg \\\\\\begin{minipage}{\\textwidth}"; |
} |
} |
} else { |
} else { |
if ($target eq 'tex') { |
if ($target eq 'tex') { |
$result='\vskip 0 mm'; |
$result='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent'; |
} |
} |
} |
} |
} |
} |
Line 661 sub end_part {
|
Line 650 sub end_part {
|
return &Apache::inputtags::grade; |
return &Apache::inputtags::grade; |
} |
} |
if ($target eq 'web' || $target eq 'tex' ) { |
if ($target eq 'web' || $target eq 'tex' ) { |
my $gradestatus=&Apache::inputtags::gradestatus($Apache::inputtags::part); |
my $gradestatus=&Apache::inputtags::gradestatus($Apache::inputtags::part,$target); |
#FIXME this is ugly we should just generate tex in inputtags |
|
if ($target eq 'tex') { $gradestatus=&html_to_tex($gradestatus); } |
|
if ($Apache::lonhomework::type eq 'exam') {$gradestatus='';} |
if ($Apache::lonhomework::type eq 'exam') {$gradestatus='';} |
return $gradestatus; |
return $gradestatus; |
} |
} |