From 7b406f72a76922679fd1b4e20a6257b834c69b08 Mon Sep 17 00:00:00 2001 From: Suryaa <0x0is1@protonmail.com> Date: Thu, 17 Oct 2024 23:04:25 +0530 Subject: [PATCH] Removed default id selection --- src/endTest.js | 7 +------ src/getAnswer.js | 5 +---- src/getOneResult.js | 8 ++------ 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/endTest.js b/src/endTest.js index 178c5f4..dc43e58 100644 --- a/src/endTest.js +++ b/src/endTest.js @@ -13,12 +13,7 @@ async function endTest(rno = 12114478) { for (var [i, j] of data.entries()) { console.log(`[${i + 1}] ${j.TestName}`); } - if (rno === null) { - var selid = prompt('Select test to get marks: '); - } - else { - selid = 1; - } + var selid = prompt('Select test to get marks: '); var set = prompt("Enter set number: "); await parseOAS.fetch_endTest(data[selid-1], reg_no, set).then(async endtdata => { if (endtdata == "-1") { diff --git a/src/getAnswer.js b/src/getAnswer.js index 5f28392..3a7676f 100644 --- a/src/getAnswer.js +++ b/src/getAnswer.js @@ -79,10 +79,7 @@ async function getAnswerNNA(rno) { for (var [i, j] of data.entries()) { console.log(`[${i + 1}] ${j.TestName}`); } - if (rno === null) { - var selid = prompt('Select test to get answers: '); - } - else selid = 1; + var selid = prompt('Select test to get answers: '); var tid = data[selid - 1].TestId; diff --git a/src/getOneResult.js b/src/getOneResult.js index c6dd1b2..f090100 100644 --- a/src/getOneResult.js +++ b/src/getOneResult.js @@ -13,12 +13,8 @@ async function getOneResult(rno = 12114478) { for (var [i, j] of data.entries()) { console.log(`[${i+1}] ${j.TestName}`); } - if (rno === null) { - var selid = prompt('Select test to get marks: '); - } - else { - selid = 1; - } + var selid = prompt('Select test to get marks: '); + parseOAS.fetch_result(data[selid-1].TestId, reg_no).then(redata => { console.log(redata); });