remove old always-on features

closes #CNVS-27699

Change-Id: I5af3d9915fef4189204283ca87cafc540ed3eed4
Reviewed-on: https://gerrit.instructure.com/73566
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
This commit is contained in:
James Williams 2016-03-02 13:52:41 -07:00
parent 71245b86a5
commit 84f0e8d9f7
11 changed files with 2 additions and 440 deletions

View File

@ -57,11 +57,6 @@ define [
# default if the <video height> is not specified
defaultVideoHeight: VIDEO_HEIGHT
unless INST.enableHtml5FirstVideos
# prefer flash player, as it works more consistently
# for now, but allow fallback to html5 (like on mobile)
mejs.MepDefaults.mode = 'auto_plugin'
mejs.MepDefaults.success = (mediaElement, domObject) ->
kalturaAnalytics(this.mediaCommentId, mediaElement, INST.kalturaSettings)
mediaElement.play()

View File

@ -504,46 +504,6 @@ class Quizzes::QuizzesController < ApplicationController
# student_analysis report
def statistics
if @context.feature_enabled?(:quiz_stats)
return statistics_cqs
end
if authorized_action(@quiz, @current_user, :read_statistics)
respond_to do |format|
format.html {
all_versions = params[:all_versions] == '1'
add_crumb(@quiz.title, named_context_url(@context, :context_quiz_url, @quiz))
add_crumb(t(:statistics_crumb, "Statistics"), named_context_url(@context, :context_quiz_statistics_url, @quiz))
if !@context.large_roster?
@statistics = @quiz.statistics(all_versions)
user_ids = @statistics[:submission_user_ids]
@submitted_users = User.where(:id => user_ids.to_a).order_by_sortable_name
#include logged out users
@submitted_users += @statistics[:submission_logged_out_users]
@users = Hash[
@submitted_users.map { |u| [u.id, u] }
]
end
js_env quiz_reports: Quizzes::QuizStatistics::REPORTS.map { |report_type|
report = @quiz.current_statistics_for(report_type, {
includes_all_versions: all_versions
})
Quizzes::QuizReportSerializer.new(report, {
controller: self,
scope: @current_user,
root: false,
includes: %w[ file progress ]
}).as_json
}
}
end
end
end
def statistics_cqs
if authorized_action(@quiz, @current_user, :read_statistics)
respond_to do |format|
format.html {

View File

@ -452,7 +452,6 @@ module ApplicationHelper
:disableScribdPreviews => !feature_enabled?(:scribd),
:disableCrocodocPreviews => !feature_enabled?(:crocodoc),
:enableScribdHtml5 => feature_enabled?(:scribd_html5),
:enableHtml5FirstVideos => @domain_root_account.feature_enabled?(:html5_first_videos),
:logPageViews => !@body_class_no_headers,
:maxVisibleEditorButtons => 3,
:editorButtons => editor_buttons,

View File

@ -1494,7 +1494,6 @@ class Attachment < ActiveRecord::Base
def set_publish_state_for_usage_rights
if self.context &&
self.context.respond_to?(:feature_enabled?) &&
self.context.feature_enabled?(:better_file_browsing) &&
self.context.feature_enabled?(:usage_rights_required)
self.locked = self.usage_rights.nil?
end

View File

@ -865,7 +865,7 @@ class Message < ActiveRecord::Base
Canvas::Twilio.deliver(
to,
body,
from_recipient_country: user.account.feature_enabled?(:international_sms_from_recipient_country)
from_recipient_country: true
)
end
rescue StandardError => e

View File

@ -1,6 +1,6 @@
<% content_for :page_title do %><%= join_title t(:page_title, 'Course Groups'), @context.name %><% end %>
<% if !@context.is_a?(Account) && @context.root_account.feature_enabled?(:student_groups_next) %>
<% if !@context.is_a?(Account) %>
<% js_env :course_id => @context.id %>
<% js_env :STUDENT_CAN_ORGANIZE_GROUPS_FOR_COURSE => @context.respond_to?(:allow_student_organized_groups) && @context.allow_student_organized_groups && can_do(@context.groups.temp_record, @current_user, :create) %>
<% js_bundle :react_groups %>

View File

@ -1,243 +0,0 @@
<% content_for :page_title, join_title(@quiz.title, t(:page_title, "Statistics")) %>
<% js_bundle :quiz_statistics %>
<% content_for :stylesheets do %>
<style>
#statistics {
width: 100%;
border-collapse: collapse;
}
#statistics table {
border-collapse: collapse;
}
#statistics td {
vertical-align: top;
}
#statistics table.results td {
text-align: center;
font-size: 0.7em;
padding: 2px 5px;
}
#statistics td.multi_row {
border-bottom: 1px dotted #ccc;
}
tr.group td {
font-size: 1.1em;
font-weight: bold;
}
tr.question td.question_name, tr.group td.group_name {
min-width: 30%;
padding-left: 10px;
padding-right: 20px;
}
tr.question.group_row td.question_name {
padding-left: 30px;
}
tr.question td.question_name .question_name {
font-weight: bold;
}
tr.question td.question_name .question_attempts {
font-size: 0.8em;
margin-left: 10px;
}
tr.question td.question_name .question_text {
font-size: 0.8em;
margin-left: 10px;
}
tr.question td.question_name .question_details {
font-size: 0.8em;
padding-left: 10px;
}
tr.question td .number_answer.correct_answer {
color: #5CA93D;
}
#statistics .response {
min-width: 50px;
}
#statistics .response_bar {
margin: 100px 5px 0;
width: auto;
border: 1px solid #999;
background: #bbb;
height: 0px;
}
#statistics .correct_answer {
font-weight: bold;
}
#statistics .correct_answer .response_bar {
border-color: #5CA93D;
background: #8EC778;
}
#statistics tr.spacer td {
border-top: 1px solid #ddd;
}
#statistics tr.group {
border-top: 1px solid #ddd;
}
#statistics tr.group_bottom {
border-top: 1px solid #ddd;
}
#statistics tr.group_row td {
background: #f6f6f6;
}
#statistics tr.spacer.group_row td {
border-top: 0px solid #ddd;
}
#statistics_summary {
border-collapse: collapse;
}
#statistics_summary th {
text-align: left;
font-size: 1.2em;
}
#statistics_summary td {
border-bottom: 1px dotted #ccc;
padding: 2px 5px;
}
#statistics .answer {
cursor: pointer;
}
#statistics .number_answer {
cursor: pointer;
}
#statistics .calculated_data {
padding: 5px 0;
}
#statistics .calculated_data .attempts {
font-size: 0.8em;
}
#statistics .essay_answers {
max-height: 150px;
overflow: auto;
}
#statistics .essay_answer {
padding: 5px;
border-bottom: 1px dotted #ccc;
max-height: 2.7em;
overflow: hidden;
cursor: pointer;
text-align: left;
}
#statistics .essay_answer.expanded {
max-height: 100px;
cursor: inherit;
overflow: auto;
}
</style>
<% end %>
<% content_for :right_side do %>
<% if !@context.large_roster? %>
<h2><%= @quiz.survey? ?
t('headers.users_have_taken_this_survey', "%{count} users have taken this survey", :count => @statistics[:unique_submission_count]) :
t('headers.users_have_taken_this_quiz', "%{count} users have taken this quiz", :count => @statistics[:unique_submission_count]) %></h2>
<div class="rs-margin-lr rs-margin-bottom">
<table id="statistics_summary">
<tr>
<td><%= before_label(:average_time, "Average Time") %></td>
<td><%= time_ago_in_words(Time.now + @statistics[:submission_duration_average]) %></td>
</tr>
<% if @quiz.graded? %>
<tr>
<td><%= before_label(:average_correct, "Average Correct") %></td>
<td><%= render_score(@statistics[:submission_correct_count_average]) %></td>
</tr><tr>
<td><%= before_label(:average_incorrect, "Average Incorrect") %></td>
<td><%= render_score(@statistics[:submission_incorrect_count_average]) %></td>
</tr><tr>
<td><%= before_label(:high_score, "High Score") %></td>
<td><%= render_score(@statistics[:submission_score_high]) %></td>
</tr><tr>
<td><%= before_label(:low_score, "Low Score") %></td>
<td><%= render_score(@statistics[:submission_score_low]) %></td>
</tr><tr>
<td><%= before_label(:mean_score, "Mean Score") %></td>
<td><%= render_score(@statistics[:submission_score_average]) %></td>
</tr><tr>
<td><%= before_label(:standard_deviation, "Standard Deviation") %></td>
<td><%= render_score(@statistics[:submission_score_stdev]) %></td>
</tr>
<% end %>
</table>
</div>
<% end %>
<div class="rs-margin-lr">
<% if params[:all_versions] %>
<% if (@statistics && @statistics[:multiple_attempts_exist]) || @context.large_roster? %>
<%= @quiz.survey? ?
t(:survey_all_version_disclaimer, "This report is showing survey statistics based on all attempts for all users.") :
t(:quiz_all_version_disclaimer, "This report is showing quiz statistics based on all attempts for all users.") %><br/>
<% end %>
<div style="margin-top: 5px;">
<% if (@statistics && @statistics[:multiple_attempts_exist]) || @context.large_roster? %>
<a href="<%= context_url(@context, :context_quiz_statistics_url, @quiz.id) %>" class="btn button-sidebar-wide"><%= t('links.count_only_latest_attempts', "Count Only Each Latest Attempt") %></a>
<% end %>
</div>
<% else %>
<% if (@statistics && @statistics[:multiple_attempts_exist]) || @context.large_roster? %>
<%= @quiz.survey? ?
t(:survey_latest_version_disclaimer, "This report is showing survey statistics based on the latest attempt for each user.") :
t(:quiz_latest_version_disclaimer, "This report is showing quiz statistics based on the latest attempt for each user.") %><br/>
<% end %>
<div style="margin-top: 5px;">
<% if (@statistics && @statistics[:multiple_attempts_exist]) || @context.large_roster? %>
<a href="<%= context_url(@context, :context_quiz_statistics_url, @quiz.id, :all_versions => '1') %>" class="btn button-sidebar-wide"><%= mt('links.count_all_attempts', "Count **All** Attempts") %></a>
<% end %>
</div>
<% end %>
<div class="quiz-reports"></div>
</div>
<% end %>
<% if !@context.large_roster? %>
<h1><%= @quiz.survey? ? t('headers.survey_statistics', "Survey Statistics") : t('headers.quiz_statistics', "Quiz Statistics") %></h1>
<table id="statistics">
<% @statistics[:questions].each do |question_type, data| %>
<% if question_type == 'group' %>
<tr class="group group_row">
<td colspan="3" class="group_name"><%= data[:name] %></td>
</tr>
<% data[:questions].each do |question_type, question| %>
<%= render :partial => 'question_statistic', :object => question, :locals => {:in_group => true, :ignore_correct_answers => @quiz.survey?} %>
<% end %>
<tr class="group_bottom">
<td colspan="3">&nbsp;</td>
</tr>
<% else %>
<%= render :partial => 'question_statistic', :object => data, :locals => {:ignore_correct_answers => @quiz.survey?} %>
<% end %>
<% end %>
</table>
<div id="submitted_users" style="display: none;">
<%
# A submitted user can either be:
# 1. User Model
# 2. TemporaryUser Struct
# (defined in models/quiz_statistics/student_analysis.rb at the top around line 4)
# Temporary Users are ones that are not logged in and ergo don't have a user id.
# The id below is a temporary_user_code
%>
<% @submitted_users.each_with_index do |user, idx| %>
<div class="user user_<%= user.id %>">
<% if @quiz.survey? && @quiz.anonymous_submissions %>
<%= t(:student_n, "Student %{student_counter}", :student_counter => idx + 1) %>
<% else %>
<%= user.short_name %>
<% end %>
</div>
<% end %>
</div>
<div id="submitted_users_dialog" style="display: none;">
<h2><%= t('headers.for_question', "For %{question_name}", :question_name => raw('<span class="question_name" style="font-style: italic;">&nbsp;</span>')) %></h2>
<div><%= before_label(:users_selected_the_answer, "The following users selected the answer, %{answer_text}", :answer_text => raw('<span class="answer_text" style="font-style: italic;">&nbsp;</span>')) %></div>
<ul class="users">
<li class="user blank" style="display: none;">
<a href="#" class="name user">&nbsp;</a>
<span class="name uncounted">&nbsp;</span>
</li>
</ul>
</div>
<% else %>
<p><%= t(:class_too_large, "This course is too large to display statistics. They can still be downloaded from the right hand sidebar.") %></p>
<% end %>

