Result utils
result.utils
handle_results(data, session)
if the given_result is an array of results, retrieve and save results for all of them else, handle results at top level
Source code in result/utils.py
22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
prepare_profile_result(question_key, participant, **kwargs)
Create a Result object, and provide its id to be serialized - question_key: the key of the question in the questionnaire dictionaries - participant: the participant on which the Result is going to be registered possible kwargs: - expected_response: optionally, provide the correct answer, used for scoring - comment: optionally, provide a comment to be saved in the database - scoring_rule: optionally, provide a scoring rule
Source code in result/utils.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
prepare_result(question_key, session, **kwargs)
Create a Result object, and provide its id to be serialized - question_key: the key of the question in the questionnaire dictionaries - session: the session on which the Result is going to be registered possible kwargs: - section: optionally, provide a section to which the Result is going to be tied - expected_response: optionally, provide the correct answer, used for scoring - json_data: optionally, provide json data tied to this result - comment: optionally, provide a comment to be saved in the database, e.g. “training phase” - scoring_rule: optionally, provide a scoring rule
Source code in result/utils.py
53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
score_result(data, session)
Create a result for given session, based on the result data (form element or top level data) parameters: session: a Session object data: a dictionary, containing a result_id, and optional other params: { result_id: int [optional] params: … }
Source code in result/utils.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|