Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 795212f

Browse files
committed
Fix: Open the image don’t download.
1 parent 6876d12 commit 795212f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

runestone/shortanswer/js/shortanswer.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,17 @@ export default class ShortAnswer extends RunestoneBase {
323323
viewFile() {
324324
// Get the URL from the S3 API -- saved when we display in grader mode
325325
if (this.attachURL) {
326-
window.open(this.attachURL, "_blank");
326+
//window.open(this.attachURL, "_blank");
327+
const image_window = window.open("", "_blank")
328+
image_window.document.write(`
329+
<html>
330+
<head>
331+
</head>
332+
<body>
333+
<img src="${this.attachURL}" alt="Attachment" >
334+
</body>
335+
</html>
336+
`);
327337
} else {
328338
alert("No attachment for this student.")
329339
}

0 commit comments

Comments
 (0)