Skip to content

Commit ee2ea38

Browse files
eschiebelJon Scheiding
authored andcommitted
Include quiz_type in the RCS quizzes api response
this will facilitate showing the correct icon in the RCE closes: MAT-954 flag=none test plan: - hit the RCS' /api/quizzes?contextType=course&contextId=:course_id api - or open the course links tray in the RCE and expand the quizzes panel in the tray > expect to see quiz_type in each quiz's entry in the response Change-Id: If6dbfa1da44bfc83b0707cf5d75c4981dc9b248c Reviewed-on: https://gerrit.instructure.com/c/canvas-rce-api/+/298825 Tested-by: Service Cloud Jenkins <[email protected]> Reviewed-by: Mysti Lilla <[email protected]> QA-Review: Mysti Lilla <[email protected]> Product-Review: Jon Scheiding <[email protected]>
1 parent 8374e81 commit ee2ea38

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

app/api/quizzes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ const canvasResponseHandler = linksResponseHandler((request, results) => {
2626
title: quiz.title,
2727
published: quiz.published,
2828
date,
29-
date_type: "due"
29+
date_type: "due",
30+
quiz_type: quiz.quiz_type
3031
};
3132
});
3233
});

test/service/api/quizzes.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ describe("Quizzes API", () => {
6464
published: true,
6565
all_dates: [{ due_at: "2019-04-22T13:00:00Z" }],
6666
due_at: "2019-04-22T13:00:00Z",
67+
quiz_type: "assignment",
6768
...overrides
6869
}
6970
]
@@ -108,5 +109,10 @@ describe("Quizzes API", () => {
108109
assert.equal(result.links[0].date, "multiple");
109110
assert.equal(result.links[0].date_type, "due");
110111
});
112+
113+
it("pulls the quiz_type from canvas' response", () => {
114+
const [result, canvasResponse] = setup();
115+
assert.equal(result.links[0].quiz_type, canvasResponse.body[0].quiz_type);
116+
});
111117
});
112118
});

0 commit comments

Comments
 (0)