Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarkar7 committed Oct 6, 2022
1 parent 2289b51 commit b3391d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function getCSRF() {
}

function getAssignment(csrf) {
var assignment_id = opener.location.href.split("/")[4];
var assignment_id = window.location.href.split("/")[4];
var url1 = "https://edpuzzle.com/api/v3/assignments/" + assignment_id + "/attempt";
httpGet(url1, function(){
var data = JSON.parse(this.responseText);
Expand All @@ -45,12 +45,12 @@ function postAttempt(csrf, data) {
['content-type', 'application/json'],
['x-csrf-token', csrf],
['x-edpuzzle-referrer', referrer],
['x-edpuzzle-web-version', opener.__EDPUZZLE_DATA__.version]
['x-edpuzzle-web-version', window.__EDPUZZLE_DATA__.version]
];

httpGet(url2, function(){
opener.location.reload();
window.location.reload();
}, headers, "POST", JSON.stringify(content));
}

init();
init();

0 comments on commit b3391d3

Please sign in to comment.