<commit_before>var React = require("lib").React;
var ReactDOM = require("lib").ReactDOM;

var _ = require("lib")._;
var Backbone = require("lib").Backbone;

var utils = require("utils");
var tags = require("tags.jsx");
var md = require("md");
var MarkdownAndPreview = require("markdown-and-preview.jsx");
MarkdownAndPreviewMixin = MarkdownAndPreview.MarkdownAndPreviewAttrs;
MarkdownDisplayMixin = MarkdownAndPreview.MarkdownDisplayMixin;
MarkdownDisplayComponent = MarkdownAndPreview.MarkdownDisplayComponent;

//var visualize = require("./../../matrixviz/js/api");
//var matrixMultiply = visualize.matrixMultiply;

var QuizList = require("./../../quiz/js/quiz-list.jsx");
var QuizFilterComponent = QuizList.QuizFilterComponent;
var QuizSnippetComponent = QuizList.QuizSnippetComponent;

var QuizCreator = require("./../../quiz/js/quiz-creator-view.jsx");
var QuizCreatorModalComponent = QuizCreator.QuizCreatorModalComponent;

var StudentQuizComponents = require("./../../quiz/js/quiz-student-view.jsx");

var SaveStatusMixin = require("save-status-component.jsx").SaveStatusMixin;
var RemoveItemComponent = require("remove-item-component.jsx").RemoveItemComponent;

var RemoveItemMixin = require("remove-item-component.jsx").RemoveItemMixin;

var CodeQuizSectionComponent = require("./../../code-quiz/js/creator.jsx").ConceptSectionComponent;
var StudentCodeQuizSectionComponent = require("./../../code-quiz/js/student.jsx").StudentCodeQuizSectionComponent;

var SectionRemoveItemComponent = React.createClass({
    
    mixins: [RemoveItemMixin],

    removeItem: function() {
        this.props.store.removeSectionAt(this.props.position);
    }

})

var SectionSaveStatusComponent = React.createClass({

    mixins: [SaveStatusMixin],

    CLASSNAME: "concept-save-status",

    componentDidMount: function() {
        this.props.store.on("change:isSaved", this.onSaveStatusChanged, this);
    },

    componentWillUnmount: function() {
        this.props.store.off("change:isSaved", this.onSaveStatusChanged);
    },

    onSaveStatusChanged: function(isSaved) {
        this.setIsSaved(isSaved);
    }

});


var SectionHeadingComponent = React.createClass({

    render: function() {
        
        return (
            <h4> {this.props.sectionName} </h4>  
        );
    }
});



//Since React doesn't support overriding mixin methods, 
// we're using underscore to perform the same task. 
var MarkdownComponentMixin = utils.inherit({

    getInitialState: function() {
        var section = this.props.store.getSectionAt(this.props.position);
        var input = section.data.input;
        return {
            input: input,
            display: md.mdAndMathToHtml(input)
        }
    },

    onContentUpdated: function(state) {
        var data = {
            input: state.input
        };
        this.props.store.saveSectionDataAt(data, this.props.position);
    }

}, MarkdownAndPreviewMixin);

var MarkdownComponent = React.createClass(MarkdownComponentMixin);

var MarkdownSectionComponent = React.createClass({

    render: function() {

        return (
            <div className="row concept-creator-section card">
                <SectionSaveStatusComponent store={this.props.store} />
                <SectionRemoveItemComponent position={this.props.position} store={this.props.store} />
                <SectionHeadingComponent sectionName="Markdown Section" />
                <MarkdownComponent position={this.props.position} store={this.props.store} />
            </div>
        );
    }
});

var GetSectionDataMixin = {

    getSectionData: function(store) {
        return store.getSectionDataAt(this.props.position);
    }
}

var StudentMarkdownSectionComponent = React.createClass({


    render: function() {
        var input = this.props.section.data.input;
        var display = md.mdAndMathToHtml(input);
        return (
            <div className="row concept-student-section">
                <MarkdownDisplayComponent display={display} />
            </div>
        );
    }
});


var VideoFrameComponent = React.createClass({

    render: function() {
        return (
            <iframe width="560" height="315" src={this.props.url} frameborder="0" allowfullscreen></iframe>
        );
    }

});

var StudentVideoSectionComponent = React.createClass({


    render: function() {
        var url = this.props.section.data.url;

        return (
            <div className="row concept-student-section">
                <VideoFrameComponent url={url} />
            </div>
        );
    }
});


var VideoSectionComponent = React.createClass({

    getInitialState: function() {
        return this.props.store.getSectionAt(this.props.position).data;
    },

    render: function() {

        var videoFrame;
        if(this.state.url) {
            videoFrame = <VideoFrameComponent url={this.state.url} />
        }
        else {
            videoFrame = <h5>Enter the embed URL to see your video</h5>
        }

        return (<commit_msg>Concept Student Page: Remove row class and add card class to markdown sections.<commit_after>var React = require("lib").React;
var ReactDOM = require("lib").ReactDOM;

var _ = require("lib")._;
var Backbone = require("lib").Backbone;

var utils = require("utils");
var tags = require("tags.jsx");
var md = require("md");
var MarkdownAndPreview = require("markdown-and-preview.jsx");
MarkdownAndPreviewMixin = MarkdownAndPreview.MarkdownAndPreviewAttrs;
MarkdownDisplayMixin = MarkdownAndPreview.MarkdownDisplayMixin;
MarkdownDisplayComponent = MarkdownAndPreview.MarkdownDisplayComponent;

//var visualize = require("./../../matrixviz/js/api");
//var matrixMultiply = visualize.matrixMultiply;

var QuizList = require("./../../quiz/js/quiz-list.jsx");
var QuizFilterComponent = QuizList.QuizFilterComponent;
var QuizSnippetComponent = QuizList.QuizSnippetComponent;

var QuizCreator = require("./../../quiz/js/quiz-creator-view.jsx");
var QuizCreatorModalComponent = QuizCreator.QuizCreatorModalComponent;

var StudentQuizComponents = require("./../../quiz/js/quiz-student-view.jsx");

var SaveStatusMixin = require("save-status-component.jsx").SaveStatusMixin;
var RemoveItemComponent = require("remove-item-component.jsx").RemoveItemComponent;

var RemoveItemMixin = require("remove-item-component.jsx").RemoveItemMixin;

var CodeQuizSectionComponent = require("./../../code-quiz/js/creator.jsx").ConceptSectionComponent;
var StudentCodeQuizSectionComponent = require("./../../code-quiz/js/student.jsx").StudentCodeQuizSectionComponent;

var SectionRemoveItemComponent = React.createClass({
    
    mixins: [RemoveItemMixin],

    removeItem: function() {
        this.props.store.removeSectionAt(this.props.position);
    }

})

var SectionSaveStatusComponent = React.createClass({

    mixins: [SaveStatusMixin],

    CLASSNAME: "concept-save-status",

    componentDidMount: function() {
        this.props.store.on("change:isSaved", this.onSaveStatusChanged, this);
    },

    componentWillUnmount: function() {
        this.props.store.off("change:isSaved", this.onSaveStatusChanged);
    },

    onSaveStatusChanged: function(isSaved) {
        this.setIsSaved(isSaved);
    }

});


var SectionHeadingComponent = React.createClass({

    render: function() {
        
        return (
            <h4> {this.props.sectionName} </h4>  
        );
    }
});



//Since React doesn't support overriding mixin methods, 
// we're using underscore to perform the same task. 
var MarkdownComponentMixin = utils.inherit({

    getInitialState: function() {
        var section = this.props.store.getSectionAt(this.props.position);
        var input = section.data.input;
        return {
            input: input,
            display: md.mdAndMathToHtml(input)
        }
    },

    onContentUpdated: function(state) {
        var data = {
            input: state.input
        };
        this.props.store.saveSectionDataAt(data, this.props.position);
    }

}, MarkdownAndPreviewMixin);

var MarkdownComponent = React.createClass(MarkdownComponentMixin);

var MarkdownSectionComponent = React.createClass({

    render: function() {

        return (
            <div className="row concept-creator-section card">
                <SectionSaveStatusComponent store={this.props.store} />
                <SectionRemoveItemComponent position={this.props.position} store={this.props.store} />
                <SectionHeadingComponent sectionName="Markdown Section" />
                <MarkdownComponent position={this.props.position} store={this.props.store} />
            </div>
        );
    }
});

var GetSectionDataMixin = {

    getSectionData: function(store) {
        return store.getSectionDataAt(this.props.position);
    }
}

var StudentMarkdownSectionComponent = React.createClass({


    render: function() {
        var input = this.props.section.data.input;
        var display = md.mdAndMathToHtml(input);
        return (
            <div className="concept-student-section card">
                <MarkdownDisplayComponent display={display} />
            </div>
        );
    }
});


var VideoFrameComponent = React.createClass({

    render: function() {
        return (
            <iframe width="560" height="315" src={this.props.url} frameborder="0" allowfullscreen></iframe>
        );
    }

});

var StudentVideoSectionComponent = React.createClass({


    render: function() {
        var url = this.props.section.data.url;

        return (
            <div className="concept-student-section card">
                <VideoFrameComponent url={url} />
            </div>
        );
    }
});


var VideoSectionComponent = React.createClass({

    getInitialState: function() {
        return this.props.store.getSectionAt(this.props.position).data;
    },

    render: function() {

        var videoFrame;
        if(this.state.url) {
            videoFrame = <VideoFrameComponent url={this.state.url} />
        }
        else {
            videoFrame = <h5>Enter the embed URL to see your video</h5>
        }

        return (
{'fraction_non_alphanumeric': 0.12753680859530442, 'fraction_numerical': 0.0021886191802626344, 'mean_word_length': 2.9829635499207607, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, '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': '5378297', 'n_tokens_mistral': 2952, 'n_tokens_neox': 2852, 'n_words': 504}