<commit_before>React                   = require 'react'
SubjectSetViewer        = require '../subject-set-viewer'
coreTools               = require 'components/core-tools'
FetchSubjectSetsMixin   = require 'lib/fetch-subject-sets-mixin'
BaseWorkflowMethods     = require 'lib/workflow-methods-mixin'
JSONAPIClient           = require 'json-api-client' # use to manage data?
ForumSubjectWidget      = require '../forum-subject-widget'
API                     = require '../../lib/api'
HelpModal               = require 'components/help-modal'
HelpButton              = require 'components/buttons/help-button'
BadSubjectButton        = require 'components/buttons/bad-subject-button'
DraggableModal          = require 'components/draggable-modal'

module.exports = React.createClass # rename to Classifier
  displayName: 'Mark'

  getDefaultProps: ->
    workflowName: 'mark'

  mixins: [FetchSubjectSetsMixin, BaseWorkflowMethods] # load subjects and set state variables: subjects, currentSubject, classification

  getInitialState: ->
    taskKey:                      null
    classifications:              []
    classificationIndex:          0
    subject_set_index:            0
    subject_index:                0
    currentSubToolIndex:          0
    helping:                      false

  componentDidMount: ->
    @getCompletionAssessmentTask()

  componentWillMount: ->
    @setState
      taskKey: @getActiveWorkflow().first_task

    @beginClassification()

  toggleHelp: ->
    @setState helping: not @state.helping

  render: ->
    return null unless @getCurrentSubject()? && @getActiveWorkflow()?
    currentTask = @getCurrentTask()
    TaskComponent = @getCurrentTool()
    onFirstAnnotation = @state.taskKey == @getActiveWorkflow().first_task


    if currentTask.tool is 'pick_one'
      currentAnswer = currentTask.tool_config.options?[currentAnnotation.value]
      waitingForAnswer = not currentAnswer

    <div className="classifier">

      <div className="subject-area">
        { if @state.noMoreSubjectSets
            style = marginTop: "50px"
            <p style={style}>There is nothing left to do. Thanks for your work and please check back soon!</p>

          else if @state.notice
            <DraggableModal header={@state.notice.header} onDone={@state.notice.onClick}>{@state.notice.message}</DraggableModal>

          else if @getCurrentSubjectSet()?
            <SubjectSetViewer
              subject_set={@getCurrentSubjectSet()}
              subject_index={@state.subject_index}
              workflow={@getActiveWorkflow()}
              task={currentTask}
              annotation={@getCurrentClassification().annotation ? {}}
              onComplete={@handleToolComplete}
              onChange={@handleDataFromTool}
              onViewSubject={@handleViewSubject}
              subToolIndex={@state.currentSubToolIndex}
              subjectCurrentPage={@state.subject_current_page}
              nextPage={@nextPage}
              prevPage={@prevPage}
              totalSubjectPages={@state.total_subject_pages}
            />
        }
      </div>
      <div className="task-area">
        <div className="task-container">
          <TaskComponent
            key={@getCurrentTask().key}
            task={currentTask}
            annotation={@getCurrentClassification().annotation ? {}}
            onChange={@handleDataFromTool}
            subject={@getCurrentSubject()}
          />
          <div className="help-bad-subject-holder">
            { if @getCurrentTask().help?
              <HelpButton onClick={@toggleHelp} />
            }
            { if onFirstAnnotation
              <BadSubjectButton active={@state.badSubject} onClick={@toggleBadSubject} />
            }
            { if @state.badSubject
              <p>You&#39;ve marked this subject as BAD. Thanks for flagging the issue!</p>
            }
          </div>
          <nav className="task-nav">
            { if false
              <button type="button" className="back minor-button" disabled={onFirstAnnotation} onClick={@destroyCurrentAnnotation}>Back</button>
            }
            { if @getNextTask()?
                <button type="button" className="continue major-button" disabled={waitingForAnswer} onClick={@advanceToNextTask}>Next</button>
              else
                if @state.taskKey == "completion_assessment_task"
                  if @getCurrentSubject() == @getCurrentSubjectSet().subjects[@getCurrentSubjectSet().subjects.length-1]
                    <button type="button" className="continue major-button" disabled={waitingForAnswer} onClick={@completeSubjectAssessment}>Next</button>
                  else
                    <button type="button" className="continue major-button" disabled={waitingForAnswer} onClick={@completeSubjectAssessment}>Next Page</button>
                else
                  <button type="button" className="continue major-button" disabled={waitingForAnswer} onClick={@completeSubjectSet}>Done</button>
            }
          </nav>
        </div>

        <div className="forum-holder">
          <ForumSubjectWidget subject_set = @getCurrentSubjectSet() />
        </div>
