diff --git a/classes/grades/synchronization/xapi_request.php b/classes/grades/synchronization/xapi_request.php index 1ed2066..666e1fc 100644 --- a/classes/grades/synchronization/xapi_request.php +++ b/classes/grades/synchronization/xapi_request.php @@ -75,22 +75,18 @@ private function has_error(array $response): bool { * @return mixed curl handle for json payload */ public function create_post_curl_request() { - $hallo_json= json_encode($this->payload, JSON_UNESCAPED_SLASHES); - error_log($this->server->get_grade_sync_url()); + $post_fields= json_encode($this->payload); $ch = curl_init($this->server->get_grade_sync_url()); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); - curl_setopt($ch, CURLOPT_POSTFIELDS, $hallo_json); + curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields); curl_setopt($ch, CURLOPT_USERAGENT, "My User Agent Name"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - error_log("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); - error_log(get_config('auth_mumie', 'mumie_api_key')); - error_log($hallo_json); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', - 'Content-Length: ' . strlen($hallo_json), + 'Content-Length: ' . strlen($post_fields), "X-API-Key: " . get_config('auth_mumie', 'mumie_api_key'), ) ); diff --git a/gradesync.php b/gradesync.php index a90e7d2..3d72926 100644 --- a/gradesync.php +++ b/gradesync.php @@ -263,12 +263,10 @@ function ($user) { $mumieusers ); $payload = new payload($syncids, $mumie->mumie_coursefile, $mumieids, $mumie->lastsync, true); - $test = context_provider::requires_context($mumie); if (context_provider::requires_context($mumie)) { $context = context_provider::get_context(array($mumie), $mumieusers); $payload->with_context($context); } - error_log("TEST: " . print_r($test)); $request = new xapi_request($mumieserver, $payload); return $request->send(); }