Skip to content

Commit

Permalink
Выход в меню со статистики
Browse files Browse the repository at this point in the history
  • Loading branch information
D1midr0sh committed Nov 23, 2023
1 parent d0e01e3 commit 5a48fc6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
18 changes: 18 additions & 0 deletions designs/stats.ui
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@
<string/>
</property>
</widget>
<widget class="QPushButton" name="backButton">
<property name="geometry">
<rect>
<x>660</x>
<y>520</y>
<width>201</width>
<height>71</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>24</pointsize>
</font>
</property>
<property name="text">
<string>Назад</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
Expand Down
7 changes: 6 additions & 1 deletion stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,10 @@ def __init__(self):
self.lastPoem.setText(f"Последний изученный стих: {poem[1]}\nАвтор: {poem[2]}")
self.cur.execute("""SELECT AVG(wrong_ratio) FROM poem""")
avg = round(self.cur.fetchone()[0], 2)
print(avg)
self.avgRatio.setText(f"Средний коэффициент правильности за все стихи: {avg}")
self.backButton.clicked.connect(self.exit_to_main_menu)

def exit_to_main_menu(self):
self.con.close()
self.hide()
main.Main().show()

0 comments on commit 5a48fc6

Please sign in to comment.