Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 06 19:36

    dependabot[bot] on npm_and_yarn

    (compare)

  • Jan 06 19:36
    dependabot[bot] closed #225
  • Jan 06 19:36
    dependabot[bot] commented #225
  • Jan 06 19:36
    dependabot[bot] labeled #235
  • Jan 06 19:36
    dependabot[bot] opened #235
  • Jan 06 19:36

    dependabot[bot] on npm_and_yarn

    Bump tinymce from 4.1.3 to 5.6.… (compare)

  • Dec 26 2020 19:17
    Yibeichan starred human-nature-lab/breadboard
  • Dec 19 2020 20:05
    disperse assigned #234
  • Dec 19 2020 20:05
    disperse labeled #234
  • Dec 19 2020 20:05
    disperse opened #234
  • Dec 18 2020 00:39

    wyattis on vue-players

    move custom params logic into c… (compare)

  • Dec 17 2020 03:41

    wyattis on vue-players

    better emulate breadboard 2.3 b… (compare)

  • Dec 09 2020 15:42

    wyattis on vue-players

    slight changes (compare)

  • Dec 09 2020 15:28

    wyattis on vue-players

    allow admin to continue game wi… remove 0's from transition page Fix hanging delays during walle… (compare)

  • Dec 03 2020 15:40

    wyattis on vue-players

    fix up dragging. change layout … (compare)

  • Dec 02 2020 16:22

    wyattis on vue-players

    fix dragging issues (compare)

  • Dec 01 2020 22:46

    wyattis on vue-players

    missing change (compare)

  • Dec 01 2020 22:45

    wyattis on vue-players

    fix double counting of money in… (compare)

  • Dec 01 2020 19:37

    wyattis on vue-players

    fixing bugs (compare)

  • Dec 01 2020 16:58

    wyattis on vue-players

    Fix concurrent modification err… (compare)

