Validation Bug in part01-20_students_in_groups

Open
#47 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
javascript, python
Domain
testing-qa

Research direction

Start by locating the automatic grader for the part01-20_students_in_groups exercise and run it against the submitted solution and the correct solution described in the issue. Check how expected output is validated, then add or adjust coverage so the incorrect solution is rejected while the correct group count is accepted.

Written by the indexing model from the issue text.

Description

I believe there may be an issue with the automatic grader for the "Students in groups" exercise.

I submitted the following solution, not expecting it to pass, and it was accepted as correct:

python
student = int(input("How many students on the course? "))
grsize = int(input("Desired group size? "))

grnum = int(student // grsize)
if grnum != 3 or 5 or 7:
print(f"Number of groups formed: {grnum}")

if grnum == 3 or 5 or 7:
print(f"Number of groups formed: {grnum + 1}")

Output 1:
How many students on the course? 8
Desired group size? 4
Number of groups formed: 2
Number of groups formed: 3

Output 2:
Output
How many students on the course? 11
Desired group size? 3
Number of groups formed: 3
Number of groups formed: 4

Correct solution:

students = int(input("How many students on the course? "))
group_size = int(input("Desired group size? "))
groups = (students + group_size - 1) // group_size
print("Number of groups formed:", groups)

I wanted to report this in case the test suite is missing some test cases or is not validating the output strictly enough.

Thank you for all the work you put into the course.

Dominant language
JavaScript
Stars
77
Forks
30
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rage/programming-26

All issues in rage/programming-26

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.