summaryrefslogtreecommitdiff
path: root/modules/zelfoverhoor
diff options
context:
space:
mode:
Diffstat (limited to 'modules/zelfoverhoor')
-rw-r--r--modules/zelfoverhoor/docent.js7
-rw-r--r--modules/zelfoverhoor/qs.js7
-rw-r--r--modules/zelfoverhoor/zelfoverhoor.js8
3 files changed, 22 insertions, 0 deletions
diff --git a/modules/zelfoverhoor/docent.js b/modules/zelfoverhoor/docent.js
index 456ea2f..2aef2e8 100644
--- a/modules/zelfoverhoor/docent.js
+++ b/modules/zelfoverhoor/docent.js
@@ -1,3 +1,10 @@
+window.addEventListener("error",function(err){
+ console.log(JSON.stringify(err));
+ var xhr=new XMLHttpRequest();
+ xhr.open("POST","/zelfoverhoor/error");
+ xhr.send(JSON.stringify(err));
+});
+
var questionsets=null;
var currentlyEditing=null;
diff --git a/modules/zelfoverhoor/qs.js b/modules/zelfoverhoor/qs.js
index 43d68f0..c07f8be 100644
--- a/modules/zelfoverhoor/qs.js
+++ b/modules/zelfoverhoor/qs.js
@@ -1,3 +1,10 @@
+window.addEventListener("error",function(err){
+ console.log(JSON.stringify(err));
+ var xhr=new XMLHttpRequest();
+ xhr.open("POST","/zelfoverhoor/error");
+ xhr.send(JSON.stringify(err));
+});
+
var setname=questionset.name;
var setdescription=questionset.description;
var questions=questionset.questions;
diff --git a/modules/zelfoverhoor/zelfoverhoor.js b/modules/zelfoverhoor/zelfoverhoor.js
index 8f87f75..d1d3068 100644
--- a/modules/zelfoverhoor/zelfoverhoor.js
+++ b/modules/zelfoverhoor/zelfoverhoor.js
@@ -220,6 +220,14 @@ module.exports=function(app,io,_moddir){
res.send();
});
+ app.post("/zelfoverhoor/error",function(req,res){
+ if(typeof req.body=="string"){
+ fs.appendFile(moddir+"/errors.txt",req.body,function(err){
+ if(err)console.log(err);
+ });
+ }
+ });
+
app.get("/zelfoverhoor/docent/docent.js",function(req,res){
res.sendFile(moddir+"/docent.js");
});