don't include quizzes locked by date in epub export
test plan: * have a quiz set to be locked until a future date * a student should not be able to see the quiz content in a epub export closes #ADMIN-842 Change-Id: I323bc3df36b8078e88331a08a85abb7914c92efb Reviewed-on: https://gerrit.instructure.com/142958 Tested-by: Jenkins Reviewed-by: Mysti Sadler <mysti@instructure.com> QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com> Product-Review: James Williams <jamesw@instructure.com>
This commit is contained in:
parent
7535e17ccd
commit
c186393f10
|
@ -61,6 +61,7 @@ module CC
|
|||
|
||||
Quizzes::ScopedToUser.new(@course, @user, @course.quizzes.active).scope.each do |quiz|
|
||||
next unless export_object?(quiz) || export_object?(quiz.assignment)
|
||||
next if @user && !@course.grants_right?(@user, :read_as_admin) && quiz.locked_for?(@user, check_policies: true)
|
||||
|
||||
title = if quiz
|
||||
quiz.title
|
||||
|
|
|
@ -829,6 +829,14 @@ describe "ZipPackage" do
|
|||
}]
|
||||
end
|
||||
|
||||
it "should not export quizzes when locked by date" do
|
||||
quiz = @course.quizzes.create!(title: 'Quiz 1', description: "stuff",
|
||||
workflow_state: "available", unlock_at: 3.days.from_now)
|
||||
@module.content_tags.create!(content: quiz, context: @course, indent: 0)
|
||||
course_data = create_zip_package.parse_course_data
|
||||
expect(course_data[:quizzes]).to be_empty
|
||||
end
|
||||
|
||||
it "should export linked file items in sub-folders" do
|
||||
folder = @course.folders.create!(name: 'folder#1', parent_folder: Folder.root_folders(@course).first)
|
||||
file = add_file(fixture_file_upload('files/cn_image.jpg', 'image/jpg'), @course, "cn_image.jpg", folder)
|
||||
|
|
Loading…
Reference in New Issue