def green_round(): return Check(''' <p>In a box, no green things are round, and all round things are large. What can we conclude?</p> ''', [('No green things are large', 1), ('Some green things are not large', 0), ('Neither of the above', -1)], var='CRT_GreenRound')
def make_additional_questions(): """Make additional questions, such as prompts for dialectical bootstrapping :return: additional questions :rtype: list of hemlock.Question """ if not current_user.meta['Bootstrap']: return [ Label(''' Please make second estimates which are different from your first estimates. ''') ] return [ Textarea(''' Imagine your first estimates were off the mark. Write at least one reason why that could be. Which assumptions or considerations could have been wrong? ''', var='Assumptions', required=True, validate=V.min_words(7), debug=[ D.send_keys('here are 7 words without a meaning'), D.send_keys(p_exec=.2) ]), Check(''' What does this reason imply? Were your first estimates too high or too low? ''', [('Too high', 'high'), ('Too low', 'low'), ('Some were too high, others too low', 'both')], var='Direction', validate=V.require()), Label(''' Based on this new perspective, make second estimates which are different from your first estimates. ''') ]
def stock(): return Check(''' <p> Simon decided to invest $8,000 in the stock market one day early in 2008. Six months after he invested, on July 17, the stocks he had purchased were down 50%. Fortunately for Simon, from July 17 to October 17, the stocks he had purchased went up 75%. At this point, Simon has:</p> ''', [('broken even in the stock market', 'even'), ('is ahead of where he began', 'gain'), ('has lost money', 'loss')], var='CRT_Stock')
def gender(require=False): gender = Check('What is your gender?', ['Male', 'Female', 'Other'], var='Gender', validate=V.require() if require else None, submit=_record_male) _debug_choices(gender, require) specify = Input('Please specify your gender.', var='GenderSpecify', data_rows=-1) show_on_event(specify, gender, 'Other') return gender, specify
def race(require=False): race_q = Check(''' Which race or ethnicity do you belong to? Check as many as apply. ''', [ 'White', 'Black', ('South Asian (Indian, Pakistani, etc.)', 'South Asian'), ('East Asian (Chinese, Japanese, etc.)', 'East Asian'), 'Arabic or Central Asian', 'Other' ], var='Race', multiple=True, validate=V.min_len(1) if require else None) _debug_choices(race_q, require) specify = Input('Please specify your race or ethnicity.', var='RaceSpecify', data_rows=-1) show_on_event(specify, race_q, 'Other') return race_q, specify
def start(): return Branch( Page( Label(texts.consent_label), Check( choices=[('I consent to participate', 'consent')], validate=V.correct_choices( 'consent', error_msg='<p>Please consent to participate.</p>' ) ) ), demographics( 'age_bins', 'gender', 'race', 'education', page=True, require=True ), *crt(page=True, require=True), berlin(require=True), navigate=N.comprehension() )
def start(): return Branch( *comprehension_check( instructions=Page( Label('Here are some instructions') ), checks=Page( Check( '<p>Select the correct choice.</p>', ['Correct', 'Incorrect', 'Also incorrect'], compile=[C.clear_response(), C.shuffle()], validate=V.require(), submit=S.correct_choices('Correct') ) ), attempts=3 ), Page( Label('You passed the comprehension check!'), terminal=True ) )