--- loncom/homework/inputtags.pm 2002/09/23 07:08:40 1.61 +++ loncom/homework/inputtags.pm 2002/10/01 21:05:45 1.63 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.61 2002/09/23 07:08:40 albertel Exp $ +# $Id: inputtags.pm,v 1.63 2002/10/01 21:05:45 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -110,7 +110,7 @@ sub start_textfield { $result.=&Apache::edit::text_arg('Rows:','rows',$token,4); $result.=&Apache::edit::text_arg('Columns:','cols',$token,4); my $bodytext=&Apache::lonxml::get_all_text("/textfield",$$parser[-1]); - $result.=&Apache::edit::editfield($token->[1],$bodytext,'Text you want to appear by default:',50,2); + $result.=&Apache::edit::editfield($token->[1],$bodytext,'Text you want to appear by default:',80,2); } elsif ($target eq 'modified') { my $constructtag=&Apache::edit::get_new_args($token,$parstack, $safeeval,'rows','cols'); @@ -382,7 +382,7 @@ sub setgradedata { foreach my $key (keys(%Apache::lonhomework::results)) { if (($key =~ /^resource\.$id\./) && ($key !~ /\.collaborators$/)) { &Apache::lonxml::debug("Removing $key"); - delete($Apache::lonhomework::results{$key}); + delete($Apache::lonhomework::results{$key}); } } #and since they didn't do anything we were never here @@ -424,7 +424,7 @@ sub grade { } sub gradestatus { - my ($id) = @_; + my ($id,$target) = @_; my $showbutton = 1; my $message = ''; my $latemessage = ''; @@ -443,9 +443,13 @@ sub gradestatus { &Apache::lonxml::debug('Getting message'); ($showbutton,$message,$previousmsg) = &decideoutput($award,$solved,$previous); - $message="$message"; - if ($previousmsg) { - $previousmsg="$previousmsg"; + if ($target eq 'tex') { + $message=' '.$message.' '; + } else { + $message="$message"; + if ($previousmsg) { + $previousmsg="$previousmsg"; + } } } my $tries = $Apache::lonhomework::history{"resource.$id.tries"}; @@ -455,22 +459,36 @@ sub gradestatus { if ( $maxtries eq '' ) { $maxtries = '2'; } if ( $maxtries eq 'con_lost' ) { $maxtries = '0'; } if ( $showbutton ) { - $trystr = "Tries $tries/$maxtries"; + if ($target eq 'tex') { + $trystr = ' '.$tries.'/'.$maxtries.' '; + } else { + $trystr = "Tries $tries/$maxtries"; + } } if ( $status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER') {$showbutton = 0;} if ( $showbutton ) { - $button = '
'; + if ($target ne 'tex') { + $button = '
'; + } } if ($Apache::lonhomework::history{"resource.$id.afterduedate"}) { #last submissions was after due date - $latemessage="The last submission was after the Due Date"; + if ($target eq 'tex') { + $latemessage=' The last submission was after the Due Date '; + } else { + $latemessage="The last submission was after the Due Date"; + } } } my $output= $previousmsg.$latemessage.$message.$trystr; if ($output =~ /^\s*$/) { return $button; } else { - return $button.''.$output.'
'; + if ($target eq 'tex') { + return $button.' \vskip 0 mm '.$output.' '; + } else { + return $button.''.$output.'
'; + } } } 1;