--- loncom/homework/inputtags.pm 2005/06/20 21:31:07 1.169
+++ loncom/homework/inputtags.pm 2005/09/09 18:45:56 1.175
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# input definitons
#
-# $Id: inputtags.pm,v 1.169 2005/06/20 21:31:07 albertel Exp $
+# $Id: inputtags.pm,v 1.175 2005/09/09 18:45:56 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -46,6 +46,10 @@ sub initialize_inputtags {
@Apache::inputtags::response=();
# list of all response ids seen in this problem
@Apache::inputtags::responselist=();
+ # list of all current hint ids
+ @Apache::inputtags::hint=();
+ # list of all hint ids seen in this problem
+ @Apache::inputtags::hintlist=();
# list of whether or not a specific response was previously used
@Apache::inputtags::previous=();
# submission it was used in
@@ -75,6 +79,7 @@ sub check_for_duplicate_ids {
my %check;
foreach my $id (@Apache::inputtags::partlist,
@Apache::inputtags::responselist,
+ @Apache::inputtags::hintlist,
@Apache::inputtags::importlist) {
$check{$id}++;
}
@@ -301,9 +306,10 @@ sub end_hiddenline {
# $which -> 'uploadedonly' -> only newly uploaded files
# 'portfolioonly' -> only allow files from portfolio
# 'both' -> allow files from either location
+# $extratext -> additional text to go between the link and the input box
# returns a table row
sub file_selector {
- my ($part,$id,$uploadedfiletypes,$which)=@_;
+ my ($part,$id,$uploadedfiletypes,$which,$extratext)=@_;
if (!$uploadedfiletypes) { return ''; }
my $jspart=$part;
@@ -338,7 +344,7 @@ sub file_selector {
$result.=' '.''.&mt('OR:').' ';
}
if ($which eq 'portfolioonly' || $which eq 'both') {
- $result.=''.
+ $result.=$extratext.''.
&mt('Select Portfolio Files').' '.
''.
' ';
@@ -418,18 +424,23 @@ sub decideoutput {
if ($solved =~ /^correct/) {
$bgcolor=$possiblecolors{'correct'};
- if ($award eq 'ASSIGNED_SCORE') {
+ $message=&mt('You are correct.');
+ if ($awarded < 1 && $awarded > 0) {
+ $message=&mt('You are partially correct.');
+ $bgcolor=$possiblecolors{'not_charged_try'};
+ } elsif ($awarded < 1) {
+ $message=&mt('Incorrect.');
+ $bgcolor=$possiblecolors{'charged_try'};
+ }
+ if ($env{'request.filename'} =~
+ m|/res/lib/templates/examupload.problem$|) {
$message = &mt("A score has been assigned.");
- if ($awarded < 1 && $awarded > 0) {
- $bgcolor=$possiblecolors{'not_charged_try'};
- } elsif ($awarded < 1) {
- $bgcolor=$possiblecolors{'charged_try'};
- }
+ $added_computer_text=1;
} else {
if ($target eq 'tex') {
- $message = '\textbf{'.&mt('You are correct.').'}';
+ $message = '\textbf{'.$message.'}';
} else {
- $message = "".&mt('You are correct.')."";
+ $message = "".$message."";
$message.=" ".&mt("Computer's answer now shown above.");
}
$added_computer_text=1;