Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. function QueryString() {
  2. var query_string = {};
  3. var query = unescape(window.location.search.substring(1));
  4. var vars = query.split("&");
  5. for (var i=0;i<vars.length;i++) {
  6. var pair = vars[i].split("=");
  7. // If first entry with this name
  8. if (typeof query_string[pair[0]] === "undefined") {
  9. query_string[pair[0]] = pair[1];
  10. // If second entry with this name
  11. } else if (typeof query_string[pair[0]] === "string") {
  12. var arr = [ query_string[pair[0]], pair[1] ];
  13. query_string[pair[0]] = arr;
  14. // If third or later entry with this name
  15. } else {
  16. query_string[pair[0]].push(pair[1]);
  17. }
  18. }
  19. return query_string;
  20. }
  21.  
  22. function FinishQuize(totalScore) {
  23.  
  24. var params = QueryString();
  25. var redirectURL = "/courses/SumScore?CourseNum="+params.CourseNum+"&SubCourseNum="+params.SubCourseNum+"&UserID="+params.UserID+"&userScore="+totalScore;
  26.  
  27. location.replace(redirectURL);
  28.  
  29. return true;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement