Log Message:
-----------
Previously, the "Unassign selected sets from selected users" button did
not work. Now it works. To help avoid inadvertant unassignments, the button
was moved lower on the page and put in the "danger" background color. I
also made the assign and unassign buttons the same length for better
aesthetics.
Some things still to do in this module:
- maybe move unassign even lower
- maybe have a safety radio button to unassignments like on other
unassign pages
- move the action from body() to pre_header_initialize() so that
addgoodmessage/addbadmessage will work like on other pages
- get return values from the assignment/unassignment commands in
case something goes wrong. Right now, the system can explode and it
will still say "All assignments were made successfully".
- it could also report some information on assignments/unassignments
actually made vs. combinations which were skipped.
Modified Files:
--------------
webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor:
Assigner.pm
Revision Data
-------------
Index: Assigner.pm
===================================================================
RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/Assigner.pm,v
retrieving revision 1.30
retrieving revision 1.31
diff -Llib/WeBWorK/ContentGenerator/Instructor/Assigner.pm -Llib/WeBWorK/ContentGenerator/Instructor/Assigner.pm -u -r1.30 -r1.31
--- lib/WeBWorK/ContentGenerator/Instructor/Assigner.pm
+++ lib/WeBWorK/ContentGenerator/Instructor/Assigner.pm
@@ -94,20 +94,23 @@
my @selected_users = $r->param("selected_users");
my @selected_sets = $r->param("selected_sets");
- if (defined $r->param("assign") || defined $r->param("assign")) {
+ if (defined $r->param("assign") || defined $r->param("unassign")) {
if (@selected_users && @selected_sets) {
- my @results;
+ my @results; # This is not used?
$self->assignSetsToUsers(\@selected_sets, \@selected_users) if defined $r->param("assign");
$self->unassignSetsFromUsers(\@selected_sets, \@selected_users) if defined $r->param("unassign");
- if (@results) {
+ if (@results) { # Can't get here?
print CGI::div({class=>"ResultsWithError"},
CGI::p("The following error(s) occured while assigning:"),
CGI::ul(CGI::li(\@results)),
);
} else {
+ my $happymessage= 'All assignments were made successfully.';
+ $happymessage='All unassignments were made successfully.'
+ if defined $r->param("unassign");
print CGI::div({class=>"ResultsWithoutError"},
- CGI::p("All assignments were made successfully."),
+ CGI::p($happymessage),
);
}
} else {
@@ -155,22 +158,28 @@
CGI::submit(
-name => "assign",
-value => "Assign selected sets to selected users",
+ -style => "width: 45ex",
),
),
),
CGI::Tr(
- CGI::td({colspan=>2, class=>"ButtonRow"},
- CGI::submit(
- -name => "unassign",
- -value => "Unassign selected sets from selected users",
+ CGI::td({colspan=>2},
+ CGI::div({class=>'ResultsWithError', style=>'color:red'},
+ "Do not unassign students unless you know what you are doing.",
+ CGI::br(),
+ "There is NO undo for unassigning students. ",
+ CGI::br(),
+ CGI::submit(
+ -name => "unassign",
+ -value => "Unassign selected sets from selected users",
+ -style => "width: 45ex",
+ ),
),
),
),
);
- print CGI::div({-style=>"color:red"}, "Do not unassign students unless you know what you are doing.", CGI::br(),
- "There is NO undo for unassigning students. ");
print CGI::p("When you unassign a student's name, you destroy all
of the data for that homework set for that student. You will then need to
|