Experiment rules
experiment.rules.base
Base
Bases: object
Base class for other rules classes
Source code in experiment/rules/base.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
|
calculate_intermediate_score(session, result)
process result data during a trial (i.e., between next_round calls) return score
Source code in experiment/rules/base.py
59 60 61 62 63 |
|
calculate_score(result, data)
use scoring rule to calculate score If not scoring rule is defined, return None Override in rules file for other scoring schemes
Source code in experiment/rules/base.py
42 43 44 45 46 47 48 49 |
|
final_score_message(session)
Create final score message for given session, base on score per result
Source code in experiment/rules/base.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
get_open_questions(session, randomize=False, cutoff_index=None)
Get a list of trials for questions not yet answered by the user
Source code in experiment/rules/base.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
|
get_single_question(session, randomize=False)
Get a random question from each question list, in priority completion order.
Participants will not continue to the next question set until they have completed their current one.
Source code in experiment/rules/base.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
|
rank(session, exclude_unfinished=True)
Get rank based on session score
Source code in experiment/rules/base.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
experiment.rules.staircasing
register_turnpoint(session, last_result)
register turnpoint: - set comment on previous result to indicate turnpoint - increase final_score (used as counter for turnpoints)
Source code in experiment/rules/util/staircasing.py
1 2 3 4 5 6 7 8 |
|
experiment.rules.practice
get_practice_views(session, intro_explainer, first_trial_callback, trial_callback, response_callback, check_previous_condition, difficulty)
Present practice views, in blocks of 2 Give feedback on the correctness of the response, and repeat practice if necessary. - session: session - intro_explainer: explainer object to introduce the experiment - first_trial_callback: function to generate the first trial after practice - trial_callback: function to return the data for a trial - response_callback: function to generate explainer object about correctness of response - check_previous_condition: function to determine the condition of previous practice trial (returns Boolean) - difficulty: difficulty of the current practice trial
Source code in experiment/rules/util/practice.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
get_trial_condition(n_choices)
get randomized trial condition return an integer between 0 and n_choices-2
Source code in experiment/rules/util/practice.py
133 134 135 136 137 138 |
|
get_trial_condition_block(session, n_trials_per_block)
make a list of n_trials_per_blocks conditions, of which one is catch (=1) store updates in the session.json_data field
Source code in experiment/rules/util/practice.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|