Ejemplo n.º 1
0
import pprint

from examples_base import parse_command_line_args
from pyelicit import elicit
from random import shuffle

experiment_URL = 'https://elicit-experiment.com'

##
## MAIN
##

pp = pprint.PrettyPrinter(indent=4)

# get the elicit object to define the experiment
elicit_object = elicit.Elicit(parse_command_line_args())

# Double-check that we have the right user: we need to be investigator or admin to create a study
user_investigator = elicit_object.assert_investigator()

#
# Add a new Study Definition
#

# Define study
study_definition_description = dict(
    title='Video player test',
    description="""This is a test of the video player""",
    version=1,
    lock_question=1,
    enable_previous=1,
Ejemplo n.º 2
0
from pyelicit import elicit
from collections import namedtuple


def Struct(**kwargs):
    return namedtuple('Struct', ' '.join(kwargs.keys()))(**kwargs)


el = elicit.Elicit(
    Struct(apiurl='https://elicit.compute.dtu.dk',
           send_opt=dict(verify=True),
           debug=True))
client = el.client

user_id = 919
study_definition_id = 394
experiment_result_id = 711
study_result_id = 711
page_size = 10

el.find_trial_results(study_result_id=study_result_id,
                      experiment_id=experiment_result_id,
                      page_size=page_size)
Ejemplo n.º 3
0
        questions = json.load(questionsfd)

pp = pprint.PrettyPrinter(indent=4)

parser.add_argument('--study_id',
                    default=1,
                    help="The study ID to dump",
                    type=int)
parser.add_argument('--user_id',
                    default=None,
                    help="The user ID to dump",
                    type=int)
parser.add_argument('--user_name', default=None, help="The user name to dump")
args = parse_command_line_args()

el = elicit.Elicit(args)
client = el.client

#
# Double-check that we have the right user
#

user = el.assert_admin()

study_results = el.find_study_results(study_definition_id=args.study_id)

all_answers = []
raw_questions = dict()
all_video_events = []
all_video_layout_events = []
all_trial_results = []
Ejemplo n.º 4
0
import csv
import json

from examples_base import *
from pyelicit import elicit
from pyelicit import api

##
## MAIN
##

pp = pprint.PrettyPrinter(indent=4)

args = parse_command_line_args()

el = elicit.Elicit(args)

#
# Double-check that we have the right user: we need to be admin to create an investigator
#

user = el.assert_admin()

investigator = el.find_or_create_user('MagnumPI', 'bad_password', '*****@*****.**', 'investigator')

pp.pprint(investigator)

# now login as investigator
el = elicit.Elicit(args, api.ElicitCreds(_admin_user='******', _admin_password='******'))

pp.pprint(el.find_study_definitions())