populate group and total "out of" labels on student grades page

Fixes: CNVS-36559

Test Plan:
1. As student, navigate to student grades page
  - Observe that assignment groups have "Out of" column populated
  - Observe that total "Out of" column is populated
2. As teacher, update course settings to disallow totals
3. As student, navigate to student grades page
  - Observe that assignment groups have no "Out of" value
  - Observe that total row is not visible

Change-Id: Ia55c67e63a7dc990e8be3349faa3e6afe8208340
Reviewed-on: https://gerrit.instructure.com/111726
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Matt Taylor <mtaylor@instructure.com>
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Christi Wruck
This commit is contained in:
Brian Park 2017-05-12 16:00:57 -07:00 committed by Keith T. Garner
parent f0a3595015
commit ac8a4c85da
4 changed files with 30 additions and 16 deletions

View File

@ -328,6 +328,7 @@ define([
const $row = $(subtotals[i].rowElementId);
$row.find('.grade').text(subtotals[i].gradeText);
$row.find('.score_teaser').text(subtotals[i].teaserText);
$row.find('.points_possible').text(subtotals[i].teaserText);
}
const finalScore = calculatedGrades[currentOrFinal].score;
@ -349,6 +350,7 @@ define([
const $finalGradeRow = $('.student_assignment.final_grade');
$finalGradeRow.find('.grade').text(finalGrade);
$finalGradeRow.find('.score_teaser').text(teaserText);
$finalGradeRow.find('.points_possible').text(scoreAsPoints);
if (groupWeightingScheme === 'percent') {
$finalGradeRow.find('.score_teaser').hide()
}

View File

@ -266,11 +266,11 @@
</div>
</div>
</td>
<td class="possible points_possible" <%= "colspan='2'".html_safe if assignment.special_class %>>
<td class="possible points_possible">
<%= n(round_if_whole(assignment.points_possible)) %>
</td>
<% if !assignment.special_class %>
<td class="details">
<% if !assignment.special_class %>
<a href="#"
class="toggle_final_grade_info tooltip"
aria-label="<%= t('This assignment does not count toward the final grade.') %>"
@ -396,8 +396,8 @@
</a>
</span>
<% end %>
</td>
<% end %>
</td>
</tr>
<%# always add row (even if empty) so javascript references work %>
<tr id="final_grade_info_<%= assignment.id %>"

View File

@ -42,6 +42,10 @@ class StudentGradesPage
f('#submission_final-grade .grade')
end
def final_points_possible
f('#submission_final-grade .points_possible')
end
def grading_period_dropdown
f('.grading_periods_selector')
end

View File

@ -33,18 +33,28 @@ describe "gradebook - logged in as a student" do
let(:student_grades_page) { StudentGradesPage.new }
it 'should display total grades as points', priority: "2", test_id: 164229 do
course_with_student_logged_in
@teacher = User.create!
@course.enroll_teacher(@teacher)
assignment = @course.assignments.build
assignment.publish
assignment.grade_student(@student, grade: 10, grader: @teacher)
@course.show_total_grade_as_points = true
@course.save!
describe 'total point displays' do
before(:each) do
course_with_student_logged_in
@teacher = User.create!
@course.enroll_teacher(@teacher)
assignment = @course.assignments.build(points_possible: 20)
assignment.publish
assignment.grade_student(@student, grade: 10, grader: @teacher)
assignment.assignment_group.update(group_weight: 1)
@course.show_total_grade_as_points = true
@course.save!
end
student_grades_page.visit_as_student(@course)
expect(student_grades_page.final_grade).to include_text("10")
it 'should display total grades as points', priority: "2", test_id: 164229 do
student_grades_page.visit_as_student(@course)
expect(student_grades_page.final_grade).to include_text("10")
end
it 'should display total "out of" point values' do
student_grades_page.visit_as_student(@course)
expect(student_grades_page.final_points_possible).to include_text("10.00 / 20.00")
end
end
context 'when testing grading periods' do
@ -86,5 +96,3 @@ describe "gradebook - logged in as a student" do
end
end
end