## Question Authors' Forum

### Web service type question

by Ping Zhang -
Number of replies: 2

I am teaching a E-commerce module with PHP.

I would like to set up the web-service type question. It means the students' answer would be a web service (PHP file) which can process the GET and POST request.

The testcase would send the GET and POST request and the output would be result in json format.

Some rough idea is as:

In another post, I see with there is an internal webserver with the sandbox like the address "http://localhost/jobe/index.php/restapi/languages". So, if the students' answer has such an address, it would be possible.

Thanks all!

Ping @ Xi'an Jiaotong Liverpool University

### Re: Web service type question

by Ping Zhang -
If students' code can be saved to a local file, which path can be used? Then this file can be visited through the URL address.
A CodeRunner question must consist of the student's code wrapped in author-supplied test code via the question's template. You could possibly have testing code that sets the $_GET and$_POST superglobals to mimic the behaviour of a web service calling their code, and you could then capture and grade their response, but you can't run any web services as part of this process.