Question¶
A question is made up of sections. When sections are added to a question, the question will begin to generate a directed graph structure. The question needs to be stored in a Task object, which generates HIT objects from the question pool. The question will pass the graph structure to the HIT, which passes it to the HTML that is passed to the crowdsource.
Example usage:
import opencrowd
question = Question()
# sections previously created, ex: images = Image(urls=[img[0], img[1]])
# make sure you specify a parent
question.add_section(images, parent='root')
# attach to a task
Module author: Michael Romero <michaelrom@zillowgroup.com>
-
class
opencrowd.model.base.question.Question¶ Create and manage a new Question.
-
add_section(section, parents=None)¶ Add a section to the question. If Parent is ‘prev’, the Question will automatically add the previous section as the parent of the newly added section, creating a linear DAG. Else, if parents is a list, the new section will be rendered after each parent.
Parameters: Attention
- the section parameter can only take the following:
- ‘root’: specifies this as the head of the graph structure
- ‘prev’: use the previous section as the parent
- [Sections] or Section: use the section(s) as parents
-