Skip to content

Commit

Permalink
Merge pull request #32 from EmTanIT/tanBE
Browse files Browse the repository at this point in the history
complete 90% automatic althorigm
  • Loading branch information
bentran1vn committed Oct 5, 2023
2 parents 6f6faa3 + 52534ac commit b7e8f7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions routes/examSlot.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ router.get('/', async (req, res) => {
// fs.appendFileSync("test.txt", data1 + "\n");
// fs.appendFileSync("test.txt", data + "\n");
*/
console.log(room.id);
await ExamRoom.create({
sSId: subjectInSlot.id,
roomId: room.id
Expand Down
3 changes: 2 additions & 1 deletion routes/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ router.delete('/', async (req, res) => {

export async function randomRoom(){
let roomList = await Room.findAll()
let ranId = Math.floor(Math.random()*(roomList.length))
let ranId = Math.floor(Math.random()*(roomList.length - 1)) + 1
console.log("log Function ranId: " + ranId);
let room = await Room.findOne({
where : {
id : ranId
Expand Down

0 comments on commit b7e8f7d

Please sign in to comment.