Skip to content

Commit

Permalink
Merge pull request #25 from EmTanIT/tanBE
Browse files Browse the repository at this point in the history
Tan be
  • Loading branch information
bentran1vn committed Oct 4, 2023
2 parents b2d2c35 + 2139db4 commit 187b449
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions routes/examSlot.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,20 @@ router.get('/', async (req, res) => {

const val = course[i];
let roomCourse = Math.ceil(val.numOfStu / process.env.NUMBER_OF_STUDENT_IN_ROOM)
fs.appendFileSync("test.txt", roomCourse + "\n");
//fs.appendFileSync("test.txt", roomCourse + "\n");
roomSlot += roomCourse
if (roomSlot <= process.env.NUMBER_OF_STUDENT_IN_ROOM * process.env.NUMBER_OF_ROOM_IN_FLOOR) {
if(roomSlot <= process.env.NUMBER_OF_STUDENT_IN_ROOM* process.env.NUMBER_OF_ROOM_IN_FLOOR){
for (let i = 0; i < roomCourse; i++) {
let data = val.id + ".." + daySlot.getDate() + ".." + slot
fs.appendFileSync("test.txt", data + "\n");
//fs.appendFileSync("test.txt", data + "\n");
//console.log();
}
} else {
let examSlot = await ExamSlot.create({
ePId: examPhaseList[key].id,
day: daySlot,
timeSlotId: slot
})
i--
}

Expand Down
Empty file removed routes/test.txt
Empty file.

0 comments on commit 187b449

Please sign in to comment.