[LON-CAPA-cvs] cvs: modules /gerd/ie ietrans.pl

www lon-capa-cvs@mail.lon-capa.org
Wed, 06 Apr 2005 19:19:19 -0000


www		Wed Apr  6 15:19:19 2005 EDT

  Modified files:              
    /modules/gerd/ie	ietrans.pl 
  Log:
  Root question can have help link
  Follow-up questions have no weight
  
  
Index: modules/gerd/ie/ietrans.pl
diff -u modules/gerd/ie/ietrans.pl:1.2 modules/gerd/ie/ietrans.pl:1.3
--- modules/gerd/ie/ietrans.pl:1.2	Sat Apr  2 12:38:34 2005
+++ modules/gerd/ie/ietrans.pl	Wed Apr  6 15:19:19 2005
@@ -1,5 +1,5 @@
 # Translation program for IEs.
-# $Id: ietrans.pl,v 1.2 2005/04/02 17:38:34 www Exp $
+# $Id: ietrans.pl,v 1.3 2005/04/06 19:19:19 www Exp $
 #
 # Usage: perl ietrans.pl filename
 #
@@ -173,7 +173,24 @@
 #
 sub endquestion {
     if ($insideaquestion) {
-	print "\n</part>\n";
+	unless ($rootproblemasked) {
+#
+# Is there a help path?
+#
+	    my $helppath=$filename;
+	    $helppath=~s/\/[^\/]+$/\/Help/;
+	    if (-e $helppath) {
+# yes, there is help - provide a link to it
+		print <<ENDHELPLINK;
+<notsolved>
+<startouttext />
+<a href="Help/ie.problem">Help</a><br />
+<endouttext />
+</notsolved>
+ENDHELPLINK
+             }
+	}
+        print "\n</part>\n";
 	if ($rootproblemasked) {
 	    print "\n</block>";
         } else {
@@ -193,6 +210,9 @@
     }
     $partid++;
     print "\n<part id='$partid'>";
+    if ($rootproblemasked) {
+	print "\n<parameter name='weight' default='0' type='float_pos' description='Weight' />\n";
+    }    
     print "\n<startouttext />\n".&get_all_string(shift)."\n<endouttext />\n";
 }
 #