AYAN BISWAS
AYAN BISWAS

Reputation: 29

Need to send scores back to LMS from teacher end using ims-lti gem

Hi I am using this gem for my ruby based application , And I want to send the scores back to the LMS , but the problem is in my platform a teacher can grade the assignments now I want to send the scores back to the LMS when the teacher view the application from inside LMS,

say @teacher_loogedin.student_1_grade is the grade of the student when teacher is logged in his/her account inside LMS using my LTI provider tool , now I want to send back the score to the LMS and LMS should record the score on behalf of the student 1 , can I do this ?

I have written a function to accomplish this but here score is only the parameter , how to use a student specific parameter like student_email so that the score is reflected for that particular student only.

here is my function, but how to achieve my desired goal ??

def submitscore
    @tp = IMS::LTI::ToolProvider.new(@@launch_params[:oauth_consumer_key],
    Rails.configuration.lti_settings[@@launch_params[:oauth_consumer_key]],
    @@launch_params)
    # add extension
    @tp.extend IMS::LTI::Extensions::OutcomeData::ToolProvider

    if [email protected]_service?
      @message = "This tool wasn't lunched as an outcome service"
      puts "This tool wasn't lunched as an outcome service"
      render(:launch_error)
    end

    res = @tp.post_extended_replace_result!(score: params[:result]) # here I want to pass a parameter of student email such that the corresponding student can be graded

    if res.success?
      puts "Score Submitted"
    else
      puts "Error during score submission"
    end
    redirect_to @@launch_params[:launch_presentation_return_url]
  end

Upvotes: 0

Views: 133

Answers (1)

Brandon
Brandon

Reputation: 60

Requirements: LTI Deeplink installation

  1. Create an assignment with an external app option
  2. Pull line items URLs at LTI launch
  3. Make requests to submit assignments with the lineitem URLs.

Hope this flow helps you.

Upvotes: 0

Related Questions