Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Commit 0b37669

Browse files
Update code.js
1 parent cd8f83a commit 0b37669

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

code.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,18 @@
3737
if (contentDiv) {
3838
questions.forEach((question, index) => {
3939
const questionDiv = document.createElement("div");
40+
questionDiv.className = "answer";
4041
questionDiv.textContent = `Question: ${question.key}`;
4142
contentDiv.appendChild(questionDiv);
4243

4344
const responseDiv = document.createElement("div");
45+
responseDiv.className = "answer";
4446
responseDiv.textContent = `Response: ${responses[index]}`;
4547
contentDiv.appendChild(responseDiv);
4648

47-
const separator = document.createElement("hr");
49+
const separator = document.createElement("br");
50+
separator.className = "answer";
51+
contentDiv.appendChild(separator);
4852
contentDiv.appendChild(separator);
4953
});
5054
} else {
@@ -68,9 +72,11 @@
6872
responseData.length > 0 &&
6973
typeof responseData[0] === "object"
7074
) {
71-
// Extract relevant information from each object and concatenate into a string
72-
const responseText = responseData.map((obj) => obj.text).join(", ");
73-
responses.push(responseText);
75+
// Display each response separately
76+
responseData.forEach((obj) => {
77+
const responseText = obj.text;
78+
responses.push(responseText);
79+
});
7480
} else {
7581
console.error(
7682
`Invalid response data format for question ${questionId}`

0 commit comments

Comments
 (0)