';
}
@@ -163,6 +175,12 @@ sub problem_web_to_edit_header {
if (defined($ENV{'form.showallfoils'})) { $result.='checked="on"'; }
$result.= ' /> Show All Foils
';
+ my $numtoanalyze=$ENV{'form.numtoanalyze'};
+ if (!$numtoanalyze) { $numtoanalyze=100; }
+ $result.= '
+ ';
+ return $result;
}
sub initialize_storage {
@@ -265,6 +283,7 @@ sub start_problem {
&page_start($target,$token,$tagstack,$parstack,$parser,$safeeval);
if ($target eq 'tex' and $ENV{'request.symb'} =~ m/\.page_/) { $result = '';}
+ if ($target eq 'analyze') { my $rndseed=&setup_rndseed($safeeval); }
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex') {
#handle exam checkout
if ($Apache::lonhomework::type eq 'exam') {
@@ -283,10 +302,11 @@ sub start_problem {
my $expression='$external::datestatus="'.$status.'";';
$expression.='$external::gradestatus="'.$Apache::lonhomework::history{"resource.0.solved"}.'";';
&Apache::run::run($expression,$safeeval);
+ &Apache::lonxml::debug("Got $status");
if (( $status eq 'CLOSED' ) ||
( $status eq 'UNCHECKEDOUT') ||
( $status eq 'BANNED')) {
- my $bodytext=&Apache::lonxml::get_all_text("/problem",$$parser[$#$parser]);
+ my $bodytext=&Apache::lonxml::get_all_text("/problem",$parser);
if ( $target eq "web" ) {
$result.= $head_tag_start.'';
my $msg=$body_tag_start.
@@ -389,9 +409,7 @@ sub end_problem {
$status ne 'UNCHECKEDOUT') {
# if part is zero, no s existed, so we need show the current
# grading status
- my $gradestatus = &Apache::inputtags::gradestatus($Apache::inputtags::part);
- #FIXME this is ugly we should just generate tex in inputtags
- if ($target eq 'tex') { $gradestatus=&html_to_tex($gradestatus); }
+ my $gradestatus = &Apache::inputtags::gradestatus($Apache::inputtags::part,$target);
if ($Apache::lonhomework::type ne 'exam') {$result.= $gradestatus;}
}
if (
@@ -408,15 +426,15 @@ sub end_problem {
$result.="