Skip to content

Commit 87beaac

Browse files
committed
fix 'let students take this quiz now' so that it correctly unlocks the quiz
when unlocking a quiz (with no time limit or for a specified period), the quiz will now unlock correctly, and the students will be able to take it. fixes CNVS-11727 test plan: - Create a quiz. Set a due date, but no "from" or "until" date. - Save and publish the quiz. - Lock the quiz; note that the date/time at which you lock it now appears in the "until" field. - Unlock the quiz with "No time limit". Note that the current date/time appears in the "Available from" cell, and the "Until" date has been cleared out. - Verify that you are able to take the quiz as a student, and note that there is no specified end date for the quiz. - Lock the quiz again, then unlock the quiz with a time limit (choose any date). Note that the current date appears in the "Available from" cell, and the specified end date appears in the "Until" cell. - Verify that you are able to take the quiz as a student, and note that there is a specified end date for the quiz. Change-Id: I94ed3e26b7c91e84728c27e58c0e130444ef95a2 Reviewed-on: https://gerrit.instructure.com/42016 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Derek DeVries <ddevries@instructure.com> QA-Review: Trevor deHaan <tdehaan@instructure.com> Product-Review: Spencer Olson <solson@instructure.com>
1 parent 84bfbd6 commit 87beaac

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

app/views/quizzes/quizzes/show.html.erb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
</li>
137137
<a href="<%= context_url(@context, :context_rubrics_url) %>" class="icon-rubric" id="add_rubric_url" style="display:none">&nbsp;</a>
138138
<% end %>
139-
139+
140140
<% if can_do(@quiz, @current_user, :update) && !needs_unpublished_warning? %>
141141
<li role="presentation">
142142
<a href="<%= course_quiz_take_path(@context, @quiz, preview: 1) %>" class="preview_link" data-method="post" tabindex="-1" role="menuitem">
@@ -145,10 +145,10 @@
145145
</a>
146146
</li>
147147
<% end %>
148-
148+
149149
<% if can_do(@quiz, @current_user, :update) %>
150150
<% if @quiz.locked? %>
151-
<%= form_for @quiz, :url => context_url(@context, :context_quiz_url, @quiz.id), :html => { :id => 'quiz_unlock_form' } do |f| %>
151+
<%= form_for @quiz, as: :quiz, method: :put, :url => context_url(@context, :context_quiz_url, @quiz.id), :html => { :id => 'quiz_unlock_form' } do |f| %>
152152
<%= hidden_field_tag 'quiz[locked]', false %>
153153
<div id="unlock_for_how_long_dialog" title="<%= t('titles.unlock_for_how_long', "How long would you like to unlock the quiz for?") %>" style="display:none;">
154154
<label style="float: left;" for="no_time_limit">
@@ -169,7 +169,7 @@
169169
</a>
170170
</li>
171171
<% else %>
172-
<%= form_for @quiz, :url => context_url(@context, :context_quiz_url, @quiz.id), :html => { :id => 'quiz_lock_form' } do |f| %>
172+
<%= form_for @quiz, as: :quiz, method: :put, :url => context_url(@context, :context_quiz_url, @quiz.id), :html => { :id => 'quiz_lock_form' } do |f| %>
173173
<%= hidden_field_tag 'quiz[locked]', true %>
174174
<% end %>
175175
<% qos_lock_quiz_title = @quiz.survey? ? t('buttons.lock_survey', "Lock this Survey Now") : t('buttons.lock_quiz', "Lock this Quiz Now") %>
@@ -180,13 +180,13 @@
180180
</li>
181181
<% end %>
182182
<% end %>
183-
183+
184184
<% if (can_do(@quiz, @current_user, :grade) || can_do(@quiz, @current_user, :review_grades)) && @quiz.available? %>
185185
<li role="presentation">
186186
<a href="#" class="quiz_details_link" tabindex="-1" role="menuitem">
187187
<% if @any_submissions_pending_review %>
188188
<i class="icon-warning" aria-label="<%= t("labels.warning_icon", "Warning") %>"></i>
189-
189+
190190
<% end %>
191191
<i class="icon-group"></i>
192192
<span id="quiz_details_text">
@@ -196,7 +196,7 @@
196196
</a>
197197
</li>
198198
<% end %>
199-
199+
200200
<% if can_do(@quiz, @current_user, :grade) && can_do(@context, @current_user, :send_messages) && @quiz.available? && !@quiz.anonymous_submissions? && @quiz.graded? %>
201201
<% message_students_who_title = t('links.message_students_who', "Message Students Who...") %>
202202
<li role="presentation">
@@ -205,7 +205,7 @@
205205
</a>
206206
</li>
207207
<% end %>
208-
208+
209209
<li role="presentation">
210210
<a href="<%= context_url(@context, :context_quiz_url, @quiz) %>" class="delete_quiz_link" tabindex="-1" role="menuitem">
211211
<i class="icon-trash"><span class="screenreader-only"><%= admin_delete_title %></span></i> <%= admin_delete_title %>
@@ -355,7 +355,7 @@
355355

356356
<% if can_do(@quiz, @current_user, :update) %>
357357
<% if @quiz.locked? %>
358-
<%= form_for @quiz, :url => context_url(@context, :context_quiz_url, @quiz.id), :html => { :id => 'quiz_unlock_form' } do |f| %>
358+
<%= form_for @quiz, as: :quiz, method: :put, :url => context_url(@context, :context_quiz_url, @quiz.id), :html => { :id => 'quiz_unlock_form' } do |f| %>
359359
<%= hidden_field_tag 'quiz[locked]', false %>
360360
<div id="unlock_for_how_long_dialog" title="<%= t('titles.unlock_for_how_long', "How long would you like to unlock the quiz for?") %>" style="display:none;">
361361
<label style="float: left;" for="no_time_limit">
@@ -376,7 +376,7 @@
376376
</a>
377377
</li>
378378
<% else %>
379-
<%= form_for @quiz, :url => context_url(@context, :context_quiz_url, @quiz.id), :html => { :id => 'quiz_lock_form' } do |f| %>
379+
<%= form_for @quiz, as: :quiz, method: :put, :url => context_url(@context, :context_quiz_url, @quiz.id), :html => { :id => 'quiz_lock_form' } do |f| %>
380380
<%= hidden_field_tag 'quiz[locked]', true %>
381381
<% end %>
382382
<% qos_lock_quiz_title = @quiz.survey? ? t('buttons.lock_survey', "Lock this Survey Now") : t('buttons.lock_quiz', "Lock this Quiz Now") %>

0 commit comments

Comments
 (0)