Esempio n. 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
Esempio n. 2
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
Esempio n. 3
0
    def test_set_questions(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)

        assert type(textStim) == TextStim
        assert type(questionHeight) == float
        assert type(questionWidth) == float
Esempio n. 4
0
    def test_set_questions(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)

        assert type(textStim) == TextStim
        assert type(questionHeight) == float
        assert type(questionWidth) == float
Esempio n. 5
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
Esempio n. 6
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]
Esempio n. 7
0
    def test_set_questions(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)

        assert type(ctrl) == TextBox2
        assert type(h) in [float, np.float64]
        assert type(w) in [float, np.float64]
Esempio n. 8
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