Sindbad~EG File Manager
<table class="table">
<thead class="text-center">
<th width="10%">Question ID</th>
<th width="80%">Question</th>
<th width="10%">Action</th>
</thead>
<tbody>
{% if session_questions %}
{% for question in session_questions %}
<tr>
<td class="text-center">
<input type="checkbox" name="remove_ids" id="remove_ids" value="{{ question.msq_id }}">
{{ question.q_id }}</td>
<td>{{ question.question }}</td>
<td class="text-center"> <button type="button" class="btn btn-link text-dark" onclick="remove_question('{{ question.msq_id }}')"><i class="fa fa-trash" aria-hidden="true"></i></button></td>
</tr>
{% endfor %}
{% else %}
<tr>
<td colspan="3">No questions in session</td>
</tr>
{% endif %}
</tbody>
</table>
<script>
function remove_question(mq_id) {
r=confirm("Are you sure to remove this question from this session")
if (r==true){
$.ajax({
type: "POST",
url: "{{ url_for('bo.remove_question_session') }}",
data: {
'mq_id': mq_id
},
dataType: "json",
success: function(data){
get_session_questions();
get_questions_assign();
}
});
}
else{
return false;
}
}
function remove_multiple_question() {
r=confirm("Are you sure to remove this question from this session")
var mq_id = []
$("input:checkbox[name=remove_ids]:checked").each(function(){
mq_id.push($(this).val());
});
mq_id = mq_id + ""
if (r==true){
$.ajax({
type: "POST",
url: "{{ url_for('bo.remove_question_session') }}",
data: {
'mq_id': mq_id
},
dataType: "json",
success: function(data){
get_session_questions();
get_questions_assign();
}
});
}
else{
return false;
}
}
</script>
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists