[LON-CAPA-cvs] cvs: modules /studip testqueries.pl

www www@source.lon-capa.org
Sun, 05 Jun 2011 23:42:06 -0000


www		Sun Jun  5 23:42:06 2011 EDT

  Modified files:              
    /modules/studip	testqueries.pl 
  Log:
  Evaluate answer
  
  
Index: modules/studip/testqueries.pl
diff -u modules/studip/testqueries.pl:1.1 modules/studip/testqueries.pl:1.2
--- modules/studip/testqueries.pl:1.1	Sun Jun  5 19:35:39 2011
+++ modules/studip/testqueries.pl	Sun Jun  5 23:42:06 2011
@@ -17,15 +17,17 @@
     my $request = new HTTP::Request('POST',$url.'?methodName='.$cmd,$headers);
     $request->content($commands);
     my $response=$ua->request($request);
-    my %returned=();
+    my @returned=();
     my $error='';
     if ($response->is_success()) {
         my $content = $response->content;
-        print "\n$content\n";
+        @returned=($content=~/\<(int|string|boolean)\>([^\<]+)/g);
     } else {
         $error = "ERROR: ".$response->status_line;
     }
-    return ($error,%returned);
+    return ($error,@returned);
 }
 
-&send('get_seminar_groups','834499e2b8a2cd71637890e5de31cba3');
+print "\n".join(",",&send('get_seminar_groups','834499e2b8a2cd71637890e5de31cba3'));
+print "\n".join(",",&send('is_session_valid','test'));
+