View File

@ -140,17 +140,6 @@ END
root_opt_in: true,
beta: true
},
'html5_first_videos' =>
{
display_name: -> { I18n.t('features.html5_first_videos', 'Prefer HTML5 for video playback') },
description: -> { I18n.t('html5_first_videos_description', <<-END) },
By default, Canvas will try to use Flash first to play videos. Turn this on to try using HTML5 first,
then fall back to Flash.
END
applies_to: 'RootAccount',
state: 'on',
beta: false
},
'high_contrast' =>
{
display_name: -> { I18n.t('features.high_contrast', 'High Contrast UI') },
@ -223,28 +212,6 @@ END
root_opt_in: true,
beta: true
},
'student_groups_next' =>
{
display_name: -> { I18n.t('features.student_groups', 'New Student Groups Page') },
description: -> { I18n.t('student_groups_desc', <<-END) },
This enables the new student group page for an account. The new page was build to provide a more dynamic group signup
experience.
END
applies_to: 'RootAccount',
state: 'on'
},
'better_file_browsing' =>
{
display_name: -> { I18n.t('features.better_file_browsing', 'Better File Browsing') },
description: -> { I18n.t('better_file_browsing_description', <<-END) },
A new, simpler, more user friendly file browsing interface. If you turn this on at the course level,
then all of the users in that course will see the new interface. To get it to show up when someone
goes to the personal files page for a user ('/files') then you need to turn it on for the account they are a member of.
END
applies_to: 'Course',
state: 'on'
},
'allow_opt_out_of_inbox' =>
{
display_name: -> { I18n.t('features.allow_opt_out_of_inbox', "Allow Users to Opt-out of the Inbox") },
@ -389,13 +356,6 @@ END
state: 'hidden',
root_opt_in: true
},
'international_sms_from_recipient_country' => {
display_name: -> { I18n.t("International SMS - Send from Recipient's Country") },
description: -> { I18n.t("Sends international text messages from a phone number in the recipient's country, if possible.") },
applies_to: 'RootAccount',
state: 'on',
root_opt_in: true
},
'all_grading_periods_totals' =>
{
display_name: -> { I18n.t('Display Totals for "All Grading Periods"') },

View File

@ -1,11 +0,0 @@
Feature.register('quiz_stats' => {
display_name: -> {
I18n.t('features.new_quiz_statistics', 'New Quiz Statistics Page')
},
description: -> {
I18n.t 'new_quiz_statistics_desc',
'Enable the new quiz statistics page for a course.'
},
applies_to: 'Course',
state: 'on'
})

View File

@ -4,11 +4,6 @@ describe "canvas_quizzes" do
include_context "in-process server selenium tests"
before do
Account.default.tap do |account|
account.enable_feature! :quiz_stats
account.save!
end
quiz_with_graded_submission([
{:question_data => {:name => 'question 1', :points_possible => 1, 'question_type' => 'true_false_question'}},
{:question_data => {:name => 'question 2', :points_possible => 1, 'question_type' => 'true_false_question'}}

View File

@ -1,92 +0,0 @@
#
# Copyright (C) 2011 Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../views_helper')
describe "/quizzes/quizzes/statistics" do
it "should render with non-nil submission statistics" do
course_with_student
view_context
assigns[:quiz] = q = @course.quizzes.create!(:quiz_type => 'assignment').tap{|q| expect(q).to be_graded }
assigns[:submitted_users] = []
assigns[:statistics] = { :submission_score_high => 20,
:submission_count => 3,
:submission_score_low => 15,
:multiple_attempts_included => true,
:last_submission_at => Time.now.utc,
:submission_duration_average => 0,
:submission_score_stdev => 2.05480466765634,
:submission_user_ids => [4, 3, 2],
:questions => [],
:submission_correct_count_average => 3,
:submission_incorrect_count_average => 2,
:submission_score_average => 17.3333333333333,
:unique_submission_count => 3}
render "quizzes/quizzes/statistics"
expect(response).not_to be_nil
expect(content_for(:right_side)).not_to be_nil
kv = {}
page = Nokogiri::HTML(content_for(:right_side))
page.css('#statistics_summary').first.children.each do |row|
next if row.name != 'tr'
row = row.children.find_all{|col| col.name == 'td'}
next if row.size != 2
kv[row[0].text] = row[1].text
end
expect(kv).to eq({
"Low Score:" => "15",
"Average Time:" => "less than a minute",
"Average Incorrect:" => "2",
"Standard Deviation:" => "2.05",
"High Score:" => "20",
"Mean Score:" => "17.33",
"Average Correct:" => "3"
})
end
it "should render with nil submission statistics" do
course_with_student
view_context
assigns[:quiz] = @course.quizzes.create!
assigns[:statistics] = { :submission_duration_average => 0,
:questions => [] }
assigns[:submitted_users] = []
render "quizzes/quizzes/statistics"
expect(response).not_to be_nil
expect(content_for(:right_side)).not_to be_nil
kv = {}
page = Nokogiri::HTML(content_for(:right_side))
page.css('#statistics_summary').first.children.each do |row|
next if row.name != 'tr'
row = row.children.find_all{|col| col.name == 'td'}
next if row.size != 2
kv[row[0].text] = row[1].text
end
expect(kv).to eq({
"Low Score:" => "_",
"Average Time:" => "less than a minute",
"Average Incorrect:" => "_",
"Standard Deviation:" => "_",
"High Score:" => "_",
"Mean Score:" => "_",
"Average Correct:" => "_"
})
end
end