This repository has been archived by the owner on Oct 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a filtering step to the marking task
Allow the decision tree task to control which subject representation (image or text) is shown in the viewer. Use the OCR as the alt text for the subject image. Add a back button which resets the marking task.
- Loading branch information
1 parent
5805f02
commit 3357e55
Showing
7 changed files
with
123 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
React = require 'react' | ||
SubjectTools = require './subject-tools' | ||
SubjectViewer = require './subject-viewer' | ||
|
||
module.exports = React.createClass | ||
displayName: 'Subject' | ||
|
||
render: -> | ||
console.log @props.task | ||
<div className="readymade-subject-viewer-container"> | ||
{ | ||
if @props.currentSubjects.length | ||
<div className="readymade-subject-viewer"> | ||
<SubjectTools project={@props.project} api={@props.api} talk={@props.talk} user={@props.user} subject_set={@props.subject_set} subject={@props.currentSubjects[0]} /> | ||
<div className="scroll-container" ref="scrollContainer"> | ||
{<SubjectViewer task={@props.task} subject={subject} key={subject.id} ref="subject#{subject.id}" /> for subject in @props.currentSubjects} | ||
</div> | ||
</div> | ||
} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
React = require 'react' | ||
|
||
answers = | ||
yes: | ||
label: 'Yes' | ||
value: 'yes' | ||
no: | ||
label: 'No' | ||
value: 'no' | ||
|
||
module.exports = React.createClass | ||
displayName: 'FilterTask' | ||
|
||
getDefaultProps: -> | ||
name: 'filter' | ||
|
||
getInitialState: -> | ||
value: null | ||
|
||
render: -> | ||
label = 'Next' | ||
label = 'Finish' if @state.value is 'no' | ||
<div className="decision-tree-task"> | ||
<div className="decision-tree-question"> | ||
Are there any health issues to mark on this page? | ||
</div> | ||
<div className="decision-tree-choices"> | ||
{for key, answer of answers | ||
<label className="decision-tree-choice"> | ||
<input type="radio" name={@props.name} value={answer.value} checked={@state.value is answer.value} onChange={@choose} /> | ||
<span className="readymade-choice-clickable standard-button">{answer.label}</span> | ||
</label> | ||
} | ||
{@props.children} | ||
<button type="button" className="major-button" onClick={@complete} disabled={!@state.value}>{label}</button> | ||
</div> | ||
</div> | ||
|
||
choose: (e) -> | ||
@setState value: e.currentTarget.value | ||
|
||
complete: -> | ||
@props.onComplete @state.value | ||
@setState value: null | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters