Exemple #1
0
    def test_set_response(self):
        survey = Form(self.win, items=[self.genderItem], size=(1.0, 0.3), pos=(0.0, 0.0), autoLog=False)
        textStim, questionHeight, questionWidth = survey._setQuestion(self.genderItem)
        sliderStim, respHeight = survey._setResponse(self.genderItem, textStim)

        assert type(sliderStim) == Slider
        assert type(respHeight) == float
Exemple #2
0
    def test_set_response(self):
        survey = Form(self.win, items=[], size=(1.0, 0.3), pos=(0.0, 0.0))
        textStim, qHeight, qWidth = survey._setQuestion(self.genderItem)
        sliderStim, aHeight = survey._setResponse(self.genderItem, textStim)

        assert type(sliderStim) == Slider
        assert type(aHeight) == float
Exemple #3
0
    def test_set_response(self):
        survey = Form(self.win, items=[self.genderItem], size=(1.0, 0.3), pos=(0.0, 0.0), autoLog=False)
        textStim, questionHeight, questionWidth = survey._setQuestion(self.genderItem)
        sliderStim, respHeight = survey._setResponse(self.genderItem, textStim)

        assert type(sliderStim) == Slider
        assert type(respHeight) == float
Exemple #4
0
    def test_set_response(self):
        survey = Form(self.win, items=[self.genderItem], size=(1.0, 0.3),
                      pos=(0.0, 0.0), autoLog=False)
        ctrl, h, w = survey._setQuestion(self.genderItem)
        sliderStim, respHeight = survey._setResponse(self.genderItem)

        assert type(sliderStim) == Slider
        assert type(respHeight) in [float, np.float64]
Exemple #5
0
    def test_baseYpositions(self):
        survey = Form(self.win, items=self.questions, size=(1.0, 0.3), pos=(0.0, 0.0))
        testPositions = []
        survey.virtualHeight = 0
        for item in survey.items:
            question, qHeight, qWidth = survey._setQuestion(item)
            response, aHeight, = survey._setResponse(item, question)
            testPositions.append(survey.virtualHeight
                                 - max(aHeight, qHeight)
                                 + (aHeight / 2)
                                 - survey.textHeight)
            survey.virtualHeight -= max(aHeight, qHeight) + survey.itemPadding

        for idx, pos in enumerate(survey._baseYpositions):
            assert testPositions[idx] == pos