Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed questions image bug #82

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion questionservice/question-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ app.post('/imgs/answer', (req, res) => {
correct: "true"
})
} else {
res.status(400).json({
res.status(200).json({
correct: "false",
country: `${imgToAssociatedMap.get(answer)}`
})
Expand Down
10 changes: 4 additions & 6 deletions webapp/src/components/Question.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ const Question = (props) => {
<h1 className="font-bold text-3xl text-gray-800 pl-8">{question.question}</h1>
<div className="grid grid-cols-2 mt-10 item">
{question.images.map( image => (
<div className="rounded-xl mx-8 my-8">
<button className="transition-transform transform-gpu hover:scale-105">
<img src={image} alt='Loading image...' className="rounded-lg max-h-50 object-contain shadow-md"
onClick={() => answerQuestion(image)}></img>
</button>
</div>
<button className="transition-transform transform-gpu hover:scale-105 rounded-xl mx-8 my-8 max-h-52 max-w-80">
<img src={image} alt='Loading image...' className="rounded-lg object-contain shadow-md"
onClick={() => answerQuestion(image)}></img>
</button>
))}
</div>
</>
Expand Down
Loading