Quantcast
Channel: Web services
Viewing all articles
Browse latest Browse all 2362

Re: Mobile web service quiz documentation

$
0
0

by Jan Philipp Weber.  

Hi Daniel,

I send quizid and userid with REST to the Web Service, here is my function from my Web Service test project:

    public function getQuizUserAttempts($token,$quizid,$userid)
    {
        $domainname = 'https://mymoodle.com';
        $functionname = 'mod_quiz_get_user_attempts';
        $restformat = 'json';
        $params = array('quizid' => $quizid,'userid' => $userid);
        $serverurl = $domainname . '/webservice/rest/server.php'. '?wstoken=' . $token . '&wsfunction='.$functionname;
        $this->load->library('Curl');
        $curl = new Curl();
        $restformat = ($restformat == 'json')?'&moodlewsrestformat=' . $restformat:'';
        $resp = $curl->post($serverurl . $restformat, $params);
        return $resp;
    }


Forme, thewhole thingisverymysterious.

Best regards,
Jan Philipp

Viewing all articles
Browse latest Browse all 2362

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>