Add grading standard to assignment type
refs VICE-3774 flag=student_grade_summary_upgrade Test Plan: - add a custom grading scheme - create an assignment - set display points as "Letter Grade" - add the custom grading scheme to the assignment - should be able to query the grading standard on the assignment type Sample query: query MyQuery { legacyNode(_id: "1019", type: Course) { ... on Course { id name _id assignmentsConnection { nodes { _id name gradingStandard { id title data { baseValue letterGrade } } } } } } } Change-Id: I65c08791a30f45900e982dc4f5eae21a532cb8fe Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/328863 Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com> Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com> QA-Review: Caleb Guanzon <cguanzon@instructure.com> Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
This commit is contained in:
parent
ca2e9197b3
commit
281f5036a1
|
@ -467,6 +467,11 @@ module Types
|
||||||
SubmissionSearch.new(assignment, current_user, session, filter).search
|
SubmissionSearch.new(assignment, current_user, session, filter).search
|
||||||
end
|
end
|
||||||
|
|
||||||
|
field :grading_standard, GradingStandardType, null: true
|
||||||
|
def grading_standard
|
||||||
|
load_association(:grading_standard)
|
||||||
|
end
|
||||||
|
|
||||||
field :group_submissions_connection, SubmissionType.connection_type, null: true do
|
field :group_submissions_connection, SubmissionType.connection_type, null: true do
|
||||||
description "returns submissions grouped to one submission object per group"
|
description "returns submissions grouped to one submission object per group"
|
||||||
argument :filter, SubmissionSearchFilterInputType, required: false
|
argument :filter, SubmissionSearchFilterInputType, required: false
|
||||||
|
|
|
@ -307,6 +307,19 @@ describe Types::AssignmentType do
|
||||||
expect(assignment_type.resolve("allowedAttempts")).to eq 7
|
expect(assignment_type.resolve("allowedAttempts")).to eq 7
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "gradingStandard" do
|
||||||
|
it "returns the grading standard" do
|
||||||
|
grading_standard = course.grading_standards.create!(title: "Win/Lose", data: [["Winner", 0.94], ["Loser", 0]])
|
||||||
|
assignment.update(grading_type: "letter_grade", grading_standard_id: grading_standard.id)
|
||||||
|
assignment.save!
|
||||||
|
expect(assignment_type.resolve("gradingStandard { title }")).to eq grading_standard.title
|
||||||
|
end
|
||||||
|
|
||||||
|
it "returns null if no grading standard is set" do
|
||||||
|
expect(assignment_type.resolve("gradingStandard { title }")).to be_nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "submissionsConnection" do
|
describe "submissionsConnection" do
|
||||||
let_once(:other_student) { student_in_course(course:, active_all: true).user }
|
let_once(:other_student) { student_in_course(course:, active_all: true).user }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue