Code coverage report for src/components/performance-forecast/student.cjsx

Statements: 88.89% (16 / 18)      Branches: 100% (0 / 0)      Functions: 66.67% (4 / 6)      Lines: 88.89% (16 / 18)      Ignored: none     

All files » src/components/performance-forecast/ » student.cjsx
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91                                                           17×                                         17×         17×         17× 17× 17×                                    
var BS, ColorKey, Guide, InfoLink, PerformanceForecast, React, Router, _;
 
React = require('react');
 
BS = require('react-bootstrap');
 
Router = require('react-router');
 
_ = require('underscore');
 
PerformanceForecast = require('../../flux/performance-forecast');
 
Guide = require('./guide');
 
ColorKey = require('./color-key');
 
InfoLink = require('./info-link');
 
module.exports = React.createClass({
  displayName: 'PerformanceForecastStudentDisplay',
  contextTypes: {
    router: React.PropTypes.func
  },
  propTypes: {
    courseId: React.PropTypes.string.isRequired
  },
  onPractice: function(section) {
    return this.context.router.transitionTo('viewPractice', {
      courseId: this.props.courseId
    }, {
      page_ids: section.page_ids
    });
  },
  returnToDashboard: function() {
    return this.context.router.transitionTo('viewStudentDashboard', {
      courseId: this.props.courseId
    });
  },
  renderHeading: function() {
    return React.createElement("div", {
      "className": 'guide-heading'
    }, React.createElement("div", {
      "className": 'guide-group-title'
    }, "Performance Forecast ", React.createElement(InfoLink, {
      "type": 'student'
    })), React.createElement("div", {
      "className": 'info'
    }, React.createElement("div", {
      "className": 'guide-group-key'
    }, React.createElement("div", {
      "className": 'guide-practice-message'
    }, "Click on the bar to practice the topic"), React.createElement(ColorKey, null)), React.createElement(Router.Link, {
      "to": 'viewStudentDashboard',
      "className": 'btn btn-default back',
      "params": {
        courseId: this.props.courseId
      }
    }, "Return to Dashboard")));
  },
  renderEmptyMessage: function() {
    return React.createElement("div", {
      "className": "no-data-message"
    }, "You have not worked any questions yet.");
  },
  renderWeakerExplanation: function() {
    return React.createElement("div", {
      "className": 'explanation'
    }, React.createElement("p", null, "Tutor shows your weakest topics so you can practice to improve."), React.createElement("p", null, "Try to get all of your topics to green!"));
  },
  render: function() {
    var courseId;
    courseId = this.props.courseId;
    return React.createElement(BS.Panel, {
      "className": 'performance-forecast student'
    }, React.createElement(Guide, {
      "onPractice": this.onPractice,
      "courseId": courseId,
      "weakerTitle": "My Weaker Areas",
      "weakerExplanation": this.renderWeakerExplanation(),
      "weakerEmptyMessage": "You haven't worked enough problems for Tutor to predict your weakest topics.",
      "heading": this.renderHeading(),
      "sampleSizeThreshold": 3.,
      "emptyMessage": this.renderEmptyMessage(),
      "onReturn": this.returnToDashboard,
      "allSections": PerformanceForecast.Student.store.getAllSections(courseId),
      "chapters": (PerformanceForecast.Student.store.get(courseId).children)
    }));
  }
});