Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Filip committed Nov 9, 2023
1 parent dbfe380 commit 5b6b23f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 3 additions & 7 deletions classes/grades/synchronization/xapi_request.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
)
);
Expand Down
2 changes: 0 additions & 2 deletions gradesync.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 5b6b23f

Please sign in to comment.