Skip to content

Commit

Permalink
Added contributor details and changed field to documentType
Browse files Browse the repository at this point in the history
  • Loading branch information
ht2 committed Feb 11, 2014
1 parent 73be3ba commit 9b65c1c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ There are several ways you can get involved with Learning Locker. Visit our site

* HT2 (http://ht2.co.uk)
* Dave Tosh (http://davetosh.com)
* James Mullaney [mailto:[email protected]]([email protected])

#### Copyright

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/xapi/StateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function index(){
'actor' => array('string', 'json'),
), $this->params );

$documents = $this->document->all( $this->lrs->_id, $data['activityId'], $data['actor'] );
$documents = $this->document->all( $this->lrs->_id, $this->document_type, $data['activityId'], $data['actor'] );
return \Response::json( $documents->toArray() );
}

Expand Down
9 changes: 5 additions & 4 deletions app/locker/repository/Document/EloquentDocumentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ public function __construct( DocumentAPI $documentapi ){

}

public function all( $lrs, $activityId, $actor ){
public function all( $lrs, $documentType, $activityId, $actor ){
return $this->documentapi->where('lrs', $lrs)
->where('documentType', $documentType)
->where('activityId', $activityId)
->where('actor', json_decode($actor))
->select('stateId')
Expand All @@ -34,13 +35,13 @@ public function find( $lrs, $stateId ){
->first();
}

public function store( $lrs, $data, $apitype ){
public function store( $lrs, $data, $documentType ){

$new_document = $this->documentapi;
$new_document->lrs = $lrs; //LL specific
$new_document->apitype = $apitype; //LL specific
$new_document->documentType = $documentType; //LL specific

switch( $new_document->apitype ){
switch( $new_document->documentType ){
case DocumentType::STATE:
$new_document->activityId = $data['activityId'];
$new_document->actor = json_decode($data['actor']);
Expand Down
5 changes: 5 additions & 0 deletions composer-public.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
"name": "HT2",
"email": "[email protected]",
"role": "sponsor"
},
{
"name": "James Mullaney",
"email": "[email protected]",
"role": "Developer"
}
],
"name": "learninglocker/learninglocker",
Expand Down

0 comments on commit 9b65c1c

Please sign in to comment.