<commit_before>class SubjectsController < ApplicationController
  before_action :set_subject, only: [:show, :edit, :update, :destroy]

  # GET /subjects
  # GET /subjects.json
  def index
    @subjects = Subject.all
  end

  # GET /subjects/1
  # GET /subjects/1.json
  def show
    @questions = [1,2]
  end<commit_msg>questions object for view is functional, but test needs to be refactored because seed is repeating<commit_after>class SubjectsController < ApplicationController
  before_action :set_subject, only: [:show, :edit, :update, :destroy]

  # GET /subjects
  # GET /subjects.json
  def index
    @subjects = Subject.all
  end

  # GET /subjects/1
  # GET /subjects/1.json
  def show
    #public_safety_question = Question.find_by_short_name("public_safety")
    #prop_value_question = Question.find_by_short_name("property_values")
    @questions_raw = Question.where(:short_name => ["public_safety", "property_values"])
    @questions = Array.new
    @questions_raw.each do |q|
      @questions << OpenStruct.new(:voice_text => q.voice_text , :short_name => q.short_name, :average_priority => Kernel.rand*5)
    end
  end
{'fraction_non_alphanumeric': 0.11022927689594356, 'fraction_numerical': 0.006172839506172839, 'mean_word_length': 4.135746606334842, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1067012', 'n_tokens_mistral': 382, 'n_tokens_neox': 364, 'n_words': 89}