<script>
var count = 0;
//<strong>Applicable keywords:</strong><p id=\"key'+count+'\"></p>\n\
$('#addQuestion').click(function () {
count+=1;
if (this.id === 'addQuestion') {
$('#questions').append('\
<div class=\"col-md-12\">\n\
<div class=\"alert alert-info alert-dismissible alert'+count+'\" id=\"qkey'+count+'\" style=\"display: none;\" role=\"alert\">\n\
<button type=\"button\" class=\"close\" data-dismiss=\"\" onclick=\"$(\'.alert'+count+'\').hide()"><span aria-hidden=\"true\">×</span><span class=\"sr-only\">Close</span></button>\n\
<strong id=\"type'+count+'\">Applicable keywords:</strong><p id=\"key'+count+'\"></p>\n\
div class=\"col-md-12\">\n\
</div>\n\
</div>\n\
\n\
<div class=\"form-group col-md-2\">\n\
<label for=\"level\">Difficulty Level</label>\n\
<select class=\"form-control col-md-2\" onchange=\"showKeyword(this)\;\" id=\"qlevel'+count+'\" name=\"qlevel'+count+'\">\n\
<option>-</option>\n\
<option>Level 1 - Easy</option>\n\
<option>Level 2 - Easy</option>\n\
<option>Level 3 - Moderate</option>\n\
<option>Level 4 - Moderate</option>\n\
<option>Level 5 - Difficult</option>\n\
<option>Level 6 - Difficult</option>\n\
</select>\n\
</div>\n\
<div class=\"form-group col-md-1\">\n\
<label for=\"marks\">Marks:</label>\n\
<input type=\"text\" class=\"form-control\" name=\"m'+count+'\" >\n\
</div>\n\
<div class=\"form-group col-md-9\">\n\
<label>Question '+count+'</label>\n\
<textarea class=\"form-control\" rows=\"3\" name=\"q'+count+'\"></textarea>\n\
</div>');
}
$('#qcounter').val(count);
$('#num').val(count);
//alert(count);
});
$('#level').on('change', function() {
alert( this.value ); // or $(this).val()
});
$('#questionlevel').on('change', function() {
alert( this.value ); // or $(this).val()
});
function showKeyword(sel) {
var itemid = sel.id;
var arrayss = itemid.split("l");
console.log(arrayss);
var newnum = arrayss[2];
console.log(newnum);
console.log(itemid);
var val = sel.value;
//alert(val);
if (val === 'Level 1 - Easy') {
var item = document.getElementById('key'+newnum.toString());
var type = document.getElementById('type'+newnum.toString());
type.innerHTML = "Knowledge - Indentification and recall of information"
item.innerHTML = "Describe, Name, Find, List, Relate, Write.";
}
else if (val === 'Level 2 - Easy') {
var item = document.getElementById('key'+newnum.toString());
var type = document.getElementById('type'+newnum.toString());
type.innerHTML = "Comprehension - Organisation and selection of facts and ideas"
item.innerHTML = "Explain, Compare, Discuss, Predict, Outline, Restate.";
}
else if (val === 'Level 3 - Moderate') {
var item = document.getElementById('key'+newnum.toString());
var type = document.getElementById('type'+newnum.toString());
type.innerHTML = "Application - Use of facts, rules, principles"
item.innerHTML = "Complete, Use, Examine, Illustrate, Classify, Solve.";
}
else if (val === 'Level 4 - Moderate') {
var item = document.getElementById('key'+newnum.toString());
var type = document.getElementById('type'+newnum.toString());
type.innerHTML = "Analysis - Separating a whole into component parts"
item.innerHTML = "Compare, Contrast, Examine, Explain, Identify, Categorize, Investigate";
}
else if (val === 'Level 5 - Difficult') {
var item = document.getElementById('key'+newnum.toString());
var type = document.getElementById('type'+newnum.toString());
type.innerHTML = "Synthesis - Combining ideas to form a new whole"
item.innerHTML = "Justify, Assess, Prioritize, Recommend, Rate, Decide, Choose";
}
else if (val === 'Level 6 - Difficult') {
var item = document.getElementById('key'+newnum.toString());
var type = document.getElementById('type'+newnum.toString());
type.innerHTML = "Evaluation - Developing opinions, judgements or decisions"
item.innerHTML = "Plan, Invent, Compose, Design, Construct, Imagine.";
}
var id = "qkey"+newnum.toString();
console.log(id);
var x = document.getElementById(id);
$(x).show();
}
</script>
</body>
</html>