Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PreferenceTest can't randomize AB choice #17

Open
MeowAlienOwO opened this issue Apr 1, 2019 · 2 comments
Open

PreferenceTest can't randomize AB choice #17

MeowAlienOwO opened this issue Apr 1, 2019 · 2 comments

Comments

@MeowAlienOwO
Copy link

Error Behaviour: Not able to randomize AB choice, it always represent as defined in test case.

In file beaqle.js line 1375,

    // create random file mapping if not yet done
    if (!this.TestState.FileMappings[TestIdx]) 
        this.TestState.FileMappings[TestIdx] = {"A": "", "B": ""};
       var RandFileNumber = Math.random();
      // ----- Highlight this line (line 1375)
      if (this.TestConfig.RandomizeFileOrder && RandFileNumber>0.5) { 
      // ----- end
           this.TestState.FileMappings[TestIdx].A = "B";
           this.TestState.FileMappings[TestIdx].B = "A";
       } else {
           this.TestState.FileMappings[TestIdx].A = "A";
           this.TestState.FileMappings[TestIdx].B = "B";
        }                
    }	

It seems a flag RandomizeFileOrder is set to decide whether to randomly shuffle AB choice or not, but I can't find where to enable it. According to the code there is nowhere to set the RandomiizeFileOrder object, as a consequence we can never randomize AB order.

As a temporary solution I deleted the RandomizeFileOrder part, but I think it should be a kind of config to let the user enable/disable randomly shuffle AB choice.

@v-nhandt21
Copy link

My solution is just set the flag RandomizeFileOrder to be True

image

@martinholters
Copy link
Member

Yep, looks like that's how it is meant to be used, but needs to be documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants