Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: Test Bug Fixes

on:
pull_request:
branches: ["main", "master"]

jobs:
test-project:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v3
- name: setup python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: install dependencies
run: python -m pip install -r requirements.txt
- name: run tests
run: python run_all_tests.py | tail -n 1
continue-on-error: true
name: Test Bug Fixes
on:
pull_request:
branches: ["main", "master"]
jobs:
test-project:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v3
- name: setup python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: install dependencies
run: python -m pip install -r requirements.txt
- name: run tests
run: python run_all_tests.py | tail -n 1
continue-on-error: true
142 changes: 71 additions & 71 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
🤝 Contributing Guidelines

We welcome contributions to improve this Grade Calculator project! Follow the guidelines below to get started:
🚀 Getting Started

Fork the Repository

Click the “Fork” button in the top-right corner of this repo.

Clone Your Fork

git clone https://github.com/CodeJam-by-CSE/practice.git
cd grade-calculator

Set Up a Virtual Environment (optional but recommended)

python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt

Run the App

python main.py

🧪 Running Tests

Before submitting a pull request, make sure all tests pass:

python -m unittest discover tests

You can also run individual test files:

python tests/test_calculator.py

✍️ How to Contribute

🔧 Fix Bugs
Check existing issues or create a new one before submitting a fix.

✨ Add Features
Make sure new features align with the app’s educational goals and include tests.

🧹 Code Clean-Up
Refactor for clarity and readability. Follow PEP8 style guidelines.

✅ Improve Tests
Add new test cases or improve coverage.

🔄 Submitting Your Changes

Create a new branch:

git checkout -b feature/your-feature-name

Commit and push your changes:

git add .
git commit -m "Add your descriptive commit message"
git push origin feature/your-feature-name

Open a Pull Request (PR) on GitHub to the Original Repository. Provide a clear description of your changes.

📌 Tips

- Keep your pull requests focused and small.

- Write descriptive commit messages.

- Include docstrings or comments where necessary.

- If you're unsure about something, open an issue to discuss first!
🤝 Contributing Guidelines
We welcome contributions to improve this Grade Calculator project! Follow the guidelines below to get started:
🚀 Getting Started
Fork the Repository
Click the “Fork” button in the top-right corner of this repo.
Clone Your Fork
git clone https://github.com/CodeJam-by-CSE/practice.git
cd grade-calculator
Set Up a Virtual Environment (optional but recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
Run the App
python main.py
🧪 Running Tests
Before submitting a pull request, make sure all tests pass:
python -m unittest discover tests
You can also run individual test files:
python tests/test_calculator.py
✍️ How to Contribute
🔧 Fix Bugs
Check existing issues or create a new one before submitting a fix.
✨ Add Features
Make sure new features align with the app’s educational goals and include tests.
🧹 Code Clean-Up
Refactor for clarity and readability. Follow PEP8 style guidelines.
✅ Improve Tests
Add new test cases or improve coverage.
🔄 Submitting Your Changes
Create a new branch:
git checkout -b feature/your-feature-name
Commit and push your changes:
git add .
git commit -m "Add your descriptive commit message"
git push origin feature/your-feature-name
Open a Pull Request (PR) on GitHub to the Original Repository. Provide a clear description of your changes.
📌 Tips
- Keep your pull requests focused and small.
- Write descriptive commit messages.
- Include docstrings or comments where necessary.
- If you're unsure about something, open an issue to discuss first!
154 changes: 77 additions & 77 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
### 🤝 Contributing

We welcome contributions of all kinds — from bug reports and fixes to feature improvements and documentation updates.

👉 To get started, please read our [Contributing Guidelines](https://github.com/CodeJam-by-CSE/Practice/blob/main/CONTRIBUTING.md).

### 🎯 Intended Behavior

This Grade Calculator project simulates a competition entry where users can input scores, compute grades, and view the remaining time until a deadline. The application includes the following core behaviors:

**Input Format:**
Scores should be entered as comma-separated numeric values (e.g., `85, 90, 78`).

![image](https://github.com/user-attachments/assets/3e7a3100-7dd4-45bd-9880-ffa68a1dd2c3)


🧠 Core Logic

Score Validation

Accepts numeric scores between 0 and 100, separated by commas.

Whitespace is ignored.

Invalid inputs (e.g., negative numbers, non-numeric characters, or empty values) are rejected with an "Invalid input" message.

Average and Grade Calculation

Computes the average of all valid scores.

Assigns a grade:

A: 90–100

B: 80–89

C: 70–79

D: 60–69

F: Below 60

Pass/Fail Logic

A score of 60 or above is considered a pass.

The is_passed() function returns True for pass scores.

⏳ Countdown Timer

Displays the time left until a predefined competition deadline in the format:

Time Left: 1d 2h 30m 15s

If the deadline has passed, the timer displays:

Time Left: 0d 0h 0m 0s - Competition ended

🎨 Text Color Logic (UI Feedback)

Result text is green if the input is valid and a grade is calculated.

Result text is red if the input is invalid.

Countdown timer text is green if the competition is ongoing and red if it has ended.

✅ Tested Scenarios

The following behaviors are verified through unit tests:

Correct time formatting before, during, and after the competition.

Accurate validation of input scores (valid ranges, whitespace handling, edge cases).

Correct color logic for result and timer messages.

Accurate average and grade calculations for different score combinations.
### 🤝 Contributing
We welcome contributions of all kinds — from bug reports and fixes to feature improvements and documentation updates.
👉 To get started, please read our [Contributing Guidelines](https://github.com/CodeJam-by-CSE/Practice/blob/main/CONTRIBUTING.md).
### 🎯 Intended Behavior
This Grade Calculator project simulates a competition entry where users can input scores, compute grades, and view the remaining time until a deadline. The application includes the following core behaviors:
**Input Format:**
Scores should be entered as comma-separated numeric values (e.g., `85, 90, 78`).
![image](https://github.com/user-attachments/assets/3e7a3100-7dd4-45bd-9880-ffa68a1dd2c3)
🧠 Core Logic
Score Validation
Accepts numeric scores between 0 and 100, separated by commas.
Whitespace is ignored.
Invalid inputs (e.g., negative numbers, non-numeric characters, or empty values) are rejected with an "Invalid input" message.
Average and Grade Calculation
Computes the average of all valid scores.
Assigns a grade:
A: 90–100
B: 80–89
C: 70–79
D: 60–69
F: Below 60
Pass/Fail Logic
A score of 60 or above is considered a pass.
The is_passed() function returns True for pass scores.
⏳ Countdown Timer
Displays the time left until a predefined competition deadline in the format:
Time Left: 1d 2h 30m 15s
If the deadline has passed, the timer displays:
Time Left: 0d 0h 0m 0s - Competition ended
🎨 Text Color Logic (UI Feedback)
Result text is green if the input is valid and a grade is calculated.
Result text is red if the input is invalid.
Countdown timer text is green if the competition is ongoing and red if it has ended.
✅ Tested Scenarios
The following behaviors are verified through unit tests:
Correct time formatting before, during, and after the competition.
Accurate validation of input scores (valid ranges, whitespace handling, edge cases).
Correct color logic for result and timer messages.
Accurate average and grade calculations for different score combinations.
Loading