| 1 | #!/usr/bin/perl |
1 | #!/usr/local/bin/perl |
| 2 | |
2 | |
| 3 | ## $Id$ |
3 | ## $Id$ |
| 4 | |
4 | |
| 5 | |
5 | |
| 6 | #################################################################### |
6 | #################################################################### |
| … | |
… | |
| 145 | |
145 | |
| 146 | |
146 | |
| 147 | ## get a hash of all loginID's for set if set is already defined |
147 | ## get a hash of all loginID's for set if set is already defined |
| 148 | |
148 | |
| 149 | my %loginHashForSet =(); |
149 | my %loginHashForSet =(); |
| 150 | if (&probSetExists($setNumber)) {%loginHashForSet = &getLoginHashForSet($setNumber);} |
150 | if (&probSetExists($setNumber)) {%loginHashForSet = %{getLoginHashForSet($setNumber)};} |
| 151 | my $new_student_count = 0; |
151 | my $new_student_count = 0; |
| 152 | my $existing_student_count = 0; |
152 | my $existing_student_count = 0; |
| 153 | |
153 | |
| 154 | my $login_name; |
154 | my $login_name; |
| 155 | |
155 | |
| … | |
… | |
| 189 | $message .= " Problems for $firstName $lastName (login $login_name) not added.\n"; |
189 | $message .= " Problems for $firstName $lastName (login $login_name) not added.\n"; |
| 190 | } |
190 | } |
| 191 | elsif (($method eq 'readFromLogFile') and (&attachProbSetRecord($psvnsHash{$login_name}) )) |
191 | elsif (($method eq 'readFromLogFile') and (&attachProbSetRecord($psvnsHash{$login_name}) )) |
| 192 | { |
192 | { |
| 193 | $PIN = $psvnsHash{$login_name}; |
193 | $PIN = $psvnsHash{$login_name}; |
| 194 | my $oldFN = &getStudentFirstName($PIN); |
|
|
| 195 | my $oldLN = &getStudentLastName($PIN); |
|
|
| 196 | my $oldLogin = &getStudentLogin($PIN); |
194 | my $oldLogin = &getStudentLogin($PIN); |
|
|
195 | attachCLRecord($oldLogin); |
|
|
196 | |
|
|
197 | my $oldFN = &CL_getStudentFirstName($oldLogin); |
|
|
198 | my $oldLN = &CL_getStudentLastName($oldLogin); |
|
|
199 | |
| 197 | # print "ERROR, ERROR, ERROR\n"; |
200 | # print "ERROR, ERROR, ERROR\n"; |
| 198 | # print " The psvn $PIN already exists. It is assigned to $oldFN $oldLN ($oldLogin).\n"; |
201 | # print " The psvn $PIN already exists. It is assigned to $oldFN $oldLN ($oldLogin).\n"; |
| 199 | # print " A new problem set must have been created after the psvn $PIN for \n"; |
202 | # print " A new problem set must have been created after the psvn $PIN for \n"; |
| 200 | # print " $firstName $lastName (login $login_name) was deleted.\n"; |
203 | # print " $firstName $lastName (login $login_name) was deleted.\n"; |
| 201 | # print " Problems for $firstName $lastName (login $login_name) have not been added.\n"; |
204 | # print " Problems for $firstName $lastName (login $login_name) have not been added.\n"; |
| … | |
… | |
| 250 | # $securityNumber=int rand(99999); |
253 | # $securityNumber=int rand(99999); |
| 251 | # print "security number is $securityNumber\n"; |
254 | # print "security number is $securityNumber\n"; |
| 252 | |
255 | |
| 253 | # Install the necessary variables into pinRecord |
256 | # Install the necessary variables into pinRecord |
| 254 | |
257 | |
| 255 | &putStudentLastName ($lastName, $PIN); |
258 | # &putStudentLastName ($lastName, $PIN); |
| 256 | &putStudentFirstName ($firstName, $PIN); |
259 | # &putStudentFirstName ($firstName, $PIN); |
| 257 | &putStudentID ($studentID, $PIN); |
260 | # &putStudentID ($studentID, $PIN); |
| 258 | &putStudentLogin ($login_name,$PIN); |
261 | &putStudentLogin ($login_name,$PIN); |
| 259 | &putStudentStatus ($status,$PIN); |
262 | # &putStudentStatus ($status,$PIN); |
| 260 | &putClassSection ($section,$PIN); |
263 | # &putClassSection ($section,$PIN); |
| 261 | &putClassRecitation ($recitation,$PIN); |
264 | # &putClassRecitation ($recitation,$PIN); |
| 262 | &putSetNumber ($setNumber, $PIN); |
265 | &putSetNumber ($setNumber, $PIN); |
| 263 | &putSetHeaderFileName ($setHeaderFileName, $PIN); |
266 | &putSetHeaderFileName ($setHeaderFileName, $PIN); |
| 264 | &putProbHeaderFileName ($probHeaderFileName, $PIN); |
267 | &putProbHeaderFileName ($probHeaderFileName, $PIN); |
| 265 | &putDueDate ($dueDate, $PIN); |
268 | &putDueDate ($dueDate, $PIN); |
| 266 | &putOpenDate ($openDate, $PIN); |
269 | &putOpenDate ($openDate, $PIN); |
| 267 | &putAnswerDate ($answerDate, $PIN); |
270 | &putAnswerDate ($answerDate, $PIN); |
| 268 | &putStudentEmailAddress ($email_address, $PIN); |
271 | # &putStudentEmailAddress ($email_address, $PIN); |
| 269 | |
272 | |
| 270 | my @seedList =(); |
273 | my @seedList =(); |
| 271 | my ($probNumber,$probSeed); |
274 | my ($probNumber,$probSeed); |
| 272 | # Generate the problems |
275 | # Generate the problems |
| 273 | if ($method eq 'readFromLogFile') {@seedsArrayFromLogFile = split /:/,$seedsHash{$login_name};} |
276 | if ($method eq 'readFromLogFile') {@seedsArrayFromLogFile = split /:/,$seedsHash{$login_name};} |