From: Mike G. v. a. <we...@ma...> - 2005-09-29 01:25:34
|
Log Message: ----------- Simplified the interface for users (who can only download one set at a time and can only download one user). It could be made slightly more general -- it currently implicitly assumes that either one can edit both multiple sets and multiple users or one can edit only a single user and a single set. Removed an error in the [edit] link when there is an error. The anchor HTML tags were wrapped two layers deep around the reference. Can probably still use some more tweaks in the interface. -- Mike Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator: Hardcopy.pm Revision Data ------------- Index: Hardcopy.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Hardcopy.pm,v retrieving revision 1.64 retrieving revision 1.65 diff -Llib/WeBWorK/ContentGenerator/Hardcopy.pm -Llib/WeBWorK/ContentGenerator/Hardcopy.pm -u -r1.64 -r1.65 --- lib/WeBWorK/ContentGenerator/Hardcopy.pm +++ lib/WeBWorK/ContentGenerator/Hardcopy.pm @@ -105,7 +105,7 @@ $self->{send_hardcopy} = 1; return; } - + # this should never happen, but apparently it did once (see bug #714), so we check for it die "Parameter 'user' not defined -- this should never happen" unless defined $userID; @@ -309,27 +309,44 @@ my $aa = $perm_multiuser ? " " : " a "; my $phrase_for_privileged_users = $perm_multiuser ? "to privileged users or" : ""; - print CGI::start_p(); - print "Select the homework set$ss for which to generate${aa}hardcopy version$ss."; - if ($authz->hasPermissions($userID, "download_hardcopy_multiuser")) { - print "You may also select multiple users from the users list. You will receive hardcopy for each (set, user) pair."; - } - print CGI::end_p(); +# print CGI::start_p(); +# print "Select the homework set$ss for which to generate${aa}hardcopy version$ss."; +# if ($authz->hasPermissions($userID, "download_hardcopy_multiuser")) { +# print "You may also select multiple users from the users list. You will receive hardcopy for each (set, user) pair."; +# } +# print CGI::end_p(); print CGI::start_form(-method=>"POST", -action=>$r->uri); print $self->hidden_authen_fields(); print CGI::hidden("in_hc_form", 1); + if ($perm_multiuser and $perm_multiset) { + print CGI::p("Select the homework sets for which to generate hardcopy versions. You may" + ." also select multiple users from the users list. You will receive hardcopy" + ." for each (set, user) pair."); + + print CGI::table({class=>"FormLayout"}, + CGI::Tr( + CGI::th("Users"), + CGI::th("Sets"), + ), + CGI::Tr( + CGI::td($scrolling_user_list), + CGI::td($scrolling_set_list), + ), + ); + } else { # single user mode + #FIXME -- do a better job of getting the set and the user when in the single set mode + my $selected_set_id = $r->param("selected_sets"); + my $selected_user_id = $Users[0]->user_id; + print CGI::hidden("selected_sets", $selected_set_id ), + CGI::hidden( "selected_users", $selected_user_id); + + print CGI::p("Download hardcopy of set ", $selected_set_id, " for ", $Users[0]->first_name, " ",$Users[0]->last_name,"?"); + + } print CGI::table({class=>"FormLayout"}, CGI::Tr( - CGI::th("Users"), - CGI::th("Sets"), - ), - CGI::Tr( - CGI::td($scrolling_user_list), - CGI::td($scrolling_set_list), - ), - CGI::Tr( CGI::td({colspan=>2, class=>"ButtonRow"}, CGI::small("You may choose to show any of the following data. Correct answers and solutions are only available $phrase_for_privileged_users after the answer date of the homework set."), CGI::br(), @@ -755,7 +772,7 @@ ); } else { # link for a real problem - $edit_url = CGI::a({href=>$self->systemLink($edit_urlpath)}, "Edit it"); + $edit_url = $self->systemLink($edit_urlpath); } if ($MergedProblem->problem_id == 0) { |