<commit_msg>changed langauge around the bad subject button in mark-workflow<commit_after>React                   = require 'react'
SubjectSetViewer        = require '../subject-set-viewer'
coreTools               = require 'components/core-tools'
FetchSubjectSetsMixin   = require 'lib/fetch-subject-sets-mixin'
BaseWorkflowMethods     = require 'lib/workflow-methods-mixin'
JSONAPIClient           = require 'json-api-client' # use to manage data?
ForumSubjectWidget      = require '../forum-subject-widget'
API                     = require '../../lib/api'
HelpModal               = require 'components/help-modal'
HelpButton              = require 'components/buttons/help-button'
BadSubjectButton        = require 'components/buttons/bad-subject-button'
DraggableModal          = require 'components/draggable-modal'

module.exports = React.createClass # rename to Classifier
  displayName: 'Mark'

  getDefaultProps: ->
    workflowName: 'mark'

  mixins: [FetchSubjectSetsMixin, BaseWorkflowMethods] # load subjects and set state variables: subjects, currentSubject, classification

  getInitialState: ->
    taskKey:                      null
    classifications:              []
    classificationIndex:          0
    subject_set_index:            0
    subject_index:                0
    currentSubToolIndex:          0
    helping:                      false

  componentDidMount: ->
    @getCompletionAssessmentTask()

  componentWillMount: ->
    @setState
      taskKey: @getActiveWorkflow().first_task

    @beginClassification()

  toggleHelp: ->
    @setState helping: not @state.helping

  render: ->
    return null unless @getCurrentSubject()? && @getActiveWorkflow()?
    currentTask = @getCurrentTask()
    TaskComponent = @getCurrentTool()
    onFirstAnnotation = @state.taskKey == @getActiveWorkflow().first_task


    if currentTask.tool is 'pick_one'
      currentAnswer = currentTask.tool_config.options?[currentAnnotation.value]
      waitingForAnswer = not currentAnswer

    <div className="classifier">

      <div className="subject-area">
        { if @state.noMoreSubjectSets
            style = marginTop: "50px"
            <p style={style}>There is nothing left to do. Thanks for your work and please check back soon!</p>

          else if @state.notice
            <DraggableModal header={@state.notice.header} onDone={@state.notice.onClick}>{@state.notice.message}</DraggableModal>

          else if @getCurrentSubjectSet()?
            <SubjectSetViewer
              subject_set={@getCurrentSubjectSet()}
              subject_index={@state.subject_index}
              workflow={@getActiveWorkflow()}
              task={currentTask}
              annotation={@getCurrentClassification().annotation ? {}}
              onComplete={@handleToolComplete}
              onChange={@handleDataFromTool}
              onViewSubject={@handleViewSubject}
              subToolIndex={@state.currentSubToolIndex}
              subjectCurrentPage={@state.subject_current_page}
              nextPage={@nextPage}
              prevPage={@prevPage}
              totalSubjectPages={@state.total_subject_pages}
            />
        }
      </div>
      <div className="task-area">
        <div className="task-container">
          <TaskComponent
            key={@getCurrentTask().key}
            task={currentTask}
            annotation={@getCurrentClassification().annotation ? {}}
            onChange={@handleDataFromTool}
            subject={@getCurrentSubject()}
          />
          <div className="help-bad-subject-holder">
            { if @getCurrentTask().help?
              <HelpButton onClick={@toggleHelp} />
            }
            { if onFirstAnnotation
              <BadSubjectButton active={@state.badSubject} onClick={@toggleBadSubject} />
            }
            { if @state.badSubject
              <p>You&#39;ve marked this subject as BAD. Thanks for flagging the issue! <strong>Press DONE to continue.</strong></p>
            }
          </div>
          <nav className="task-nav">
            { if false
              <button type="button" className="back minor-button" disabled={onFirstAnnotation} onClick={@destroyCurrentAnnotation}>Back</button>
            }
            { if @getNextTask()?
                <button type="button" className="continue major-button" disabled={waitingForAnswer} onClick={@advanceToNextTask}>Next</button>
              else
                if @state.taskKey == "completion_assessment_task"
                  if @getCurrentSubject() == @getCurrentSubjectSet().subjects[@getCurrentSubjectSet().subjects.length-1]
                    <button type="button" className="continue major-button" disabled={waitingForAnswer} onClick={@completeSubjectAssessment}>Next</button>
                  else
                    <button type="button" className="continue major-button" disabled={waitingForAnswer} onClick={@completeSubjectAssessment}>Next Page</button>
                else
                  <button type="button" className="continue major-button" disabled={waitingForAnswer} onClick={@completeSubjectSet}>Done</button>
            }
          </nav>
        </div>

        <div className="forum-holder">
          <ForumSubjectWidget subject_set = @getCurrentSubjectSet() />
        </div>

{'fraction_non_alphanumeric': 0.10748065348237318, 'fraction_numerical': 0.0017196904557179708, 'mean_word_length': 2.3637532133676094, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 83, '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': '4932765', 'n_tokens_mistral': 2653, 'n_tokens_neox': 2622, 'n_words': 508}