[system] / branches / rel-2-4-patches / webwork-modperl / lib / WebworkSOAP.pm Repository:
ViewVC logotype

Diff of /branches/rel-2-4-patches/webwork-modperl/lib/WebworkSOAP.pm

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

Revision 6062 Revision 6063
55 $self->{ce} = $ce; 55 $self->{ce} = $ce;
56 bless $self; 56 bless $self;
57 return $self; 57 return $self;
58} 58}
59 59
60sub array_to_soap_string {
61 my @array = @_;
62 @array = map { SOAP::Data->type( 'string', $_ ) } @array;
63 return \@array;
64}
65
60sub soap_fault_authen { 66sub soap_fault_authen {
61 die SOAP::Fault->faultcode(SOAPERROR_AUTHEN_FAILED) 67 die SOAP::Fault->faultcode(SOAPERROR_AUTHEN_FAILED)
62 ->faultstring("SOAP Webservice Authentication Failed!"); 68 ->faultstring("SOAP Webservice Authentication Failed!");
63} 69}
64 70
101 if($authenKey != $WebworkSOAP::SeedCE{soap_authen_key}) { 107 if($authenKey != $WebworkSOAP::SeedCE{soap_authen_key}) {
102 soap_fault_authen; 108 soap_fault_authen;
103 } 109 }
104 $@ and soap_fault_major("Course Environment cannot be constructed."); 110 $@ and soap_fault_major("Course Environment cannot be constructed.");
105 my @test = listCourses($ce); 111 my @test = listCourses($ce);
106 return \@test; 112 return array_to_soap_string( @test );
107} 113}
108 114
109=pod 115=pod
110=begin WSDL 116=begin WSDL
111_IN authenKey $string 117_IN authenKey $string
125 $newKey = join ("", @chars[map rand(@chars), 1 .. $length]); 131 $newKey = join ("", @chars[map rand(@chars), 1 .. $length]);
126 my $Key = $soapEnv->{db}->newKey(user_id=>$userID, key=>$newKey, timestamp=>$timestamp); 132 my $Key = $soapEnv->{db}->newKey(user_id=>$userID, key=>$newKey, timestamp=>$timestamp);
127 eval { $soapEnv->{db}->deleteKey($userID) }; 133 eval { $soapEnv->{db}->deleteKey($userID) };
128 eval { $soapEnv->{db}->addKey($Key) }; 134 eval { $soapEnv->{db}->addKey($Key) };
129 $@ and soap_fault(SOAPERROR_USER_NOT_FOUND,"User not found."); 135 $@ and soap_fault(SOAPERROR_USER_NOT_FOUND,"User not found.");
130 return $newKey; 136 return SOAP::Data->type( 'string', $newKey );
131} 137}
132 138
133=pod 139=pod
134=begin WSDL 140=begin WSDL
135_IN authenKey $string 141_IN authenKey $string
169 $UserProblem->set_id($GlobalProblem->set_id); 175 $UserProblem->set_id($GlobalProblem->set_id);
170 $UserProblem->problem_id($GlobalProblem->problem_id); 176 $UserProblem->problem_id($GlobalProblem->problem_id);
171 initializeUserProblem($UserProblem, $seed); 177 initializeUserProblem($UserProblem, $seed);
172 eval { $db->addUserProblem($UserProblem) }; 178 eval { $db->addUserProblem($UserProblem) };
173 } 179 }
174 return @results; 180 return array_to_soap_string( @results ); #FIXME WSDL says $string, not @string?
175} 181}
176 182
177=pod 183=pod
178=begin WSDL 184=begin WSDL
179_IN authenKey $string 185_IN authenKey $string
194 for(my $i=0;$i<@problemData;$i++) { 200 for(my $i=0;$i<@problemData;$i++) {
195 $grade += @problemData[$i]->status; 201 $grade += @problemData[$i]->status;
196 } 202 }
197 push(@grades,$grade); 203 push(@grades,$grade);
198 } 204 }
199 return \@grades; 205 return array_to_soap_string( @grades );
200} 206}
201 207
202=pod 208=pod
203=begin WSDL 209=begin WSDL
204_IN authenKey $string 210_IN authenKey $string
205_IN courseName $string 211_IN courseName $string
206_IN setID $string 212_IN setID $string
207_RETURN @string 213_RETURN $WebworkSOAP::Classes::GlobalSet
208=end WSDL 214=end WSDL
209=cut 215=cut
210sub get_set_data { 216sub get_set_data {
211 my ($self,$authenKey,$courseName,$setID) = @_; 217 my ($self,$authenKey,$courseName,$setID) = @_;
212 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 218 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
214 if(not defined $setData) { 220 if(not defined $setData) {
215 return -1; 221 return -1;
216 } 222 }
217 my $set = new WebworkSOAP::Classes::GlobalSet($setData); 223 my $set = new WebworkSOAP::Classes::GlobalSet($setData);
218 return $set; 224 return $set;
219
220
221} 225}
222 226
223#################################################################### 227####################################################################
224##FUNCTIONS DIRECTLY MAPPED TO FUNCTIONS IN DB.pm 228##FUNCTIONS DIRECTLY MAPPED TO FUNCTIONS IN DB.pm
225#################################################################### 229####################################################################
238sub add_password { 242sub add_password {
239 my ($self,$authenKey,$courseName,$record) = @_; 243 my ($self,$authenKey,$courseName,$record) = @_;
240 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 244 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
241 my $newPassword = $soapEnv->{db}->newPassword; 245 my $newPassword = $soapEnv->{db}->newPassword;
242 %$newPassword = %$record; 246 %$newPassword = %$record;
243 return $soapEnv->{db}->addPassword($newPassword); 247 return SOAP::Data->type( 'string', $soapEnv->{db}->addPassword($newPassword) );
244} 248}
245 249
246=pod 250=pod
247=begin WSDL 251=begin WSDL
248_IN authenKey $string 252_IN authenKey $string
252=end WSDL 256=end WSDL
253=cut 257=cut
254sub put_password { 258sub put_password {
255 my ($self,$authenKey,$courseName,$record) = @_; 259 my ($self,$authenKey,$courseName,$record) = @_;
256 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 260 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
257 return $soapEnv->{db}->putPassword($record); 261 return SOAP::Data->type( 'string', $soapEnv->{db}->putPassword($record) );
258} 262}
259 263
260=pod 264=pod
261=begin WSDL 265=begin WSDL
262_IN authenKey $string 266_IN authenKey $string
266=cut 270=cut
267sub list_password { 271sub list_password {
268 my ($self,$authenKey,$courseName) = @_; 272 my ($self,$authenKey,$courseName) = @_;
269 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 273 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
270 my @tempArray = $soapEnv->{db}->listPasswords; 274 my @tempArray = $soapEnv->{db}->listPasswords;
271 return \@tempArray; 275 return array_to_soap_string( @tempArray );
272} 276}
273 277
274=pod 278=pod
275=begin WSDL 279=begin WSDL
276_IN authenKey $string 280_IN authenKey $string
324sub add_permission { 328sub add_permission {
325 my ($self,$authenKey,$courseName,$record) = @_; 329 my ($self,$authenKey,$courseName,$record) = @_;
326 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 330 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
327 my $newPermissionLevel = $soapEnv->{db}->newPermissionLevel; 331 my $newPermissionLevel = $soapEnv->{db}->newPermissionLevel;
328 %$newPermissionLevel = %$record; 332 %$newPermissionLevel = %$record;
329 return $soapEnv->{db}->addPermissionLevel($newPermissionLevel); 333 return SOAP::Data->type( 'string', $soapEnv->{db}->addPermissionLevel($newPermissionLevel) );
330} 334}
331 335
332=pod 336=pod
333=begin WSDL 337=begin WSDL
334_IN authenKey $string 338_IN authenKey $string
338=end WSDL 342=end WSDL
339=cut 343=cut
340sub put_permission { 344sub put_permission {
341 my ($self,$authenKey,$courseName,$record) = @_; 345 my ($self,$authenKey,$courseName,$record) = @_;
342 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 346 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
343 return $soapEnv->{db}->putPermissionLevel($record); 347 return SOAP::Data->type( 'string', $soapEnv->{db}->putPermissionLevel($record) );
344} 348}
345 349
346=pod 350=pod
347=begin WSDL 351=begin WSDL
348_IN authenKey $string 352_IN authenKey $string
352=cut 356=cut
353sub list_permissions { 357sub list_permissions {
354 my ($self,$authenKey,$courseName) = @_; 358 my ($self,$authenKey,$courseName) = @_;
355 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 359 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
356 my @tempArray = $soapEnv->{db}->listPermissionLevels; 360 my @tempArray = $soapEnv->{db}->listPermissionLevels;
357 return \@tempArray; 361 return array_to_soap_string( @tempArray );
358} 362}
359 363
360=pod 364=pod
361=begin WSDL 365=begin WSDL
362_IN authenKey $string 366_IN authenKey $string
410sub add_key { 414sub add_key {
411 my ($self,$authenKey,$courseName,$record) = @_; 415 my ($self,$authenKey,$courseName,$record) = @_;
412 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 416 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
413 my $newKey = $soapEnv->{db}->newKey; 417 my $newKey = $soapEnv->{db}->newKey;
414 %$newKey = %$record; 418 %$newKey = %$record;
415 return $soapEnv->{db}->addKey($newKey); 419 return SOAP::Data->type( 'string', $soapEnv->{db}->addKey($newKey) );
416} 420}
417 421
418=pod 422=pod
419=begin WSDL 423=begin WSDL
420_IN authenKey $string 424_IN authenKey $string
424=end WSDL 428=end WSDL
425=cut 429=cut
426sub put_key { 430sub put_key {
427 my ($self,$authenKey,$courseName,$record) = @_; 431 my ($self,$authenKey,$courseName,$record) = @_;
428 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 432 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
429 return $soapEnv->{db}->putKey($record); 433 return SOAP::Data->type( 'string', $soapEnv->{db}->putKey($record) );
430} 434}
431 435
432=pod 436=pod
433=begin WSDL 437=begin WSDL
434_IN authenKey $string 438_IN authenKey $string
438=cut 442=cut
439sub list_keys { 443sub list_keys {
440 my ($self,$authenKey,$courseName) = @_; 444 my ($self,$authenKey,$courseName) = @_;
441 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 445 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
442 my @tempArray = $soapEnv->{db}->listKeys; 446 my @tempArray = $soapEnv->{db}->listKeys;
443 return \@tempArray; 447 return array_to_soap_string( @tempArray );
444} 448}
445 449
446=pod 450=pod
447=begin WSDL 451=begin WSDL
448_IN authenKey $string 452_IN authenKey $string
496sub add_user { 500sub add_user {
497 my ($self,$authenKey,$courseName,$record) = @_; 501 my ($self,$authenKey,$courseName,$record) = @_;
498 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 502 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
499 my $newUser = $soapEnv->{db}->newUser; 503 my $newUser = $soapEnv->{db}->newUser;
500 %$newUser = %$record; 504 %$newUser = %$record;
501 return $soapEnv->{db}->addUser($newUser); 505 return SOAP::Data->type( 'string', $soapEnv->{db}->addUser($newUser) );
502} 506}
503 507
504=pod 508=pod
505=begin WSDL 509=begin WSDL
506_IN authenKey $string 510_IN authenKey $string
510=end WSDL 514=end WSDL
511=cut 515=cut
512sub put_user { 516sub put_user {
513 my ($self,$authenKey,$courseName,$record) = @_; 517 my ($self,$authenKey,$courseName,$record) = @_;
514 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 518 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
515 return $soapEnv->{db}->putUser($record); 519 return SOAP::Data->type( 'string', $soapEnv->{db}->putUser($record) );
516} 520}
517 521
518=pod 522=pod
519=begin WSDL 523=begin WSDL
520_IN authenKey $string 524_IN authenKey $string
524=cut 528=cut
525sub list_users { 529sub list_users {
526 my ($self,$authenKey,$courseName) = @_; 530 my ($self,$authenKey,$courseName) = @_;
527 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 531 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
528 my @tempArray = $soapEnv->{db}->listUsers; 532 my @tempArray = $soapEnv->{db}->listUsers;
529 return \@tempArray; 533 return array_to_soap_string( @tempArray );
530} 534}
531 535
532=pod 536=pod
533=begin WSDL 537=begin WSDL
534_IN authenKey $string 538_IN authenKey $string
576=end WSDL 580=end WSDL
577=cut 581=cut
578sub delete_user { 582sub delete_user {
579 my ($self,$authenKey,$courseName,$userID) = @_; 583 my ($self,$authenKey,$courseName,$userID) = @_;
580 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 584 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
581 return $soapEnv->{db}->deleteUser($userID); 585 return SOAP::Data->type( 'string', $soapEnv->{db}->deleteUser($userID) );
582} 586}
583 587
584################################################## 588##################################################
585##Global Sets 589##Global Sets
586################################################## 590##################################################
596sub add_global_set { 600sub add_global_set {
597 my ($self,$authenKey,$courseName,$record) = @_; 601 my ($self,$authenKey,$courseName,$record) = @_;
598 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 602 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
599 my $newGlobalSet = $soapEnv->{db}->newGlobalSet; 603 my $newGlobalSet = $soapEnv->{db}->newGlobalSet;
600 %$newGlobalSet = %$record; 604 %$newGlobalSet = %$record;
601 return $soapEnv->{db}->addGlobalSet($newGlobalSet); 605 return SOAP::Data->type( 'string', $soapEnv->{db}->addGlobalSet($newGlobalSet) );
602} 606}
603 607
604=pod 608=pod
605=begin WSDL 609=begin WSDL
606_IN authenKey $string 610_IN authenKey $string
610=end WSDL 614=end WSDL
611=cut 615=cut
612sub put_global_set { 616sub put_global_set {
613 my ($self,$authenKey,$courseName,$record) = @_; 617 my ($self,$authenKey,$courseName,$record) = @_;
614 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 618 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
615 return $soapEnv->{db}->putGlobalSet($record); 619 return SOAP::Data->type( 'string', $soapEnv->{db}->putGlobalSet($record) );
616} 620}
617 621
618=pod 622=pod
619=begin WSDL 623=begin WSDL
620_IN authenKey $string 624_IN authenKey $string
624=cut 628=cut
625sub list_global_sets { 629sub list_global_sets {
626 my ($self,$authenKey,$courseName) = @_; 630 my ($self,$authenKey,$courseName) = @_;
627 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 631 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
628 my @tempArray = $soapEnv->{db}->listGlobalSets; 632 my @tempArray = $soapEnv->{db}->listGlobalSets;
629 return \@tempArray; 633 return array_to_soap_string( @tempArray );
630} 634}
631
632 635
633=pod 636=pod
634=begin WSDL 637=begin WSDL
635_IN authenKey $string 638_IN authenKey $string
636_IN courseName $string 639_IN courseName $string
696=end WSDL 699=end WSDL
697=cut 700=cut
698sub delete_global_set { 701sub delete_global_set {
699 my ($self,$authenKey,$courseName,$setID) = @_; 702 my ($self,$authenKey,$courseName,$setID) = @_;
700 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 703 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
701 return $soapEnv->{db}->deleteGlobalSet($setID); 704 return SOAP::Data->type( 'string', $soapEnv->{db}->deleteGlobalSet($setID) );
702} 705}
703 706
704################################################## 707##################################################
705##Global Problems 708##Global Problems
706################################################## 709##################################################
716sub add_global_problem { 719sub add_global_problem {
717 my ($self,$authenKey,$courseName,$record) = @_; 720 my ($self,$authenKey,$courseName,$record) = @_;
718 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 721 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
719 my $newGlobalProblem = $soapEnv->{db}->newGlobalProblem; 722 my $newGlobalProblem = $soapEnv->{db}->newGlobalProblem;
720 %$newGlobalProblem = %$record; 723 %$newGlobalProblem = %$record;
721 return $soapEnv->{db}->addGlobalProblem($newGlobalProblem); 724 return SOAP::Data->type( 'string', $soapEnv->{db}->addGlobalProblem($newGlobalProblem) );
722} 725}
723 726
724=pod 727=pod
725=begin WSDL 728=begin WSDL
726_IN authenKey $string 729_IN authenKey $string
730=end WSDL 733=end WSDL
731=cut 734=cut
732sub put_global_problem { 735sub put_global_problem {
733 my ($self,$authenKey,$courseName,$record) = @_; 736 my ($self,$authenKey,$courseName,$record) = @_;
734 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 737 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
735 return $soapEnv->{db}->putGlobalProblem($record); 738 return SOAP::Data->type( 'string', $soapEnv->{db}->putGlobalProblem($record) );
736} 739}
737 740
738=pod 741=pod
739=begin WSDL 742=begin WSDL
740_IN authenKey $string 743_IN authenKey $string
745=cut 748=cut
746sub list_global_problems { 749sub list_global_problems {
747 my ($self,$authenKey,$courseName,$setID) = @_; 750 my ($self,$authenKey,$courseName,$setID) = @_;
748 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 751 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
749 my @tempArray = $soapEnv->{db}->listGlobalProblems($setID); 752 my @tempArray = $soapEnv->{db}->listGlobalProblems($setID);
750 return \@tempArray; 753 return array_to_soap_string( @tempArray );
751} 754}
752 755
753=pod 756=pod
754=begin WSDL 757=begin WSDL
755_IN authenKey $string 758_IN authenKey $string
771 774
772=pod 775=pod
773=begin 776=begin
774_IN authenKey $string 777_IN authenKey $string
775_IN courseName $string 778_IN courseName $string
776_IN problemIDs @string 779_IN problemIDs @string An array reference: [userID setID problemID]
777_RETURN @WebworkSOAP::Classes::GlobalProblem Array of user objects 780_RETURN @WebworkSOAP::Classes::GlobalProblem Array of user objects
778=end WSDL 781=end WSDL
779=cut 782=cut
780sub get_global_problems { 783sub get_global_problems {
781 my ($self,$authenKey,$courseName,$problemIDs) = @_; 784 my ($self,$authenKey,$courseName,$problemIDs) = @_;
782 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 785 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
783 my @problemData = $soapEnv->{db}->getGlobalProblems(@$problemIDs); 786 my @problemData = $soapEnv->{db}->getGlobalProblems(@$problemIDs);
784 my @problems; 787 my @problems;
785 for(my $i=0;$i<@problemData;$i++) { 788 for(my $i=0;$i<@problemData;$i++) {
786 push(@problems,new WebworkSOAP::Classes::GlobalProblem(@problemData[$i])); 789 push(@problems,new WebworkSOAP::Classes::GlobalProblem(@problemData[$i])); #FIXME $problemData[$i]?
787 } 790 }
788 return \@problems; 791 return \@problems;
789} 792}
790 793
791=pod 794=pod
818=end WSDL 821=end WSDL
819=cut 822=cut
820sub delete_global_problem { 823sub delete_global_problem {
821 my ($self,$authenKey,$courseName,$setID,$problemID) = @_; 824 my ($self,$authenKey,$courseName,$setID,$problemID) = @_;
822 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 825 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
823 return $soapEnv->{db}->deleteGlobalProblem($setID,$problemID); 826 return SOAP::Data->type( 'string', $soapEnv->{db}->deleteGlobalProblem($setID,$problemID) );
824} 827}
825 828
826################################################## 829##################################################
827##USER PROBLEM 830##USER PROBLEM
828################################################## 831##################################################
838sub add_user_problem { 841sub add_user_problem {
839 my ($self,$authenKey,$courseName,$record) = @_; 842 my ($self,$authenKey,$courseName,$record) = @_;
840 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 843 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
841 my $newUserProblem = $soapEnv->{db}->newUserProblem; 844 my $newUserProblem = $soapEnv->{db}->newUserProblem;
842 %$newUserProblem = %$record; 845 %$newUserProblem = %$record;
843 return $soapEnv->{db}->addUserProblem($newUserProblem); 846 return SOAP::Data->type( 'string', $soapEnv->{db}->addUserProblem($newUserProblem) );
844} 847}
845 848
846=pod 849=pod
847=begin WSDL 850=begin WSDL
848_IN authenKey $string 851_IN authenKey $string
852=end WSDL 855=end WSDL
853=cut 856=cut
854sub put_user_problem { 857sub put_user_problem {
855 my ($self,$authenKey,$courseName,$record) = @_; 858 my ($self,$authenKey,$courseName,$record) = @_;
856 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 859 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
857 return $soapEnv->{db}->putUserProblem($record); 860 return SOAP::Data->type( 'string', $soapEnv->{db}->putUserProblem($record) );
858} 861}
859 862
860=pod 863=pod
861=begin WSDL 864=begin WSDL
862_IN authenKey $string 865_IN authenKey $string
866_IN courseName $string
863_IN courseName $string 867_IN userID $string
864_IN userID $string 868_IN setID $string
865_RETURN @string of names objects. 869_RETURN @string of names objects.
866=end WSDL 870=end WSDL
867=cut 871=cut
868sub list_user_problems { 872sub list_user_problems {
869 my ($self,$authenKey,$courseName,$userID) = @_; 873 my ($self,$authenKey,$courseName,$userID,$setID) = @_;
870 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 874 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
871 my @tempArray = $soapEnv->{db}->listUserProblems($userID); 875 my @tempArray = $soapEnv->{db}->listUserProblems($userID,$setID);
872 return \@tempArray; 876 return array_to_soap_string( @tempArray );
873} 877}
874 878
875=pod 879=pod
876=begin WSDL 880=begin WSDL
877_IN authenKey $string 881_IN authenKey $string
894 898
895=pod 899=pod
896=begin WSDL 900=begin WSDL
897_IN authenKey $string 901_IN authenKey $string
898_IN courseName $string 902_IN courseName $string
899_IN userProblemIDs @string 903_IN userProblemIDs @string A 3 element array: { user_ID, setID, problemID }
900_RETURN @WebworkSOAP::Classes::UserProblem of names objects. 904_RETURN @WebworkSOAP::Classes::UserProblem of names objects.
901=end WSDL 905=end WSDL
902=cut 906=cut
903sub get_user_problems { 907sub get_user_problems {
904 my ($self,$authenKey,$courseName,$userProblemIDs) = @_; 908 my ($self,$authenKey,$courseName,$userProblemIDs) = @_;
943=end WSDL 947=end WSDL
944=cut 948=cut
945sub delete_user_problem { 949sub delete_user_problem {
946 my ($self,$authenKey,$courseName,$userID,$setID,$problemID) = @_; 950 my ($self,$authenKey,$courseName,$userID,$setID,$problemID) = @_;
947 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 951 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
948 return $soapEnv->{db}->deleteUserProblem($userID,$setID,$problemID); 952 return SOAP::Data->type( 'string', $soapEnv->{db}->deleteUserProblem($userID,$setID,$problemID) );
949} 953}
950 954
951################################################## 955##################################################
952##USER SET 956##USER SET
953################################################## 957##################################################
963sub add_user_set { 967sub add_user_set {
964 my ($self,$authenKey,$courseName,$record) = @_; 968 my ($self,$authenKey,$courseName,$record) = @_;
965 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 969 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
966 my $newUserSet = $soapEnv->{db}->newUserSet; 970 my $newUserSet = $soapEnv->{db}->newUserSet;
967 %$newUserSet = %$record; 971 %$newUserSet = %$record;
968 return $soapEnv->{db}->addUserSet($newUserSet); 972 return SOAP::Data->type( 'string', $soapEnv->{db}->addUserSet($newUserSet) );
969} 973}
970 974
971=pod 975=pod
972=begin WSDL 976=begin WSDL
973_IN authenKey $string 977_IN authenKey $string
977=end WSDL 981=end WSDL
978=cut 982=cut
979sub put_user_set { 983sub put_user_set {
980 my ($self,$authenKey,$courseName,$record) = @_; 984 my ($self,$authenKey,$courseName,$record) = @_;
981 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 985 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
982 return $soapEnv->{db}->addUserSet($record); 986 return SOAP::Data->type( 'string', $soapEnv->{db}->addUserSet($record) );
983} 987}
984 988
985=pod 989=pod
986=begin WSDL 990=begin WSDL
987_IN authenKey $string 991_IN authenKey $string
992=cut 996=cut
993sub list_user_sets { 997sub list_user_sets {
994 my ($self,$authenKey,$courseName,$userID) = @_; 998 my ($self,$authenKey,$courseName,$userID) = @_;
995 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 999 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
996 my @tempArray = $soapEnv->{db}->listUserSets($userID); 1000 my @tempArray = $soapEnv->{db}->listUserSets($userID);
997 return \@tempArray; 1001 return array_to_soap_string( @tempArray );
998} 1002}
999 1003
1000=pod 1004=pod
1001=begin WSDL 1005=begin WSDL
1002_IN authenKey $string 1006_IN authenKey $string
1064=end WSDL 1068=end WSDL
1065=cut 1069=cut
1066sub delete_user_set { 1070sub delete_user_set {
1067 my ($self,$authenKey,$courseName,$userID,$setID) = @_; 1071 my ($self,$authenKey,$courseName,$userID,$setID) = @_;
1068 my $soapEnv = new WebworkSOAP($authenKey,$courseName); 1072 my $soapEnv = new WebworkSOAP($authenKey,$courseName);
1069 return $soapEnv->{db}->deleteUserSet($userID,$setID); 1073 return SOAP::Data->type( 'string', $soapEnv->{db}->deleteUserSet($userID,$setID) );
1070} 1074}
1071 1075
1072 1076
10731; 10771;

Legend:
Removed from v.6062  
changed lines
  Added in v.6063

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9