--- loncom/interface/loncommon.pm 2010/11/28 00:04:05 1.987 +++ loncom/interface/loncommon.pm 2010/12/16 16:01:14 1.988 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.987 2010/11/28 00:04:05 raeburn Exp $ +# $Id: loncommon.pm,v 1.988 2010/12/16 16:01:14 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3551,6 +3551,29 @@ sub format_previous_attempt_value { $value = &Apache::lonlocal::locallocaltime($value); } elsif (ref($value) eq 'ARRAY') { $value = '('.join(', ', @{ $value }).')'; + } elsif ($key =~ /answerstring$/) { + my %answers = &Apache::lonnet::str2hash($value); + my @anskeys = sort(keys(%answers)); + if (@anskeys == 1) { + my $answer = $answers{$anskeys[0]}; + if ($answer =~ m{\Q\0\E}) { + $answer =~ s{\Q\0\E}{, }g; + } + my $tag_internal_answer_name = 'INTERNAL'; + if ($anskeys[0] eq $tag_internal_answer_name) { + $value = $answer; + } else { + $value = $anskeys[0].'='.$answer; + } + } else { + foreach my $ans (@anskeys) { + my $answer = $answers{$ans}; + if ($answer =~ m{\Q\0\E}) { + $answer =~ s{\Q\0\E}{, }g; + } + $value .= $ans.'='.$answer.'
';; + } + } } else { $value = &unescape($value); } @@ -8730,7 +8753,7 @@ sub upload_embedded { if ($context eq 'portfolio') { $output .= '

'.&mt('or').'

'; } elsif ($context eq 'testbank') { - $output .= '

'.&mt('Or [_1]continue[_2] the testbank import without modifying the references(s).','','').'

'; + $output .= '

'.&mt('Or [_1]continue[_2] the testbank import without modifying the reference(s).','','').'

'; $returnflag = 'modify_orightml'; } }