File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -83,13 +83,15 @@ def exercises_all
8383 end
8484
8585 def push_external
86- #account_link = AccountLink.find(params[:account_link][:id]);
87- #oauth2Client = OAuth2::Client.new('client_id', 'client_secret', :site => account_link.push_url)
88- #oauth2_token = account_link[:oauth2_token]
89- #token = OAuth2::AccessToken.from_hash(oauth2Client, :access_token => oauth2_token)
90- #token.post(account_link.push_url)
91- #redirect_to @exercise, notice: ('Exercise pushed to ' + account_link.readable)
92- redirect_to @exercise , notice : 'Exercise was successfully exported.'
86+ account_link = AccountLink . find ( params [ :account_link ] [ :id ] ) ;
87+ oauth2Client = OAuth2 ::Client . new ( 'client_id' , 'client_secret' , :site => account_link . push_url )
88+ oauth2_token = account_link [ :oauth2_token ]
89+ token = OAuth2 ::AccessToken . from_hash ( oauth2Client , :access_token => oauth2_token )
90+ logger . fatal ( '@exercise.to_proforma_xml' )
91+ logger . fatal ( @exercise . to_proforma_xml )
92+ logger . fatal ( '@exercise.to_proforma_xml' )
93+ token . post ( account_link . push_url , { body : @exercise . to_proforma_xml } )
94+ redirect_to @exercise , notice : ( 'Exercise pushed to ' + account_link . readable )
9395 end
9496
9597 private
You can’t perform that action at this time.
0 commit comments