function send_cancel_teach_comment(form, root){
// Проверить комментарий
// Отправить
if (CKEDITOR.instances.comment_sent_text.getData()){
$('[name=sent_comment_progress]').show();
$('[name='+form+']').find('[name=comment_sent_text]').val(CKEDITOR.instances.comment_sent_text.getData());
$.ajax({
type: 'POST',
url: '/courses/send_exam_cancel_teach_comment',
data: $('[name='+form+']').serialize(),
success: function(data){
if(data['code'] == '1'){
$('[name=sent_comment_progress]').hide();
document.forms[form].reset();
$('[name="comment_for_user_id"]').val($('[name=USER_ID]').val());
$('[name=comment_for_theme_id]').val($('[name=THEME_ID]').val());
CKEDITOR.instances.comment_sent_text.setData('');
reload_lesson_comments(data['data']);
$('[name='+$('#'+root).attr('sketch_place')+']').html('')
}
}
});
} else {
show_system_message('Введите текст сообщения')
}
}
function send_accept_teach_comment(form, root){
// Проверить комментарий
// Отправить
$('[name=sent_comment_progress]').show();
$('[name='+form+']').find('[name=comment_sent_text]').val(CKEDITOR.instances.comment_sent_text.getData());
$.ajax({
type: 'POST',
url: '/courses/send_exam_accept_teach_comment',
data: $('[name=' + form + ']').serialize(),
success: function (data) {
if (data['code'] == '1') {
$('[name=sent_comment_progress]').hide();
document.forms[form].reset();
$('[name="comment_for_user_id"]').val($('[name=USER_ID]').val());
$('[name=comment_for_theme_id]').val($('[name=THEME_ID]').val());
CKEDITOR.instances.comment_sent_text.setData('');
reload_lesson_comments(data['data']);
$('[name=' + $('#' + root).attr('sketch_place') + ']').html('')
}
}
});
}
function write_comment(block, data){
var message;
var user_status;
var reply;
if (data['replies'].length==0){
reply = ''
} else {
reply = '
' +
'
' +
'
'
} else {
avatar = ''+
'