An error occurred while loading the file. Please try again.
  • Artem Baranovskyi's avatar
    General Plugin Implementation. · 7b3a3538
    Artem Baranovskyi authored
    - creating ASYST API on Flask server
    - preparation a query to API
    - response processing and Manual Grading Form manipulations (not yet covers slots !!!).
    7b3a3538
client.php 474 bytes
<?php
namespace local_asystgrade\api;
defined('MOODLE_INTERNAL') || die();
class client {
    private $endpoint;
    private $httpClient;
    public function __construct(string $endpoint, http_client $httpClient = null) {
        $this->endpoint = $endpoint;
        $this->httpClient = $httpClient ?: new http_client();
    public function send_data($data) {
        $response = $this->httpClient->post($this->endpoint, $data);
        return $response;