<commit_before>React = require 'react'
BS = require 'react-bootstrap'
Router = require 'react-router'
_ = require 'underscore'

BindStoreMixin = require '../bind-store-mixin'
LearningGuide = require '../../flux/learning-guide'
{PerformanceStore} = require '../../flux/performance'

Guide = require './guide'

module.exports = React.createClass
  displayName: 'LearningGuideTeacherStudentDisplay'
  contextTypes:
    router: React.PropTypes.func

  propTypes:
    courseId: React.PropTypes.string.isRequired
    roleId:   React.PropTypes.string.isRequired

  onSelectStudent: (roleId) ->
    {courseId} = @props
    @context.router.transitionTo('viewStudentTeacherGuide', {courseId, roleId})

  renderHeading: ->
    students = PerformanceStore.getAllStudents(@props.courseId)
    selected = PerformanceStore.getStudent(@props.courseId, @props.roleId)
    return null unless selected
    emptyMessage = <h5>{selected.name} has not worked any questions yet.</h5>
    console.log(selected)
    <div className='guide-heading'>
      <div className='student-selection'>Current level of understanding for:
        <BS.DropdownButton bzSize='large' className='student-selection' title={selected.name}
          bsStyle='link' onSelect={@onSelectStudent}>
            { for student in _.sortBy(students, 'name') when student.role isnt selected.role
              <BS.MenuItem key={student.role} eventKey={student.role}>{student.name}</BS.MenuItem> }
        </BS.DropdownButton>
        {emptyMessage if selected.data.length is 0}
      </div>
      <Router.Link activeClassName='' to='viewPerformance'
        className='btn btn-default pull-right'
        params={courseId: @props.courseId}>
        Return to Performance Report
      </Router.Link>
    </div>

  returnToDashboard: ->
    @context.router.transitionTo('viewTeacherDashBoard', {courseId: @props.courseId})

  render: ->
    {courseId, roleId} = @props

    <BS.Panel className='learning-guide teacher-student'>
      <Guide
        courseId={courseId}
        heading={@renderHeading()}<commit_msg>removed console<commit_after>React = require 'react'
BS = require 'react-bootstrap'
Router = require 'react-router'
_ = require 'underscore'

BindStoreMixin = require '../bind-store-mixin'
LearningGuide = require '../../flux/learning-guide'
{PerformanceStore} = require '../../flux/performance'

Guide = require './guide'

module.exports = React.createClass
  displayName: 'LearningGuideTeacherStudentDisplay'
  contextTypes:
    router: React.PropTypes.func

  propTypes:
    courseId: React.PropTypes.string.isRequired
    roleId:   React.PropTypes.string.isRequired

  onSelectStudent: (roleId) ->
    {courseId} = @props
    @context.router.transitionTo('viewStudentTeacherGuide', {courseId, roleId})

  renderHeading: ->
    students = PerformanceStore.getAllStudents(@props.courseId)
    selected = PerformanceStore.getStudent(@props.courseId, @props.roleId)
    return null unless selected
    emptyMessage = <h5>{selected.name} has not worked any questions yet.</h5>
    <div className='guide-heading'>
      <div className='student-selection'>Current level of understanding for:
        <BS.DropdownButton bzSize='large' className='student-selection' title={selected.name}
          bsStyle='link' onSelect={@onSelectStudent}>
            { for student in _.sortBy(students, 'name') when student.role isnt selected.role
              <BS.MenuItem key={student.role} eventKey={student.role}>{student.name}</BS.MenuItem> }
        </BS.DropdownButton>
        {emptyMessage if selected.data.length is 0}
      </div>
      <Router.Link activeClassName='' to='viewPerformance'
        className='btn btn-default pull-right'
        params={courseId: @props.courseId}>
        Return to Performance Report
      </Router.Link>
    </div>

  returnToDashboard: ->
    @context.router.transitionTo('viewTeacherDashBoard', {courseId: @props.courseId})

  render: ->
    {courseId, roleId} = @props

    <BS.Panel className='learning-guide teacher-student'>
      <Guide
        courseId={courseId}
        heading={@renderHeading()}
{'fraction_non_alphanumeric': 0.12878787878787878, 'fraction_numerical': 0.001466275659824047, 'mean_word_length': 3.6938073394495414, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 37, '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': '2761759', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1165, 'n_words': 243}