[system] / trunk / webwork2 / lib / WeBWorK / ContentGenerator / Instructor.pm Repository:
ViewVC logotype

Diff of /trunk/webwork2/lib/WeBWorK/ContentGenerator/Instructor.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1105 Revision 1106
76 76
77# When a new problem is added to a set, all students to whom the set 77# When a new problem is added to a set, all students to whom the set
78# it belongs to is assigned should have it assigned to them. 78# it belongs to is assigned should have it assigned to them.
79# Note that this does NOT assign to all users of a course, just all users 79# Note that this does NOT assign to all users of a course, just all users
80# of a set. 80# of a set.
81sub assignProblemToAllUsers { 81sub assignProblemToAllSetUsers {
82 my ($self, $globalProblem) = @_; 82 my ($self, $globalProblem) = @_;
83 my $db = $self->{db}; 83 my $db = $self->{db};
84 my $setID = $globalProblem->set_id; 84 my $setID = $globalProblem->set_id;
85 my @users = $db->listSetUsers($setID); 85 my @users = $db->listSetUsers($setID);
86 86
95# This function caches database data as a speed optimization. 95# This function caches database data as a speed optimization.
96sub assignSetToAllUsers { 96sub assignSetToAllUsers {
97 my ($self, $setID) = @_; 97 my ($self, $setID) = @_;
98 my $db = $self->{db}; 98 my $db = $self->{db};
99 my @problems = (); 99 my @problems = ();
100 my @users = $db->listUsers($setID); 100 my @users = $db->listUsers;
101 my @problemRecords = map {$db->getGlobalProblem($setID, $_)} $db->listGlobalProblems($setID); 101 my @problemRecords = map {$db->getGlobalProblem($setID, $_)} $db->listGlobalProblems($setID);
102 102
103 foreach my $user (@users) { 103 foreach my $user (@users) {
104 # FIXME: Create a UserSet record for the user!!!! 104 # FIXME: Create a UserSet record for the user!!!!
105 my $userSet = $db->{set_user}->{record}->new; 105 my $userSet = $db->{set_user}->{record}->new;

Legend:
Removed from v.1105  
changed lines
  Added in v.1106

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9