disperse
@disperse
@Mollyrollo It isn’t well documented at this point, take a look in ‘breadboard/groovy/graph.groovy` around line 97 for the code that adds timers.
We use some custom timers in the Coloring Game we published here: https://github.com/human-nature-lab/ColoringGame/blob/master/Steps/GameStartStep.groovy
disperse
@disperse
The short answer for cancelling timers is just to set player.timers = [:] and it will no longer be displayed
Ugur Yildirim
@uguryi
@disperse I want to show my subjects a slider with possible values 0.0 to 1.0 (or, 0 to 100, doesn't really matter). I'm currently using the following code chunk, but this code doesn't show the subjects the values corresponding to specific selections on the bar. Is there a way to add this info? In other words, I want my subjects to be able to see exactly what number their selection corresponds to on the slider.
    a.add(player,
      [name: "Submit",
       custom: """
       <p><strong>TODO</strong></p>
       <div>
         <input type="range" class="param" min="0" max="100" name="range" ng-model="range" required>
       </div>
       <p><hr></p>
       """.toString(),
       result: { params->
         a.addEvent("FractionGive1", ["pid": player.id,
                                      "give1": params['range']])
       }])
Mollyrollo
@Mollyrollo
when I do player.timers = [:] it gives me an error and doesn't get rid of the timer
disperse
@disperse
Oh, sorry, that was an incomplete snippet, it would be:
g.V.each { player->
  player.timers = [:]
}
Mollyrollo
@Mollyrollo
oh it works now thank you!
disperse
@disperse
@uguryi You can add hashmarks and labels on the slider using HTML: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/range
Alternately, you could display the current value using Javascript.
Ugur Yildirim
@uguryi
@disperse I'm not very familiar with Javascript. Is it easy to display the current value? How do I do it? That's exactly what I'm looking for.
disperse
@disperse
@uguryi It’s pretty easy, you’re looking for something like this:
a.add(player,
      [name: "Submit",
       custom: """
       <p><strong id="rangeValue">Value: 50</strong></p>
       <div>
         <input id="rangeInput" onchange="updateRangeValue" type="range" class="param" min="0" max="100" name="range" ng-model="range" required>
       </div>
       <p><hr></p>

        <script>
        jQuery('#rangeInput').change(function() {
          jQuery('#rangeValue').html('Value: ' + jQuery('#rangeInput').val())
        })
       </script>

       """.toString(),
       result: { params->
         a.addEvent("FractionGive1", ["pid": player.id,
                                      "give1": params['range']])
       }])
Ugur Yildirim
@uguryi
@disperse Thanks!
Ugur Yildirim
@uguryi
For the record, something like the following also works for adding value indicator to a range object:
<div>
         <input type="range" name="inputNameGive1" id="inputIdGive1" value="0.5" min="0" max="1" step="0.01" 
                oninput="outputIdGive1.value = inputIdGive1.value" ng-model="range" class="param" required>
         <output name="outputNameGive1" id="outputIdGive1">0.5</output>
       </div>
@disperse Is there a way to make sure g.pairs() only pairs up active participants? I think it simply pairs up anyone who is in the graph without regard to whether they are dropped or not.
disperse
@disperse
@uguryi You’ll have to create your own pairs method to filter, something like:
def activePlayers = g.V.filter{it.active}.iterator().toList()
    for (int i = 0; i < activePlayers.size(); i += 2) {
      if (activePlayers.size() > (i + 1))
         g.addTrackedEdge(activePlayers.get(i), activePlayers.get(i + 1), "connected")
    }
Ugur Yildirim
@uguryi
Thanks!
Ugur Yildirim
@uguryi

@disperse I'm almost done coding the experiment. Now, I just need to figure out how to let random AI's take over dropped players the right way. I'm currently using the following DropPlayerStep:

a.setDropPlayers(false)
a.setIdleTime(idleTime.intdiv(2))
a.setDropPlayerClosure({ player->
  a.addEvent("DropPlayer", ["pid": (player.id)])
  player.text = c.get("Dropped")
  a.ai.add(player)
})

However, what's happening is that when a player gets dropped, Breadboard first shows the Dropped content for a few seconds together with the Begin button, and then it's back to the earlier content minus the Begin button, and then the game freezes. This will almost certainly be the case with choices other than Begin too, but here's the example code where I'm experiencing this error:

  g.V.each { player->
    if (player.ai == 1) {
      // skip
    } else {
      player.text = c.get("StartPos", player.private.startPos, player.private.startScore) + 
                    "<p><strong>Click 'Begin' to join the game.</strong></p>"
      a.add(player, [name: "Begin", 
                     result: {player.text = c.get("StartPos", player.private.startPos, player.private.startScore) + 
                                            "<p><strong>Thank you, the game will begin in a moment.</strong></p>"}])
    }
  }
disperse
@disperse
Try adding player.dropped = true to the drop player closure. That should hide everything and display a “You have been dropped for being idle” message by default. You can customize the message in the Client HTML tab of the Customize dialog.
Ugur Yildirim
@uguryi
Great, I think that works now. Thanks @disperse !
Ugur Yildirim
@uguryi
@disperse Is it possible to let workers know how many seconds/minutes are remaining until the initStep starts? I feel like sometimes players get bored waiting after reading the tutorial (especially those who join right after the task is posted), and then they visit another page to read the news or something, and by the time they are back, the game has already started and they are dropped for being idle. Is there a way to avoid this?
disperse
@disperse
Yes, if you check the “Start initStep automatically” checkbox then breadboard will set a global startAt variable with the unix timestamp when the game will start. You can use that to add a timer with code in onJoinStep like:
    def curTime = new Date().getTime()
      if (!startAt) {
        startAt = curTime + 1000000
      }
      g.addTimer("player": player, time: ((startAt - curTime)/1000).toInteger(), type: "time", appearance: "info", timerText: "The game will start in:", direction: "down", result: {})
The if (!startAt) block just sets the timer to 1000 seconds in the future if startAt isn’t set (which it won’t be if you haven’t submitted a HIT to AMT).
Ugur Yildirim
@uguryi
@disperse For some reason, the code chunk you gave doesn't work when I try the experiment locally. I try signing in as a subject but never see the tutorials... Any ideas?
disperse
@disperse
Hmm, I’m not sure, are you getting player from playerId in the onJoinStep? Double-check the addTimer method in breadboard/groovy/graph.groovy and make sure the syntax hasn’t changed.
Ugur Yildirim
@uguryi
@disperse the problem has something to do with startAt or curTime. When I manually add a time such as 1000, then it works fine.
disperse
@disperse
You might need to assign startAt as a global variable, put startAt = false outside of the onJoinStep entirely (at the top of the file) and then it will be in global scope.
Ugur Yildirim
@uguryi
Yep, I think I need to do something like that. Will it be overridden by the actual startAt value when I launch the experiment on mTurk? Or, will I need to delete that if statement when running the experiment on mTurk?
disperse
@disperse
Yes, it should be overwritten when you submit the HIT
Ugur Yildirim
@uguryi
Thanks!
Ugur Yildirim
@uguryi

@disperse I'm experiencing a strange problem where choices that are only supposed to be shown to non-AI players are shown to AI's, which slows the experiment down because AI's are not programmed to make those decisions, so I need to wait until they are dropped for the game to move on. When I'm looping over players using g.V.each { player-> ... }, I specifically do something like if (player.ai == 1 || player.dropped == 1) { // skip } else { ... }. However, even when I do this, Breadboard seems to be expecting a choice from dropped AI's... Do you have any ideas about what's going on? I'm guessing this could be related to Breadboard being slow in actually labeling those dropped players as AI since another chunk of code that's supposed to fill in choices for AI's isn't working too... It's as if even after seeing the Dropped screen, those players are still not being treated as AI's...

Update: When I add a random delay using the following, the problem seems to go away... Very strange.

def randomDelay = 1000 + r.nextInt(2000)
  new Timer().runAfter(randomDelay) {
    dictator1To2Step.start()
  }
Brenda
@brenda6268
@disperse I met a problem: in the process of running our game, it was suddenly terminated and reported an error. This situation not always happen, but sometimes it occurs, and we don't know what's wrong with it. This is snapshot: https://drive.google.com/file/d/1nSuX7wS0d-ZycxauCygjp8zLQh5786GS/view?usp=sharing
disperse
@disperse
’No such property: network for class’ makes me think the script is looking for a network global variable or parameter that has not been set.
Brenda
@brenda6268
@disperse, I have a question about the automatic start the game: when all players join into the game through the web site of the instance. It seems that the game administrator must press the 'Start InitStep' button, then the game could run. How to let the game automatically start to run as soon as there are enough players join into the game? Thanks in advance.
disperse
@disperse
@brenda6268 If you check the “Start initStep automatically…” checkbox when submitting a HIT to AMT it will start a timer and automatically run initStep after the Tutorial time + Assignment duration elapses (some details here: https://github.com/human-nature-lab/breadboard/wiki/Creating-A-HIT).
There is a startAt global variable that is set with the unix timestamp of when the initStep will be run. You can use that to display a timer to the AMT workers as follows:
  def curTime = new Date().getTime()
  if (!startAt) {
    startAt = curTime + 1000000
  }
  g.addTimer("player": player, time: ((startAt - curTime)/1000).toInteger(), type: "time", appearance: "info", timerText: "The game will start in:", direction: "down", result: {})
Shrey Patel
@pshrey4201
@disperse, Hi, I wanted to ask about some trouble I have been experiencing with client-graph.js, where if I make changes to the file like increasing the node size, and then I export the experiment and then import the experiment again, the values that I changed are getting reset to the default value. I was wondering if someone has experienced this issue before, and if so how to fix it. Thank you
disperse
@disperse
@pshrey4201 Are you making changes in the Customize -> Client Graph dialog inside of breadboard or making changes to the client-graph.js file directly? If you make changes to the client-graph.js file and then export the experiment, the client-graph.js file is overwritten.
Shrey Patel
@pshrey4201
@disperse I am making the changes in the customize -> client graph dialog inside of breadboard
disperse
@disperse
It sounds like client-graph.js is not exporting correctly in v2.3. As a work-around, you can copy the contents of the editor and save it separately. We have done a lot of work on customizing experiments and direct file editing mode for v2.4 which should solve these issues for you. Unfortunately, v2.4 is on hold while we direct our efforts on our COVID tracking app Hunala. We’ll get back to v2.4 as soon as we can.
Shrey Patel
@pshrey4201
Got ya, thanks
Shrey Patel
@pshrey4201
@disperse, Hi, I wanted to ask if it was possible to change the text of the button at the end of the g.submitForm() function as marked in the attached screenshot. Link: https://drive.google.com/file/d/1TgS1BnFwmZallCg-Ivexmoi1FikrW6oy/view?usp=sharing(https://drive.google.com/file/d/1TgS1BnFwmZallCg-Ivexmoi1FikrW6oy/view?usp=sharing)
disperse
@disperse
@pshrey4201 Yeah, the easiest way to do this is to modify the code in the breadboard/groovy/graph.groovy file. The getSubmitForm method should be defined around line 195, just change the Submit HIT text to anything you want.
Shrey Patel
@pshrey4201
Thank you
Neelabja
@Neelabja
Hi, I am very new to breadboard. I was just wondering if there was any workaround by which I can deploy my breaboard experiments for online participation (say my friends etc) without having to integrate in anyway with AMT. Any help will be much appreciated.
disperse
@disperse
@Neelabja Yes, you can provide your friends with a login URL. After creating an Experiment Instance you’ll see a “Client URL” link inside of the Experiment Instances dialog. Provide that link to your friends or other participants. The password is empty by default but you can set a global variable called password if you want to set one. (put password = “breadboard” inside of a new empty step).
Neelabja
@Neelabja
@disperse so the issue is: the client url in my experiment instance (say right now: it is, http://localhost:9000/game/<randomnumber>/<randomnumber>/login) is only accessible from the browsers of my device which is currently hosting and running the breadboard instance..i or anybody from my device can play as player with that link from my device.. But if i send the link out to a subject to participate on their own device browser..it throws up the usual "this site cannot be reached".. so is it that i still have to deploy it through a web server..so that anybody anywhere can access it through a link... and is that at all possible to be deployed in breadboard without AMT? all the documentations that i came across had used AMT...so it will be great if you can provide me any clue or directions. thanks in advance
disperse
@disperse
Yes, you’ll need to put it up on a server. It is somewhat simplified in that you will not need a domain name or SSL certificate if you’re not using AMT. You can follow the instructions here, skipping steps 2 and 3: https://github.com/human-nature-lab/breadboard/wiki/Setting-up-a-Server
Shrey Patel
@pshrey4201
@disperse Hey, I wanted to ask about an issue with a bug I am running into and I wanted to get info on it. The bug is that with more than 20 people and no ai, breadboard is unresponsive and we cant really play the experiment, however the backend is still fine. I am attaching a screenshot of the log. Could you tell me what the issue may be. Thank you. https://drive.google.com/file/d/1DIpxDbBmaEHSyLu-Vj0DRzux8gIRcVNh/view?usp=sharing
disperse
@disperse
You’re getting a null pointer exception inside a timer. The two most common timers are a timer to start the game (usually within InitStep) and the drop player timer. Check the code there and see if you can find the place where the NPE is thrown.