<commit_before>var React = require('react-native');
var PercentageChart = require('./percentageChart');
var HistogramChart = require('./histogramChart');
var NavBar = require('./../../shared/navbar');
var Button = require('./../../shared/button');
// var api = require('../Utils/api');

var {
  View,
  Text,
  StyleSheet,
  Navigator,
  TouchableOpacity,
  Dimensions
} = React;

class FeedbackView extends React.Component {
  constructor(props) {
    super(props);

    var {height, width} = Dimensions.get('window');
    this.state = {
      classId: this.props.classId,
      lessonId: this.props.lessonId,
      feedbackOption: this.props.route.feedbackOption,
      height: height,
      width: width,
      socket: this.props.route.socket,
      studentThumbsData: {
        data: [],
        average: 0,
        lowest: 0,
        highest: 0
      },
      studentMultiChoiceData: {
        data: [],
        leader: 'N/A'
      }
    };

    this.state.socket.on('studentResponseForTeacher', (studentData) => {
      
      // MultiChoice case
      if(typeof studentData.answer === 'string') {
        var currentStudentMultiChoiceData = this.state.studentMultiChoiceData.data.slice();
        currentStudentMultiChoiceData.push(studentData.answer);
        
        var calculateLeader = (responses) => {
          var leader = [];

          responses.forEach(() => {<commit_msg>Fix issue where route was missing from state setter<commit_after>var React = require('react-native');
var PercentageChart = require('./percentageChart');
var HistogramChart = require('./histogramChart');
var NavBar = require('./../../shared/navbar');
var Button = require('./../../shared/button');
// var api = require('../Utils/api');

var {
  View,
  Text,
  StyleSheet,
  Navigator,
  TouchableOpacity,
  Dimensions
} = React;

class FeedbackView extends React.Component {
  constructor(props) {
    super(props);

    var {height, width} = Dimensions.get('window');
    this.state = {
      classId: this.props.route.classId,
      lessonId: this.props.route.lessonId,
      feedbackOption: this.props.route.feedbackOption,
      height: height,
      width: width,
      socket: this.props.route.socket,
      studentThumbsData: {
        data: [],
        average: 0,
        lowest: 0,
        highest: 0
      },
      studentMultiChoiceData: {
        data: [],
        leader: 'N/A'
      }
    };

    this.state.socket.on('studentResponseForTeacher', (studentData) => {
      
      // MultiChoice case
      if(typeof studentData.answer === 'string') {
        var currentStudentMultiChoiceData = this.state.studentMultiChoiceData.data.slice();
        currentStudentMultiChoiceData.push(studentData.answer);
        
        var calculateLeader = (responses) => {
          var leader = [];

          responses.forEach(() => {
{'fraction_non_alphanumeric': 0.14124293785310735, 'fraction_numerical': 0.00211864406779661, 'mean_word_length': 2.608917197452229, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6100454', 'n_tokens_mistral': 826, 'n_tokens_neox': 807, 'n_words': 164}