예제 #1
0
 def show_text(self, text):
     if len(text) > 0:
         new_lines = HebrewManagement.multiline(text, 45)
         for nl in range(0, len(new_lines)):
             self.the_widget.cg_lbl[nl].text = new_lines[nl]
     else:
         for l in self.the_widget.cg_lbl:
             l.text = ''
 def show_text(self, text):
     if len(text) > 0:
         new_lines = HebrewManagement.multiline(text, 45)
         for nl in range(0, len(new_lines)):
             self.the_widget.cg_lbl[nl].text = new_lines[nl]
     else:
         for l in self.the_widget.cg_lbl:
             l.text = ''
예제 #3
0
    def start(self, pars):
        if self.first_update:
            self.first_update = False
            dx = float(self.the_app.sm.size[0]) / float(
                self.the_app.original_size[0])
            dy = float(self.the_app.sm.size[1]) / float(
                self.the_app.original_size[1])
            text_based_widgets = [Label]
            for l1 in self.children:
                if type(l1) in text_based_widgets:
                    l1.font_size = int(l1.font_size * dx)
                    l1.size_hint_y *= dy
                else:
                    for l2 in l1.children:
                        if type(l2) in text_based_widgets:
                            l2.font_size = int(l2.font_size * dx)
                            l2.size_hint_y *= dy
                        else:
                            for l3 in l2.children:
                                if type(l3) in text_based_widgets:
                                    l3.font_size = int(l3.font_size * dx)
                                    l3.size_hint_y *= dy
        final_score = 'high'

        # total_info in percentage
        if 'total_info' in self.the_app.score.score:
            score = self.the_app.score.score['total_info']
            if score < 0:
                score = 0.75

            if score < 0.25:
                final_score = 'low'
            else:
                if score < 0.5:
                    final_score = 'medium'

        new_lines = HebrewManagement.multiline(
            self.statements[final_score]["s1"][::-1], 75)
        for nl in range(0, len(new_lines)):
            self.statement_label[nl].text = new_lines[nl]

        KL.log.insert(action=LogAction.data,
                      obj='FacultyGame',
                      comment='The End',
                      sync=True)
예제 #4
0
    def start(self, pars):
        final_score = 'high'

        # total_info in percentage
        if 'total_info' in self.the_app.score.score:
            score = self.the_app.score.score['total_info']
            if score < 0:
                score = 0.75

            if score < 0.25:
                final_score = 'low'
            else:
                if score < 0.5:
                    final_score = 'medium'

        new_lines = HebrewManagement.multiline(self.statements[final_score]["s1"][::-1], 75)
        for nl in range(0, len(new_lines)):
            self.statement_label[nl].text = new_lines[nl]
예제 #5
0
    def start(self, pars):
        final_score = 'high'

        # total_info in percentage
        if 'total_info' in self.the_app.score.score:
            score = self.the_app.score.score['total_info']
            if score < 0:
                score = 0.75

            if score < 0.25:
                final_score = 'low'
            else:
                if score < 0.5:
                    final_score = 'medium'

        new_lines = HebrewManagement.multiline(
            self.statements[final_score]["s1"][::-1], 75)
        for nl in range(0, len(new_lines)):
            self.statement_label[nl].text = new_lines[nl]
예제 #6
0
    def __init__(self, the_app):
        super(ConsentForm, self).__init__()
        self.the_app = the_app
        self.dict = {'title':self.title,
                'body':self.body,
                'checkbox_txt':self.checkbox_txt,
                'button':self.button}
        store = JsonStore('consent_form.json').get('agreement')
        for key, value in store.items():
            self.dict[key].text = value[::-1]

        self.body_labels = []
        txt = self.dict['body'].text
        new_lines = HebrewManagement.multiline(txt, 50)
        for nl in new_lines[::-1]:
            self.body_labels.append(Label(text=nl,
                      font_name="fonts/the_font",
                      font_size=36,
                      color=[0,0,0,1]))
            self.dict['body'].add_widget(self.body_labels[-1])
예제 #7
0
    def __init__(self, the_app):
        super(ConsentForm, self).__init__()
        self.the_app = the_app
        self.dict = {
            'title': self.title,
            'body': self.body,
            'checkbox_txt': self.checkbox_txt,
            'button': self.button
        }
        store = JsonStore('consent_form.json').get('agreement')
        for key, value in store.items():
            self.dict[key].text = value[::-1]

        self.body_labels = []
        txt = self.dict['body'].text
        new_lines = HebrewManagement.multiline(txt, 50)
        for nl in new_lines[::-1]:
            self.body_labels.append(
                Label(text=nl,
                      font_name="fonts/the_font",
                      font_size=36,
                      color=[0, 0, 0, 1]))
            self.dict['body'].add_widget(self.body_labels[-1])