Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ayan-biswas0412 opened this issue Jun 10, 2021 · 3 comments
Open

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

ayan-biswas0412 opened this issue Jun 10, 2021 · 3 comments

Comments

@ayan-biswas0412
Copy link

ayan-biswas0412 commented Jun 10, 2021

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

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

@ayan-biswas0412
Copy link
Author

@jbasdf @crewton @brodock @bracken can you help please in this problem ?

@ayan-biswas0412
Copy link
Author

hi @krozett can you please help me in this ?

@JMCQ87
Copy link

JMCQ87 commented Apr 25, 2023

@lis_result_sourcedid seems to identify the resource the request should deal with (on the 1.2.x branch). Identifying the students relevant result to update will require another step.

side note: Does it really make sense to initialise @tp on each submitscore request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants