--- loncom/homework/inputtags.pm 2011/05/16 01:02:57 1.271.2.7
+++ loncom/homework/inputtags.pm 2010/12/31 00:58:10 1.276
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# input definitons
#
-# $Id: inputtags.pm,v 1.271.2.7 2011/05/16 01:02:57 raeburn Exp $
+# $Id: inputtags.pm,v 1.276 2010/12/31 00:58:10 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -60,7 +60,7 @@ use LONCAPA;
BEGIN {
- &Apache::lonxml::register('Apache::inputtags',('hiddensubmission','hiddenline','textfield','textline'));
+ &Apache::lonxml::register('Apache::inputtags',('hiddenline','textfield','textline'));
}
=pod
@@ -354,7 +354,6 @@ sub start_textline {
unless ($newvariation) {
$oldresponse = $Apache::lonhomework::history{"resource.$partid.$id.submission"};
&Apache::lonxml::debug("oldresponse $oldresponse is ".ref($oldresponse));
-
if (ref($oldresponse) eq 'ARRAY') {
$oldresponse = $oldresponse->[$#Apache::inputtags::inputlist];
}
@@ -479,48 +478,6 @@ sub end_hiddenline {
return "";
}
-sub start_hiddensubmission {
- my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
- my $result = "";
- my $input_id = &start_input($parstack,$safeeval);
- if ($target eq 'web') {
- $Apache::lonxml::evaluate--;
- if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
- my $partid=$Apache::inputtags::part;
- my $id=$Apache::inputtags::response[-1];
- if ($Apache::lonhomework::type ne 'exam') {
- my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval);
- $value = &HTML::Entities::encode($value,'<>&"');
- $result= '';
- }
- }
- } elsif ($target eq 'edit') {
- $result=&Apache::edit::tag_start($target,$token);
- $result.=&Apache::edit::text_arg('Value:','value',$token,'15');
- $result.=&Apache::edit::end_row();
- $result.=&Apache::edit::end_table();
- } elsif ($target eq 'modified') {
- my $constructtag=&Apache::edit::get_new_args($token,$parstack,
- $safeeval,'value');
- if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
- }
-
- if ( ($target eq 'web' || $target eq 'tex')
- && $Apache::lonhomework::type eq 'exam'
- && &needs_exam_box($tagstack)) {
- $result.=&exam_box($target);
- }
- return $result;
-}
-
-sub end_hiddensubmission {
- my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
- if ($target eq 'web') { $Apache::lonxml::evaluate++; }
- elsif ($target eq 'edit') { return ('','no'); }
- &end_input();
- return "";
-}
-
=pod
=item file_selector()
@@ -666,7 +623,7 @@ sub current_file_submissions {
}
$result .=
'
'.$showname.' | '."\n".
+ '" border="0" />'.$showname.''."\n".
''.$rows{$url}{size}.' | '."\n".
''.$rows{$url}{lastmodified}.' | '."\n".
&Apache::loncommon::end_data_table_row();
@@ -728,7 +685,7 @@ sub valid_award {
'UNIT_FAIL', 'NO_UNIT',
'UNIT_NOTNEEDED', 'WANTED_NUMERIC',
'BAD_FORMULA', 'NOT_FUNCTION', 'WRONG_FORMAT',
- 'INTERNAL_ERROR', 'SIG_FAIL', 'INCORRECT',
+ 'INTERNAL_ERROR', 'SIG_FAIL', 'INCORRECT',
'MISORDERED_RANK', 'INVALID_FILETYPE',
'EXCESS_FILESIZE', 'FILENAME_INUSE',
'DRAFT', 'SUBMITTED', 'SUBMITTED_CREDIT',
@@ -746,7 +703,7 @@ sub valid_award {
'UNIT_INVALID_INSTRUCTOR', 'UNIT_INVALID_STUDENT',
'UNIT_IRRECONCIBLE', 'UNIT_FAIL', 'NO_UNIT',
'UNIT_NOTNEEDED', 'WANTED_NUMERIC', 'BAD_FORMULA', 'NOT_FUNCTION',
- 'WRONG_FORMAT', 'INTERNAL_ERROR',
+ 'WRONG_FORMAT', 'INTERNAL_ERROR',
'COMMA_FAIL', 'SIG_FAIL', 'INCORRECT', 'MISORDERED_RANK',
'INVALID_FILETYPE', 'EXCESS_FILESIZE', 'FILENAME_INUSE',
'DRAFT', 'SUBMITTED',
@@ -1041,7 +998,7 @@ sub decideoutput {
$message = &mt("Wrong format").'.';
$css_class=$possible_class{'not_charged_try'};
$button=1;
- } elsif ($award eq 'INTERNAL_ERROR') {
+ } elsif ($award eq 'INTERNAL_ERROR') {
$message = &mt("An internal error occurred while processing your answer. Please try again later.");
$css_class=$possible_class{'not_charged_try'};
$button=1;
@@ -1318,7 +1275,7 @@ sub setgradedata {
&Apache::response::add_to_gradingqueue();
}
if (($Apache::lonhomework::type eq 'anonsurvey') ||
- ($Apache::lonhomework::type eq 'anonsurveycred') ||
+ ($Apache::lonhomework::type eq 'anonsurveycred') ||
($Apache::lonhomework::type eq 'randomizetry')) {
$Apache::lonhomework::results{"resource.$id.type"} = $Apache::lonhomework::type;
}
@@ -1548,7 +1505,6 @@ sub previous_tries {
$count++;
$count_lookup{$i} = $count;
my $curr_rndseed = $Apache::lonhomework::history{"$prefix.rndseed"};
-
my ($previousmsg,$latemessage,$message,$trystr);
($previousmsg,$latemessage,$message,$trystr) =
@@ -1566,16 +1522,6 @@ sub previous_tries {
) {
my $txt_correct = &mt('Correct');
- my $awarded = $Apache::lonhomework::history{"$prefix.awarded"};
- if ($awarded < 1 && $awarded > 0) {
- $txt_correct=&mt('Partially Correct');
- } elsif ($awarded < 1) {
- if ($awarded eq '') {
- $txt_correct='';
- } else {
- $txt_correct=&mt('Incorrect');
- }
- }
$message =~ s{()(.*?)()}
{$1 $txt_correct. $3}s;
}
@@ -1584,7 +1530,7 @@ sub previous_tries {
if ($curr_rndseed ne $lastrndseed) {
$trystr .= '
'.&mt('New problem variation this try.').'';
}
- }
+ }
$message =~ s{()}{ $trystr $1};
}
my ($class) = ($message =~ m{