mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 10:42:51 +02:00
Fix Math Expressions contract
Previously player could submit as many wrong answers in the solution as they wanted, as long as all correct answers were included. Fixed by ensuring length matches actual answer.
This commit is contained in:
@@ -1271,6 +1271,8 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
||||
|
||||
const result: string[] = [];
|
||||
helper(result, "", num, target, 0, 0, 0);
|
||||
// Prevent player from providing extra wrong answers and still receiving credit
|
||||
if (result.length !== sanitizedPlayerAnsArr.length) return false;
|
||||
|
||||
for (const expr of result) {
|
||||
if (!sanitizedPlayerAnsArr.includes(expr)) {
|
||||
|
||||
Reference in New Issue
Block a user