Skip to content

Commit

Permalink
Backported fix for Visible/Reduced Credit Enabled checkboxes always b…
Browse files Browse the repository at this point in the history
…eing marked.
  • Loading branch information
goehle committed Aug 30, 2013
1 parent 1bff1b3 commit 1604417
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2245,25 +2245,28 @@ sub fieldEditHTML {
}

if ($type eq "checked") {

# FIXME: kludge (R)
# if the checkbox is checked it returns a 1, if it is unchecked it returns nothing
# in which case the hidden field overrides the parameter with a 0
# kludge 2 -- get visible and reduced scoring to have no names (might reduce accessibility)
# my $label_text = $properties->{label_text} || "NoLabel";
return WeBWorK::CGI_labeled_input(
-type=>"checkbox",
-id=>$fieldName."_id",
-label_text=>"", #$label_text,
-input_attr=>{
-name => $fieldName,
-checked => $value,
-label => "",
-value => 1
}
my %attr = ( name => $fieldName,
label => "",
value => 1
);

$attr{'checked'} = 1 if ($value);


return WeBWorK::CGI_labeled_input(
-type=>"checkbox",
-id=>$fieldName."_id",
# The labeled checkboxes are making the table very wide.
-label_text=>"",
# -label_text=>ucfirst($fieldName),
-input_attr=>\%attr
) . CGI::hidden(
-name => $fieldName,
-value => 0
-name => $fieldName,
-value => 0
);
}
}
Expand Down

0 comments on commit 1604417

Please sign in to comment.