diff --git a/app/coffeescripts/models/Quiz.coffee b/app/coffeescripts/models/Quiz.coffee
index 157bab31b1e..3767a143b20 100644
--- a/app/coffeescripts/models/Quiz.coffee
+++ b/app/coffeescripts/models/Quiz.coffee
@@ -65,10 +65,13 @@ define [
initPointsCount: ->
pts = @get 'points_possible'
text = ''
- if pts && pts > 0
+ if pts && pts > 0 && !@isUngradedSurvey()
text = I18n.t('assignment_points_possible', 'pt', count: pts)
@set 'possible_points_label', text
+ isUngradedSurvey: ->
+ @get('quiz_type') == "survey"
+
initAllDates: ->
if (allDates = @get('all_dates'))?
@set 'all_dates', new DateGroupCollection(allDates)
diff --git a/app/helpers/quizzes_helper.rb b/app/helpers/quizzes_helper.rb
index 9f015b087a5..746022790bb 100644
--- a/app/helpers/quizzes_helper.rb
+++ b/app/helpers/quizzes_helper.rb
@@ -672,4 +672,8 @@ module QuizzesHelper
end
end
+ def points_possible_display
+ @quiz.quiz_type == "survey" ? "" : @quiz.points_possible
+ end
+
end
diff --git a/app/views/quizzes/quizzes/_quiz_show_teacher.html.erb b/app/views/quizzes/quizzes/_quiz_show_teacher.html.erb
index 38e4d763e01..03649a8715d 100644
--- a/app/views/quizzes/quizzes/_quiz_show_teacher.html.erb
+++ b/app/views/quizzes/quizzes/_quiz_show_teacher.html.erb
@@ -18,7 +18,7 @@
<%= t(:points, "Points") %>
- <%= @quiz.points_possible %>
+ <%= points_possible_display %>
diff --git a/spec/coffeescripts/models/QuizSpec.coffee b/spec/coffeescripts/models/QuizSpec.coffee
index f841207ef2e..828e0dbf17b 100644
--- a/spec/coffeescripts/models/QuizSpec.coffee
+++ b/spec/coffeescripts/models/QuizSpec.coffee
@@ -85,6 +85,10 @@ define [
@quiz = new Quiz(points_possible: 2)
equal @quiz.get('possible_points_label'), "2 pts"
+ test "#initialize points possible to null if ungraded survey", ->
+ @quiz = new Quiz(points_possible: 5, quiz_type: "survey")
+ equal @quiz.get('possible_points_label'), ""
+
# Publishing
test '#publish saves to the server', ->
diff --git a/spec/views/quizzes/quizzes/show.html.erb_spec.rb b/spec/views/quizzes/quizzes/show.html.erb_spec.rb
index fe4ac4ba1ea..14b1b8826dd 100644
--- a/spec/views/quizzes/quizzes/show.html.erb_spec.rb
+++ b/spec/views/quizzes/quizzes/show.html.erb_spec.rb
@@ -88,5 +88,21 @@ describe "/quizzes/quizzes/show" do
expect(response).not_to have_tag ".unpublished_quiz_warning"
end
+ it "should hide points possible for ungraded surveys" do
+ points = 5
+
+ course_with_teacher_logged_in(active_all: true)
+ @quiz = @course.quizzes.create!(quiz_type: "survey", points_possible: points)
+
+ assigns[:quiz] = @quiz
+ view_context
+ render "quizzes/quizzes/show"
+
+ doc = Nokogiri::HTML(response)
+ doc.css(".control-group .controls .value").each do |node|
+ expect(node.content).not_to include("#{points}") if node.parent.parent.content.include? "Points"
+ end
+ end
+
end