Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actor format is incorrect for 'received grade for' event #133

Closed
dasu2013 opened this issue Sep 8, 2017 · 7 comments
Closed

Actor format is incorrect for 'received grade for' event #133

dasu2013 opened this issue Sep 8, 2017 · 7 comments
Labels

Comments

@dasu2013
Copy link

dasu2013 commented Sep 8, 2017

Description

  • Actor format is incorrect for ‘received grade for’ event. It appears like below in learning locker.
    "actor": {
    "account": {
    "homePage": "https://example.com",
    "name": "12345"
    },
    "name": "Ann Smith",
    "objectType": "Agent"
    }
    Expected actor format is,
    "actor": {
    "mbox": "mailto:12345@example.com",
    "name": " Ann Smith",
    "objectType": "Agent"
    }
@ryasmi
Copy link
Member

ryasmi commented Sep 8, 2017

Hi @dasu2013, thanks for reporting your issue.

@garemoko
Copy link
Contributor

garemoko commented Sep 8, 2017

ie. in https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/src/Events/AssignmentGraded.php#L42-L50

$statement['actor'] = $this->readUser($opts, "graded_user");

Gotta love fixes that actually reduce lines of code.

@Dasuntha
Copy link
Contributor

Hi Andrew,

Thanks for this reply. The problem is $opts array doesn't have graded_user's email. It has only graded_user_id, graded_user_url and graded_user_name. There is no 'graded_user_email'. Therefore this proposed solution didn't work.

@Dasuntha
Copy link
Contributor

Solution for this is
https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/src/Events/AssignmentGraded.php#L42-L50
$statement['actor'] = $this->readUser($opts, "graded_user");

AND

https://github.com/LearningLocker/Moodle-xAPI-Translator/blob/master/src/Events/AssignmentGraded.php#L36-L38

Add user email address into this array,
return [array_merge(parent::read($opts)[0], [
'recipe' => 'assignment_graded',
'graded_user_id' => $opts['graded_user']->id,
'graded_user_url' => $opts['graded_user']->url,
'graded_user_name' => $opts['graded_user']->fullname,
'graded_user_email' => $opts['graded_user']->email,
'grade_score_raw' => $scoreRaw,
'grade_score_min' => $scoreMin,
'grade_score_max' => $scoreMax,
'grade_score_scaled' => $scoreScaled,
'grade_success' => $success,
'grade_completed' => true,
'grade_comment' => strip_tags($opts['grade_comment']),
])];

@ryasmi
Copy link
Member

ryasmi commented Sep 20, 2017

Thanks @dasu2013 👍

@davidpesce
Copy link
Collaborator

This was merged with #139

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants