Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused annotation prop from task inputs #5104

Merged
merged 2 commits into from
Nov 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions app/classifier/tasks/drawing/index.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,17 @@ module.exports = createReactClass
annotation: null
onChange: Function.prototype

render: ->
tools = for tool, i in @props.task.tools
tools: ->
@props.task.tools.map (tool, i) =>
tool._key ?= Math.random()
count = (true for mark in @props.annotation.value when mark.tool is i).length
marksByType = @props.annotation.value.filter (mark) -> mark.tool is i
count = marksByType.length
translation = @props.translation.tools[i]
checked = i is (@props.annotation._toolIndex ? 0)
checked = i is (@props.annotation._toolIndex ? 0)
<div>
<TaskInputField
annotation={@props.annotation}
autoFocus={checked}
checked = {checked}
checked={checked}
className={if checked then 'active' else ''}
index={i}
key={tool._key}
Expand All @@ -117,10 +117,11 @@ module.exports = createReactClass
<GridButtons {...@props} />}
</div>

render: ->
<GenericTask
question={@props.translation.instruction}
help={@props.translation.help}
answers={tools}
answers={@tools()}
required={@props.task.required}
/>

Expand Down
1 change: 0 additions & 1 deletion app/classifier/tasks/multiple/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export default class MultipleChoiceTask extends React.Component {

answers.push(
<TaskInputField
annotation={annotation}
autoFocus={checked}
checked={checked}
className={checked ? 'active' : ''}
Expand Down
1 change: 0 additions & 1 deletion app/classifier/tasks/single/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export default class SingleChoiceTask extends React.Component {

answers.push(
<TaskInputField
annotation={annotation}
autoFocus={checked}
checked={checked}
className={checked ? 'active' : ''}
Expand Down