summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/zelfoverhoor/docent.html2
-rw-r--r--modules/zelfoverhoor/docent.js20
2 files changed, 19 insertions, 3 deletions
diff --git a/modules/zelfoverhoor/docent.html b/modules/zelfoverhoor/docent.html
index c3c1d7b..501d007 100644
--- a/modules/zelfoverhoor/docent.html
+++ b/modules/zelfoverhoor/docent.html
@@ -21,7 +21,7 @@ td, th {
padding: 4px;
}
.newquestioncontainer {
- margin-bottom: 10px;
+ margin-bottom: 5px;
}
.newquestioncontainer > span {
margin-right: 5px;
diff --git a/modules/zelfoverhoor/docent.js b/modules/zelfoverhoor/docent.js
index c14fb2e..b44d4b6 100644
--- a/modules/zelfoverhoor/docent.js
+++ b/modules/zelfoverhoor/docent.js
@@ -181,17 +181,33 @@ function renumberQuestions(){
function addNewQuestion(){
var parent=document.getElementById("newquestions");
+ var number=parent.children.length;
var div=document.createElement("div");
div.classList.add("newquestioncontainer");
+ if(number>0){
+ var insertbtn=document.createElement("input");
+ insertbtn.setAttribute("type","button");
+ insertbtn.setAttribute("value","Voeg vraag hier toe");
+ insertbtn.setAttribute("style","margin-bottom:5px");
+ insertbtn.addEventListener("click",function(){
+ addNewQuestion();
+ var newdiv=parent.children[parent.children.length-1];
+ parent.insertBefore(newdiv,div);
+ renumberQuestions();
+ });
+ div.appendChild(insertbtn);
+ div.appendChild(document.createElement("br"));
+ }
+
var span=document.createElement("span");
span.setAttribute("style","display:inline-block");
var b=document.createElement("b");
b.appendChild(document.createTextNode("Vraag "));
- var span2=document.createElement("span2");
+ var span2=document.createElement("span");
span2.classList.add("questionindex");
- span2.innerHTML=parent.children.length+1;
+ span2.innerHTML=number+1;
b.appendChild(span2);
b.appendChild(document.createTextNode(":"));
span.appendChild(b);