~russo79/mnemosyne-proj/force-matplotlib-pyqt4-backend

« back to all changes in this revision

Viewing changes to mnemosyne/mnemosyne/cle/review_widget.py

  • Committer: Peter.Bienstman at UGent
  • Date: 2014-06-11 19:05:49 UTC
  • Revision ID: peter.bienstman@ugent.be-20140611190549-jwo465yeepay8dka
More Android work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
from mnemosyne.libmnemosyne.ui_components.review_widget import ReviewWidget
6
6
 
7
7
 
8
 
class ReviewWdgt(ReviewWidget):
9
 
    
10
 
    def __init__(self, component_manager):
11
 
        ReviewWidget.__init__(self, component_manager)
12
 
        self.callbacks = {}
13
 
        
14
 
    def set_callback(self, name, callback):
15
 
        self.callbacks[name] = callback    
 
8
class ReviewWdgt(ReviewWidget):  
16
9
 
17
10
    def redraw_now(self):
18
 
        self.callbacks["redraw_now"]()
 
11
        pass
19
12
 
20
13
    def show_answer(self):
21
14
        self.review_controller().show_answer()
24
17
        self.review_controller().grade_answer(grade)
25
18
 
26
19
    def set_question_box_visible(self, is_visible):
27
 
        self.callbacks["set_question_box_visible"](is_visible)
 
20
        pass
28
21
 
29
22
    def set_answer_box_visible(self, is_visible):
30
 
        self.callbacks["set_answer_box_visible"](is_visible)
 
23
        # TODO
 
24
        pass
31
25
        
32
26
    def set_question_label(self, text):
33
 
        self.callbacks["set_question_label"](text)
 
27
        self.component_manager().activity.setQuestionLabel(self.text)
34
28
 
35
29
    def set_question(self, text):
36
 
        self.callbacks["set_question"](text)
 
30
        self.question = text
37
31
        
38
32
    def set_answer(self, text):
39
 
        self.callbacks["set_answer"](text)
 
33
        self.answer = text
 
34
        
 
35
    def reveal_question(self):
 
36
        self.component_manager().activity.setQuestion(self.question)
 
37
        
 
38
    def reveal_answer(self):
 
39
        self.component_manager().activity.setAnswer(self.answer)
40
40
        
41
41
    def clear_question(self):
42
 
        self.callbacks["clear_question"]()
 
42
        self.question = ""
 
43
        self.reveal_question()
43
44
        
44
45
    def clear_answer(self):
45
 
        self.callbacks["clear_answer"]()
 
46
        self.answer = ""
 
47
        self.reveal_answer()
46
48
 
47
49
    def update_show_button(self, text, is_default, is_enabled):
48
 
        self.callbacks["update_show_button"](text, is_default, is_enabled)
 
50
        pass
49
51
 
50
52
    def set_grades_enabled(self, is_enabled):
51
 
        self.callbacks["set_grades_enabled"](is_enabled)
 
53
        pass
52
54
 
53
55
    def set_default_grade(self, grade):
54
 
        self.callbacks["set_default_grade"](grade)
 
56
        pass
55
57
 
56
58
    def update_status_bar_counters(self):
 
59
        # TODO
57
60
        scheduled_count, non_memorised_count, active_count = \
58
61
            self.review_controller().counters()
59
 
        self.callbacks["update_status_bar_counters"]\
60
 
            (scheduled_count, non_memorised_count, active_count)
 
62