[LON-CAPA-cvs] cvs: loncom /interface lonhelper.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 12 Jul 2005 16:03:17 -0000


albertel		Tue Jul 12 12:03:17 2005 EDT

  Modified files:              
    /loncom/interface	lonhelper.pm 
  Log:
  - checked, asleected updates
  - for and to attributes need to start with a letter not a number
  
  
Index: loncom/interface/lonhelper.pm
diff -u loncom/interface/lonhelper.pm:1.110 loncom/interface/lonhelper.pm:1.111
--- loncom/interface/lonhelper.pm:1.110	Tue Jul 12 02:52:48 2005
+++ loncom/interface/lonhelper.pm	Tue Jul 12 12:03:12 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # .helper XML handler to implement the LON-CAPA helper
 #
-# $Id: lonhelper.pm,v 1.110 2005/07/12 06:52:48 albertel Exp $
+# $Id: lonhelper.pm,v 1.111 2005/07/12 16:03:12 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1265,13 +1265,13 @@
         my $id = &new_id();
         $result .= "<tr>\n<td width='20'>&nbsp;</td>\n";
         $result .= "<td valign='top'><input type='$type' name='$var.forminput'"
-            . "' value='" . 
+            . " value='" . 
             HTML::Entities::encode($choice->[1],"<>&\"'") 
             . "'";
         if ($checkedChoices{$choice->[1]}) {
-            $result .= " checked ";
+            $result .= " checked='checked' ";
         }
-        $result .= qq{id="$id"};
+        $result .= qq{id="id$id"};
         my $choiceLabel = $choice->[0];
         if ($choice->[4]) {  # if we need to evaluate this choice
             $choiceLabel = "sub { my $helper = shift; my $state = shift;" .
@@ -1279,7 +1279,7 @@
             $choiceLabel = eval($choiceLabel);
             $choiceLabel = &$choiceLabel($helper, $self);
         }
-        $result .= "/></td><td> ".qq{<label for="$id">}.
+        $result .= "/></td><td> ".qq{<label for="id$id">}.
             $choiceLabel. "</label></td></tr>\n";
     }
     $result .= "</table>\n\n\n";
@@ -1427,7 +1427,7 @@
             HTML::Entities::encode($choice->[1],"<>&\"'") 
             . "'";
         if ($checkedChoices{$choice->[1]}) {
-            $result .= " selected";
+            $result .= " selected='selected' ";
         }
         my $choiceLabel = $choice->[0];
         if ($choice->[4]) {  # if we need to evaluate this choice
@@ -1566,7 +1566,7 @@
     $result .= "<select name='${var}month'>\n";
     for ($i = 0; $i < 12; $i++) {
         if ($i == $date->mon) {
-            $result .= "<option value='$i' selected>";
+            $result .= "<option value='$i' selected='selected'>";
         } else {
             $result .= "<option value='$i'>";
         }
@@ -1578,7 +1578,7 @@
     $result .= "<select name='${var}day'>\n";
     for ($i = 1; $i < 32; $i++) {
         if ($i == $date->mday) {
-            $result .= '<option selected>';
+            $result .= '<option selected="selected">';
         } else {
             $result .= '<option>';
         }
@@ -1590,7 +1590,7 @@
     $result .= "<select name='${var}year'>\n";
     for ($i = 2000; $i < 2030; $i++) { # update this after 64-bit dates
         if ($date->year + 1900 == $i) {
-            $result .= "<option selected>";
+            $result .= "<option selected='selected'>";
         } else {
             $result .= "<option>";
         }
@@ -1605,21 +1605,21 @@
 	my $pm = &mt('p.m.');
         # Build hour
         $result .= "<select name='${var}hour'>\n";
-        $result .= "<option " . ($date->hour == 0 ? 'selected ':'') .
+        $result .= "<option " . ($date->hour == 0 ? 'selected="selected" ':'') .
             " value='0'>" . &mt('midnight') . "</option>\n";
         for ($i = 1; $i < 12; $i++) {
             if ($date->hour == $i) {
-                $result .= "<option selected value='$i'>$i $am</option>\n";
+                $result .= "<option selected='selected' value='$i'>$i $am</option>\n";
             } else {
                 $result .= "<option value='$i'>$i $am</option>\n";
             }
         }
-        $result .= "<option " . ($date->hour == 12 ? 'selected ':'') .
+        $result .= "<option " . ($date->hour == 12 ? 'selected="selected" ':'') .
             " value='12'>" . &mt('noon') . "</option>\n";
         for ($i = 13; $i < 24; $i++) {
             my $printedHour = $i - 12;
             if ($date->hour == $i) {
-                $result .= "<option selected value='$i'>$printedHour $pm</option>\n";
+                $result .= "<option selected='selected' value='$i'>$printedHour $pm</option>\n";
             } else {
                 $result .= "<option value='$i'>$printedHour $pm</option>\n";
             }
@@ -1634,7 +1634,7 @@
                 $printedMinute = "0" . $printedMinute;
             }
             if ($date->min == $i) {
-                $result .= "<option selected>";
+                $result .= "<option selected='selected'>";
             } else {
                 $result .= "<option>";
             }
@@ -2016,7 +2016,7 @@
 			"\|\|\|";
 		    my $checked ="";
 		    if($var_value =~ /\Q|||$raw_name|||\E/) {
-			$checked = "checked";
+			$checked = "checked='checked'";
 		    }
 		    $col .= 
                         "<td align='center'><input type='checkbox' name ='$option_var".
@@ -2027,11 +2027,11 @@
 
             $col .= "<td align='center'><input type='$inputType' name='${var}.forminput' ";
             if (!$checked && !$multichoice) {
-                $col .= "checked ";
+                $col .= "checked='checked' ";
                 $checked = 1;
             }
 	    if ($multichoice) { # all resources start checked; see bug 1174
-		$col .= "checked ";
+		$col .= "checked='checked' ";
 		$checked = 1;
 	    }
             $col .= "value='" . $resource_name  . "' /></td>";
@@ -2342,7 +2342,7 @@
             $self->{'variable'} . '.forminput' . "'";
             
         if (!$self->{'multichoice'} && !$checked) {
-            $result .= " checked ";
+            $result .= " checked='checked' ";
             $checked = 1;
         }
         $result .=
@@ -2670,7 +2670,7 @@
             . ".forminput' ".qq{id="$id"}." value='" . HTML::Entities::encode($fileName,"<>&\"'").
                 "'";
             if (!$self->{'multichoice'} && $choices == 0) {
-                $result .= ' checked';
+                $result .= ' checked="checked"';
             }
             $result .= "/></td><td bgcolor='$color'>".
                 qq{<label for="$id">}. $file . "</label></td>" .