The LevelOne contract fails to enforce a critical educational requirement: the verification that each student has received exactly 4 reviews (one per week) before system upgrade. This directly contradicts the explicitly stated invariant: "Students must have gotten all reviews before system upgrade. System upgrade should not occur if any student has not gotten 4 reviews (one for each week)."
The absence of this check compromises the educational integrity of the entire system by allowing students to progress without receiving complete academic evaluation. This creates an inconsistent and potentially unfair academic environment where some students receive full evaluation while others may advance with minimal or no reviews.
Given the manual nature of the review process and dependency on teacher actions, it's highly probable that some students will not receive all required reviews. Without an enforcement mechanism, the issue will manifest whenever a graduation cycle occurs with incomplete student reviews.
The contract includes functionality to track and limit reviews:
A reviewCount mapping tracks the number of reviews per student:
The giveReview function has a check to prevent excessive reviews:
However, this counter is never incremented in the giveReview function, rendering the check ineffective:
The graduateAndUpgrade function contains no verification of review counts:
This creates a double failure:
The review counting mechanism is broken due to not incrementing the counter
Even if it worked correctly, the graduation function doesn't enforce the minimum review requirement
The result is a complete breakdown of the review system's integrity, as students can graduate regardless of how many reviews they've received.
Consider this sequence of events:
A school session starts with 10 students
Teachers give reviews to only 5 students
At session end, the principal calls graduateAndUpgrade
The function executes successfully despite 5 students having received no reviews
The invariant "Students must have gotten all reviews" is violated
Two key fixes are required:
Fix the review counting mechanism in giveReview:
Add review verification in graduateAndUpgrade:
These changes ensure that the educational process is properly tracked and verified before graduation, maintaining the academic integrity specified in the system invariants.
All students are graduated when the graduation function is called as the cut-off criteria is not applied.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.