marckaufmann / congame Goto Github PK
View Code? Open in Web Editor NEWThe best experimental economics software built in Racket
The best experimental economics software built in Racket
The following is the info.rkt
file for congame-pjb-studies
:
#lang info
(define collection "congame-pjb-studies")
(define deps '("base"
"congame-core"
"congame-price-lists"))
(define build-deps '())
(define congame-studies
'((congame-pjb-studies/pjb-pilot pjb-pilot-study)))
(define congame-bots
'((congame-pjb-studies/pjb-pilot-bot pjb-pilot-bot #:for pjb-pilot-study #:models (pjb-pilot-bot-model))))
Despite this, the call in congame/studies/all.rkt
to `find-relevant-directories doesn't find this bot:
all.rkt> (find-relevant-directories '(congame-studies))
'(#path:/home/marc/Git/kutat/congame/congame-pjb-studies
#path:/home/marc/Git/kutat/congame/congame-price-lists)
all.rkt> (find-relevant-directories '(congame-bots))
'(#path:/home/marc/Git/kutat/congame/congame-price-lists)
I also directly print the *bot-registry*
after registering all the bots, and it shows the same, so this is not a REPL issue. I am fairly sure this is a cache issue, but can't seem to fix it. I tried:
raco pkg update
for congame/, congame-pjb-studies/, can congame-core/raco setup --tidy ...
as well as raco setup -c ...
compiled/
folders in the top-level of each of the above.Writing this, I decided to delete all compiled/ folders and update packages. And zing! It works.
So it would be good to make sure this is handled more automatically, so that if someone update info.rkt
to include bots, that we automatically remove and update the cache.
Our current bot runner works by running a browser, requesting the pages, and sending responses like an actual user would. This is fantastic for testing purposes, and even works for data generation. It is however fairly slow, since even a single bot run takes several seconds to a minute on the current pilot study, and this will only get worse. This won't work for generating hundreds of data points.
Instead, we probably should write a different runner that walks the study, but does so without having the bots send requests and the server sending responses, instead it uses a direct response/request loop. This will require that we replace handlers by something that a bot can understand and respond to.
An alternative approach would be that a single bot walks through the study, but on each page it doesn't generate a single answer, but 100 (say). This approach requires that we change the storage layer though, so that a single user can submit not merely one answer, but a list or hash of answers. This would work because generating 100 answers isn't the bottleneck, but the response/request waiting is. I have no sense of how hard it is to add this option to the DB layer, or to somehow replace it for bots. Maybe one can let the bot-side save everything on its side, so that it doesn't interfere with the DB - otherwise we would add features to the normal-user side that are not necessary, which will lead to confusing and difficult-to-understand bugs.
Edit: The alternative is stupid. It cannot respond to different answers by different bots. We also shouldn't change behavior specifically for bots.
Prolific users have an ID that also corresponds directly to their email, such as [email protected]. If they have to sign up with their prolific ID, there is more scope for mistyping and if they need to verify the email, it takes longer. For some studies this is unnecessary overhead.
How can we achieve this given that the studies assume that the person is verified and logged in? Can we generate a password for the participant (or a new one, if they already did a study in the past) and log them in if they arrive through the correct url to a study? Or is this going to be a lot of work, in which case we might shelve this feature for a while.
I get the following:
20:56:47 web.1 | [2020-10-15 20:56:47] [ 24194] [ debug] north-adapter: applying revision 4b823e9c3a3c15057acd77d39a6fe1af
20:56:47 web.1 | migrate!: failed to apply revision 4b823e9c3a3c15057acd77d39a6fe1af
20:56:47 web.1 | cause: query-exec: column "status" does not exist
20:56:47 web.1 | SQLSTATE: 42703
20:56:47 web.1 | context...:
20:56:47 web.1 | do-error
20:56:47 web.1 | .../private/more-scheme.rkt:168:6: loop
20:56:47 web.1 | .../database/migrator.rkt:20:3: component-start
20:56:47 web.1 | .../private/arrow-val-first.rkt:486:18
20:56:47 web.1 | .../private/system.rkt:80:4: for-loop
20:56:47 web.1 | .../private/system.rkt:77:0: system-start
20:56:47 web.1 | winder-dummy
20:56:47 web.1 | .../private/arrow-val-first.rkt:486:18
20:56:47 web.1 | .../congame/dynamic.rkt:66:0: start
20:56:47 web.1 | .../private/arrow-higher-order.rkt:379:33
20:56:47 web.1 | proc
20:56:47 web.1 | call-in-empty-metacontinuation-frame
20:56:47 web.1 | call-with-module-prompt
20:56:47 web.1 | body of (submod "/home/marc/Git/kutat/congame/congame/dynamic.rkt" main)
20:56:47 web.1 | temp35_0
20:56:47 web.1 | for-loop
I can't tell why this is happening, since that revision is supposed to create the colum status
. However that revision does two things: create the column, and create a constraint. I am wondering now if one has to split both? On the other hand it works fine on the server, so my guess is that something weirder has happened.
The code for specific experiments should live in its own repositories and be easy to integrate with congame-core.
raco koyo dist
. Was it the serializable structs, or the define-resource
?When a form is submitted with only some of the choices made, it doesn't pass validation and is reset to an empty form. Instead it should keep the answers that were provided and only require the remaining to be filled in.
Is there a way to switch this behavior on for forms in general, or does it have to be done on a per-form basis?
We use (form a-form an-action a-renderer)
to create forms. The action should be taken upon a valid form submission. Suppose we have the following:
(define (handler some-argument)
(define n (random 10))
(define a-form ...) ; asks to guess the number
(define (an-action guessed-number)
(if (= n guessed-number) (put 'success? #true) (put 'success? #false)))
(define (a-renderer rw) ...)
(form a-form an-action a-renderer))
Then after submission of the form with a guessed-number, the handler is called again, which generates a new n
. If a valid guess was provided, it then compares the guessed-number
against this new value of n
, not the original one -- which is of course not the intended behavior.
How can we fix this?
Prolific generates a URL with the following query parameters that we should extract:
?PROLIFIC_PID={{%PROLIFIC_PID%}}&STUDY_ID={{%STUDY_ID%}}&SESSION_ID={{%SESSION_ID%}}
Ideally this should be integrated with #44.
The CI/CD fails with the new way of adding bots without real signup email and proper verification url, which is unsurprising:
raco test: "congame-tests/info.rkt"
1 congame-tests/congame/components/hash.rkt
0 congame-tests/congame/common.rkt
0 congame-tests/info.rkt
1 1 congame-tests/congame/components/auth.rkt
1 1 congame-tests/congame/components/mail.rkt
1 1 congame-tests/congame/components/user.rkt
3/4 test failures
Error message:
raco test: (submod "congame-tests/congame/components/auth.rkt" test)
query-value: cannot convert given value to SQL type
given: #f
type: int4
expected: int32?
dialect: PostgreSQL
context...:
Edit: I thought it was about email sending, but it was more mundane.
We now show only bots in bot sets, hence I can't see what the progress is on the bot run from the command line without going into the DB.
The main reason I wanted this is to run the bot in non-headless (headful? headed?) mode to see what's going on, but it chokes on the first page. I haven't looked into it, as I am trying to fix something else.
It is pretty tedious to debug bots currently, as one has to navigate to the page to find out what went wrong if it is an HTML/JS/CSS issue. Would be nice to be able to resume a bot user as admin or some such.
Participants really dislike doing extra matrices. Of the three participants, one dropped out in the middle of the required tasks, one didn't want to do any extra tasks for any amount until $2.80 and one was willing to do 5 extra matrices for $2.00, which is fairly pricey. So:
Think about using other tasks.
Prolific seems to replace any email it finds sent via their system by the proflic-email of the sender. Therefore including the user's email in the current template then wrongly claims that they should try to log in with my proflic email, which won't work.
File a bug with prolific about this.
study-tools should go into core, no benefit to separate package.
We should ensure we send no emails to bots. Either we pass in an extra parameter to the send-email function/do an extra check before every send email. Alternatively, we could change the mail-adapter-send-email-with-template
to check in the database whether the email belongs to a bot, in which case it isn't sent. The benefit of the latter approach is that it doesn't require micromanaging every email-send action, so that forgetting to check for bots doesn't lead to email attempts by mistake. @Bogdanp, what do you think?
Our form-creating function wraps everything in an HTML form tag, so that different renderers can be combined - but should it not then also provide the single submit button?
If no csv mapping names to matrix-images (presumed to exist) is found, the server generates both new images and a csv file. See here.
When I deleted the matrix.csv
file and ran it, it works, but logs this:
12:50:28 web.1 | [2021-02-26 12:50:28] [ 31525] [ info] runner: starting application process
12:50:38 web.1 | [2021-02-26 12:50:38] [ 31525] [warning] runner: timed out while waiting for 'listening' output
12:50:38 web.1 | [2021-02-26 12:50:38] [ 31525] [ info] runner: application process started with pid 31562
The timeout is almost surely from waiting for the 200 matrices to be finished.
My question is: is this the correct approach in general if I want something to be setup correctly before everything gets launched? If not, what is? If it is, how should it be improved so that the pipeline knows to wait for it?
I feel that the right time for the matrices is the time when the study that requires the matrices (here: pjb-pilot-study) is registered, so study registration seems the natural time for setup that is required by all study instances.
I keep clicking on the text and miss the part that counts, which is fairly annoying.
For most studies, I will want participants to stay on the page so that they can complete the main study, but it may still be useful to have a feature to redirect participants to prolific to complete the current study.
Currently, even making a one-question form is a boiler-plate fest that rivals Java. Other software shines for making surveys (Qualtrics in particular), primarily thanks to GUIs. While I don't expect us to compete with Qualtrics, I would like to stop competing with Java.
For some reason, the test-audio.mp3
doesn't load or exist or is not of the right type on the staging server:
Media resource https://staging.totalinsightmanagement.com/resource/6c5a0c28d6b45c19dfa9f61a70b47d0c/test-audio.mp3 could not be decoded, error: Error Code: NS_ERROR_DOM_MEDIA_METADATA_ERR (0x806e0006)
Uncaught (in promise) DOMException: The media resource indicated by the src attribute or assigned media provider object was not suitable.
When I follow the link to the resource directly, I get a message that "No video with supported format and MIME type found."
My local dist created via raco koyo dist
does have the test-audio.mp3 file in it, and it runs fine. Nginx is not configured to deal with mp3's in some special way, at least not in the /etc/nginx/sites-available config. In Chromium-browser (Ubuntu), the hidden button is instead not hidden, and the music also doesn't play. It does not throw any errors that I can see.
I found this, which suggests that the content-type is not properly set. The decoding issue, although then why does it work in development, and even when I use the raco koyo dist
version? Something something docker/https?
app.js
doesn't appear to be loaded, and because of this the toggling of the task description is not working on the task description page.
Specifically, after the consent page, it runs task-study, but somehow skips the first step, 'initialize-tasks
and thereupon fails to set the necessary variables. No amount of refreshing helps. I will add the commit of the code I was on at the time, but nothing to see really. I'll update if it replicates. I wonder if it is related to the other problems we are having with ending a step/study and starting a step/study.
Logs:
12:37:55 web.1 | [2021-02-17 12:37:55] [ 19650] [ debug] study: step #(struct:step consent #procedure:consent #<procedure:consent/bo
t> #procedure:temp104) returned continue
12:37:55 web.1 | [2021-02-17 12:37:55] [ 19650] [ debug] study: GET
12:37:55 web.1 | stack: (root the-study)
12:37:55 web.1 | key: consent?
12:37:55 web.1 | [2021-02-17 12:37:55] [ 19650] [ debug] study: PUT
12:37:55 web.1 | stack: (root the-study)
12:37:55 web.1 | key: rest-treatment
12:37:55 web.1 | value: elicit-then-get-rest
12:37:55 web.1 | [2021-02-17 12:37:55] [ 19650] [ debug] study: running step: #(struct:step/study required-tasks #<procedure:...onents
/study.rkt:320:3> #procedure:void #procedure:temp108 #(struct:study (n title max-wrong-tasks hide-description?) (success? correct-answer
s wrong-answers) (#(struct:step start-tasks #<procedure:i...
12:37:55 web.1 | [2021-02-17 12:37:55] [ 19650] [ debug] study: GET
12:37:55 web.1 | stack: (root the-study)
12:37:55 web.1 | key: required-tasks
12:37:55 web.1 | [2021-02-17 12:37:55] [ 19650] [ debug] study: GET
12:37:55 web.1 | stack: (root the-study)
12:37:55 web.1 | key: required-tasks
12:37:55 web.1 | [2021-02-17 12:37:55] [ 19650] [ debug] study: running step: #(struct:step task #procedure:task #<procedure:task/bo
t> #procedure:task-completion)
12:37:55 web.1 | [2021-02-17 12:37:55] [ 19650] [ debug] study: GET
12:37:55 web.1 | stack: (root the-study required-tasks)
12:37:55 web.1 | key: current-matrix
12:37:55 web.1 | Servlet (@ /study/pjb-pilot;((%22k%22%20.%20%22(1%2015%2017938064)%22))) exception:
12:37:55 web.1 | get: value not found for key current-matrix
12:37:55 web.1 |
12:37:55 web.1 | context...:
12:37:55 web.1 | /home/marc/Git/kutat/congame/congame-pjb-studies/tasks.rkt:98:0: task
12:37:55 web.1 | /usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt:375:33
12:37:55 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:371:0: response/step
12:37:55 web.1 | /usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt:375:33
12:37:55 web.1 | [repeats 1 more time]
12:37:55 web.1 | /usr/share/racket/pkgs/web-server-lib/web-server/servlet/web.rkt:123:10
12:37:55 web.1 | /usr/share/racket/pkgs/web-server-lib/web-server/servlet/web.rkt:117:0: send/suspend/dispatch
12:37:55 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:444:0: run-step
12:37:55 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:320:3
12:37:55 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:371:0: response/step
12:37:55 web.1 | /usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt:375:33
12:37:55 web.1 | [repeats 1 more time]
12:37:55 web.1 | /usr/share/racket/pkgs/web-server-lib/web-server/servlet/web.rkt:123:10
12:37:55 web.1 | /usr/share/racket/pkgs/web-server-lib/web-server/servlet/web.rkt:117:0: send/suspend/dispatch
12:37:55 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:444:0: run-step
12:37:55 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:320:3
12:37:55 web.1 | ...
Implement a way to have bot-sets specifically for various testing purposes that are run upon deployment, or can be run easily from the admin interface. Unlike other bot sets:
congame/congame-tests/congame/bots.rkt
Line 44 in 50f44b0
bot-user
created right before, yet I don't believe it should. Is this due to the ON DELETE SET NULL in study_participants? But why would that happen if the bot-user
is not a participant of any study?It seems that git lfs can eat lots of bandwidth without caching, although I don't get why it would need more than without git lfs. Is it just a case that git lfs downloads all files in the pipeline, whereas in a normal pipeline files can be cached more easily -- or is the concern simply that those who use git lfs usually have large files, hence caching becomes important?
If it is worse than the prior solution then (i) why did I start using it and (ii) let's cache it.
The current pilot identifies differences in WTW between subjects, which has lower power. Alternatively, I could elicit WTW repeatedly for each individual and repeat the same experiment multiple times in succession, so that I get a better sense of individual-level effects and see changes in WTW better. However, if the main effect later on is estimated via between-subjects, then I still need that too, but the within subject might allow me to identify better which treatments cause the largest changes in WTW.
The first run might be pure between subjects (ask only once), but the later runs ask twice or more.
Redesign study to have a short tutorial with small fee, followed by all-bonus main study. Make sure to take the baseline into account when bonusing, so that I don't double-pay.
Check how participants get paid on prolific and how to make this easy to handle by either directly hooking congame up with prolific, or generating a csv with user, participant, and payment information.
Due to an error (see #27 (comment)), the transition for 'required-tasks
got called twice hence it attempted to put a payment twice. This led to an error that can't be solved as either normal or admin user.
We probably should disallow the double-calling of a transition, but errors can creep in that break a step and then it almost surely can happen -- or is there a way to avoid this for errors in the handlers?
Nonetheless, should the impossible happen in production, it seems better to log to sentry (with payment details), while leaving the DB alone.
Start at the low end of the spectrum (i.e. short runs) where little time is needed; only later scale up to larger amounts of tasks.
Randomization and initialization of variables is most naturally done at the beginning of a study, but there is currently no way of running them before displaying the first page. I suggest that we add #:pre
and #:post
(or before/after or setup/teardown) hooks to make-step/study
. Currently this can be solved in two ways, both of which are not great.
First, we can pass values in as #:require-bindings
. But this does not work for the top-level study; assumes that the parent study knows how to set certain values in a way that only the child study knows; and requires adding an extra step before make-step/study
is called, even if it is naturally the first step.
Second, we can add the code before the rendering happens in the first step of the child study. But since this code can be run repeatedly by refreshing the page, it shouldn't be mutating (or at least it should be idempotent), which is precisely not what initialization usually is.
When I refreshed the page determine-extra-tasks
, I get an error because car
is passed ()
when it expects a pair. I thought the failing call is (car resume-stack)
here, but this is inside an else-clause where we check for (null? resume-stack)
in the first clause. It went away with several refreshs.
18:08:23 web.1 | [2021-02-16 18:08:23] [ 10678] [ debug] study: PUT
18:08:23 web.1 | stack: (root the-study elicit-WTW-and-work)
18:08:23 web.1 | key: remaining-price-lists
18:08:23 web.1 | value: ()
18:08:23 web.1 | [2021-02-16 18:08:23] [ 10678] [ debug] study: running step: #(struct:step determine-extra-tasks #<procedure:determin
e-extra-tasks> #procedure:handler/bot #procedure:default-transition)
18:08:26 web.1 | [2021-02-16 18:08:26] [ 10678] [ debug] study: GET
18:08:26 web.1 | stack: (root the-study elicit-WTW-and-work)
18:08:26 web.1 | key: remaining-price-lists
18:08:26 web.1 | [2021-02-16 18:08:26] [ 10678] [ debug] study: GET
18:08:26 web.1 | stack: (root the-study elicit-WTW-and-work)
18:08:26 web.1 | key: answered-price-lists
18:08:26 web.1 | Servlet (@ /study/pjb-pilot;((%22k%22%20.%20%22(14%2011%2094073931)%22))) exception:
18:08:26 web.1 | car: contract violation
18:08:26 web.1 | expected: pair?
18:08:26 web.1 | given: '()
18:08:26 web.1 |
18:08:26 web.1 | context...:
18:08:26 web.1 | /home/marc/Git/kutat/congame/congame-pjb-studies/pjb-pilot.rkt:361:15: temp57
18:08:26 web.1 | /usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt:379:33
18:08:26 web.1 | f807
18:08:26 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:408:0: run-study
18:08:26 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:320:3
18:08:26 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:371:0: response/step
18:08:26 web.1 | /usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt:375:33
18:08:26 web.1 | [repeats 1 more time]
18:08:26 web.1 | /usr/share/racket/pkgs/web-server-lib/web-server/servlet/web.rkt:123:10
18:08:26 web.1 | /usr/share/racket/pkgs/web-server-lib/web-server/servlet/web.rkt:117:0: send/suspend/dispatch
18:08:26 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:444:0: run-step
18:08:26 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:320:3
18:08:26 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:371:0: response/step
18:08:26 web.1 | /usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt:375:33
18:08:26 web.1 | [repeats 1 more time]
18:08:26 web.1 | /usr/share/racket/pkgs/web-server-lib/web-server/servlet/web.rkt:123:10
18:08:26 web.1 | ...
18:08:27 web.1 | [2021-02-16 18:08:27] [ 10678] [ debug] study: GET
18:08:27 web.1 | stack: (root the-study elicit-WTW-and-work)
18:08:27 web.1 | key: remaining-price-lists
18:08:27 web.1 | [2021-02-16 18:08:27] [ 10678] [ debug] study: GET
18:08:27 web.1 | stack: (root the-study elicit-WTW-and-work)
18:08:27 web.1 | key: answered-price-lists
18:08:27 web.1 | Servlet (@ /study/pjb-pilot;((%22k%22%20.%20%22(14%2011%2094073931)%22))) exception:
18:08:27 web.1 | car: contract violation
18:08:27 web.1 | expected: pair?
18:08:27 web.1 | given: '()
18:08:27 web.1 |
18:08:27 web.1 | context...:
18:08:27 web.1 | /home/marc/Git/kutat/congame/congame-pjb-studies/pjb-pilot.rkt:361:15: temp57
18:08:27 web.1 | /usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt:379:33
18:08:27 web.1 | f807
18:08:27 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:408:0: run-study
18:08:27 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:320:3
18:08:27 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:371:0: response/step
18:08:27 web.1 | /usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt:375:33
18:08:27 web.1 | [repeats 1 more time]
18:08:27 web.1 | /usr/share/racket/pkgs/web-server-lib/web-server/servlet/web.rkt:123:10
18:08:27 web.1 | /usr/share/racket/pkgs/web-server-lib/web-server/servlet/web.rkt:117:0: send/suspend/dispatch
18:08:27 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:444:0: run-step
18:08:27 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:320:3
18:08:27 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:371:0: response/step
18:08:27 web.1 | /usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt:375:33
18:08:27 web.1 | [repeats 1 more time]
18:08:27 web.1 | /usr/share/racket/pkgs/web-server-lib/web-server/servlet/web.rkt:123:10
18:08:27 web.1 | ...
18:08:27 web.1 | ...
18:08:28 web.1 | [2021-02-16 18:08:28] [ 10678] [ debug] study: GET
18:08:28 web.1 | stack: (root the-study elicit-WTW-and-work)
18:08:28 web.1 | key: remaining-price-lists
18:08:28 web.1 | [2021-02-16 18:08:28] [ 10678] [ debug] study: GET
18:08:28 web.1 | stack: (root the-study elicit-WTW-and-work)
18:08:28 web.1 | key: answered-price-lists
18:08:28 web.1 | Servlet (@ /study/pjb-pilot;((%22k%22%20.%20%22(14%2011%2094073931)%22))) exception:
18:08:28 web.1 | car: contract violation
18:08:28 web.1 | expected: pair?
18:08:28 web.1 | given: '()
18:08:28 web.1 |
18:08:28 web.1 | context...:
18:08:28 web.1 | /home/marc/Git/kutat/congame/congame-pjb-studies/pjb-pilot.rkt:361:15: temp57
18:08:28 web.1 | /usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt:379:33
18:08:28 web.1 | f807
18:08:28 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:408:0: run-study
18:08:28 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:320:3
18:08:28 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:371:0: response/step
18:08:28 web.1 | /usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt:375:33
18:08:28 web.1 | [repeats 1 more time]
18:08:28 web.1 | /usr/share/racket/pkgs/web-server-lib/web-server/servlet/web.rkt:123:10
18:08:28 web.1 | /usr/share/racket/pkgs/web-server-lib/web-server/servlet/web.rkt:117:0: send/suspend/dispatch
18:08:28 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:444:0: run-step
18:08:28 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:320:3
18:08:28 web.1 | /home/marc/Git/kutat/congame/congame-core/components/study.rkt:371:0: response/step
18:08:28 web.1 | /usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt:375:33
18:08:28 web.1 | [repeats 1 more time]
18:08:28 web.1 | /usr/share/racket/pkgs/web-server-lib/web-server/servlet/web.rkt:123:10
18:08:28 web.1 | ...
18:08:33 web.1 | [2021-02-16 18:08:33] [ 10678] [ debug] study: running step: #(struct:step/study the-study #<procedure:...onents/stud
y.rkt:320:3> #procedure:void #procedure:transition #(struct:study (participation-fee practice-tasks required-tasks price-lists) (task-tr
eatment rest-treatment) (#(struct:step explain-study #<pr...
18:08:33 web.1 | [2021-02-16 18:08:33] [ 10678] [ debug] study: running step: #(struct:step/study elicit-WTW-and-work #<procedure:...o
nents/study.rkt:320:3> #procedure:void #procedure:temp101 #(struct:study (price-lists) (WTWs) (#(struct:step introduce-WTW #<procedure:i
ntroduce-WTW> #procedure:handler/bot #<procedure:defaul...
18:08:33 web.1 | [2021-02-16 18:08:33] [ 10678] [ debug] study: GET
18:08:33 web.1 | stack: (root the-study)
18:08:33 web.1 | key: price-lists
Need new operators:
get/group
, put/group
study_data
should have round & group in the primary key.
I got an error where a value can't be get
ted, because it wasn't put
ted. It should however have been put. This is on the local dev server, maybe something to do with this, but this might be one of those weird errors that occur only once in a while and are tricky to pinpoint. Is there a possible problem with a value not yet having been written to the database by the time the step is run that expects it?
It did not happen again after clearing the participant and rerunning the study.
17:42:22 web.1 | [2021-02-16 17:42:22] [ 9765] [ debug] study: running step: #(struct:step/study the-study #procedure:...onents/study.rkt:320:3 #procedure:void #procedure:transition #(struct:study (participation-fee practice-tasks required-tasks price-lists) (task-treatment rest-treatment) (#(struct:step explain-study #<pr...
17:42:22 web.1 | [2021-02-16 17:42:22] [ 9765] [ debug] study: running step: #(struct:step/study required-tasks #procedure:...onents/study.rkt:320:3 #procedure:void #procedure:temp96 #(struct:study (n title max-wrong-tasks hide-description?) (success? correct-answers wrong-answers) (#(struct:step start-tasks #<procedure:in...
17:42:22 web.1 | [2021-02-16 17:42:22] [ 9765] [ debug] study: GET
17:42:22 web.1 | stack: (root the-study)
17:42:22 web.1 | key: required-tasks
17:42:22 web.1 | [2021-02-16 17:42:22] [ 9765] [ debug] study: GET
17:42:22 web.1 | stack: (root the-study)
17:42:22 web.1 | key: required-tasks
17:42:22 web.1 | [2021-02-16 17:42:22] [ 9765] [ debug] study: running step: #(struct:step start-tasks #procedure:initialize-tasks #procedure:continuer #procedure:task-completion)
17:42:22 web.1 | [2021-02-16 17:42:22] [ 9765] [ debug] study: GET
17:42:22 web.1 | stack: (root the-study required-tasks)
17:42:22 web.1 | key: n
17:42:22 web.1 | Servlet (@ /study/pjb-pilot) exception:
17:42:22 web.1 | get: value not found for key n
17:42:22 web.1 |
17:42:22 web.1 | context...:
For whatever reason, the js/audio-player.js
doesn't work, even though it clearly loads since it correctly sets the objects playerpause
and I see it getting loaded. The code is here and for ease copied:
var audioContainer = document.getElementById('audioContainer');
var audio = document.getElementById('audio');
var audioControls = document.getElementById('audio-controls');
var playpause = document.getElementById('playpause');
var volinc = document.getElementById('volume-up');
var voldec = document.getElementById('volume-down');
playpause.addEventListener('click', function(e) {
if (audio.paused || audio.ended) audio.play();
else audio.pause();
});
When clicking the button, all I get is:
Uncaught TypeError: up.syntax is undefined
nativeCallback http://127.0.0.1:5100/static/vendor/unpoly.min.js?rev=dev:1
n http://127.0.0.1:5100/static/vendor/unpoly.min.js?rev=dev:1
and once a complaint (might have been upon loading the page):
Cannot play media. No decoders for requested formats: application/ogg
Yet, when I directly type into the console audio.play()
, it works and the music starts. Similarly, if I copy-paste the above code snippet into the console, then clicking on the button also works.
What gives?
It is possible for participants to do some of the work and then fail at a later stage. In this case, they often can receive partial payment. This requires however that we add a way to mark the study as 'completed in the database.
I suggest that we have a way to mark a substudy as failed
, which is like done
but leads parent studies to throw failed
until there is a level at which it is caught. On the top-level, I will usually want to catch it with a final goodbye screen showing partial payments, as well as the reason for failing. Alternatively, we could simply have a default study that we jump to upon failed
, so that one can only fail from a substudy to the overall study, but nowhere in between.
One issue to deal with is that parent studies expect that a substudy provides its #:provides
-- but this requirement should be overridden on failed
.
Ask whether they actually listened to the songs, whether it was too long, how they decide the payment levels.
This happened to both Marc and I and we have been unable to reproduce it. Might be related to failing a form and then continuing. The error was related to "resuming". Might have been caused by a form failure followed by a jump outside of a substudy.
I tried to run a bot from a bot-set on staging server, but it failed with the following error that I didn't investigate at all due to looking into #39:
error exn:fail:contract
process*: contract violation expected: path-string? given: #f
ID: a15> error exn:fail:contract
process*: contract violation expected: path-string? given: #f
ID: a15a3a07526c4141ad14bb3b99a2d2ef
March 12, 2021, 2:18:50 p.m. UTCException
exn:fail:contract: process*: contract violation
expected: path-string?
given: #f
File ".../racket/system.rkt", line 100, in unknown
File ".../racket/system.rkt", line 98, in do-process*/ports
File ".../marionette/main.rkt", line 46, in start-marionette!
File ".../marionette/main.rkt", line 121, in unknown
File ".../pages/admin.rkt", line 533, in unknown
...
(26 additional frame(s) were not displayed)
a3a07526c4141ad14bb3b99a2d2ef
March 12, 2021, 2:18:50 p.m. UTCException
exn:fail:contract: process*: contract violation
expected: path-string?
given: #f
File ".../racket/system.rkt", line 100, in unknown
File ".../racket/system.rkt", line 98, in do-process*/ports
File ".../marionette/main.rkt", line 46, in start-marionette!
File ".../marionette/main.rkt", line 121, in unknown
File ".../pages/admin.rkt", line 533, in unknown
...
(26 additional frame(s) were not displayed)
The package 'congame-pjb-studies' depends on 'congame-price-lists' and 'study-tools' packages, but when installing via
$ raco pkg install congame-pjb-studies/
if cannot find these packages which exist somewhere on the local machine after all. Am I right to assume that the approach is to install each of the required dependencies manually first for now, and later to host all the packages so they are found?
Chromium browser on Ubuntu does not hide the button on the requirements page (and probably later for the songs). We should check that it works for most browsers, since it's fairly central to the study.
When a library is not installed, the server fails, and sentry doesn't catch this, since the server never gets off the ground.
Since prolific provides prolific-specific emails, we can ask participants to use those to sign up, and to email them updates/notification about study participation if studies go over multiple days.
Figure out if there is anything at all we need to do on the congame side of things to implement this.
Re the build failure, this is one place where the circular dependency is biting us and we should fix it by either coming up with a different mechanism for studies to access configuration or with a different mechanism for studies to be able to define jobs (or both).
For 2htdp/image
, there were several missing (Linux) libraries missing in the docker image, which I only realized upon each new deploy. I added one library at a time, with each new error message on the staging server, but this cycle takes ~5-15 minutes and eats up Github minutes.
One question and one feature:
deploy.sh
script, with a custom development.env
file, or should it have its own separate setup that is simpler and interferes less with staging/production? Any best practices (or other ways to achieve the same)?@Bogdanp :
I pushed a broken commit as I am trying to implement email again. The issue, if you remember, is that the job broker needs to have access to the mailer in order to be able to set up jobs for email sending anywhere in studies. In the earlier version, we did this via system-ref
-- which is done via ... system, I guess? I can't figure out where define-system
is defined, so currently I get the error that system-ref
used elsewhere is undefined.
The questions are:
(system-ref 'mailer)
to work in congame-pjb-studies/...
? (I don't know, found a define-system in koyo/console
, but didn't see that imported previously.)with-sentry
is there to ensure I get notified if the job trips up (I am 90% certain of this, but checking) (define-job (send-study-completion-email u payment)
(with-sentry
(define mailer (system-ref 'mailer))
(mailer-send-study-completed-email mailer u payment)))
(define (send-completion-email)
(schedule-at
(get-moment)
(send-completion-email
(user-username (current-user))
(get-payment (current-participant-id)))))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.