[system] / branches / gage_dev / webwork2 / lib / RQP.pm Repository:
ViewVC logotype

Diff of /branches/gage_dev/webwork2/lib/RQP.pm

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

Revision 3291 Revision 3292
10 10
11use WebworkWebservice; 11use WebworkWebservice;
12package RQP; 12package RQP;
13@ISA = (SOAP::Server::Parameters); 13@ISA = (SOAP::Server::Parameters);
14local(*MYLOG); 14local(*MYLOG);
15
16use WeBWorK::Utils::Tasks qw(fake_set fake_problem);
17use RQP::Render;
18
19our $WW_DIRECTORY = $WebworkWebservice::WW_DIRECTORY;
20our $PG_DIRECTORY = $WebworkWebservice::PG_DIRECTORY;
21our $COURSENAME = $WebworkWebservice::COURSENAME;
22our $HOST_NAME = $WebworkWebservice::HOST_NAME;
23our $HOSTURL ="http://$HOST_NAME:8002"; #FIXME
24our $ce =$WebworkWebservice::SeedCE;
25# create a local course environment for some course
26 $ce = WeBWorK::CourseEnvironment->new($WW_DIRECTORY, "", "", $COURSENAME);
27#print "\$ce = \n", WeBWorK::Utils::pretty_print_rh($ce);
28our $db = WeBWorK::DB->new($ce->{dbLayout});
15 29
16#print MYLOG "restarting server\n\n"; 30#print MYLOG "restarting server\n\n";
17sub test { 31sub test {
18 open MYLOG, ">>/home/gage/debug_info.txt" ; 32 open MYLOG, ">>/home/gage/debug_info.txt" ;
19 local($|=1); 33 local($|=1);
91 my $soap_som = pop; 105 my $soap_som = pop;
92 my $rh_params= $soap_som->method; 106 my $rh_params= $soap_som->method;
93 local(*DEBUGLOG); 107 local(*DEBUGLOG);
94 open DEBUGLOG, ">>/home/gage/debug_info.txt" || die "can't open debug file"; 108 open DEBUGLOG, ">>/home/gage/debug_info.txt" || die "can't open debug file";
95 print DEBUGLOG "--RQP_SessionInformation\n"; 109 print DEBUGLOG "--RQP_SessionInformation\n";
96 my $templateVars = []; 110 my $templatevars = $rh_params->{templatevars};
111 $templatevars->{seed}=4321;
97 my $correctResponses = []; 112 my $correctResponses = [];
98 $rh_out = { 113 $rh_out = {
114 'outcomevars' => {id=>45},
99 'templateVars' => $templateVars, 115 'templatevars' => $templatevars,
100 'correctResponses' => $correctResponses, 116 'correctResponses' => $correctResponses,
101 input => '<hr>'.WebworkWebservice::pretty_print_rh($rh_params).'<hr>', 117 input => '<hr>'.WebworkWebservice::pretty_print_rh($rh_params).'<hr>',
102 }; 118 };
103 close(DEBUGLOG); 119 close(DEBUGLOG);
104 return $rh_out; 120 return $rh_out;
105} 121}
106 122
107 123
108sub RQP_Render { 124sub RQP_Render {
109 my $class = shift; 125 RQP::Render::RQP_Render(@_);
110 my $soap_som = pop;
111 my $rh_params= $soap_som->method;
112 local(*DEBUGLOG);
113 open DEBUGLOG, ">>/home/gage/debug_info.txt" || die "can't open debug file";
114 print DEBUGLOG "--RQP_Render\n";
115 #my $output = WebworkWebservice::pretty_print_rh(\%parameters);
116 my $source = $rh_params->{source};
117 $source =~s/</&lt;/g;
118 $source =~s/>/&gt;/g;
119 my $output = "the first element is ". $self. " and the last ". ref($envelope)."\n\n";
120 $output .= WebworkWebservice::pretty_print_rh($rh_params);
121 my $rh_out = {
122 templateVars => [],
123 persistentData => '',
124 outcomeVars => [],
125 output => $output,
126 source => $source,
127 input => '<hr>'.WebworkWebservice::pretty_print_rh($rh_params).'<hr>',
128
129 };
130 close(DEBUGLOG);
131 return $rh_out;
132 126
133} 127}
134 128
135 129
1361; 1301;

Legend:
Removed from v.3291  
changed lines
  Added in v.3292

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9