❓ TeacherAssistant · FAQ

v1.0.8+
📦 How do I install the required dependency PySideAbdhUI?

The application relies on the custom PySideAbdhUI library. You can install it using any of these methods (as documented in main.py):

  • Local wheel (recommended for end users):
    pip install F:\path\to\PySideAbdhUI-1.0.8-py3-none-any.whl
  • Editable install (for development):
    pip install -e F:\Projects\Python\PySideAbdhUI
  • Direct from GitHub:
    pip install git+https://github.com/abdhmohammadi/PySideAbdhUI.git

Make sure your Python environment is activated (e.g., env\Scripts\activate on Windows).

🔌 How do I connect to the PostgreSQL database?

When you launch the app, a connection dialog (PostgreSqlConnectionWidget) appears automatically. You must provide:

  • Host (default: localhost)
  • Port (default: 5432)
  • Database name
  • Username (default: postgres)
  • Password

After successful connection, the settings are saved to %LOCALAPPDATA%\Abdh\TeacherAssistant\settings.json. The app will then load the Home page (StudentListPage). If connection fails, the dialog stays open – check your PostgreSQL service and credentials.

🛠️ How do I build an executable and installer for Windows?

The project includes a complete build pipeline:

  1. Install dependencies (including pyinstaller).
  2. Compile resources: python scripts/compile_qrc.py (generates resources_rc.py).
  3. Run PyInstaller with the provided spec file:
    pyinstaller .\scripts\TeacherAssistant.spec
  4. Use InnoSetup to create a Windows installer from the generated dist/TeacherAssistant/ folder.

If pyinstaller is not in PATH, use the full path e.g.:
C:\Users\AbdhM\AppData\Roaming\Python\Python314\Scripts\pyinstaller .\scripts\TeacherAssistant.spec

The installer can optionally bundle PostgreSQL command-line tools (pg_dump, pg_restore) for backup/restore features.

🎨 How do I change the theme or font?

Open the right settings panel (gear icon or “Settings” from left menu). There you can:

  • Select a theme from the dropdown – available themes are defined by theme_manager.get_all_themes().
  • Pick a font family and size (tiny, small, medium, large).
  • Switch the interface direction (Left-to-Right or Right-to-Left).

Changes apply immediately to the whole application and are saved in settings.json under the font, theme, and direction keys.

🌐 Does the app support multiple languages?

Currently, the settings panel includes a language selector (English / فارسی). However, as noted in main_window.py, the language feature is not yet fully implemented globally – it is planned for future updates. The direction setting (RTL/LTR) does work and affects the main window layout.

You can still select a language; the choice is stored in settings.json but does not yet translate UI strings.

💾 How do I backup or restore the database?

Use the Database maintenance page (accessible from the left panel: “Database maintenance”). You need to have PostgreSQL tools (pg_dump, pg_restore) installed and their path configured in settings.json (key postgreSQL tools path). Then you can:

  • Choose a backup directory
  • Perform a full backup of the current database
  • Restore from a previous backup file

The page (DatabaseManagerPage) reads connection settings automatically from settings.json.

🏠 What is the "Home" page and how is it loaded?

The Home page is the StudentListPage class. It is loaded immediately after a successful database connection via main_window.load_students_page(None). This page displays the list of students and is the central management hub. You can also navigate to it at any time by clicking the Students button in the left panel.

The loading sequence: main.py → connection dialog success → load_students_page()uncheck_items()add_page(StudentListPage(...)) → Home view appears.

📚 How do I manage educational resources?

The app provides two dedicated pages:

  • Resource collectionEduResourcesView: read‑only viewer for existing resources, can filter by target students.
  • Resource EditorEducationalResourceEditor: allows creating, editing, and deleting educational materials (e.g., notes, links, files).

Both are accessible from the left navigation panel. Resources are stored in the PostgreSQL database (specific schema not shown in provided code).

📁 Where are settings saved?

All persistent settings are stored in a settings.json file located at:

%LOCALAPPDATA%\Abdh\TeacherAssistant\settings.json

On Windows, this expands to C:\Users\[YourUsername]\AppData\Local\Abdh\TeacherAssistant\settings.json. The file contains:

  • Database connection parameters (connection)
  • Font family and size (font)
  • Theme name (theme)
  • Language preference (language)
  • Interface direction (direction)
  • Backup/restore paths and PostgreSQL tools path

The directory is created by app_context.setup_app_directories() on first run.

🖼️ How are icons handled in the project?

All icons are downloaded from Lucide (and modified if needed). They are placed in src/teacher_assistant/resources/. To make them portable, a resources.qrc file is created (via scripts/build_qrc.py) and then compiled using pyside6-rcc into a Python module resources_rc.py (via scripts/compile_qrc.py). This module is imported in core/app_context.py and allows using icons with the :/icons/... prefix anywhere in the code (e.g., QPixmap(':/icons/app-icon.png')).

If you add or change icons, you must recompile the resources.

🐍 How do I run the app from source for development?

From the project root, follow these steps:

  1. Create and activate a virtual environment:
    python -m venv env
    env\Scripts\activate (Windows)
  2. Install dependencies: pip install -r requirements.txt (if provided) or manually install PySide6, PySideAbdhUI, psycopg2, etc.
  3. Run the application:
    python main.py

The main.py file automatically adds src to sys.path, so no extra PYTHONPATH is needed.

📓 Why is the "Notebook" button disabled?

In main_window.py, the button for “Notebook” is created with setEnabled(False). This is a placeholder for a planned future feature – possibly a personal note‑taking or lesson planning module. The functionality has not yet been implemented.


❓ Still have questions? Check the GitHub repository or the generated technical documentation.