[LON-CAPA-cvs] cvs: loncom(GCI_3) /homework inputtags.pm

raeburn raeburn@source.lon-capa.org
Sun, 06 Dec 2009 21:00:15 -0000


raeburn		Sun Dec  6 21:00:15 2009 EDT

  Modified files:              (Branch: GCI_3)
    /loncom/homework	inputtags.pm 
  Log:
  - Customization for GCI_3.
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.260 loncom/homework/inputtags.pm:1.260.4.1
--- loncom/homework/inputtags.pm:1.260	Fri Jul 17 15:27:17 2009
+++ loncom/homework/inputtags.pm	Sun Dec  6 21:00:15 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.260 2009/07/17 15:27:17 droeschl Exp $
+# $Id: inputtags.pm,v 1.260.4.1 2009/12/06 21:00:15 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -869,7 +869,13 @@
 	$css_class=$possible_class{'charged_try'};
 	$button=1;
     } elsif ($award eq 'SUBMITTED') {
-	$message = &mt("Your submission has been recorded.");
+        if ($env{'request.uri'} eq '/res/gci/gci/internal/submission.problem') {
+            if ($target eq 'web') {
+                $message .= '<br />'.&mt('Thank you for making a submission to the Geosciences Concept Inventory via the GCI Web Center.');
+            }
+        } else {
+	    $message = &mt("Your submission has been recorded.");
+        }
 	$css_class=$possible_class{'no_grade'};
 	$button=1;
     } elsif ($award eq 'DRAFT') {
@@ -922,7 +928,14 @@
     if (&Apache::lonhomework::hide_problem_status()
 	&& $Apache::inputtags::status[-1] ne 'SHOW_ANSWER'
 	&& &hide_award($award)) {
-	$message = &mt("Answer Submitted: Your final submission will be graded after the due date.");
+        if ($env{'request.uri'} eq '/res/gci/gci/internal/submission.problem') {
+            if ($target eq 'web') {
+                $message = &mt("Your submission has been recorded.").'<br />'.
+                           &mt('Thank you for making a submission to the Geosciences Concept Inventory via the GCI Web Center.');
+            }
+        } else {
+	    $message = &mt("Answer Submitted: Your final submission will be graded after the due date.");
+        }
 	$css_class=$possible_class{'no_grade'};
 	$button=1;
     }
@@ -1237,15 +1250,19 @@
 		$trystr = '\vskip 0 mm ';
 	    }
 	} else {
-	    $trystr = '<td><span class="LC_nobreak">'.$tries_text." $tries";
-	    if ($Apache::lonhomework::parsing_a_task) {
-	    } elsif($env{'request.state'} ne 'construct') {
-		$trystr.="/$maxtries";
-	    } else {
-		if (defined($Apache::inputtags::params{'maxtries'})) {
-		    $trystr.="/".$Apache::inputtags::params{'maxtries'};
-		}
-	    }
+            $trystr = '<td><span class="LC_nobreak">';
+            my %parmhash=&Apache::lonnet::coursedescription($env{'request.course.id'});
+            if ($parmhash{'suppress_tries'} ne 'yes') {
+                $trystr .= "$tries_text $tries";
+	        if ($Apache::lonhomework::parsing_a_task) {
+	        } elsif($env{'request.state'} ne 'construct') {
+		    $trystr.="/$maxtries";
+	        } else {
+		    if (defined($Apache::inputtags::params{'maxtries'})) {
+		        $trystr.="/".$Apache::inputtags::params{'maxtries'};
+		    }
+	        }
+            }
 	    $trystr.="</span></td>";
 	}
     }
@@ -1288,10 +1305,14 @@
 	}
 	if ( $showbutton ) { 
 	    if ($target ne 'tex') {
+                my $submit_text = &mt('Submit Answer');
+                if ($env{'request.uri'} eq '/res/gci/gci/internal/submission.problem') {
+                    $submit_text = &mt('Submit Questions');
+                }
 		$button = 
             '<input onmouseup="javascript:setSubmittedPart(\''.$id.'\')"
                     type="submit" name="submit_'.$id.'"
-                    value="'.&mt('Submit Answer').'" />';
+                    value="'.$submit_text.'" />';
 	    }
 	}
 
@@ -1387,8 +1408,12 @@
     $output.='<br /><form action=""><center><input type="button" name="close" value="'.&mt('Close Window').'" onClick="window.close()" /></center></form>';
 
     my $windowopen=&Apache::lonhtmlcommon::javascript_docopen();
+    my $pagetitle = 'Previous Tries';
+    if ($env{'request.uri'} eq '/res/gci/gci/internal/submission.problem') {
+        $pagetitle = 'Submission History';
+    }
     my $start_page =
-	&Apache::loncommon::start_page('Previous Tries', undef,
+	&Apache::loncommon::start_page($pagetitle, undef,
 				       {'only_body'      => 1,
 					'bgcolor'        => '#FFFFFF',
 					'js_ready'       => 1,
@@ -1399,11 +1424,15 @@
     $prefix =~ tr{.}{_};
     my $function_name = "LONCAPA_previous_tries_".$prefix.
 	$Apache::lonxml::curdepth.'_'.$env{'form.counter'};
+    my $triestext = &mt('Previous Tries');
+    if ($env{'request.uri'} eq '/res/gci/gci/internal/submission.problem') {
+        $triestext = &mt('Submission History');
+    }
     my $result ="<script type=\"text/javascript\">
 // <![CDATA[
     function $function_name() {newWindow=open('','new_W','width=500,height=500,scrollbars=1,resizable=yes');newWindow.$windowopen;newWindow.document.writeln('$start_page $output $end_page');newWindow.document.close();newWindow.focus()}
 // ]]>
-</script><a href=\"javascript:$function_name();void(0);\">".&mt("Previous Tries")."</a><br />";
+</script><a href=\"javascript:$function_name();void(0);\">".$triestext."</a><br />";
     #use Data::Dumper;
     #&Apache::lonnet::logthis(&Dumper(\%Apache::inputtags::submission_display));
     return $result;