Thắc mắc về nhận dữ liệu trả về

Chào mọi người. Em có một lớp check là thông tin câu hỏi trắc nghiệm, bên view thì em có dùng lisk check để hiện ra câu hỏi trắc nghiệm và đáp án để chọn, còn bên controller thì em có lấy dữ liệu ng dùng chọn thì cái biến Answer nó cứ trả về không mặc dù đã nhấn gửi rồi ạ, có ai biết bị sao không ạ!Screenshot 2024-02-06 161929

Sorry, ignore this answer if I don’t understand you correctly
You set diem = 0 and didn’t change the “diem” in the loop and that is the reason why you get a “khong” (0)

2 Likes

Trên trình duyệt

  • mở Develop tool lên
  • chọn Network
  • Tìm đến request post data, kiểm tra định dạng Payload đang là gì

Sau khi xác định được chính xác vấn đề, tiếp tục tìm câu trả lời.

1 Like

Tự nhiên em đổi cái phần name để nó lấy khóa khác đi thì lại được ấy bác, đợi mở dev tool thì thấy nó có gửi dữ liệu nhưng lại cứ không nhận dc, chứ ko phải nó ko gửi dc

, em đổi cái list để lưu thì oke

The problem I encountered was that when I submitted, the function did not have the user’s selected data. I didn’t pay much attention to the logic.

Oh… This is a very serious “sin” for an IT developer :grinning:. Believe me, logic is the key to success in any field and in any society. Especially in IT development.
IT without logic is not IT, but a mess of unrelated coincidences.
Without logic the world will be ungovernable and will go crazy.

1 Like

I understand what you mean, I tried the logic and it doesn’t have any problems, it’s just that if I don’t receive data then I don’t know if it can run or not, thank you very much. :sunglasses:

3 Likes
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?