<commit_before># SUM(CASE WHEN acts.is_final_score = true THEN acts.id ELSE 0 END) AS act_id
class Scorebook::Query
  SCORES_PER_PAGE = 200

  def self.run(classroom_id, current_page=1, unit_id=nil, begin_date=nil, end_date=nil, offset=0)
    first_unit = self.units(unit_id) ? self.units(unit_id).first : nil
    last_unit = self.units(unit_id) ? self.units(unit_id).last : nil
    ActiveRecord::Base.connection.execute(
    "SELECT
       students.id AS user_id,
        cu.id AS cu_id,
        cuas.completed AS marked_complete,
        students.name AS name,
        activity.activity_classification_id,
        activity.name AS activity_name,
        activity.id AS activity_id,
        activity.description AS activity_description,
        MAX(acts.updated_at) AS updated_at,
        MIN(acts.started_at) AS started_at,
        MAX(acts.percentage) AS percentage,
        SUM(CASE WHEN acts.percentage IS NOT NULL THEN 1 ELSE 0 END) AS completed_attempts,
        SUM(CASE WHEN acts.state = 'started' THEN 1 ELSE 0 END) AS started,<commit_msg>change limit on scorebook query to 10000<commit_after># SUM(CASE WHEN acts.is_final_score = true THEN acts.id ELSE 0 END) AS act_id
class Scorebook::Query
  SCORES_PER_PAGE = 10000

  def self.run(classroom_id, current_page=1, unit_id=nil, begin_date=nil, end_date=nil, offset=0)
    first_unit = self.units(unit_id) ? self.units(unit_id).first : nil
    last_unit = self.units(unit_id) ? self.units(unit_id).last : nil
    ActiveRecord::Base.connection.execute(
    "SELECT
       students.id AS user_id,
        cu.id AS cu_id,
        cuas.completed AS marked_complete,
        students.name AS name,
        activity.activity_classification_id,
        activity.name AS activity_name,
        activity.id AS activity_id,
        activity.description AS activity_description,
        MAX(acts.updated_at) AS updated_at,
        MIN(acts.started_at) AS started_at,
        MAX(acts.percentage) AS percentage,
        SUM(CASE WHEN acts.percentage IS NOT NULL THEN 1 ELSE 0 END) AS completed_attempts,
        SUM(CASE WHEN acts.state = 'started' THEN 1 ELSE 0 END) AS started,
{'fraction_non_alphanumeric': 0.0846262341325811, 'fraction_numerical': 0.012693935119887164, 'mean_word_length': 3.298989898989899, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '927781', 'n_tokens_mistral': 719, 'n_tokens_neox': 663, 'n_words': 181}