@@ -30,7 +30,9 @@ public function put_grade(LTI_Grade $grade, LTI_Lineitem $lineitem = null) {
3030 $ lineitem = $ this ->find_or_create_lineitem ($ lineitem );
3131 $ score_url = $ lineitem ->get_id ();
3232 }
33- $ score_url .= '/scores ' ;
33+ // Place '/scores' before url params
34+ $ pos = strpos ($ score_url , '? ' );
35+ $ score_url = substr_replace ( $ score_url , '/scores ' , $ pos , 0 );
3436 return $ this ->service_connector ->make_service_request (
3537 $ this ->service_data ['scope ' ],
3638 'POST ' ,
@@ -70,10 +72,13 @@ public function find_or_create_lineitem(LTI_Lineitem $new_line_item) {
7072
7173 public function get_grades (LTI_Lineitem $ lineitem ) {
7274 $ lineitem = $ this ->find_or_create_lineitem ($ lineitem );
75+ // Place '/results' before url params
76+ $ pos = strpos ($ lineitem ->get_id (), '? ' );
77+ $ results_url = substr_replace ( $ lineitem ->get_id (), '/results ' , $ pos , 0 );
7378 $ scores = $ this ->service_connector ->make_service_request (
7479 $ this ->service_data ['scope ' ],
7580 'GET ' ,
76- $ lineitem -> get_id () . ' /results ' ,
81+ $ results_url ,
7782 null ,
7883 null ,
7984 'application/vnd.ims.lis.v2.resultcontainer+json '
0 commit comments