{"version":3,"file":"diagnostic-BWq0D-hY.js","sources":["../../../client/app/bundles/Shared/components/shared/resumeOrBeginButton.tsx","../../../client/app/bundles/Shared/components/shared/smartSpinner.tsx","../../../client/app/bundles/Shared/quill-marking-logic/src/libs/algorithms/partsOfSpeech.ts","../../../client/app/bundles/Shared/quill-marking-logic/src/libs/matchers/parts_of_speech_match.ts","../../../client/app/bundles/Shared/quill-marking-logic/src/libs/graders/diagnostic_sentence_fragment.ts","../../../client/app/bundles/Diagnostic/actions/concepts.js","../../../client/app/bundles/Diagnostic/actions/fillInBlank.ts","../../../client/app/bundles/Diagnostic/libs/lessons_api.ts","../../../client/app/bundles/Diagnostic/actions/sentenceFragments.ts","../../../client/app/bundles/Diagnostic/actions/titleCards.ts","../../../client/app/bundles/Diagnostic/actions/lessons.ts","../../../client/app/bundles/Diagnostic/components/navbar/studentNavbar.tsx","../../../client/app/bundles/Diagnostic/components/navbar/teacherNavbar.tsx","../../../client/app/bundles/Diagnostic/components/questions/questionForm.jsx","../../../client/app/bundles/Diagnostic/components/concepts/concept.jsx","../../../client/app/bundles/Diagnostic/components/shared/linkListItem.tsx","../../../client/app/bundles/Diagnostic/components/concepts/concepts.jsx","../../../client/app/bundles/Diagnostic/actions/massEdit.js","../../../client/app/bundles/Diagnostic/components/questions/conceptResultList.jsx","../../../client/app/bundles/Diagnostic/actions/display.js","../../../client/app/bundles/Diagnostic/components/questions/massEditContainer.jsx","../../../client/app/bundles/Diagnostic/actions/filters.js","../../../client/app/bundles/Diagnostic/libs/grading/rematching.ts","../../../client/app/bundles/Diagnostic/libs/partsOfSpeechTagging.js","../../../client/app/bundles/Diagnostic/libs/algorithms/changeObjects.js","../../../client/app/bundles/Diagnostic/libs/algorithms/joiningWords.js","../../../client/app/bundles/Diagnostic/libs/algorithms/spacingBeforePunctuation.js","../../../client/app/bundles/Diagnostic/libs/quillNormalizer.js","../../../client/app/bundles/Diagnostic/libs/requiredWords.js","../../../client/app/bundles/Diagnostic/libs/sharedResponseFunctions.js","../../../client/app/bundles/Diagnostic/libs/question.js","../../../client/app/bundles/Diagnostic/libs/validEndingPunctuation.js","../../../client/app/bundles/Diagnostic/libs/sentenceFragment.js","../../../client/app/bundles/Diagnostic/components/questions/POSForResponse.jsx","../../../client/app/bundles/Diagnostic/components/questions/POSIndex.jsx","../../../client/app/bundles/Diagnostic/components/questions/POSForResponsesList.jsx","../../../client/app/bundles/Diagnostic/components/questions/response.tsx","../../../client/app/bundles/Diagnostic/components/questions/responseList.tsx","../../../client/app/bundles/Diagnostic/components/questions/responseComponent.jsx","../../../client/app/bundles/Diagnostic/components/questions/responseRouteWrapper.jsx","../../../client/app/bundles/Diagnostic/components/renderForQuestions/cues.tsx","../../../client/app/bundles/Diagnostic/components/fillInBlank/fillInBlankForm.jsx","../../../client/app/bundles/Diagnostic/components/fillInBlank/editFillInBlank.jsx","../../../client/app/bundles/Diagnostic/components/renderForQuestions/submitResponse.js","../../../client/app/bundles/Diagnostic/components/renderForQuestions/updateResponseResource.js","../../../client/app/bundles/Diagnostic/components/fillInBlank/playFillInTheBlankQuestion.tsx","../../../client/app/bundles/Diagnostic/components/fillInBlank/testFillInBlankQuestionContainer.jsx","../../../client/app/bundles/Diagnostic/components/fillInBlank/fillInBlankQuestion.jsx","../../../client/app/bundles/Diagnostic/components/shared/questionList.tsx","../../../client/app/bundles/Diagnostic/components/fillInBlank/fillInBlankQuestions.jsx","../../../client/app/bundles/Diagnostic/components/fillInBlank/newFillInBlank.jsx","../../../client/app/bundles/Diagnostic/components/lessons/chooseModel.tsx","../../../client/app/bundles/Diagnostic/components/lessons/lessonFormComponents.tsx","../../../client/app/bundles/Diagnostic/components/lessons/lessonForm.tsx","../../../client/app/bundles/Diagnostic/components/lessons/lesson.jsx","../../../client/app/bundles/Diagnostic/components/lessons/lessons.jsx","../../../client/app/bundles/Diagnostic/components/misc/diffedResponse.jsx","../../../client/app/bundles/Diagnostic/components/misc/answerVisualizer.jsx","../../../client/app/bundles/Diagnostic/components/focusPoints/editFocusPointsContainer.jsx","../../../client/app/bundles/Diagnostic/components/focusPoints/focusPointsContainer.jsx","../../../client/app/bundles/Diagnostic/components/focusPoints/newFocusPointsContainer.jsx","../../../client/app/bundles/Diagnostic/components/incorrectSequence/editIncorrectSequenceContainer.jsx","../../../client/app/bundles/Diagnostic/components/incorrectSequence/incorrectSequenceContainer.jsx","../../../client/app/bundles/Diagnostic/components/incorrectSequence/newIncorrectSequenceContainer.jsx","../../../client/app/bundles/Diagnostic/components/questions/boilerplateFeedback.jsx","../../../client/app/bundles/Diagnostic/components/questions/chooseModelContainer.jsx","../../../client/app/bundles/Diagnostic/actions.js","../../../client/app/bundles/Diagnostic/components/renderForQuestions/checkAnswer.ts","../../../client/app/bundles/Diagnostic/components/renderForQuestions/feedbackStatements.jsx","../../../client/app/bundles/Diagnostic/libs/markupUserResponses.js","../../../client/app/bundles/Diagnostic/components/renderForQuestions/renderTextEditor.jsx","../../../client/app/bundles/Diagnostic/components/diagnostics/sentenceCombining.jsx","../../../client/app/bundles/Diagnostic/components/questions/testQuestion.jsx","../../../client/app/bundles/Diagnostic/components/questions/question.jsx","../../../client/app/bundles/Diagnostic/components/shared/questionListByConcept.tsx","../../../client/app/bundles/Diagnostic/components/questions/questions.jsx","../../../client/app/bundles/Diagnostic/components/sentenceFragments/chooseModelContainer.jsx","../../../client/app/bundles/Diagnostic/components/sentenceFragments/sentenceFragmentForm.jsx","../../../client/app/bundles/Diagnostic/components/sentenceFragments/newSentenceFragment.jsx","../../../client/app/bundles/Diagnostic/components/renderForQuestions/answerState.ts","../../../client/app/bundles/Diagnostic/components/renderForQuestions/feedback.tsx","../../../client/app/bundles/Diagnostic/components/sentenceFragments/sentenceFragmentTemplateComponent.tsx","../../../client/app/bundles/Diagnostic/components/diagnostics/sentenceFragment.jsx","../../../client/app/bundles/Diagnostic/components/sentenceFragments/testSentenceFragmentContainer.jsx","../../../client/app/bundles/Diagnostic/components/sentenceFragments/sentenceFragment.jsx","../../../client/app/bundles/Diagnostic/components/sentenceFragments/sentenceFragments.jsx","../../../client/app/bundles/Diagnostic/components/diagnostics/finishedDiagnostic.jsx","../../../client/app/bundles/Diagnostic/components/diagnostics/landing.jsx","../../../client/app/bundles/Diagnostic/components/turk/finishedDiagnostic.jsx","../../../client/app/bundles/Diagnostic/libs/formattedCues.js","../../../client/app/bundles/Diagnostic/libs/conceptResults/fillInTheBlanks.js","../../../client/app/bundles/Diagnostic/libs/conceptResults/sentenceCombining.js","../../../client/app/bundles/Diagnostic/libs/conceptResults/sharedConceptResultsFunctions.js","../../../client/app/bundles/Diagnostic/libs/conceptResults/sentenceFragment.js","../../../client/app/bundles/Diagnostic/libs/conceptResults/diagnostic.js","../../../client/app/bundles/Diagnostic/utils/saveSession.tsx","../../../client/app/bundles/Diagnostic/libs/calculateProgress.ts","../../../client/app/bundles/Diagnostic/components/diagnostics/studentDiagnostic.jsx","../../../client/app/bundles/Diagnostic/components/eslDiagnostic/finishedDiagnostic.jsx","../../../client/app/bundles/Shared/libs/translations/modules/languagePageInfo.js","../../../client/app/bundles/Diagnostic/components/eslDiagnostic/landingPage.jsx","../../../client/app/bundles/Diagnostic/components/eslDiagnostic/sentenceCombining.jsx","../../../client/app/bundles/Diagnostic/components/eslDiagnostic/sentenceFragment.jsx","../../../client/app/bundles/Shared/libs/translations/modules/commonText.js","../../../client/app/bundles/Diagnostic/components/eslDiagnostic/titleCard.tsx","../../../client/app/bundles/Diagnostic/components/eslDiagnostic/studentDiagnostic.jsx","../../../client/app/bundles/Diagnostic/components/shared/diagnosticRouter.tsx","../../../client/app/bundles/Diagnostic/components/titleCards/showTitleCard.tsx","../../../client/app/bundles/Diagnostic/components/titleCards/titleCardForm.tsx","../../../client/app/bundles/Diagnostic/components/titleCards/titleCards.tsx","../../../client/app/bundles/Diagnostic/components/admin/admin.jsx","../../../client/app/bundles/Diagnostic/routes.tsx","../../../client/app/bundles/Diagnostic/components/home.tsx","../../../client/app/bundles/Diagnostic/utils/backOff.js","../../../client/app/bundles/Diagnostic/reducers/classroomLesson.js","../../../client/app/bundles/Diagnostic/reducers/classroomLessons.js","../../../client/app/bundles/Diagnostic/reducers/classroomLessonsReviews.js","../../../client/app/bundles/Diagnostic/reducers/classroomSessions.js","../../../client/app/bundles/Diagnostic/reducers/concepts.ts","../../../client/app/bundles/Diagnostic/reducers/conceptsFeedback.ts","../../../client/app/bundles/Diagnostic/reducers/customize.js","../../../client/app/bundles/Diagnostic/reducers/diagnostics.js","../../../client/app/bundles/Diagnostic/reducers/display.js","../../../client/app/bundles/Diagnostic/reducers/fillInBlank.ts","../../../client/app/bundles/Diagnostic/reducers/filtersReducer.js","../../../client/app/bundles/Diagnostic/reducers/generatedIncorrectSequences.js","../../../client/app/bundles/Diagnostic/reducers/lessons.ts","../../../client/app/bundles/Diagnostic/reducers/massEdit.js","../../../client/app/bundles/Diagnostic/reducers/questionReducer.js","../../../client/app/bundles/Diagnostic/reducers/questionReducerV2.js","../../../client/app/bundles/Diagnostic/reducers/questions.ts","../../../client/app/bundles/Diagnostic/reducers/responsesReducer.js","../../../client/app/bundles/Diagnostic/reducers/sentenceFragments.ts","../../../client/app/bundles/Diagnostic/reducers/sessions.js","../../../client/app/bundles/Diagnostic/reducers/titleCards.ts","../../../client/app/bundles/Diagnostic/reducers/combined.js","../../../client/app/bundles/Diagnostic/utils/configureStore.js","../../../client/app/bundles/Diagnostic/app.tsx","../../../client/app/bundles/Diagnostic/clientRegistration.js"],"sourcesContent":["import * as React from 'react'\n\nconst ResumeOrBeginButton = ({ onClickFn, text, }) => (\n )\n\nexport { ResumeOrBeginButton }\n","import * as React from 'react';\n\nconst spinner = 'https://assets.quill.org/images/icons/loader_still.svg';\n\nclass SmartSpinner extends React.Component {this.props.message} \n \n \n \n \n \n \n \n Loading... 404: No Concept Found this.removeResponseFromMassEditArray(response)} style={{ marginRight: '0.5em', }} type=\"checkbox\" />{responses[response].text}\n
\n \n
;\n\ninterface TeacherNavbarProps {\n dispatch: (action: any) => void;\n diagnosticID: string;\n isELLDiagnostic: boolean;\n isOnMobile: boolean;\n languageMenuOpen: boolean;\n previewShowing?: boolean;\n onTogglePreview?: () => void;\n language: string;\n languageOptions: DropdownObjectInterface[];\n translate: (language: string) => string;\n updateLanguage: (language: string) => void;\n}\n\nexport const TeacherNavbar = ({\n isELLDiagnostic,\n isOnMobile,\n previewShowing,\n onTogglePreview,\n language,\n updateLanguage,\n languageOptions,\n translate,\n}: TeacherNavbarProps) => {\n\n function handleTogglePreview() { onTogglePreview() }\n\n return (\n
Create a new question
\n \n
\n \n {listItems}
\n )\n\n };\n\n renderNewQuestionForm = () => {\n return {this.getConcept().displayName}
\n {this.questionsForConcept().length} Questions
\n {this.renderNewQuestionForm()}\n {this.renderQuestionsForConcept()}\n {selectedResponses.length} Responses Selected for Mass Editing:
\n Modify Feedback for {selectedResponses.length} Responses
\n FEEDBACK
\n Add Concept Results for {selectedResponses.length} Responses
\n CONCEPT RESULTS All other concept results associated with selected responses will be overwritten
\n
Loading...
);\n\n }\n}\n\nexport default PlayDiagnosticQuestion;\n","import React, { Component } from 'react';\nimport { connect } from 'react-redux';\nimport { clearData, loadData, nextQuestion } from '../../actions.js';\nimport PlayLessonQuestion from '../diagnostics/sentenceCombining';\n\nclass TestQuestion extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n responsesForGrading: [],\n allResponses: [],\n key: 0,\n };\n }\n\n componentDidMount() {\n this.reset();\n }\n\n reset = () => {\n const { dispatch, } = this.props\n dispatch(clearData());\n this.startActivity();\n this.setState(prevState => ({ key: prevState.key + 1, }));\n }\n\n questionsForLesson = () => {\n const { match } = this.props\n const { params } = match\n const question = this.getQuestion();\n question.key = params.questionID;\n return [\n {\n type: 'SC',\n question,\n }\n ];\n }\n\n startActivity = () => {\n const { dispatch, } = this.props\n const action = loadData(this.questionsForLesson());\n dispatch(action);\n const next = nextQuestion();\n dispatch(next);\n }\n\n getQuestion = () => {\n const { questions, match } = this.props\n const { data } = questions\n const { params } = match\n const { questionID } = params\n return data[questionID];\n }\n\n render() {\n const { playLesson, dispatch, } = this.props\n const { key, } = this.state\n\n if (playLesson.currentQuestion) {\n const { question, } = playLesson.currentQuestion;\n return (\nLoading...
\n );\n }\n }\n\n}\n\nfunction select(props) {\n return {\n questions: props.questions,\n playLesson: props.playLesson,\n };\n}\n\nexport default connect(select)(TestQuestion);\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { NavLink, Route, Switch, withRouter } from 'react-router-dom';\nimport _ from 'underscore';\nimport { Modal, UploadOptimalResponses } from '../../../Shared/index';\nimport questionActions from '../../actions/questions';\nimport {\n submitOptimalResponses,\n submitResponse\n} from '../../actions/responses';\nimport C from '../../constants';\nimport EditFocusPointsContainer from '../focusPoints/editFocusPointsContainer.jsx';\nimport FocusPointsContainer from '../focusPoints/focusPointsContainer.jsx';\nimport NewFocusPointsContainer from '../focusPoints/newFocusPointsContainer.jsx';\nimport EditIncorrectSequenceContainer from '../incorrectSequence/editIncorrectSequenceContainer.jsx';\nimport IncorrectSequenceContainer from '../incorrectSequence/incorrectSequenceContainer.jsx';\nimport NewIncorrectSequenceContainer from '../incorrectSequence/newIncorrectSequenceContainer.jsx';\nimport Cues from '../renderForQuestions/cues.tsx';\nimport getBoilerplateFeedback from './boilerplateFeedback.jsx';\nimport ChooseModelContainer from './chooseModelContainer.jsx';\nimport MassEditContainer from './massEditContainer.jsx';\nimport EditForm from './questionForm.jsx';\nimport ResponseComponentWrapper from './responseRouteWrapper.jsx';\nimport TestQuestionContainer from './testQuestion';\n\nconst icon = `${window.postbuildEnv.CDN_URL}/images/icons/direction.svg`\n\nclass Question extends React.Component {\n constructor(props) {\n super(props)\n\n this.state = {\n selectedBoilerplateCategory: '',\n responses: [],\n loadedResponses: false,\n addingNewResponse: false,\n uploadingNewOptimalResponses: false\n }\n }\n\n handleClickStartEditingQuestion = () => {\n const { dispatch, match } = this.props\n const { params } = match\n const { questionID } = params;\n dispatch(questionActions.startQuestionEdit(questionID));\n }\n\n cancelEditingQuestion = () => {\n const { dispatch, match } = this.props\n const { params } = match\n const { questionID } = params;\n dispatch(questionActions.cancelQuestionEdit(questionID));\n }\n\n saveQuestionEdits = (vals) => {\n const { dispatch, match } = this.props\n const { params } = match\n const { questionID } = params;\n dispatch(questionActions.submitQuestionEdit(questionID, vals));\n }\n\n\n submitOptimalResponses = (responses) => {\n const { dispatch, match, concepts, } = this.props\n const { params } = match\n const { questionID } = params;\n const conceptUID = this.getQuestion().conceptID\n dispatch(\n submitOptimalResponses(questionID, conceptUID, responses, concepts)\n )\n this.setState({ uploadingNewOptimalResponses: false, })\n }\n\n getQuestion = () => {\n const { match, questions, } = this.props\n const { params } = match\n const { data, } = questions;\n const { questionID, } = params;\n return data[questionID];\n }\n\n handleClickAddNewResponse = () => {\n this.setState({ addingNewResponse: true, });\n }\n\n handleClickUploadOptimalResponses = () => {\n this.setState({ uploadingNewOptimalResponses: true, });\n }\n\n handleSubmitResponse = () => {\n const { match, dispatch, } = this.props\n const { params } = match\n const { questionID } = params\n\n const newResp = {\n vals: {\n text: this.refs.newResponseText.value,\n feedback: this.refs.newResponseFeedback.value,\n optimal: this.refs.newResponseOptimal.checked,\n questionUID: questionID,\n gradeIndex: `human${questionID}`,\n count: 1,\n }\n };\n this.refs.newResponseText.value = null;\n this.refs.newResponseFeedback.value = null;\n this.refs.newResponseOptimal.checked = false;\n dispatch(submitResponse(newResp.vals));\n this.setState({ addingNewResponse: false, });\n }\n\n boilerplateCategoriesToOptions = () => {\n return getBoilerplateFeedback().map(category => (\n \n ));\n }\n\n boilerplateSpecificFeedbackToOptions = (selectedCategory) => {\n return selectedCategory.children.map(childFeedback => (\n \n ));\n }\n\n chooseBoilerplateCategory = (e) => {\n this.setState({ selectedBoilerplateCategory: e.target.value, });\n }\n\n chooseSpecificBoilerplateFeedback = (e) => {\n if (e.target.value === 'Select specific boilerplate feedback') {\n this.refs.newResponseFeedback.value = '';\n } else {\n this.refs.newResponseFeedback.value = e.target.value;\n }\n }\n\n onCloseUploadOptimalResponsesModal = () => this.setState({ uploadingNewOptimalResponses: false })\n\n onCloseNewResponseModal = () => this.setState({ addingNewResponse: false, })\n\n renderBoilerplateCategoryDropdown = (onChangeEvent) => {\n const style = { marginRight: '20px', };\n return (\n \n \n \n );\n }\n\n renderBoilerplateCategoryOptionsDropdown = (onChangeEvent, description) => {\n const selectedCategory = _.find(getBoilerplateFeedback(), { description, });\n if (selectedCategory) {\n return (\n \n \n \n );\n } else {\n return ();\n }\n }\n\n renderNewResponseForm = () => {\n const { addingNewResponse, selectedBoilerplateCategory, } = this.state\n if (!addingNewResponse) { return }\n\n return (\n\n \n
\n \n\n \n
\n \n\n \n
\n \nLoading...
);\n } else if (data[questionID]) {\n const activeLink = massEdit.numSelectedResponses > 1\n ?{data[questionID].instructions || 'Combine the sentences into one sentence.'}
\n\n Edit Question\n Add New Response\n Upload Optimal Responses\n
\n404: No Question Found
\n );\n }\n }\n}\n\nfunction select(state) {\n return {\n concepts: state.concepts,\n questions: state.questions,\n routing: state.routing,\n massEdit: state.massEdit\n };\n}\n\nexport default withRouter(connect(select)(Question));\n","import _ from 'lodash'\nimport * as React from 'react'\nimport { Link } from 'react-router-dom';\n\nimport { hashToCollection } from '../../../Shared/index'\n\n\nexport class QuestionListByConcept extends React.Component\n {concept.name}\n
\n );\n }\n\n renderQuestionLinks = (questions) => {\n const { basePath } = this.props;\n let filtered;\n if (!this.props.showOnlyArchived) {\n filtered = questions.filter((question) => question.flag !== \"archived\" )\n } else {\n filtered = questions.filter((question) => question.flag === \"archived\" )\n }\n return filtered.map((question) => {\n if (question.prompt) {\n return (\n \n \n \n );\n }\n });\n }\n\n renderConceptWithQuestions = (questions, label) => {\n if (questions.length === 0) {\n return;\n }\n\n const listItems = this.renderQuestionLinks(questions);\n return [\n label,\n (\n No valid concept\n
)\n return this.renderConceptWithQuestions(questionsToRender, label);\n }\n }\n\n render() {\n return (\n \n );\n }\n}\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { push } from 'react-router-redux';\nimport SelectSearch from 'react-select-search';\nimport _ from 'underscore';\nimport {\n ArchivedButton,\n Modal,\n hashToCollection,\n responsesWithStatus\n} from '../../../Shared/index';\nimport actions from '../../actions/questions';\nimport { deleteResponse, submitResponseEdit } from '../../actions/responses';\nimport Question from '../../libs/question';\nimport { QuestionListByConcept } from '../shared/questionListByConcept';\n\nfunction sleep(milliseconds) {\n const start = new Date().getTime();\n for (let i = 0; i < 1e7; i++) {\n if ((new Date().getTime() - start) > milliseconds) {\n break;\n }\n }\n}\n\nclass Questions extends React.Component {\n constructor(props) {\n super(props)\n\n const { questions } = props\n\n this.state = {\n diagnosticQuestions: questions.data ? questions.data : null,\n showOnlyArchived: false\n }\n }\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n const { questions, lessons } = nextProps\n const { diagnosticQuestions } = this.state;\n if (questions.hasreceiveddata && lessons.hasreceiveddata) {\n if (Object.keys(diagnosticQuestions).length === 0 || !_.isEqual(this.props.questions.data, questions.data) || (!_.isEqual(this.props.lessons.data, lessons.data))) {\n this.setState({ diagnosticQuestions: questions.data })\n }\n }\n }\n\n createNew = () => {\n const { dispatch } = this.props;\n dispatch(actions.toggleNewQuestionModal());\n };\n\n submitNewQuestion = () => {\n const { dispatch } = this.props;\n const newQuestion = { name: this.refs.newQuestionName.value, };\n dispatch(actions.submitNewQuestion(newQuestion));\n this.refs.newQuestionName.value = '';\n };\n\n updateRematchedResponse = (rid, vals) => {\n const { dispatch } = this.props;\n dispatch(submitResponseEdit(rid, vals));\n };\n\n getErrorsForAttempt(attempt) {\n return attempt.feedback;\n }\n\n generateFeedbackString(attempt) {\n const errors = this.getErrorsForAttempt(attempt);\n return errors;\n }\n\n getMatchingResponse(quest, response, responses) {\n const fields = {\n questionUID: quest.key,\n responses: _.filter(responses, resp => resp.statusCode < 2),\n focusPoints: quest.focusPoints ? hashToCollection(quest.focusPoints) : [],\n };\n const question = new Question(fields);\n return question.checkMatch(response.text);\n }\n\n // functions for rematching all Responses\n mapConceptsToList = () => {\n let { concepts, questions } = this.props;\n concepts = hashToCollection(concepts.data['0']);\n questions = hashToCollection(questions.data);\n const conceptsWithQuestions = concepts.map(concept => _.where(questions, { conceptID: concept.uid, }));\n return _.flatten(conceptsWithQuestions);\n };\n\n responsesWithStatusForQuestion = questionUID => {\n let { responses } = this.props;\n const { data } = responses;\n responses = data[questionUID];\n return hashToCollection(responsesWithStatus(responses));\n };\n\n rematchAllResponses = (question) => {\n const responsesWithStat = this.responsesWithStatusForQuestion(question.key);\n const weak = _.filter(responsesWithStat, resp => resp.statusCode > 1);\n weak.forEach((resp, index) => {\n const percentage = index / weak.length * 100;\n this.rematchResponse(question, resp, responsesWithStat);\n });\n };\n\n rematchResponse = (question, response, responses) => {\n if (!response.questionUID || !response.text) {\n return;\n }\n const newMatchedResponse = this.getMatchingResponse(question, response, responses);\n const changed =\n (newMatchedResponse.response.parentID !== response.parentID) ||\n (newMatchedResponse.response.author !== response.author) ||\n (newMatchedResponse.response.feedback !== response.feedback) ||\n (newMatchedResponse.response.conceptResults !== response.conceptResults);\n const unmatched = (newMatchedResponse.found === false);\n if (changed) {\n if (unmatched) {\n const newValues = {\n weak: false,\n text: response.text,\n count: response.count || 1,\n questionUID: response.questionUID,\n gradeIndex: `unmatched${response.questionUID}`,\n };\n } else if (newMatchedResponse.response.parentID === undefined) {\n this.props.dispatch(\n deleteResponse(question.key, response.key)\n );\n } else {\n const newValues = {\n weak: false,\n parentID: newMatchedResponse.response.parentID,\n author: newMatchedResponse.response.author,\n feedback: newMatchedResponse.response.feedback,\n gradeIndex: `nonhuman${response.questionUID}`,\n };\n if (newMatchedResponse.response.conceptResults) {\n newValues.conceptResults = newMatchedResponse.response.conceptResults;\n }\n sleep(150);\n this.updateRematchedResponse(response.key, newValues);\n }\n }\n };\n\n renderModal = () => {\n const { questions } = this.props;\n const { newQuestionModalOpen, submittingnew } = questions;\n const stateSpecificClass = submittingnew ? 'is-loading' : '';\n if (newQuestionModalOpen) {\n return (\n\n \n \n
\n\n \n \n \n
\n\n \n
\n\n \n \n \n
\n )\n }\n\n render() {\n const { conceptsFeedback } = this.props;\n const { data } = conceptsFeedback;\n return(\n\n this.handleChange('optimalResponseText', e)} type=\"text\" value={this.state.optimalResponseText} />\n
)\n ]\n );\n };\n\n wordCountInfo = (minOrMax) => {\n if (this.state.wordCountChange && this.state.wordCountChange[minOrMax]) {\n return this.state.wordCountChange[minOrMax];\n }\n };\n\n render() {\n const { conceptID, flag, isFragment, instructions, needsIdentification, prompt } = this.state\n return (\n\n this.handleChange('prompt', e)} type=\"text\" value={prompt} />\n
\n \n\n
\n\n\n \n
\n\n \n
\n \n
\n \n
\n {this.renderOptimalResponseTextInput()}\n\n \n
{data.sentence}
);\n break;\n case \"revise-matched\":\n case \"correct-matched\":\n returnVal = data.renderFeedbackStatements(latestAttempt);\n break;\n case \"override\":\n returnVal = ({data.sentence}
);\n break;\n case \"instructions\":\n returnVal = ({data.question.instructions}
);\n break;\n case \"getQuestion-instructions\":\n returnVal = ({data.getQuestion().instructions}
);\n break;\n case \"default-fill-in-blank\":\n returnVal = (Fill in the blank with the correct option.
);\n break;\n case \"default-with-cues\":\n returnVal = (Combine the sentences using {data.listCuesAsString(data.getQuestion().cues)}
);\n break;\n case \"default\":\n returnVal = (Combine the sentences into one sentence.
)\n break;\n default:\n returnVal = (Combine the sentences into one sentence.
)\n }\n return returnVal\n }\n\n render() {\n const { question, } = this.props\n const key:number = question ? question.attempts.length : 0;\n if (question) {\n return (\n{this.getQuestion().prompt}
\nLoading...
\n );\n }\n }\n\n}\n\nfunction select(props) {\n return {\n sentenceFragments: props.sentenceFragments,\n playDiagnostic: props.playDiagnostic,\n };\n}\n\nexport default connect(select)(TestQuestion);\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { NavLink, Route, Switch, withRouter } from 'react-router-dom';\n\nimport {\n Modal,\n UploadOptimalResponses,\n} from '../../../Shared/index';\nimport {\n listenToResponsesWithCallback,\n submitOptimalResponses\n} from '../../actions/responses';\nimport fragmentActions from '../../actions/sentenceFragments.ts';\nimport C from '../../constants';\nimport EditFocusPointsContainer from '../focusPoints/editFocusPointsContainer.jsx';\nimport FocusPointsContainer from '../focusPoints/focusPointsContainer.jsx';\nimport NewFocusPointsContainer from '../focusPoints/newFocusPointsContainer.jsx';\nimport EditIncorrectSequenceContainer from '../incorrectSequence/editIncorrectSequenceContainer.jsx';\nimport IncorrectSequenceContainer from '../incorrectSequence/incorrectSequenceContainer.jsx';\nimport NewIncorrectSequenceContainer from '../incorrectSequence/newIncorrectSequenceContainer.jsx';\nimport MassEditContainer from '../questions/massEditContainer.jsx';\nimport ResponseComponent from '../questions/responseComponent.jsx';\nimport ResponseComponentWrapper from '../questions/responseRouteWrapper.jsx';\nimport ChooseModelContainer from './chooseModelContainer.jsx';\nimport EditForm from './sentenceFragmentForm.jsx';\nimport TestQuestionContainer from './testSentenceFragmentContainer';\n\nconst icon = `${window.postbuildEnv.CDN_URL}/images/icons/direction.svg`\n\n\nclass SentenceFragment extends React.Component {\n constructor(props) {\n super(props)\n\n this.state = {\n selectedBoilerplateCategory: '',\n responses: [],\n loadedResponses: false,\n uploadingNewOptimalResponses: false\n }\n }\n\n UNSAFE_componentWillMount() {\n const { match } = this.props\n const { params } = match\n const { questionID } = params\n listenToResponsesWithCallback(\n questionID,\n (data) => {\n this.setState({\n responses: data,\n loadedResponses: true,\n });\n }\n );\n }\n\n getQuestion = () => {\n const { sentenceFragments, match, } = this.props;\n const { params } = match\n const { data } = sentenceFragments;\n const { questionID } = params;\n return data[questionID];\n }\n\n getResponses = () => {\n const { responses, } = this.state\n return responses;\n }\n\n handleUploadOptimalResponsesClick = () => {\n this.setState({ uploadingNewOptimalResponses: true, });\n }\n\n cancelEditingSentenceFragment = () => {\n const { dispatch, match, } = this.props\n const { params } = match\n const { questionID } = params;\n dispatch(fragmentActions.cancelSentenceFragmentEdit(questionID));\n }\n\n handleEditFragmentClick = () => {\n const { dispatch, match, } = this.props;\n const { params } = match\n const { questionID } = params;\n dispatch(fragmentActions.startSentenceFragmentEdit(questionID));\n }\n\n saveSentenceFragmentEdits = (data) => {\n const { dispatch, match, } = this.props;\n const { params } = match\n const { questionID } = params;\n dispatch(fragmentActions.submitSentenceFragmentEdit(questionID, data));\n }\n\n submitOptimalResponses = (responses) => {\n const { dispatch, match, concepts, } = this.props;\n const { params } = match\n const { questionID } = params;\n\n const conceptUID = this.getQuestion().conceptID\n dispatch(submitOptimalResponses(questionID, conceptUID, responses, concepts))\n this.setState({ uploadingNewOptimalResponses: false, })\n }\n\n closeModal = () => {\n this.setState({ uploadingNewOptimalResponses: false, })\n }\n\n renderEditForm = () => {\n const { sentenceFragments, match, concepts, } = this.props;\n const { data, states } = sentenceFragments;\n const { params } = match\n const { questionID } = params;\n if (states[questionID] === C.EDITING_SENTENCE_FRAGMENT) {\n return (\n{data[questionID].instructions || 'Combine the sentences into one sentence.'}
\nSentence Fragments
\n\n The activity session with this unique identifier has already been completed.
\n In order to redo this activity, you must return to your dashboard and click \"Replay Activity\".
\n If you believe that you have received this message in error, ask your teacher to contact Quill.
\n Please provide the following URL to help us solve the problem.\n
Your results could not be saved.
\n Make sure you are connected to the internet.
\n You can attempt to save again using the button below.
\n If the issue persists, ask your teacher to contact Quill.
\n Please provide the following URL to help us solve the problem.\n
\n {window.location.href}\n
\n Your results are being saved now.\n You'll be redirected automatically once they are saved.\n
\n\n You're about to answer {questionCount || '22'} questions about writing sentences.\n Don't worry, it's not a test. It's just to figure out what you know.\n
\n\n Some of the questions might be about things you haven't learned yet—that's okay!\n Just answer them as best as you can.\n Once you're finished, Quill will create a learning plan just for you!\n
\n\n Your unique code is ij3982rmf9.\n
\n\n The activity session with this unique identifier has already been completed.
\n In order to redo this activity, you must return to your dashboard and click "Replay Activity".
\n If you believe that you have received this message in error, ask your teacher to contact Quill.
\n Please provide the following URL to help us solve the problem.\n
Your results could not be saved.
\n Make sure you are connected to the internet.
\n You can attempt to save again using the button below.
\n If the issue persists, ask your teacher to contact Quill.
\n Please provide the following URL to help us solve the problem.\n
\n {window.location.href}\n
Your results are being saved now. You'll be redirected automatically once they are saved.
\n{translate('completedDiagnostic^text')}
\n{firstLine}
\n {isLeftToRight &&{secondLine}
}\n {isLeftToRight &&{thirdLine}
}\n{instructions}
\n {translationPresent &&{translate(text)}
}\nLoading...
);\n }\n}\n\nfunction select(state) {\n return {\n concepts: state.concepts,\n questions: state.questions,\n routing: state.routing,\n };\n}\n\nexport default connect(select)(ELLSentenceCombining);\n","import React from 'react';\nimport ReactTransition from 'react-addons-css-transition-group';\nimport { connect } from 'react-redux';\n\nimport { Feedback, getDisplayedText, getLatestAttempt, hashToCollection, renderPreviewFeedback } from '../../../Shared/index';\nimport {\n getGradedResponsesWithCallback\n} from '../../actions/responses.js';\nimport POSMatcher from '../../libs/sentenceFragment.js';\nimport TextEditor from '../renderForQuestions/renderTextEditor.jsx';\nimport updateResponseResource from '../renderForQuestions/updateResponseResource.js';\nconst icon = `${window.postbuildEnv.CDN_URL}/images/icons/direction.svg`\n\nconst key = ''; // enables this component to be used by both play/sentence-fragments and play/diagnostic\n\nclass PlaySentenceFragment extends React.Component {\n constructor(props) {\n super(props)\n\n this.state = {\n response: props.question.prompt,\n checkAnswerEnabled: true,\n submitted: false,\n }\n }\n componentDidMount = () => {\n getGradedResponsesWithCallback(\n this.getQuestion().key,\n (data) => {\n this.setState({ responses: data, });\n }\n );\n }\n\n getInstructionText = () => {\n const { question } = this.props;\n const { instructions } = question;\n return ;\n }\n\n choosingSentenceOrFragment = () => {\n const { question, } = this.props;\n return question.identified === undefined && (question.needsIdentification === undefined || question.needsIdentification === true);\n // the case for question.needsIdentification===undefined is for sentenceFragments that were created before the needsIdentification field was put in\n }\n\n showNextQuestionButton = () => {\n const { question, } = this.props;\n const attempted = question.attempts.length > 0;\n if (attempted) {\n return true;\n }\n return false;\n }\n\n getQuestion = () => {\n const { question, } = this.props;\n if (question.key.endsWith('-esp')) {\n question.key = question.key.slice(0, -4);\n }\n return question;\n }\n\n getResponses = () => {\n const { responses, } = this.state\n return responses;\n }\n\n handleClickCompleteSentence = () => this.checkChoice('Sentence')\n\n handleClickIncompleteSentence = () => this.checkChoice('Fragment')\n\n checkChoice = (choice) => {\n const { question, markIdentify, } = this.props\n const questionType = question.isFragment ? 'Fragment' : 'Sentence';\n markIdentify(choice === questionType);\n }\n\n getSentenceOrFragmentButtons = () => {\n return (\nIs this a complete or an incomplete sentence?
\n{this.getQuestion().prompt}
\n{commonText[title].text}
\n{translate(text)}
\n<\\/p>/g, ' Making this change will break the translation mapping because this new title does not yet exist in the mappings. If this change is intended, please make a request on the support board to have the translation mapping updated before making this change. Are you sure you want to proceed?
').replace(/ /g, '
')\n this.setState({content: formattedContent})\n }\n\n renderHeaderText = () => {\n const { titleCardID } = this.props.match.params\n if (titleCardID) {\n return 'Edit this title card'\n } else {\n return 'Create a new title card'\n }\n }\n\n handleConfirm = () => {\n this.submit()\n }\n\n handleCancel= () => {\n this.setState({ showModal: false })\n }\n\n renderModal = () => {\n return(\n
Loading...
\n } else {\n returnNo title cards yet
\n }\n }\n\n render() {\n return (\nTitle Cards
\n {this.renderQuestionsList()}\n