Skip to content

Commit

Permalink
Merge pull request openwebwork#9 from mgage/master
Browse files Browse the repository at this point in the history
fix bug in hidden_fields in ContentGenerator
  • Loading branch information
mgage committed Jun 12, 2012
2 parents a3e1f2a + 89cafae commit acbf2b1
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions lib/WeBWorK/ContentGenerator.pm
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,12 @@ sub links {


print CGI::start_li(); # Homework Set Editor
print &$makelink("${pfx}ProblemSetList", urlpath_args=>{%args}, systemlink_args=>\%systemlink_args);
print &$makelink("${pfx}ProblemSetList", urlpath_args=>{%args}, systemlink_args=>\%systemlink_args)
if $ce->{showeditors}->{homeworkseteditor1};
print "<br/>";
print &$makelink("${pfx}ProblemSetList2", urlpath_args=>{%args}, systemlink_args=>\%systemlink_args)
if $ce->{showeditors}->{homeworkseteditor2};;

## only show editor link for non-versioned sets
if (defined $setID && $setID !~ /,v\d+$/ ) {
print CGI::start_ul();
Expand All @@ -732,7 +737,14 @@ sub links {

if (defined $problemID) {
print CGI::start_ul();
print CGI::li(&$makelink("${pfx}PGProblemEditor", text=>"$problemID", urlpath_args=>{%args,setID=>$setID,problemID=>$problemID}, systemlink_args=>\%systemlink_args, target=>"WW_Editor"));
print CGI::li(&$makelink("${pfx}PGProblemEditor", text=>"$problemID", urlpath_args=>{%args,setID=>$setID,problemID=>$problemID}, systemlink_args=>\%systemlink_args, target=>"WW_Editor"))
if $ce->{showeditors}->{pgproblemeditor1};
print CGI::end_ul();
}
if (defined $problemID) {
print CGI::start_ul();
print CGI::li(&$makelink("${pfx}PGProblemEditor2", text=>"--$problemID", urlpath_args=>{%args,setID=>$setID,problemID=>$problemID}, systemlink_args=>\%systemlink_args, target=>"WW_Editor2"))
if $ce->{showeditors}->{pgproblemeditor2};;
print CGI::end_ul();
}

Expand All @@ -741,8 +753,12 @@ sub links {
}
print CGI::end_li(); # end Homework Set Editor

print CGI::li(&$makelink("${pfx}SetMaker", text=>$r->maketext("Library Browser"), urlpath_args=>{%args}, systemlink_args=>\%systemlink_args));
print CGI::li(&$makelink("${pfx}SetMaker2", text=>$r->maketext("Library Browser 2"), urlpath_args=>{%args}, systemlink_args=>\%systemlink_args));
print CGI::li(&$makelink("${pfx}SetMaker", text=>$r->maketext("Library Browser"), urlpath_args=>{%args}, systemlink_args=>\%systemlink_args))
if $ce->{showeditors}->{librarybrowser1};
print CGI::li(&$makelink("${pfx}SetMaker2", text=>$r->maketext("Library Browser 2"), urlpath_args=>{%args}, systemlink_args=>\%systemlink_args))
if $ce->{showeditors}->{librarybrowser2};
print CGI::li(&$makelink("${pfx}SetMaker3", text=>$r->maketext("Library Browser 3"), urlpath_args=>{%args}, systemlink_args=>\%systemlink_args))
if $ce->{showeditors}->{librarybrowser3};
print CGI::start_li(); # Stats
print &$makelink("${pfx}Stats", urlpath_args=>{%args}, systemlink_args=>\%systemlink_args);
if ($userID ne $eUserID or defined $setID) {
Expand Down Expand Up @@ -1251,8 +1267,10 @@ handled.
sub if_warnings {
my ($self, $arg) = @_;
my $r = $self->r;

if (MP2 ? $r->notes->get("warnings") : $r->notes("warnings")) {

if ( (MP2 ? $r->notes->get("warnings") : $r->notes("warnings"))
or ($self->{pgerrors}) )
{
return $arg;
} else {
!$arg;
Expand Down Expand Up @@ -1638,7 +1656,9 @@ sub hidden_fields {
# $html .= CGI::hidden($param, @values); #MEG
# warn "$param ", join(" ", @values) if @values >1; #this should never happen!!!
my $value = $r->param($param);
$html .= CGI::hidden($param, $value); # (can't name these items when using real CGI)
# $html .= CGI::hidden($param, $value); # (can't name these items when using real CGI)
$html .= CGI::hidden(-name=>$param, -default=>$value, -id=>"hidden_".$param); # (can't name these items when using real CGI)

}
return $html;
}
Expand Down Expand Up @@ -1959,7 +1979,6 @@ problem rendering.
sub errorOutput($$$) {
my ($self, $error, $details) = @_;
my $r = $self->{r};

print "Entering ContentGenerator::errorOutput subroutine</br>" if $TRACE_WARNINGS;
my $time = time2str("%a %b %d %H:%M:%S %Y", time);
my $method = $r->method;
Expand Down

0 comments on commit acbf2b1

Please sign in to comment.