Skip to content

Commit 4581193

Browse files
committed
removed extra button to resume quiz
after a student starts a quiz, leaves it, and looks at the quiz again, the 'resume quiz' button on the right-side bar was removed. Test Plan: - As a student start a quiz and navigate away in the middle of the quiz. - Return to the individual quiz page and check if there is a button on the right side to resume the quiz *should test that the button is not on the right-side panel fixes CNVS-4453 Change-Id: I2947c90410fa6474d3cff6b658a8360cf5b8fa2a Reviewed-on: https://gerrit.instructure.com/20255 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com> QA-Review: Amber Taniuchi <amber@instructure.com> Product-Review: Stanley Stuart <stanley@instructure.com>
1 parent 808a959 commit 4581193

4 files changed

Lines changed: 39 additions & 15 deletions

File tree

app/views/quizzes/show.html.erb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,6 @@
5757
<div class="rs-margin-top">
5858
<% if @submission && @submission.completed? %>
5959
<%= render :partial => "quizzes/quiz_right_side", :locals => {:allow_take => !@locked} %>
60-
<% elsif @submission && @submission.untaken? %>
61-
<div>
62-
<% if !@quiz.locked? %>
63-
<%= @quiz.survey? ?
64-
t(:survey_in_progress, "You're in the middle of taking this survey.") :
65-
t(:quiz_in_progress, "You're in the middle of taking this quiz.") %><br/>
66-
<%= link_to_resume_poll(:class => "btn") %>
67-
<% end %>
68-
</div>
6960
<% end %>
7061
</div>
7162
<% end %>

spec/integration/quizzes_spec.rb

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,34 @@ def create_section_override(section, due_at)
171171
end
172172
end
173173

174+
context "show_student" do
175+
before :each do
176+
course_with_student_logged_in(:active_all => true)
177+
course_quiz true
178+
post "courses/#{@course.id}/quizzes/#{@quiz.id}/take?user_id=#{@student.id}"
179+
180+
get "courses/#{@course.id}/quizzes/#{@quiz.id}/take"
181+
end
182+
183+
context "Show Center resume button" do
184+
it "should show resume button in the center" do
185+
get "courses/#{@course.id}/quizzes/#{@quiz.id}"
186+
187+
doc = Nokogiri::HTML(response.body)
188+
doc.css("#not_right_side .take_quiz_button").text.should include "Resume Quiz"
189+
end
190+
end
191+
192+
context "Not show right_side resume button" do
193+
it "should not show resume button on right_side" do
194+
get "courses/#{@course.id}/quizzes/#{@quiz.id}"
195+
196+
doc = Nokogiri::HTML(response.body)
197+
doc.css("#right-side .rs-margin-top").text.should_not include "Resume Quiz"
198+
end
199+
end
200+
end
201+
174202
context "#history" do
175203
context "pending_review" do
176204
def mkquiz
@@ -236,4 +264,11 @@ def mksurvey
236264
end
237265
end
238266
end
267+
268+
def course_quiz(active=false)
269+
@quiz = @course.quizzes.create
270+
@quiz.workflow_state = "available" if active
271+
@quiz.save!
272+
@quiz
273+
end
239274
end

spec/selenium/quizzes_one_question_at_a_time_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def answers_flow
300300
submit_unfinished_quiz
301301
end
302302

303-
it "should warn about resuming from the right sidebar" do
303+
it "should warn about resuming" do
304304
take_the_quiz
305305

306306
it_should_show_cant_go_back_warning
@@ -313,7 +313,7 @@ def answers_flow
313313

314314
fj("a:contains('OQAAT quiz')").click
315315
wait_for_ajaximations
316-
fj("#right-side a:contains('Resume Quiz')").click
316+
fj("#not_right_side .take_quiz_button a:contains('Resume Quiz')").click
317317

318318
it_should_show_cant_go_back_warning
319319
accept_cant_go_back_warning

spec/selenium/student_quizzes_spec.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def validate_description_text(does_contain_text, text)
5454

5555
describe "on individual quiz page" do
5656
def validate_resume_button_text(text)
57-
f('#right-side .btn').text.should == text
57+
f('#not_right_side .take_quiz_button').text.should == text
5858
end
5959

6060
before do
@@ -77,9 +77,7 @@ def validate_resume_button_text(text)
7777
pending('193')
7878
update_quiz_lock(Time.now - 5.minutes, nil)
7979
get "/courses/#{@course.id}/quizzes/#{@quiz.id}"
80-
right_side = f('#right-side')
81-
right_side.should_not include_text("You're in the middle of taking this quiz.")
82-
right_side.should_not include_text(@resume_text)
80+
f('#not_right_side .take_quiz_button').should_not be_present
8381
end
8482
end
8583
end

0 commit comments

Comments
 (0)