fix score display on quiz moderation; fixes #4003
Also did a couple other tweaks: * Fixed the "Time" display when reloading via ajax (wasn't checking for the right workflow_state * Hide the "Attempts" column on quizzes that have an unlimited # of since it doesn't contain any useful data (always "--"). Change-Id: I21182193005d7415594b9c0531c03d619a31c262 Reviewed-on: https://gerrit.instructure.com/2857 Tested-by: Hudson <hudson@instructure.com> Reviewed-by: Brian Palmer <brianp@instructure.com>
This commit is contained in:
parent
bace2a985d
commit
1b1d607a9b
|
@ -429,7 +429,7 @@ class QuizzesController < ApplicationController
|
|||
@submissions = @quiz.quiz_submissions.updated_after(last_updated_at).for_user_ids(@students.map(&:id))
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json { render :json => @submissions.to_json(:include_root => false, :exclude => :submission_data, :methods => ['extendable?', :finished_in_words, :attempts_left]) }
|
||||
format.json { render :json => @submissions.to_json(:include_root => false, :except => [:submission_data, :quiz_data], :methods => ['extendable?', :finished_in_words, :attempts_left]) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
<th>Student</th>
|
||||
<th>Attempt</th>
|
||||
<th>Time</th>
|
||||
<th>Attempts<br/>Left</th>
|
||||
<th>Current<br/>Score</th>
|
||||
<th style="<%= hidden if @quiz.allowed_attempts < 0 %>">Attempts<br/>Left</th>
|
||||
<th>Score</th>
|
||||
<th style="text-align: right;">
|
||||
<a href="#" class="reload_link"><%= image_tag "ajax-reload.gif" %></a>
|
||||
</th>
|
||||
|
@ -57,7 +57,7 @@
|
|||
</span>
|
||||
<a href="#" class="extend_time_link no-hover"><%= image_tag "history.png", :alt => "Add Time" %></a>
|
||||
</td>
|
||||
<td class="attempts_left number">
|
||||
<td class="attempts_left number" style="<%= hidden if @quiz.allowed_attempts < 0 %>">
|
||||
<% if @quiz.allowed_attempts < 0 %>
|
||||
--
|
||||
<% elsif submission %>
|
||||
|
@ -67,7 +67,7 @@
|
|||
<% end %>
|
||||
</td>
|
||||
<td class="score_holder">
|
||||
<span class="score"><%= submission && submission.score %></span>
|
||||
<span class="score"><%= submission && submission.kept_score %></span>
|
||||
</td>
|
||||
<td class="links">
|
||||
<span class="unlocked" title="Manually Unlocked" style="<%= hidden unless submission && submission.manually_unlocked %>"><%= image_tag "unlock.png" %></span>
|
||||
|
|
|
@ -59,14 +59,14 @@ var moderation = {
|
|||
moderation.lastUpdatedAt = new Date(Math.max(Date.parse(submission.updated_at), moderation.lastUpdatedAt));
|
||||
}
|
||||
var state_text = "";
|
||||
if(submission.workflow_state == 'complete' || submission.workflow_state == 'needs_review') {
|
||||
if(submission.workflow_state == 'complete' || submission.workflow_state == 'pending_review') {
|
||||
state_text = "finished in " + submission.finished_in_words;
|
||||
}
|
||||
var data = {
|
||||
attempt: submission.attempt || '--',
|
||||
extra_time: submission.extra_time,
|
||||
extra_attempts: submission.extra_attempts,
|
||||
score: submission.score
|
||||
score: submission.kept_score
|
||||
};
|
||||
if(submission.attempts_left == -1) {
|
||||
data.attempts_left = '--';
|
||||
|
|
Loading…
Reference in New Issue