Skip to content

Need to send scores back to LMS from teacher end #168

Description

@ayan-biswas0412

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 !@tp.outcome_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

my problem is also similar to this but I need to solve this using this gem , please help me

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions