Skip to content

Commit

Permalink
fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Filip committed Nov 9, 2023
1 parent 5b6b23f commit 0eb46ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions classes/grades/synchronization/xapi_request.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,18 @@ private function has_error(array $response): bool {
* @return mixed curl handle for json payload
*/
public function create_post_curl_request() {
$post_fields= json_encode($this->payload);
$postfields = json_encode($this->payload);
$ch = curl_init($this->server->get_grade_sync_url());
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($ch, CURLOPT_USERAGENT, "My User Agent Name");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt(
$ch,
CURLOPT_HTTPHEADER,
array(
'Content-Type: application/json',
'Content-Length: ' . strlen($post_fields),
'Content-Length: ' . strlen($postfields),
"X-API-Key: " . get_config('auth_mumie', 'mumie_api_key'),
)
);
Expand Down
4 changes: 2 additions & 2 deletions gradesync.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ public static function get_all_grades_for_user(stdClass $mumie, int $userid) : ?
*/
private static function xapi_to_moodle_grade($xapigrade) : stdClass {
$grade = new stdClass();
$sync_id = self::get_mumie_user_from_sync_id($xapigrade->actor->account->name);
$grade->userid = $sync_id->get_moodle_id();
$syncid = self::get_mumie_user_from_sync_id($xapigrade->actor->account->name);
$grade->userid = $syncid->get_moodle_id();
$grade->rawgrade = 100 * $xapigrade->result->score->raw;
$grade->timecreated = strtotime($xapigrade->timestamp);
return $grade;
Expand Down

0 comments on commit 0eb46ac

Please sign in to comment.