<commit_before>EC.TopicsStudentsProgressReport = React.createClass({
  propTypes: {
    sourceUrl: React.PropTypes.string.isRequired
  },

  getInitialState: function() {
    // topic state is used to customize the column definitions.
    return {
      topic: {}
    }
  },

  columnDefinitions: function() {
    // Derive column names from this.state.topic
    return [
      {
        name: this.state.topic.topic_name,
        field: 'name',
        sortByField: 'name'
      },
      {
        name: this.state.topic.total_activity_session_count + ' Activities',
        field: 'activity_session_count',
        sortByField: 'activity_session_count'
      },
      {
        name: this.state.topic.proficient_count + ' Proficient',
        field: 'proficient_count',
        sortByField: 'proficient_count'
      },
      {
        name: this.state.topic.not_proficient_count + ' Not Proficient',
        field: 'not_proficient_count',
        sortByField: 'not_proficient_count'
      }<commit_msg>Add total_time_spent to topics students report<commit_after>EC.TopicsStudentsProgressReport = React.createClass({
  propTypes: {
    sourceUrl: React.PropTypes.string.isRequired
  },

  getInitialState: function() {
    // topic state is used to customize the column definitions.
    return {
      topic: {}
    }
  },

  displayTimeSpent: function(timeInSeconds) {
    if (timeInSeconds === null) {
      return '—';
    } else {
      return Math.ceil(timeInSeconds / 60) + ' minutes';
    }
  },

  columnDefinitions: function() {
    // Derive column names from this.state.topic
    return [
      {
        name: this.state.topic.topic_name,
        field: 'name',
        sortByField: 'name'
      },
      {
        name: this.state.topic.total_activity_session_count + ' Activities',
        field: 'activity_session_count',
        sortByField: 'activity_session_count'
      },
      {
        name: this.state.topic.proficient_count + ' Proficient',
        field: 'proficient_count',
        sortByField: 'proficient_count'
      },
      {
        name: this.state.topic.not_proficient_count + ' Not Proficient',
        field: 'not_proficient_count',
        sortByField: 'not_proficient_count'
      },
      {
        name: this.displayTimeSpent(this.state.topic.total_time_spent),
        field: 'total_time_spent',
        sortByField: 'total_time_spent',
        customCell: _.bind(function(row) {
          return this.displayTimeSpent(row['total_time_spent']);
        }, this)
      }
{'fraction_non_alphanumeric': 0.11031461569095978, 'fraction_numerical': 0.0007964954201513341, 'mean_word_length': 2.488888888888889, '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': '1922901', 'n_tokens_mistral': 766, 'n_tokens_neox': 749, 'n_words': 136}