|
32 | 32 | from harmony.schemas.requests.text import Instrument, Question |
33 | 33 |
|
34 | 34 |
|
35 | | -def create_instrument_from_list(question_texts: list[str], answer_texts: list[list] = None, question_numbers: list = None, |
| 35 | +def create_instrument_from_list(question_texts: list[str], answer_texts: list[list] = None, |
| 36 | + question_numbers: list = None, |
36 | 37 | instrument_name: str = "My instrument", |
37 | 38 | file_name="My file") -> Instrument: |
38 | 39 | """ |
39 | 40 | Read a list of strings and create an Instrument object. |
40 | 41 |
|
41 | 42 | :param question_texts: The main part of the texts of the questions in the questionnaires, e.g. ["I feel nervous", "I feel afraid"] |
42 | | - :param answer_texts: Optional parameter where you can provide the response options. This is a list of lists of the same length of the list of questions. Each item in the list of lists is a list containing the options for that question. E.g. [["Rarely", "Often"], ["Rarely", "Sometimes", "Never"]] would represent the options for a questionnaire consisting of two questions. |
43 | | - :param question_numbers: Optional parameter where you can provide the original question numbers associated with the questions. This list should be the same length as `question_texts`. Question numbers can be strings. |
| 43 | + :param answer_texts: Optional parameter where you can provide the response options. |
| 44 | + This is a list of lists of the same length of the list of questions. |
| 45 | + Each item in the list of lists is a list containing the options for that question. |
| 46 | + E.g. [["Rarely", "Often"], ["Rarely", "Sometimes", "Never"]] would represent the options for a questionnaire consisting of two questions. |
| 47 | + :param question_numbers: Optional parameter where you can provide the original question numbers associated with the questions. |
| 48 | + This list should be the same length as `question_texts`. Question numbers can be strings. |
44 | 49 | :param instrument_name: Optional metadata containing name of the instrument. |
45 | 50 | :param file_name: Optional metadata containing name of the file. |
46 | 51 | :return: Single Instrument. |
|
0 commit comments