empiricaly / meteor-empirica-core

Core Meteor package for the experiment Empirica platform. This is where you should submit issues.
MIT License
27 stars 13 forks source link

When someone exits early for game, game continues to wait for player #261

Closed dawnwages closed 2 years ago

dawnwages commented 2 years ago

Expected Behavior

When a player exits early with player.exit("playerQuit"), the user is brought to the exit steps. The other players will be able to continue the game without having to wait for the exited player. This will have a cascade of affects like removing the player from chat, ignoring player confirmation on Wait component / longTermEngagement Treatment handled outside of core on client in order to continue with expected game play.

Current Behavior

When a player exits early with player.exit("playerQuit"), the user is brought to the exit steps, while game continues to wait for a response for the exited player.

Possible Solution

Setting an inactive or exited as a Date field on the exited game.player object for client-side game to build features that address exited player, and update core so game only waits for player.stage.submit() on active players (players that do not have a value for inactive or exited), similar to the way stage submitted is handled.

Steps to Reproduce (for bugs)

https://github.com/Watts-Lab/multi-task-empirica/

  1. treatment set exitEarly to true which enables a button for player to exit in Task component

    
    quitEarly(event){
    const { player } = this.props;
     event.preventDefault();
     player.exit('playerQuit');
    }
    
    showQuitEarly(){
    const { game } = this.props;
    if (game.treatment.quitEarly === true){
      return(
          <Button
            type="button"
            onClick={e => this.quitEarly(e)}
            icon={"tick"}
            large={true}
            fill={true}
          >
            Skip to Exit
          </Button>
      )
    }
    }

Image of treatments: ![treatment_screenshot](https://user-images.githubusercontent.com/20374042/143087222-6b913ecb-3d51-47b7-8157-313955546456.png)
2. One of the simulated players clicks exit and successfully jumps to `ExitSurvey` component.
3. You will then see the issue that the other player(s) will not be able to continue and the game waits for the exited player's response.

## Context
https://github.com/Watts-Lab/multi-task-empirica/
In order to implement the quitEarly feature for muti-task app. This is needed for experiments with Watts Lab/

## Your Environment
Chrome/FF
Node 14.17.0
npm 6.14.13
Desktop

- Version used:
- Environment name and version (e.g. Chrome 39, node.js 5.4):
- Operating System and version (desktop or mobile):
- Link to your project: https://github.com/Watts-Lab/multi-task-empirica/
dawnwages commented 2 years ago

Thanks for checking this out for me @npaton

npaton commented 2 years ago

I see, indeed, this is a problem 😅 Thank you for the report. We will look into this, hopefully pushing a fix soon.

npaton commented 2 years ago

@dawnwages This should be fixed, let us know otherwise ⛵