<commit_before>require 'csv'

class Teachers::ProgressReports::ActivitySessionsController < Teachers::ProgressReportsController
  PAGE_SIZE = 25;

  def index
    respond_to do |format|
      format.html
      format.csv do<commit_msg>CSV downloads are protected from nonpremium users<commit_after>require 'csv'

class Teachers::ProgressReports::ActivitySessionsController < Teachers::ProgressReportsController
  PAGE_SIZE = 25;

  def index
    respond_to do |format|
      format.html
      format.csv do
        unless current_user.is_premium?
          flash[:warning] = 'Downloadable reports are only available to Premium users.'
          return redirect_to premium_path
        end
{'fraction_non_alphanumeric': 0.06540697674418605, 'fraction_numerical': 0.005813953488372093, 'mean_word_length': 3.8865248226950353, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1567193', 'n_tokens_mistral': 194, 'n_tokens_neox': 179, 'n_words': 50}