NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

<html lang="ar" dir="rtl" style="--navbar-mobile-menu-color:#000000; --navbar-mobile-menu-bg-color:rgb(255, 255, 255);"><head>
<meta property="og:type" content="website">
<meta property="og:site_name" content="eduact">
<meta property="og:title" content="EduAct">
<meta property="og:description" content="لغة عربية مع صانع الأوائل أ/رضا الفاروق">
<base href="https://redaalfarouk-eduact.talentlms.com/">
<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0">
<meta http-equiv="Content-Language" content="ar">
<meta charset="utf-8">
<meta name="keywords" content="lms, elearning, learning platform, cloud, saas">
<meta name="description" content="لغة عربية مع صانع الأوائل أ/رضا الفاروق">
<title>redaalfarouk | المحاضرة الاولى ( سنتر) (ARCENTER01) | البلاغة</title>
<link href="pages/themes/default/css/animate.min.css?v=458" rel="stylesheet" type="text/css">
<link href="https://redaalfarouk-eduact.talentlms.com/index/css/fmt:1600151117,tn:41,tv:0,ct:1,rtl:1" rel="stylesheet" type="text/css">
<link href="pages/themes/default/css/codemirror.css?v=458" rel="stylesheet" type="text/css">
<link href="pages/themes/default/css/fullscreen.css?v=458" rel="stylesheet" type="text/css">
<link href="pages/themes/default/css/dialog.css?v=458" rel="stylesheet" type="text/css">
<link href="pages/themes/default/css/matchesonscrollbar.css?v=458" rel="stylesheet" type="text/css">
<link href="pages/themes/default/css/summernote.css?v=458" rel="stylesheet" type="text/css">
<link href="pages/themes/default/css/summernote-bs2.css?v=458" rel="stylesheet" type="text/css">
<link href="pages/themes/default/css/font-awesome-rtl.min.css?v=458" rel="stylesheet" type="text/css">
<link href="pages/themes/default/css/wysiwyg-fonts.css?v=458" rel="stylesheet" type="text/css">
<link href="https://d3j0t7vrtr92dk.cloudfront.net/eduact/1599176337_Group.png?" rel="shortcut icon">
<link rel="prefetch" href="https://redaalfarouk-eduact.talentlms.com/unit/viewtestsurvey/id:2258,mode:test,prefetch:1">
<link rel="prerender" href="https://redaalfarouk-eduact.talentlms.com/unit/viewtestsurvey/id:2258,mode:test,prefetch:1">
<script src="pages/scripts/lib/main-458.min.js" type="text/javascript"></script>
<script src="pages/scripts/lib/editor-458.min.js" type="text/javascript"></script>
<link href="pages/themes/default/css/toastr.min.css?v=458" rel="stylesheet" type="text/css">
</head>
<body class="tl-body">
<div class="navbar">
<div class="navbar-inner">
<div class="container-fluid nav-container">
<a class="btn btn-navbar hamburger hamburger--slider hamburger--small hamburger--collapse" data-toggle="collapse" data-target=".nav-collapse">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</a>
<div class="hidden-phone hidden-tablet pull-left">
<div class="tl-ellipsis"><a class="brand title rtl-arrow-back headerCourseName" id="tl-navbar-course-name" title="عودة إلى الدورات" href="https://redaalfarouk-eduact.talentlms.com/dashboard"><span title="عودة إلى الدورات" class="tl-formatted-course-name">المحاضرة الاولى ( سنتر)</span></a></div>

</div>

<div class="tl-ellipsis hidden-desktop">
<div class="tl-ellipsis"><a class="brand title headerCourseName" id="tl-navbar-course-name" title="عودة إلى الدورات" href="https://redaalfarouk-eduact.talentlms.com/dashboard"><span title="عودة إلى الدورات" class="tl-formatted-course-name">المحاضرة الاولى ( سنتر) <span class="tl-formatted-course-code">(ARCENTER01)</span></span></a></div>
</div>

<div id="tl-loading-pane" class="hide affix text-center"><p><img src="https://d3j0t7vrtr92dk.cloudfront.net/images/loading-small.gif" class="tl-loader-small"></p></div>
<div class="nav-collapse collapse">
<ul class="nav pull-right" id="tl-pull-right-nav">
<li><a id="tl-header-gamification-entrance" class="btn btn-success" href="javascript:void(0);" data-entrancevalue="7237" data-entrancemode="points">7237 نقط</a></li>
<li class="headerUnits"><a title="سابق" href="https://redaalfarouk-eduact.talentlms.com/unit/viewtestsurvey/id:2257,mode:test" style="padding-bottom: 11px;"><i class="icon-chevron-right" style="font-size: 24px; line-height: 14px; margin-top: 4px;"></i></a></li>
<li class="dropdown headerUnits" id="tl-dropdown-progress">
<a href="#" class="dropdown-toggle scrolling-dropdown" data-toggle="dropdown">
<span title="البلاغة">البلاغة</span> <b class="caret"></b>
</a>
<ul class="dropdown-menu" style="overflow-y: auto; overflow-x: hidden; max-height: 500px;" id="tl-navbar-progress">
<li class="nav-header" style="margin-top: 4px;">
<div class="progress progress-success" style="margin-bottom: 0px;">
<div class="bar" id="tl-navbar-progress-measure" style="width: 100%;">منتهي</div>
</div>
</li>
<li class="divider"></li>
<li style="margin: 4px 0px;"><span class="tl-cursor-default label label-section" style="display: inline; margin-left: 10px; margin-right: 10px;"><span title="المقدمة">المقدمة</span></span></li><li><a id="tl-navbar-unit-link-2269" style="" href="https://redaalfarouk-eduact.talentlms.com/unit/view/id:2269"><i class="icon-ok tl-green-ok"></i>&nbsp;<span title="تدريب على الحصة">تدريب على الحصة</span></a></li><li><a id="tl-navbar-unit-link-2259" style="" href="https://redaalfarouk-eduact.talentlms.com/unit/view/id:2259"><i class="icon-ok tl-green-ok"></i>&nbsp;<span title="تنويه مهم">تنويه مهم</span></a></li><li><a id="tl-navbar-unit-link-2260" style="" href="https://redaalfarouk-eduact.talentlms.com/unit/view/id:2260"><i class="icon-ok tl-green-ok"></i>&nbsp;<span title="المقدمة">المقدمة</span></a></li><li style="margin: 4px 0px;"><span class="tl-cursor-default label label-section" style="display: inline; margin-left: 10px; margin-right: 10px;"><span title="النحو">النحو</span></span></li><li><a id="tl-navbar-unit-link-2261" style="" href="https://redaalfarouk-eduact.talentlms.com/unit/view/id:2261"><i class="icon-ok tl-green-ok"></i>&nbsp;<span title="النحو">النحو</span></a></li><li><a id="tl-navbar-unit-link-2257" style="" href="https://redaalfarouk-eduact.talentlms.com/unit/viewtestsurvey/id:2257,mode:test"><i class="icon-ok tl-green-ok"></i>&nbsp;<span title="تدريب نحوي">تدريب نحوي</span></a></li><li style="margin: 4px 0px;"><span class="tl-cursor-default label label-section" style="display: inline; margin-left: 10px; margin-right: 10px;"><span title="البلاغة">البلاغة</span></span></li><li><a id="tl-navbar-unit-link-2263" style="font-weight: 600;" href="https://redaalfarouk-eduact.talentlms.com/unit/view/id:2263"><i class="icon-ok tl-green-ok"></i>&nbsp;<span title="البلاغة">البلاغة</span></a></li><li><a id="tl-navbar-unit-link-2258" style="" href="https://redaalfarouk-eduact.talentlms.com/unit/viewtestsurvey/id:2258,mode:test"><i class="icon-ok tl-green-ok"></i>&nbsp;<span title="تدريب بلاغي">تدريب بلاغي</span></a></li><li style="margin: 4px 0px;"><span class="tl-cursor-default label label-section" style="display: inline; margin-left: 10px; margin-right: 10px;"><span title="الأدب">الأدب</span></span></li><li><a id="tl-navbar-unit-link-2265" style="" href="https://redaalfarouk-eduact.talentlms.com/unit/view/id:2265"><i class="icon-ok tl-green-ok"></i>&nbsp;<span title="الأدب">الأدب</span></a></li><li style="margin: 4px 0px;"><span class="tl-cursor-default label label-section" style="display: inline; margin-left: 10px; margin-right: 10px;"><span title="المناقشة والأسئلة">المناقشة والأسئلة</span></span></li><li><a id="tl-navbar-unit-link-2267" style="" href="https://redaalfarouk-eduact.talentlms.com/unit/viewtestsurvey/id:2267,mode:survey"><i class="icon-ok tl-green-ok"></i>&nbsp;<span title="رأيك يهمنا">رأيك يهمنا</span></a></li><li style="margin: 4px 0px;"><span class="tl-cursor-default label label-section" style="display: inline; margin-left: 10px; margin-right: 10px;"><span title="الواجب والامتحان">الواجب والامتحان</span></span></li><li><a id="tl-navbar-unit-link-2262" style="" href="https://redaalfarouk-eduact.talentlms.com/unit/viewtestsurvey/id:2262,mode:test"><i class="icon-ok tl-green-ok"></i>&nbsp;<span title="الواجب">الواجب</span></a></li><li><a id="tl-navbar-unit-link-2264" style="" href="https://redaalfarouk-eduact.talentlms.com/unit/viewtestsurvey/id:2264,mode:test"><i class="icon-ok tl-green-ok"></i>&nbsp;<span title="الامتحان">الامتحان</span></a></li> </ul>
</li>
<li class="headerUnits"><a title="التالي" href="https://redaalfarouk-eduact.talentlms.com/unit/viewtestsurvey/id:2258,mode:test" id="tl-navbar-next-unit" style="padding-bottom: 11px;"><i class="icon-chevron-left" style="font-size: 24px; line-height: 14px; margin-top: 4px;"></i></a></li>
<li class="divider-vertical headerMoreOptions"></li>
<li class="dropdown headerMoreOptions hidden-phone" id="tl-dropdown-more">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">المزيد&nbsp;<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="javascript:void(0)" class="tl-course-info" data-url="https://redaalfarouk-eduact.talentlms.com/course/info/course_id:318">lمعلومات الدورة</a></li>
<li><a href="https://redaalfarouk-eduact.talentlms.com/dashboard/index">عودة إلى الدورات</a></li>
<li class="divider"></li>
<li><a href="javascript:void(0)" id="send-message-instructor">أرسل رسالة إلى المعلم</a></li>
<li class="divider"></li>
<li><a href="https://redaalfarouk-eduact.talentlms.com/index/logout">خروج</a></li>
</ul>
</li>
<li class="divider-vertical headerCertificationIcon"></li>
<li class="headerCertificationIcon"><a title="تم إكمال الدورة" href="javascript:void(0)" onclick="$('#tl-course-completed-modal').modal()" style="padding-bottom: 10px;"><i class="icon-trophy" style="font-size: 24px; line-height: 14px; margin-top: 5px;"></i></a></li>
</ul>
</div>
</div>
</div>
</div>

<div class="modal fade hide" id="tl-course-info-modal" style="outline: none;" tabindex="-1">
<div class="modal-header">
<a href="javascript:void(0)" class="close" data-dismiss="modal">×</a>
<h3>lمعلومات الدورة</h3>
</div>
<div class="modal-body">
<div class="span1 pull-left padded">
<img id="tl-course-info-modal-avatar" src="https://d3j0t7vrtr92dk.cloudfront.net/images/unknown_big.png">
</div>
<h3 id="tl-course-info-modal-name"></h3>
<h3 id="tl-course-info-modal-name"></h3>
<div id="tl-course-info-modal-description" class="tl-course-description"></div>
<p id="tl-course-info-modal-fields" class="tl-course-fields"></p>
<div id="tl-course-info-modal-description-tmp"></div>
<div style="clear: both;">
<fieldset>
<legend>محتويات</legend>
<div id="tl-course-info-modal-no-units" class="alert alert-info">
<h4 class="alert-heading">دورة فارغة</h4>
ليس هناك أي وحدات في الوقت الحالي </div>
<ul class="tl-unit-list" id="tl-course-info-modal-unit-list"></ul>
</fieldset>
</div>
<div style="clear: both;" id="tl-course-info-modal-rules">
<fieldset>
<legend>قواعد الإنجاز</legend>
<ul class="tl-unit-list" id="tl-course-info-modal-rules-list"></ul>
</fieldset>
</div>
<div style="clear: both;" id="tl-course-info-modal-prerequisites">
<fieldset>
<legend>المستلزمات</legend>
<ul class="tl-unit-list tl-course-info-prerequisites-list" id="tl-course-info-modal-prerequisites-list"></ul>
</fieldset>
</div>
</div>
<div class="modal-footer">
<a data-dismiss="modal" class="btn">إغلاق</a>
</div>
</div>

<div class="modal fade hide" id="tl-send-message-modal" style="outline: none;" tabindex="-1">
<div class="modal-header">
<a href="javascript:void(0)" class="close" data-dismiss="modal">×</a>
<h3>أرسل رسالة إلى المعلم</h3>
</div>
<div class="modal-body"><div class="tl-messages-create-container">
<script type="text/javascript">
$(document).ready(function(){
$('#03cd8c4e0f7a29dd760bb97b7af88a2f').submit(function(event){
if($(this).attr('id') == 'tl-account-certifications' && $('#mode').val() == 1){
$('#update-certificate').removeClass('disabled').button('reset');
}

if($(this).attr('id') == 'tl-account-themes' && $('#mode').val() == 1){
$('#update-theme').removeClass('disabled').button('reset');
}

if(($(this).attr('id') == 'add-coupon-form' || $(this).attr('id') == 'edit-coupon-form') && $('#tl-discount-type').val() == '1'){
$("input[name='fixed_amount_discount']").val(123456789.11);
}
else if(($(this).attr('id') == 'add-coupon-form' || $(this).attr('id') == 'edit-coupon-form') && $('#tl-discount-type').val() == '2'){
$("input[name='percentage_discount']").val(99.101);
}

myportal.app.submitForm = new Array();

if(typeof(myportal.app.validForm) == 'undefined' || myportal.app.validForm == false){
myportal.app.validForm = true;
}

$('#message_subject').closest('.controls').find('.help-block:first').empty();
$('#message_subject').parents('.control-group').removeClass('error');
$('#message_body').closest('.controls').find('.help-block:first').empty();
$('#message_body').parents('.control-group').removeClass('error');

myportal.app.submitForm['message_subject'] = new Array();
myportal.app.submitForm['message_subject']['mandatory'] = true;
myportal.app.submitForm['message_subject']['maxlength'] = true;
myportal.app.submitForm['message_body'] = new Array();
myportal.app.submitForm['message_body']['maxHTMLlength'] = true;

myportal.app.validateMandatory('message_subject', decodeURIComponent('%27%D9%85%D9%88%D8%B6%D9%88%D8%B9%27%20%D9%85%D8%B7%D9%84%D9%88%D8%A8%20'));
myportal.app.validateMaxLength('message_subject', decodeURIComponent('%27%D9%85%D9%88%D8%B6%D9%88%D8%B9%27%20%D9%8A%D8%AC%D8%A8%20%D8%A3%D9%84%D8%A7%20%D9%8A%D8%B2%D9%8A%D8%AF%20%D8%B9%D8%AF%D8%AF%20%D8%B1%D9%85%D9%88%D8%B2%D9%87%20%D8%B9%D9%86%20150'), 150);
myportal.app.validateMaxHTMLLength('message_body', decodeURIComponent('%27%D8%AC%D9%88%D9%87%D8%B1%20%D8%A7%D9%84%D9%85%D9%88%D8%B6%D9%88%D8%B9%27%20%D9%8A%D8%AC%D8%A8%20%D8%A3%D9%84%D8%A7%20%D9%8A%D8%B2%D9%8A%D8%AF%20%D8%B9%D8%AF%D8%AF%20%D8%B1%D9%85%D9%88%D8%B2%D9%87%20%D8%B9%D9%86%2015000'), 15000);


if(typeof(myportal.app.submitForm) != 'undefined'){
var submitMe = true;
var errorElement = false;

for(var index in myportal.app.submitForm){
for(var index_ in myportal.app.submitForm[index]){
if(myportal.app.submitForm[index][index_] == false){
submitMe = false;
errorElement = index;
myportal.app.validForm = false;
break;
}
}
}
}

if(typeof(myportal.app.submitForm) != 'undefined' && submitMe == false){
event.preventDefault();
$(this).find("input[type=submit]").next('.dropdown-toggle').removeClass('disabled');
$(this).find("input[type=submit]").button('reset');
$(this).find("input[type=submit]").blur();


if(($(this).attr('id') == 'tl-account-themes' || $(this).attr('id') == 'tl-account-certifications') && !myportal.app.validForm){ // make sure that the tab with the error is shown
var errorTab = $('#'+errorElement).parents('.tab-pane').attr('id');
$('li a[href="#'+errorTab+'"]').tab('show');
}

if(($(this).attr('id') == 'tl-account-certifications' && $('#mode').val() == 1) || ($(this).attr('id') == 'tl-account-themes' && $('#mode').val() == 1)){
$('#save-as-new-button').removeClass('disabled').removeAttr("disabled").val(myportal.app.translate('save-as-new'));
}

if(($(this).attr('id') == 'add-coupon-form' || $(this).attr('id') == 'edit-coupon-form') && $('#tl-discount-type').val() == '1'){
$("input[name='fixed_amount_discount']").val('');
}
else if(($(this).attr('id') == 'add-coupon-form' || $(this).attr('id') == 'edit-coupon-form') && $('#tl-discount-type').val() == '2'){
$("input[name='percentage_discount']").val('');
}
}
});
});
</script>
<form name="msg_form" method="post" action="https://redaalfarouk-eduact.talentlms.com/unit/view/id:2263" class="tl-form form-vertical" id="03cd8c4e0f7a29dd760bb97b7af88a2f"><input type="hidden" name="_track_msg_form" value="1600170362" class="" id="551829638"><input type="hidden" name="_redirect_" value="" class="" id="_redirect_"><input type="hidden" name="_myToken" value="af2e48f47aa28b18c5267174c4f329ca" class="" id="_myToken"><input type="hidden" name="attachment_id" value="" class="" id="583014212"><input type="hidden" name="attachment_hash" value="" class="" id="1872115857"><input type="hidden" name="attachment_name" value="" class="" id="1907352915"><input type="hidden" name="tempfile" value="" class="" id="1346313177"> <div class="control-group tl-message-subject ">
<label class="control-label tl-mandatory-label" for="message_subject">موضوع</label> <div class="controls">
<div class="input-append tl-countdown"><input type="text" name="title" value="" class="span7" id="message_subject" placeholder="" autocomplete="off" tabindex="" data-provide="limit" data-counter="#counter-message_subject" data-maxchars="150"><span class="add-on" id="counter-message_subject"></span></div> <span class="help-block"></span>
</div>
</div>
<div class="control-group ">
<label class="control-label" for="message_body">جوهر الموضوع</label> <div class="controls">
<textarea name="body" class="span7" id="message_body" placeholder="" rows="7" tabindex="" style="display: none; margin-bottom: 0px;"></textarea><div class="note-editor"><div class="note-dropzone"><div class="note-dropzone-message"></div></div><div class="note-dialog"><div class="note-image-dialog modal" aria-hidden="false"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" aria-hidden="true" tabindex="-1">×</button><h4 class="modal-title">Insert Image</h4></div><form class="note-modal-form"><div class="modal-body"><div class="form-group row-fluid note-group-select-from-files"><label>Select from files</label><input class="note-image-input" type="file" name="files" accept="image/*" multiple="multiple"></div><div class="form-group row-fluid"><label>Image URL</label><input class="note-image-url form-control span12" type="text"></div></div><div class="modal-footer"><button href="#" class="btn btn-primary note-image-btn disabled" disabled="">Insert Image</button></div></form></div></div></div><div class="note-link-dialog modal" aria-hidden="false"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" aria-hidden="true" tabindex="-1">×</button><h4 class="modal-title">Insert Link</h4></div><form class="note-modal-form"><div class="modal-body"><div class="form-group row-fluid"><label>Text to display</label><input class="note-link-text form-control span12" type="text"></div><div class="form-group row-fluid"><label>To what URL should this link go?</label><input class="note-link-url form-control span12" type="text"></div><div class="checkbox"><label><input type="checkbox" checked=""> Open in new window</label></div></div><div class="modal-footer"><button href="#" class="btn btn-primary note-link-btn disabled" disabled="">Insert Link</button></div></form></div></div></div><div class="note-help-dialog modal" aria-hidden="false"><div class="modal-dialog"><div class="modal-content"><form class="note-modal-form"><div class="modal-body"><a class="modal-close pull-right" aria-hidden="true" tabindex="-1">Close</a><div class="title">Keyboard shortcuts</div><div class="note-shortcut-row row"><div class="note-shortcut note-shortcut-col col-sm-6 col-xs-12"><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-title col-xs-offset-6">Action</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + Z</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Undo</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + Shift + Z</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Redo</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + ]</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Indent</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + [</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Outdent</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + ENTER</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Insert Horizontal Rule</div></div></div><div class="note-shortcut note-shortcut-col col-sm-6 col-xs-12"><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-title col-xs-offset-6">Text formatting</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + B</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Bold</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + I</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Italic</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + U</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Underline</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + </div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Remove Font Style</div></div></div></div><div class="note-shortcut-row row"><div class="note-shortcut note-shortcut-col col-sm-6 col-xs-12"><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-title col-xs-offset-6">Document Style</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + NUM0</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Normal</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + NUM1</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Header 1</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + NUM2</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Header 2</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + NUM3</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Header 3</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + NUM4</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Header 4</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + NUM5</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Header 5</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + NUM6</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Header 6</div></div></div><div class="note-shortcut note-shortcut-col col-sm-6 col-xs-12"><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-title col-xs-offset-6">Paragraph formatting</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + Shift + L</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Align left</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + Shift + E</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Align center</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + Shift + R</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Align right</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + Shift + J</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Justify full</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + Shift + NUM7</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Ordered list</div></div><div class="note-shortcut-row row"><div class="note-shortcut-col col-xs-6 note-shortcut-key">Ctrl + Shift + NUM8</div><div class="note-shortcut-col col-xs-6 note-shortcut-name">Unordered list</div></div></div></div><p class="text-center"><a href="//summernote.org/" target="_blank">Summernote 0.6.1</a> · <a href="//github.com/summernote/summernote" target="_blank">Project</a> · <a href="//github.com/summernote/summernote/issues" target="_blank">Issues</a></p></div></form></div></div></div><div class="note-talent-image-dialog modal" aria-hidden="false"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" aria-hidden="true" tabindex="-1">×</button><h4 class="modal-title">Insert Image</h4></div><form class="note-modal-form"><div class="modal-body"><div class="pull-left" style="margin-right: 5px;"><select class="imagesselect" id="imagesselect_1600170366"><option value="0">إستعمل صورة من ملفات الدورة</option></select></div><div style="max-height: 20px;margin-top: 2px;" id="images_namespace_1600170366" class="tl-editor-uploader" data-selectbox="imagesselect_1600170366" data-url="undefined"><span class="file-wrapper fileinput-button"><input type="file" multiple="" name="files[]"><a class="tl-editor-uploader-tool-tip none-decoration" tabindex="-1" rel="tooltip" data-original-title="<u>الملفات المقبولة</u>: gif, jpg, jpeg, png<br><u>الحجم الأقصى للملف</u>: 10 MB" data-html="true" id="fileupload_input" style="float:left; line-height: 18px; font-size: 13px;" href="javascript:void(0);"><i class="icon-upload icon-grid"></i></a><div class="note error text-error pull-left" style="margin-left:3px"> </div></span><table class="zebra-striped" style="width: 40%;"><tbody class="files"></tbody></table><script>var fileUploadErrors = {maxFileSize: 'File is too big',minFileSize: 'File is too small',acceptFileTypes: 'File type not accepted',maxNumberOfFiles: 'Max number of files exceeded',uploadedBytes: 'Uploaded bytes exceed file size',emptyResult: 'Empty file upload result'};</script><script id="template-upload" type="text/html">{% for (var i=0, file; file=o.files[i]; i++) { %}<tr class='template-upload fade'><td><strong class='error text-danger'></strong><div class='progress progress-striped active' role='progressbar' aria-valuemin='0' aria-valuemax='100' aria-valuenow='0' style='margin-left:5px;max-width:200px'><div class='bar bar-success progress-bar progress-bar-success' style='width:0%;'></div></div></td></tr>{% } %}</script><script id="template-download" type="text/html">{% for (var i=0, files=o.files, l=files.length, file=files[0]; i<l; file=files[++i]) { %}<tr class='template-download fade'>{% if (file.error) { %}<td></td><td class='error' colspan='2'><span class='label important'>Error</span> {%=fileUploadErrors[file.error] || file.error%}</td>{% } else { %}<td class='preview' style='text-align: center;vertical-align:middle'>{% if (file.thumbnail_url) { %}<img src='{%=file.thumbnail_url%}'>{% } %}</td>{% } %}</tr>{% } %}</script></div><div class="clear"></div><div class="form-group row-fluid"><input class="note-image-url form-control span8" type="text" placeholder="إستعمل رابط الصورة (...//:http)"><button href="#" class="btn btn-primary note-ok-btn disabled" style="margin-left:5px" disabled="">OK</button></div></div><div class="modal-footer"> </div></form></div></div></div></div><div class="note-handle"><div class="note-control-selection"><div class="note-control-selection-bg"></div><div class="note-control-holder note-control-nw"></div><div class="note-control-holder note-control-ne"></div><div class="note-control-holder note-control-sw"></div><div class="note-control-sizing note-control-se"></div><div class="note-control-selection-info"></div></div></div><div class="note-popover"><div class="note-link-popover popover bottom in" style="display: none;"><div class="arrow"></div><div class="popover-content"><a href="http://www.google.com" target="_blank">www.google.com</a>&nbsp;&nbsp;<div class="note-insert btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="showLinkDialog" data-hide="true" tabindex="-1" data-original-title="Edit (CTRL+K)"><i class="fa fa-edit"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="unlink" tabindex="-1" data-original-title="Unlink"><i class="fa fa-unlink"></i></button></div></div></div><div class="note-image-popover popover bottom in" style="display: none;"><div class="arrow"></div><div class="popover-content"><div class="btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="resize" data-value="1" tabindex="-1" data-original-title="Resize Full"><span class="note-fontsize-10">100%</span></button><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="resize" data-value="0.5" tabindex="-1" data-original-title="Resize Half"><span class="note-fontsize-10">50%</span></button><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="resize" data-value="0.25" tabindex="-1" data-original-title="Resize Quarter"><span class="note-fontsize-10">25%</span></button></div><div class="btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="floatMe" data-value="left" tabindex="-1" data-original-title="Float Left"><i class="fa fa-align-left"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="floatMe" data-value="right" tabindex="-1" data-original-title="Float Right"><i class="fa fa-align-right"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="floatMe" data-value="none" tabindex="-1" data-original-title="Float None"><i class="fa fa-align-justify"></i></button></div><div class="btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="imageShape" data-value="img-rounded" tabindex="-1" data-original-title="Shape: Rounded"><i class="fa fa-square"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="imageShape" data-value="img-circle" tabindex="-1" data-original-title="Shape: Circle"><i class="fa fa-circle-o"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="imageShape" data-value="img-thumbnail" tabindex="-1" data-original-title="Shape: Thumbnail"><i class="fa fa-picture-o"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="imageShape" tabindex="-1" data-original-title="Shape: None"><i class="fa fa-times"></i></button></div><div class="btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="removeMedia" data-value="none" tabindex="-1" data-original-title="Remove Image"><i class="fa fa-trash-o"></i></button></div></div></div></div><div class="note-toolbar btn-toolbar"><div class="note-text btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="bold" tabindex="-1" data-original-title="Bold (CTRL+B)"><i class="fa fa-bold"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="italic" tabindex="-1" data-original-title="Italic (CTRL+I)"><i class="fa fa-italic"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="underline" tabindex="-1" data-original-title="Underline (CTRL+U)"><i class="fa fa-underline"></i></button></div><div class="note-layout btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="insertUnorderedList" tabindex="-1" data-original-title="Unordered list (CTRL+SHIFT+NUM7)"><i class="fa fa-list-ul"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="insertOrderedList" tabindex="-1" data-original-title="Ordered list (CTRL+SHIFT+NUM8)"><i class="fa fa-list-ol"></i></button><button type="button" class="btn btn-default btn-sm btn-small dropdown-toggle" data-toggle="dropdown" title="" tabindex="-1" data-original-title="Paragraph"><i class="fa fa-align-left"></i> <span class="caret"></span></button><div class="dropdown-menu"><div class="note-align btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="justifyLeft" tabindex="-1" data-original-title="Align left (CTRL+SHIFT+L)"><i class="fa fa-align-left"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="justifyCenter" tabindex="-1" data-original-title="Align center (CTRL+SHIFT+E)"><i class="fa fa-align-center"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="justifyRight" tabindex="-1" data-original-title="Align right (CTRL+SHIFT+R)"><i class="fa fa-align-right"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="justifyFull" tabindex="-1" data-original-title="Justify full (CTRL+SHIFT+J)"><i class="fa fa-align-justify"></i></button></div><div class="note-list btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="indent" tabindex="-1" data-original-title="Indent (CTRL+])"><i class="fa fa-indent"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="outdent" tabindex="-1" data-original-title="Outdent (CTRL+[)"><i class="fa fa-outdent"></i></button></div></div></div><div class="note-insert btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="showLinkDialog" data-hide="true" tabindex="-1" data-original-title="Link (CTRL+K)"><i class="fa fa-link"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="" data-event="showImageDialog" data-hide="true" tabindex="-1" data-original-title="Picture"><i class="fa fa-picture-o"></i></button></div></div><textarea class="note-codable" style="margin-bottom: 0px;"></textarea><div class="note-editable tl-message-editor span9" contenteditable="true" style="margin-bottom: 10px;"></div></div> <!--<div class="tl-air-editor tl-message-editor span7" contenteditable="true" style="float:none; display:inline-block"></div>-->
<span class="help-block"></span>
</div>
</div>
</form></div>

<script type="text/javascript">
$(document).ready(function(){
$('#message_body').summernote({
toolbar: [
['text', ['bold', 'italic', 'underline']],
['layout', ['ul', 'ol', 'paragraph']],
['insert', ['link', 'picture']]
],
codemirror: {
mode: 'text/html',
htmlMode: true,
lineWrapping: true,
lineNumbers: true
},
prettifyHtml: false,
disableDragAndDrop: true,
oninit: function(){
$('.note-editable').addClass('tl-message-editor');
$('.note-editable').addClass('span9');
$('#message_body').code($('#message_body').val());
},
onImageUpload: function(files){
return false;
},
onpaste: function(){
setTimeout(function(){
$('#message_body').code($('.tl-message-editor').code().trim().replace(/r?n|r/g, '').replace(/^s*(<brs*/?s*>)+|(<brs*/?s*>)+s*$/ig, '')); //trim, remove newlines, remove heading and trailing br's
}, 100);
},
onCreateLink : function(originalLink) {
return strip_tags(originalLink);
}
});

$('.note-toolbar button').tooltip().on('shown', function(e){ e.stopPropagation(); });
});
</script>
</div>
<div class="modal-footer">
<input type="submit" name="submit_send_message" value="إرسل رسالة" class="btn btn-primary" id="submit_send_message" data-loading-text="بعث " tabindex=""> <a data-dismiss="modal" class="btn">إغلاق</a>
</div>
</div>

<script type="text/javascript">
$(document).ready(function(){
if($('.btn-navbar').is(':visible')){ // responsive
var pullRightWidth = $('.btn-navbar').width();
}
else{
var pullRightWidth = $('#tl-pull-right-nav').width();
}

if(pullRightWidth < 300){
var formattedCourseName = "<span title='المحاضرة الاولى ( سنتر)' class='tl-formatted-course-name'>المحاضرة الاولى ( سنتر)</span>";
}
else if(pullRightWidth < 400){
var formattedCourseName = "<span title='المحاضرة الاولى ( سنتر)' class='tl-formatted-course-name'>المحاضرة الاولى ( سنتر)</span>";
}
else if(pullRightWidth < 500){
var formattedCourseName = "<span title='المحاضرة الاولى ( سنتر)' class='tl-formatted-course-name'>المحاضرة الاولى ( سنتر)</span>";
}
else if(pullRightWidth < 600){
var formattedCourseName = "<span title='المحاضرة الاولى ( سنتر)' class='tl-formatted-course-name'>المحاضرة الاولى ( سنتر)</span>";
}
else if(pullRightWidth < 700){
var formattedCourseName = "<span title='المحاضرة الاولى ( سنتر)' class='tl-formatted-course-name'>المحاضرة الاولى ( سنتر)</span>";
}
else{
var formattedCourseName = "<span title='المحاضرة الاولى ( سنتر)' class='tl-formatted-course-name'>المحاضرة الاولى...</span>";
}

$('#tl-navbar-course-name').html(formattedCourseName);
$('#tl-navbar-course-name .tl-formatted-course-name').prop('title', 'عودة إلى الدورات');


var sendMessageFormId = '03cd8c4e0f7a29dd760bb97b7af88a2f';
$('#' + sendMessageFormId + ' textarea').css('margin-bottom', '0px');
$('#' + sendMessageFormId + ' .tl-message-editor').css('margin-bottom', '10px');
$('#' + sendMessageFormId + ' #message_subject, #' + sendMessageFormId + ' #message_body').removeClass('span8').addClass('span7');

$(document).on('click', '#send-message-instructor', function(){
$('#tl-send-message-modal').modal();
});

$('#tl-send-message-modal').on('show', function(){
$('#' + sendMessageFormId + ' .error').removeClass('error');
$('#' + sendMessageFormId + ' .help-block').html('');
$('#tl-send-message-modal .alert').remove();
$('#' + sendMessageFormId).show();
$('#tl-send-message-modal .modal-footer').show();
$('#submit_send_message').removeClass('disabled').text("إرسل رسالة").val("إرسل رسالة");
});

$('#submit_send_message').on('click', function(){
if($(this).hasClass('disabled')){
return false;
}

$(this).addClass('disabled').text("بعث ").val("بعث ");
$('#' + sendMessageFormId + ' .error').removeClass('error');
$('#' + sendMessageFormId + ' .help-block').html('');
$('#tl-send-message-modal .alert').remove();

var url = 'https://redaalfarouk-eduact.talentlms.com/learner/sendmessage/course-id:###course-id###,unit-id:###unit-id###,unit-type:###unit-type###'.replace('###course-id###', '318').replace('###unit-id###', '2263').replace('###unit-type###', 'Unit');

$('#message_body').val($('.tl-message-editor').code());

myportal.app.ajax(url, {
type: "post",
data: $('#' + sendMessageFormId).serialize(),
dataType: 'json',
success: function(resp){
if(!resp.success){
if(resp.data){
$.each(resp.data, function(key, val){
$("input[name='" + key + "']").parents('.control-group').addClass('error');
$("input[name='" + key + "']").closest('.controls').find('.help-block:first').html('<span class="help-inline">' + val + '</span>');
$("textarea[name='" + key + "']").parents('.control-group').addClass('error');
$("textarea[name='" + key + "']").closest('.controls').find('.help-block:first').html('<span class="help-inline">' + val + '</span>');
});

}
else if(resp.exc){
myportal.app.notify({type: "error", message: resp.exc});
}

$('#submit_send_message').removeClass('disabled').text("إرسل رسالة").val("إرسل رسالة");
}
else{
$('#' + sendMessageFormId).hide();
$('#tl-send-message-modal .modal-footer').hide();
myportal.app.notify({type: "success", message: "تم إرسال الرسالة بنجاح"});
$('#tl-send-message-modal').modal('hide');
}
}
});

return false;
});


// Auto open header menus
$('#tl-dropdown-progress, #tl-dropdown-more, #tl-dropdown-add, #tl-dropdown-files').mouseenter(function(e) {
if (!$(this).hasClass('open') && $(window).width() >= 980){
$(this).addClass("open autoopened");
}
});
$('#tl-dropdown-progress, #tl-dropdown-more, #tl-dropdown-add, #tl-dropdown-files').mouseleave(function() {
if ($(this).hasClass('open') && $(this).hasClass('autoopened')){
$(this).removeClass("open autoopened");
}
});
});
</script>

<div class="container ">



<div class="row">
<div class="span12">

<div class="tl-unit-content ">
<div style="display: none;" id="last-unit-progress"></div>
<div style="display: none;" id="assignment-reply-type"></div>
<div class="hide" id="assignment-modify-answer-time"></div>
<div class="tl-unit-content">
<center><div class="readability"><p style="text-align: center;"><span style="font-weight: bold;" wfd-id="37">ao161586 - البلاغة&nbsp;</span></p>
<div style="padding-top:56.25%;position:relative;"><iframe src="https://player.vdocipher.com/playerAssets/1.x/vdo/embed/index.html#otp=20160313versUSE3232gya1GFjZlL0C2hc4R4W0rUC6h6VtxV52FqNLACcwkwvNB&amp;playbackInfo=eyJ2aWRlb0lkIjoiZTIwZWE3OTIxODI3NDM2NDkxMmU3ZDVkZjk4OWMyMDEifQ==" style="border:0;height:360px;width:640px;max-width:100%;position:absolute;top:0px;left:0px;height:100%;width:100%;" allowfullscreen="true" allow="encrypted-media"></iframe></div></div></center> </div>
<div class="clear"></div>
<div id="tl-complete-unit-handles-area" class="text-center ">
<hr class="tl-hr-content">
<div class="tl-completed-unit-handles" style="">
<div class="btn-group dropup" style="display: inline-block;">
<a href="javascript:void(0)" class="btn btn-large tl-passed-continue-unit-button" onclick="location='https://redaalfarouk-eduact.talentlms.com/unit/viewtestsurvey/id:2258,mode:test'">اكتملت. لنتابع</a>

</div>
</div>

<div class="tl-pending-unit-handles" style="display:none">
<a href="javascript:void(0)" class="btn btn-large tl-pending-button-assignment disabled">في انتظار الرد من المعلم</a>
<div class="help-inline tl-assignment-more-options-pending">
<div class="tl-assignment-handles-inner">
<div class="tl-assignment-icon tl-assignment-check-answer">
<div class="tl-icon-stack">
<i class="icon-circle tl-icon-stack-background"></i>
<i class="icon-comment tl-icon-stack-content"></i>
</div>
<br class="clear">
<div class="tl-icon-label">إجابتك</div>
</div>
<div class="tl-assignment-icon tl-assignment-modify-answer">
<div class="tl-icon-stack">
<i class="icon-circle tl-icon-stack-background"></i>
<i class="icon-edit tl-icon-stack-content"></i>
</div>
<br class="clear">
<div class="tl-icon-label">قم بتعديل إجابتك</div>
</div>
</div>
</div>
</div>



<div class="tl-incomplete-unit-handles" style="display:none">
<a href="javascript:void(0)" class="btn btn-large tl-complete-button tl-completed-continue-button" data-toggle="https://redaalfarouk-eduact.talentlms.com/unit/complete/id:2263">حدد كـ منتهي وأكمل</a>

</div>
</div>

</div>

<div class="modal fade" id="tl-course-completed-modal" style="display: none; outline: none;" tabindex="-1">
<div class="modal-body text-center">
<a href="javascript:void(0)" class="close pull-right" data-dismiss="modal">×</a>
<h1>تهانينا! مبروك!</h1>
<img alt="تم إكمال الدورة" src="https://d3j0t7vrtr92dk.cloudfront.net/images/course_completed.jpg">
<h2>تم إكمال الدورة</h2>
<h3><span title="المحاضرة الاولى ( سنتر) (ARCENTER01)" class="tl-formatted-course-name">المحاضرة الاولى ( سنتر) <span class="tl-formatted-course-code">(ARCENTER01)</span></span></h3>
<div id="tl-course-completed-modal-options" class="text-center">
<p><a class="btn btn-primary tl-download-certificate" href="https://redaalfarouk-eduact.talentlms.com/user/downloadcertification/id:###id###" style="display: none;">تنزيل الشهادة</a></p>
<p><a class="tl-courses-list" href="https://redaalfarouk-eduact.talentlms.com/dashboard/index">إذهب إلى قائمة الدورات</a></p>
<p><a class="tl-next-course" href="https://redaalfarouk-eduact.talentlms.com/learner/course/id:###id###" style="display:none">إذهب إلى الدورة التالية</a></p>
</div>
</div>
</div>

<div class="modal fade hide" id="tl-course-failed-modal" style="outline: none;" tabindex="-1">
<div class="modal-body text-center">
<a href="javascript:void(0)" class="close pull-right" data-dismiss="modal">×</a>
<h1>أنت لم تفعلها</h1>
<img alt="أنت لم تفعلها" src="https://d3j0t7vrtr92dk.cloudfront.net/images/course_failed.png">
<h2>للأسف، لم تصل إلى درجة النجاح في هذه الدورة</h2>
<div id="tl-course-failed-modal-options" class="text-center">
<p><a class="tl-courses-list" href="javascript:void(0)" id="send-message-instructor-failing">اطلب من المعلم أخذ هذه الدورة مرة أخرى</a></p>
<p><a class="tl-courses-list" href="https://redaalfarouk-eduact.talentlms.com/dashboard/index">إذهب إلى قائمة الدورات</a></p>
</div>
</div>
</div>



<script>
var tl_timer_id = false;

$(document).ready(function(){

if($('#tl-gamification-points-message').length){
$('#tl-gamification-points-message').css('z-index','10000');
}

if($('#tl-gamification-badges-message').length){
$('#tl-gamification-badges-message').css('z-index','10000');
}

if ($('#documents-images-zip_namespace').length) {
$('#documents-images-zip_namespace').fileupload({
autoUpload: true,
disableInputButton: false,
replaceFileInput: true,
acceptFileTypes: /(.|/)(gif|jpg|jpeg|png|ppt|pptx|doc|docx|xls|xlsx|pdf|zip|mp4|webm|ogg|ogv|avi|mpeg|mpg|mov|wmv|3gp|flv|mp3|aac|ogg|wav|mpeg|webm|wave|wma|ra|aif|aiff)$/i,
maxFileSize: 629145600,
maxFileSizeArray: uploader_limits,
add: function(e, data){
var that = this;
var $this = $(this);
var validation = data.process(function () {
return $this.fileupload('process', data);
});
validation.done(function() {
$.blueimp.fileupload.prototype.options.add.call(that, e, data);
});
validation.fail(function(data) {
$('#documents-images-zip_namespace .note.error').html("<i class='icon-attention-circled tl-cursor-default'></i> "+data.files[data.index].error);
});
},
done: function(e, data){
resp = $.parseJSON(data.jqXHR.responseText);
setTimeout(function(){data.context.remove()}, 200); // remove completed file's table row

if (resp.success) {
if(resp.data.assignmentReplyFile !== undefined){
completeAssignmentUnit(null, resp.data.assignmentReplyFile);
}
else {
$('#documents-images-zip_namespace .note.error').html("<i class='icon-attention-circled tl-cursor-default'></i> "+resp.data.error);
}
}
else {
$('#documents-images-zip_namespace .note.error').html("<i class='icon-attention-circled tl-cursor-default'></i> "+resp.data.error);
}
}
});
$('#documents-images-zip_namespace').bind('fileuploadadd', function (e) {$('#documents-images-zip_namespace tr.template-upload, #documents-images-zip_namespace tr.template-download').remove();});
$('#documents-images-zip_namespace').bind('fileuploadstart', function(e){ myportal.app.isUploading = true; });
$('#documents-images-zip_namespace').bind('fileuploadstop', function(e){ myportal.app.isUploading = false; });
}


$('#send-message-instructor-failing').on('click', function(){
$('#tl-course-failed-modal').modal('hide');
$('#tl-send-message-modal').modal();
});

if ($('.tl-assignment-reply-editor').length) {
$('.tl-assignment-reply-editor').summernote({
airMode: true,
airPopover: [
['text', ['bold', 'italic', 'underline']],
['insert', ['link', 'picture']]
],
disableDragAndDrop: true,
onImageUpload: function(files) {
return false;
}
});
}

$(document).on('blur', '.note-editable', function(){
$('.note-air-popover').hide();
});

var gamificationPointsForUnitCompletion = $.cookie("gamification_points_for_unit_completion");
var gamificationPointsForCourseCompletion = $.cookie("gamification_points_for_course_completion");
var gamificationPointsForCertification = $.cookie("gamification_points_for_certification");
var gamificationPointsNotification = '';
var gamificationAddedPoints = 0;

if(gamificationPointsForUnitCompletion){
var parts = gamificationPointsForUnitCompletion.split('###');
gamificationPointsNotification = parts[0];
gamificationAddedPoints = parseInt(parts[1]);
setTlmsCookie("gamification_points_for_unit_completion", null, {expires: -1, path: '/', domain: myEffectiveDomain, secure: false});
}

if(gamificationPointsForCourseCompletion){
var parts = gamificationPointsForCourseCompletion.split('###');
gamificationPointsNotification = (gamificationPointsNotification) ? gamificationPointsNotification + '<br/>' + parts[0] : parts[0];
gamificationAddedPoints = gamificationAddedPoints + parseInt(parts[1]);
setTlmsCookie("gamification_points_for_course_completion", null, {expires: -1, path: '/', domain: myEffectiveDomain, secure: false});
}

if(gamificationPointsForCertification){
var parts = gamificationPointsForCertification.split('###');
gamificationPointsNotification = (gamificationPointsNotification) ? gamificationPointsNotification + '<br/>' + parts[0] : parts[0];
gamificationAddedPoints = gamificationAddedPoints + parseInt(parts[1]);
setTlmsCookie("gamification_points_for_certification", null, {expires: -1, path: '/', domain: myEffectiveDomain, secure: false});
}

if(gamificationPointsNotification){
if($("#tl-header-gamification-entrance").data('entrancemode') == 'points'){
$("#tl-header-gamification-entrance").empty();
var pointsCountUp = new countUp("tl-header-gamification-entrance", parseInt($("#tl-header-gamification-entrance").data('entrancevalue')) - parseInt(gamificationAddedPoints), parseInt($("#tl-header-gamification-entrance").data('entrancevalue')), 0, 1.5, {useEasing: true, useGrouping: true, separator: '', suffix: ' ' + "نقاط"});
pointsCountUp.start();
}

$("#tl-gamification-points-message").html(decodeURIComponent(gamificationPointsNotification)).fadeIn(1000);
setTimeout(function(){$("#tl-gamification-points-message").fadeOut('slow');}, 3000);
}

var gamificationAssignmentBadge = $.cookie("gamification_assignment_badge");
var gamificationLearningBadge = $.cookie("gamification_learning_badge");
var gamificationCertificationBadge = $.cookie("gamification_certification_badge");

if(gamificationAssignmentBadge){
var parts = gamificationAssignmentBadge.split('###');
$(".tl-badge-image").attr('src', parts[1]);
$(".tl-badge-message").html(decodeURIComponent(parts[0]));
setTlmsCookie("gamification_assignment_badge", null, {expires: -1, path: '/', domain: myEffectiveDomain, secure: false});
}

if(gamificationLearningBadge){
var parts = gamificationLearningBadge.split('###');
setTlmsCookie("gamification_learning_badge", null, {expires: -1, path: '/', domain: myEffectiveDomain, secure: false});

if($(".tl-badge-image").attr('src') != '' && $(".tl-badge-message").html() != ''){
$("#tl-gamification-badges-message").append('<hr/><div id="learning-badge-message" class="tl-badge-image-message-wrapper"></div>');
$("#learning-badge-message").append('<img class="tl-badge-image pull-left image60x60" src="' + parts[1] + '"/>').append('<div class="tl-badge-message text-center tl-bold-item">' + decodeURIComponent(parts[0]) + '</div>');
}
else{
$(".tl-badge-image").attr('src', parts[1]);
$(".tl-badge-message").html(decodeURIComponent(parts[0]));
}
}

if(gamificationCertificationBadge){
var parts = gamificationCertificationBadge.split('###');
setTlmsCookie("gamification_certification_badge", null, {expires: -1, path: '/', domain: myEffectiveDomain, secure: false});

if($(".tl-badge-image").attr('src') != '' && $(".tl-badge-message").html() != ''){
$("#tl-gamification-badges-message").append('<hr/><div id="certification-badge-message" class="tl-badge-image-message-wrapper"></div>');
$("#certification-badge-message").append('<img class="tl-badge-image pull-left image60x60" src="' + parts[1] + '"/>').append('<div class="tl-badge-message text-center tl-bold-item">' + decodeURIComponent(parts[0]) + '</div>');
}
else{
$(".tl-badge-image").attr('src', parts[1]);
$(".tl-badge-message").html(decodeURIComponent(parts[0]));
}
}

if(gamificationAssignmentBadge || gamificationLearningBadge || gamificationCertificationBadge){
if(gamificationPointsNotification){
$("#tl-gamification-badges-message").css('bottom', $("#tl-gamification-points-message").height() + 20 + 16 + 5);
}

if($("#tl-header-gamification-entrance").data('entrancemode') == 'badges'){
$("#tl-header-gamification-entrance").empty();
var badgesCountUp = new countUp("tl-header-gamification-entrance", 0, parseInt($("#tl-header-gamification-entrance").data('entrancevalue')), 0, 1.5, {useEasing: true, useGrouping: true, separator: '', suffix: ' ' + "شارات"});
badgesCountUp.start();
}

$("#tl-gamification-badges-message").fadeIn(1000).css('display', 'table');
setTimeout(function(){$("#tl-gamification-badges-message").fadeOut('slow');}, 5000);
}

var gamificationCompletedCourses = $.cookie("gamification_completed_courses");

if(gamificationCompletedCourses && $("#tl-header-gamification-entrance").data('entrancemode') == 'courses'){
$("#tl-header-gamification-entrance").empty();
var completedCoursesCountUp = new countUp("tl-header-gamification-entrance", 0, parseInt($("#tl-header-gamification-entrance").data('entrancevalue')), 0, 1.5, {useEasing: true, useGrouping: true, separator: '', suffix: ' ' + "الدورات المكتملة"});
completedCoursesCountUp.start();
setTlmsCookie("gamification_completed_courses", null, {expires: -1, path: '/', domain: myEffectiveDomain, secure: false});
}

var gamificationUserLevel = $.cookie("gamification_user_level");

if(gamificationUserLevel && $("#tl-header-gamification-entrance").data('entrancemode') == 'levels'){
var gamificationUserLevelParts = gamificationUserLevel.split('###');
$("#tl-header-gamification-entrance").empty();
var userLevelCountUp = new countUp("tl-header-gamification-entrance", 0, parseInt(gamificationUserLevelParts[0]), 0, 1.5, {useEasing: true, useGrouping: true, separator: ''});
userLevelCountUp.start(function(){$('#tl-header-gamification-entrance').html(decodeURIComponent(gamificationUserLevelParts[1]));});
setTlmsCookie("gamification_user_level", null, {expires: -1, path: '/', domain: myEffectiveDomain, secure: false});
}


$('#documents-images-zip_namespace .inputbtn').addClass('btn btn-large').data('placement', 'right');

$("a[rel=popover]").popover({placement: 'bottom'}).click(function(e){
if($(this).hasClass('tl-content-show-popover')){
e.preventDefault();
}
});

$(document).on('click', '.tl-assignment-select-method', function(){
$("#tl-recording-area").hide();
if(videoRecordingPlayer){
videoRecordingPlayer.record().reset();
}
$("#tl-recording-audio-area").hide();
if(audioRecordingPlayer){
audioRecordingPlayer.record().reset();
}
$('#documents-images-zip_namespace').hide();
$('#assignment-reply-textbox-group').hide();
$('.tl-assignment-handles').hide();
$('.tl-complete-button-assignment').hide();
$('.tl-send-assignment-recording').addClass('disabled').hide();
$('.tl-send-assignment-recording-audio').addClass('disabled').hide();
$('.tl-assignment-handles').show();
$(this).parent().hide();
});

$(document).on('click', '.tl-assignment-usetextbox', function(){
$("#tl-recording-area").hide();
if(videoRecordingPlayer){
videoRecordingPlayer.record().reset();
}
$("#tl-recording-audio-area").hide();
if(audioRecordingPlayer){
audioRecordingPlayer.record().reset();
}
$('#documents-images-zip_namespace').hide();
$('#assignment-reply-textbox-group').show();
$('#assignment-reply-textbox-group').removeClass('hidden-textbox').addClass('visible-textbox');
$('.tl-complete-button-assignment').show();
$('.tl-send-assignment-recording').addClass('disabled').hide();
$('.tl-send-assignment-recording-audio').addClass('disabled').hide();
$('.tl-assignment-select-method').parent().show();
$('.tl-assignment-handles').hide();
setTimeout(function(){ $("#assignment-reply-textbox").focus(); }, 100);
});

$(document).on('click', '.tl-assignment-showuploader', function(){
$("#tl-recording-area").hide();
if(videoRecordingPlayer){
videoRecordingPlayer.record().reset();
}
$("#tl-recording-audio-area").hide();
if(audioRecordingPlayer){
audioRecordingPlayer.record().reset();
}
$('#documents-images-zip_namespace').show();
$('#assignment-reply-textbox-group').hide();
$('#assignment-reply-textbox-group').removeClass('visible-textbox').addClass('hidden-textbox');
$('#documents-images-zip_namespace').show();
$('.tl-complete-button-assignment').hide();
$('.tl-send-assignment-recording').addClass('disabled').hide();
$('.tl-send-assignment-recording-audio').addClass('disabled').hide();
$('.tl-assignment-select-method').parent().show();
$('.tl-assignment-handles').hide();
});

$(document).on('click', '.tl-assignment-showrecorder', function(){
$("#tl-recording-audio-area").hide();
if(audioRecordingPlayer){
audioRecordingPlayer.record().reset();
}
$('#assignment-reply-textbox-group').removeClass('visible-textbox').addClass('hidden-textbox');
$('#documents-images-zip_namespace').hide();
$('.tl-complete-button-assignment').hide();
$('.tl-send-assignment-recording').addClass('disabled').show();
$('.tl-send-assignment-recording-audio').addClass('disabled').hide();
$('.tl-assignment-select-method').parent().show();
$('.tl-assignment-handles').hide();
$("#tl-recording-area").show();
if(videoRecordingPlayer){
videoRecordingPlayer.record().getDevice();
}
});

$(document).on('click', '.tl-assignment-showrecorder-audio', function(){
$("#tl-recording-area").hide();
if(videoRecordingPlayer){
videoRecordingPlayer.record().reset();
}
setTimeout(function(){
// unlike the video recorder, we initialize the audio recorder after it is visible to the user, otherwise the sound waves do not show up
initAudioRecordingPlayer();
}, 100);
$('#assignment-reply-textbox-group').removeClass('visible-textbox').addClass('hidden-textbox');
$('#documents-images-zip_namespace').hide();
$('.tl-complete-button-assignment').hide();
$('.tl-send-assignment-recording').addClass('disabled').hide();
$('.tl-send-assignment-recording-audio').addClass('disabled').show();
$('.tl-assignment-select-method').parent().show();
$('.tl-assignment-handles').hide();
$("#tl-recording-audio-area").show();
if(audioRecordingPlayer){
audioRecordingPlayer.record().getDevice();
}
});

$(document).on('click', '.tl-assignment-modify-answer', function(){
var replyType = $('#assignment-reply-type').text();
$('#assignment-modify-answer-time').text(Math.floor(new Date().getTime()/1000));

$('.tl-assignment-handles').show();
$('.tl-pending-unit-handles').hide();
$('.tl-incomplete-unit-handles').show();
$('#documents-images-zip_namespace').hide();
$('.tl-assignment-more-options-complete .tl-assignment-select-method').removeClass('tl-assignment-select-method').addClass('tl-assignment-cancel-modify').parent().show();
});

$(document).on('click', '.tl-assignment-cancel-modify', function(){
$('.tl-assignment-handles').hide();
$('.tl-pending-unit-handles').show();
$('.tl-incomplete-unit-handles').hide();
$("#tl-recording-area").hide();
if(videoRecordingPlayer){
videoRecordingPlayer.record().reset();
}
$("#tl-recording-audio-area").hide();
if(audioRecordingPlayer){
audioRecordingPlayer.record().reset();
}
$('#documents-images-zip_namespace').hide();
$('#assignment-reply-textbox-group').hide();
$('#assignment-reply-textbox-group').removeClass('visible-textbox').addClass('hidden-textbox');
$('.tl-complete-button-assignment').hide();
$('.tl-send-assignment-recording').addClass('disabled').hide();
$('.tl-send-assignment-recording-audio').addClass('disabled').hide();
});

$(document).on('click', '.tl-assignment-check-answer', function(){
var url = 'https://redaalfarouk-eduact.talentlms.com/unit/getassignmentreply/id:2263,mode:view';

myportal.app.ajax(url, {
type: 'GET',
success: function(response){
var data = myportal.app.parseResponse(response);
var replyTypeFile = 'file';

if(data.type == replyTypeFile && data.fileType != 'zip' && data.fileType != ''){
$('#tl-assignment-check-answer-modal').addClass('preview-modal');
}
else{
$('#tl-assignment-check-answer-modal').removeClass('preview-modal');
}

$('#tl-assignment-check-answer-modal .modal-body').html(data.reply);
$('#tl-assignment-check-answer-modal .modal-header h3').html("إجابتك");
$('#tl-assignment-check-answer-modal').modal();
}
});
});

$(document).on('click', '.tl-assignment-checkreply', function(){
var url = 'https://redaalfarouk-eduact.talentlms.com/unit/getassignmentreply/id:2263,mode:view';

myportal.app.ajax(url, {
type: 'GET',
success: function(response){
var data = myportal.app.parseResponse(response);

$('#tl-assignment-check-answer-modal .modal-header h3').html("رد المدرب");
$('#tl-assignment-check-answer-modal .modal-body').empty().append("<div style='margin-bottom: 7px;'><b>" + "درجة" + ":</b>&nbsp;" + data.grade + "</div>");
$('#tl-assignment-check-answer-modal .modal-body').append("<div class='pull-left'><b>" + "التعليقات" + ":</b>&nbsp;</div><div class='pull-left' style='max-width:100%'>" + data.comments + "</div>");
$('#tl-assignment-check-answer-modal').removeClass('preview-modal');
$('#tl-assignment-check-answer-modal').modal();
}
});
});

$(document).on('click', '.tl-ilt-checkreply', function(){
var url = 'https://redaalfarouk-eduact.talentlms.com/unit/getiltreply/id:2263';

myportal.app.ajax(url, {
type: 'GET',
success: function(response){
var data = myportal.app.parseResponse(response);

$('#tl-ilt-check-answer-modal .modal-body').empty().append("<div style='margin-bottom: 7px;'><b>" + "درجة" + ":</b>&nbsp;" + data.grade + "</div>");
$('#tl-ilt-check-answer-modal .modal-body').append("<div class='pull-left'><b>" + "التعليقات" + ":</b>&nbsp;</div><div class='pull-left'>" + data.comments + "</div>");
$('#tl-ilt-check-answer-modal').modal();
}
});
});

$('.tl-failed-button-assignment').on('click', function(){
var url = 'https://redaalfarouk-eduact.talentlms.com/unit/resetprogress/id:31265';
myportal.app.ajax(url, {
success: function(){
window.location = window.location.toString();
}
});
});

updateProgress = function(response){
data = myportal.app.parseResponse(response);

if(typeof(data) != 'undefined'){
if(data.unit_status == 'completed'){ // means that the unit was completed
if(data.progress_measure && $('#tl-navbar-progress-measure').length > 0){
$('#tl-navbar-progress-measure').css('width', data.progress_measure + '%').text(data.progress_measure + '%');

if (data.progress_measure == 100){
$(".tl-courses-list").text('إذهب إلى قائمة الدورات');
$(".tl-courses-list").removeAttr('data-dismiss');
$(".tl-courses-list").attr('href', 'https://redaalfarouk-eduact.talentlms.com/dashboard/index');
}

if(data.course_completed){
$('#tl-navbar-progress-measure').text("منتهي");
}
}

if(data.unit_id){
if($('#tl-navbar-unit-link-' + data.unit_id).length > 0){
$('#tl-navbar-unit-link-' + data.unit_id).css('fontWeight', 'bold');
$('#tl-navbar-unit-link-' + data.unit_id).children('i').show();
}

var redirect_url = 'https://redaalfarouk-eduact.talentlms.com/unit/viewtestsurvey/id:2258,mode:test';
window.location = redirect_url;
return true;
}

$('.tl-incomplete-unit-handles').fadeOut('fast', function(){
$('.tl-completed-unit-handles').fadeIn('fast');
$('#tl-scorm-iframe-closed-message').find('h3').text("قمت بإكمال الوحدة");
});

if($('#tl-navbar-next-unit').length > 0){
$('#tl-navbar-next-unit').attr('title', "التالي");
$('#tl-navbar-next-unit').children().removeClass('tl-disabled');
$('#tl-navbar-next-unit').popover('destroy');
$('#tl-navbar-next-unit').removeClass('tl-content-show-popover');

if($('#tl-navbar-next-unit').attr('data-href') && $('#tl-navbar-next-unit').attr('data-href').length){
$('#tl-navbar-next-unit').attr('href', $('#tl-navbar-next-unit').attr('data-href'));
}
}


var gamificationPointsForUnitCompletion = $.cookie("gamification_points_for_unit_completion");
var gamificationPointsForCourseCompletion = $.cookie("gamification_points_for_course_completion");
var gamificationPointsForCertification = $.cookie("gamification_points_for_certification");
var gamificationPointsNotification = '';
var gamificationAddedPoints = 0;

if(gamificationPointsForUnitCompletion){
var parts = gamificationPointsForUnitCompletion.split('###');
gamificationPointsNotification = parts[0];
gamificationAddedPoints = parseInt(parts[1]);
setTlmsCookie("gamification_points_for_unit_completion", null, {expires: -1, path: '/', domain: myEffectiveDomain, secure: false});
}

if(gamificationPointsForCourseCompletion){
var parts = gamificationPointsForCourseCompletion.split('###');
gamificationPointsNotification = (gamificationPointsNotification) ? gamificationPointsNotification + '<br/>' + parts[0] : parts[0];
gamificationAddedPoints = gamificationAddedPoints + parseInt(parts[1]);
setTlmsCookie("gamification_points_for_course_completion", null, {expires: -1, path: '/', domain: myEffectiveDomain, secure: false});
}

if(gamificationPointsForCertification){
var parts = gamificationPointsForCertification.split('###');
gamificationPointsNotification = (gamificationPointsNotification) ? gamificationPointsNotification + '<br/>' + parts[0] : parts[0];
gamificationAddedPoints = gamificationAddedPoints + parseInt(parts[1]);
setTlmsCookie("gamification_points_for_certification", null, {expires: -1, path: '/', domain: myEffectiveDomain, secure: false});
}

if(gamificationPointsNotification){
if($("#tl-header-gamification-entrance").data('entrancemode') == 'points'){
$("#tl-header-gamification-entrance").empty();
var pointsCountUp = new countUp("tl-header-gamification-entrance", parseInt($("#tl-header-gamification-entrance").data('entrancevalue')), parseInt($("#tl-header-gamification-entrance").data('entrancevalue')) + parseInt(gamificationAddedPoints), 0, 1.5, {useEasing: true, useGrouping: true, separator: '', suffix: ' ' + "نقاط"});
pointsCountUp.start();
}

$("#tl-gamification-points-message").html(decodeURIComponent(gamificationPointsNotification)).fadeIn(1000);
setTimeout(function(){$("#tl-gamification-points-message").fadeOut('slow');}, 3000);
}

var gamificationAssignmentBadge = $.cookie("gamification_assignment_badge");
var gamificationLearningBadge = $.cookie("gamification_learning_badge");
var gamificationCertificationBadge = $.cookie("gamification_certification_badge");
var gamificationAddedBadges = 0;
$(".tl-badge-image").attr('src', '');
$(".tl-badge-message").empty();

if(gamificationAssignmentBadge){
var parts = gamificationAssignmentBadge.split('###');
$(".tl-badge-image").attr('src', parts[1]);
$(".tl-badge-message").html(decodeURIComponent(parts[0]));
setTlmsCookie("gamification_assignment_badge", null, {expires: -1, path: '/', domain: myEffectiveDomain, secure: false});
gamificationAddedBadges++;
}

if(gamificationLearningBadge){
var parts = gamificationLearningBadge.split('###');
setTlmsCookie("gamification_learning_badge", null, {expires: -1, path: '/', domain: myEffectiveDomain, secure: false});
gamificationAddedBadges++;

if($(".tl-badge-image").attr('src') != '' && $(".tl-badge-message").html() != ''){
$("#tl-gamification-badges-message").append('<hr/><div id="learning-badge-message" class="tl-badge-image-message-wrapper"></div>');
$("#learning-badge-message").append('<img class="tl-badge-image pull-left image60x60" src="' + parts[1] + '"/>').append('<div class="tl-badge-message text-center tl-bold-item">' + decodeURIComponent(parts[0]) + '</div>');
}
else{
$(".tl-badge-image").attr('src', parts[1]);
$(".tl-badge-message").html(decodeURIComponent(parts[0]));
}
}

if(gamificationCertificationBadge){
var parts = gamificationCertificationBadge.split('###');
setTlmsCookie("gamification_certification_badge", null, {expires: -1, path: '/', domain: myEffectiveDomain, secure: false});
gamificationAddedBadges++;

if($(".tl-badge-image").attr('src') != '' && $(".tl-badge-message").html() != ''){
$("#tl-gamification-badges-message").append('<hr/><div id="certification-badge-message" class="tl-badge-image-message-wrapper"></div>');
$("#certification-badge-message").append('<img class="tl-badge-image pull-left image60x60" src="' + parts[1] + '"/>').append('<div class="tl-badge-message text-center tl-bold-item">' + decodeURIComponent(parts[0]) + '</div>');
}
else{
$(".tl-badge-image").attr('src', parts[1]);
$(".tl-badge-message").html(decodeURIComponent(parts[0]));
}
}

if(gamificationAssignmentBadge || gamificationLearningBadge || gamificationCertificationBadge){
if(gamificationPointsNotification){
$("#tl-gamification-badges-message").css('bottom', $("#tl-gamification-points-message").height() + 20 + 16 + 5);
}

if($("#tl-header-gamification-entrance").data('entrancemode') == 'badges'){
$("#tl-header-gamification-entrance").empty();
var badgesCountUp = new countUp("tl-header-gamification-entrance", 0, parseInt($("#tl-header-gamification-entrance").data('entrancevalue')) + parseInt(gamificationAddedBadges), 0, 1.5, {useEasing: true, useGrouping: true, separator: '', suffix: ' ' + "شارات"});
badgesCountUp.start();
}

$("#tl-gamification-badges-message").fadeIn(1000).css('display', 'table');
setTimeout(function(){$("#tl-gamification-badges-message").fadeOut('slow');}, 5000);
}

var gamificationCompletedCourses = $.cookie("gamification_completed_courses");

if(gamificationCompletedCourses && ($("#tl-header-gamification-entrance").data('entrancemode') == 'courses' || $("#tl-header-gamification-entrance").data('entrancemode') == 'certifications')){
$("#tl-header-gamification-entrance").empty();
var completedCoursesCountUp = new countUp("tl-header-gamification-entrance", 0, parseInt(gamificationCompletedCourses), 0, 1.5, {useEasing: true, useGrouping: true, separator: '', suffix: ' ' + "الدورات المكتملة"});
completedCoursesCountUp.start();
setTlmsCookie("gamification_completed_courses", null, {expires: -1, path: '/', domain: myEffectiveDomain, secure: false});
}

var gamificationUserLevel = $.cookie("gamification_user_level");

if(gamificationUserLevel && $("#tl-header-gamification-entrance").data('entrancemode') == 'levels'){
var gamificationUserLevelParts = gamificationUserLevel.split('###');
$("#tl-header-gamification-entrance").empty();
var userLevelCountUp = new countUp("tl-header-gamification-entrance", 0, parseInt(gamificationUserLevelParts[0]), 0, 1.5, {useEasing: true, useGrouping: true, separator: ''});
userLevelCountUp.start(function(){$('#tl-header-gamification-entrance').html(decodeURIComponent(gamificationUserLevelParts[1]));});
setTlmsCookie("gamification_user_level", null, {expires: -1, path: '/', domain: myEffectiveDomain, secure: false});
}
}
else if(data.unit_status == 'pending'){ // means that the unit is in a pending status now (assignment units)

$('.tl-incomplete-unit-handles').fadeOut('fast', function(){
$('.tl-pending-unit-handles').fadeIn('fast');
});
$('#tl-recording-area').fadeOut('fast');
$('#tl-recording-audio-area').fadeOut('fast');
}
else{

$('#tl-submit-question').removeClass('disabled').addClass('btn-danger').text("إجابة خاطئة, الرجاء المحاولة مرة أخرى");
setTimeout(function(){
$('#tl-submit-question').fadeOut('slow', function(){
$('#tl-submit-question').removeClass('btn-danger').text("إرسال الإجابة");
$('#tl-submit-question').fadeIn(400);
});}, 2000);

}
}
}

submitResults = function(url){
myportal.app.ajax(url, {
type: 'post',
data: $('.tl-unit-question-form').serialize() + "&myToken=" + myToken,
success: function(response){
updateProgress(response);
},
error: function(jqXHR_obj){
var response = $.parseJSON(jqXHR_obj.responseText);
$('#tl-submit-question').removeClass('disabled');
myportal.app.notify({type: "error", message: decodeURIComponent(response.message)});
}
});
}

window.completeUnit = function(el){
var url = $(el).attr('data-toggle');

if(typeof(url) != 'undefined'){
myportal.app.ajax(url, {
type: 'GET',
success: function(response){
$('#last-unit-progress').text('');

updateProgress(response);
}
});
}
}

completeAssignmentUnit = function(el, fileId){
var assignmentId = '2263';
var replyType = '';
var url = '';

if(el == null && fileId != null){
url = 'https://redaalfarouk-eduact.talentlms.com/unit/complete';
}
else{
url = $(el).attr('data-toggle');
}

if($('#assignment-reply-textbox-group').hasClass('hidden-textbox')){
replyType = 'file';
}
else{
replyType = 'textbox';
}

$('#assignment-reply-type').text(replyType);

if(typeof(url) != 'undefined'){
myportal.app.ajax(url, {
type: 'POST',
data: {'id': assignmentId, 'textbox-reply': $('#assignment-reply-textbox').val(), 'reply-type': replyType, 'reply-file': fileId, 'assignment-modify-answer-time': $('#assignment-modify-answer-time').text()},
success: function(response){
$('#last-unit-progress').text('');

updateProgress(response);
$('.tl-complete-button-assignment').text("إرسل ردك").removeClass('disabled');
if($('#assignment-reply-textbox-group').hasClass('visible-textbox')){
$('#assignment-reply-textbox-group').removeClass('visible-textbox').addClass('hidden-textbox');
$('#assignment-reply-textbox-group').fadeOut('slow');
$('.tl-complete-button-assignment').hide();
}
}
});
}
}

$('#tl-submit-question').on('click', function(){
if($(this).hasClass('disabled') || $(this).hasClass('btn-success') || $(this).hasClass('btn-danger')){
return false;
}

$(this).addClass('disabled');
var url = 'https://redaalfarouk-eduact.talentlms.com/unit/submitquestion/id:2263,questionId:,questionType:';
submitResults(url);
});

$(document).on('click', '.tl-complete-button, .tl-complete-button-assignment', function(){
if($(this).hasClass('disabled')){
return;
}

$(this).text("جار الإكمال").addClass('disabled');

if(!$(this).hasClass('tl-complete-button-assignment')){
completeUnit($(this));
}
else{
$('#assignment-reply-textbox').val($('.tl-assignment-reply-editor').code());
completeAssignmentUnit($(this), null);
}
});

$(document).on('click', '.tl-send-assignment-recording', function(){
if($(this).hasClass('disabled') || !recordedData){
return;
}

// Videos shorter than 5 seconds seem to have issues in EncodeMagic. Check the duration (written in the recorder's toolbar) and if too small do nothing
var parts = $('#tl-recording-video span.vjs-duration-display').text().split(':');
if(parts.length == 2){
if(parts[0]*60+parts[1]*1 < 6){ // multiply seconds with 1 to be sure we have an integer and not a string
$('#tl-record-error').text('يجب ألّا يتعدى طول الفيديو 5 ثانية').removeClass('hide');
$('.tl-send-assignment-recording').addClass('disabled');
return;
}
}
else if(parts.length == 3){
if(parts[0]*3600+parts[1]*60+parts[2]*1 < 6){ // multiply seconds with 1 to be sure we have an integer and not a string
$('#tl-record-error').text('يجب ألّا يتعدى طول الفيديو 5 ثانية').removeClass('hide');
$('.tl-send-assignment-recording').addClass('disabled');
return;
}
}

var uploadUrl = 'https://redaalfarouk-eduact.talentlms.com/unit/uploadassignmentreply/id:2263';
var _formData = new FormData();
_formData.append('files', recordedData, recordedData.name);

myportal.app.ajax(uploadUrl,{
type: "POST",
data: _formData,
cache: false,
dataType: 'json',
processData: false,
contentType: false,
success: function(resp){
if(resp.success){
$('.tl-send-assignment-recording').addClass('disabled').hide();
completeAssignmentUnit(null, resp.data.assignmentReplyFile);
}
}
});
});

$(document).on('click', '.tl-send-assignment-recording-audio', function(){
if($(this).hasClass('disabled') || !recordedAudioData){
return;
}

// Videos/audio shorter than 5 seconds seem to have issues in EncodeMagic. Check the duration (written in the recorder's toolbar) and if too small do nothing
var parts = $('#tl-recording-audio span.vjs-duration-display').text().split(':');

if(parts.length == 3){
if(parts[0]*60+parts[1]*1 < 6){ // multiply seconds with 1 to be sure we have an integer and not a string
$('#tl-record-audio-error').text('يجب ألّا يتعدى طول الملف الصوتي 5 ثانية').removeClass('hide');
$('.tl-send-assignment-recording-audio').addClass('disabled');
return;
}
}
else if(parts.length == 4){
if(parts[0]*3600+parts[1]*60+parts[2]*1 < 6){ // multiply seconds with 1 to be sure we have an integer and not a string
$('#tl-record-audio-error').text('يجب ألّا يتعدى طول الملف الصوتي 5 ثانية').removeClass('hide');
$('.tl-send-assignment-recording-audio').addClass('disabled');
return;
}
}

var uploadUrl = 'https://redaalfarouk-eduact.talentlms.com/unit/uploadassignmentreply/id:2263';
var _formData = new FormData();
_formData.append('files', recordedAudioData, recordedAudioData.name);

myportal.app.ajax(uploadUrl,{
type: "POST",
data: _formData,
cache: false,
dataType: 'json',
processData: false,
contentType: false,
success: function(resp){
if(resp.success){
$('.tl-send-assignment-recording-audio').addClass('disabled').hide();
completeAssignmentUnit(null, resp.data.assignmentReplyFile);
}
}
});
});


$('.tl-scorm-frame').ready(function(){
$('#tl-scorm-progress-bar').hide();
$('.tl-complete-button-scorm').show().removeClass('disabled').text("غير مكتمل").popover({'placement': 'top', 'html': true, content: "تكتمل هذه الوحدة تلقائيًا فور تلبية جميع شروطها. عند رغبتك في الخروج والتحقق من حالة الاكتمال اضغط <a href='javascript:void(0)' class='tl-complete-button-scorm-link'><strong>هنا</strong></a>"});

$(document).on('click', '.tl-complete-button-scorm-link', function(){
$('.tl-complete-button-scorm').popover('destroy');
$('.tl-scorm-frame').attr('src', '').remove(); // .remove() without emptying the iframe content, sometimes crashes ie
$('.tl-complete-button-scorm').hide().text("غير مكتمل. اضغط لإعادة المحاولة.").on('click', function() {window.location.reload()}).fadeIn('slow');
$('#tl-scorm-iframe-closed-message').fadeIn('slow');
});
});

$('#tl-reset-progress').on('click', function(){
var lastUnitProgress = $('#last-unit-progress').text();

if(lastUnitProgress != ''){
var url = 'https://redaalfarouk-eduact.talentlms.com/unit/resetprogress/id:##unit_progress_id##'.replace('##unit_progress_id##', lastUnitProgress);
}
else{
var url = 'https://redaalfarouk-eduact.talentlms.com/unit/resetprogress/id:31265';
}

myportal.app.ajax(url, {
success: function(){
$('.tl-completed-unit-handles').fadeOut('fast', function(){
$('.tl-incomplete-unit-handles').fadeIn('fast');

if(window.clearQuestion){
window.clearQuestion(); // Clear the question's results
}

if($('#tl-timer').length){
$('#tl-timer').text(start_time);
if(!tl_timer_id){
tl_timer_id = window.setInterval(tl_startCounter, 1000);
}
}

$('#tl-submit-question').removeClass('btn-danger').removeClass('btn-success').text("إرسال الإجابة").show();
$('.tl-question-preview-feedback').css('display', 'none');

});
}
});
});

start_time = '0';

window.tl_startCounter = function (){
var new_time = parseInt($('#tl-timer-seconds').text());

if(new_time > 0){
$('#tl-timer-seconds').text(new_time - 1);
interval = formatTimeInterval(new_time - 1);

if(!interval){
$('.tl-timer-button').text("جاهز!");
}
else{
$('#tl-timer').text(interval);
}
}
else{
completeUnit($('.tl-timer-button'));
window.clearInterval(tl_timer_id);
tl_timer_id = false;
}
}

window.formatTimeInterval = function(interval){
var seconds = interval % 60;
var minutes = ((interval - seconds) / 60) % 60;
var hours = ((interval - seconds - (minutes * 60)) / 3600) % 24;
var days = (interval - hours * 3600 + minutes * 60 + seconds) / (24 * 3600);
var str = new Array();

if(days >= 1){
str.push("###days###d".replace('###days###', parseInt(days)));
}

if(hours){
str.push("###hours###h".replace('###hours###', hours));
}

if(minutes){
str.push("###minutes###m".replace('###minutes###', minutes));
}

if(seconds){
str.push("###seconds###s".replace('###seconds###', seconds));
}

return str.join(' ');
}


if (typeof window.syncVideoUnitTimer === 'undefined' || !window.syncVideoUnitTimer){
if(!tl_timer_id){
tl_timer_id = window.setInterval(tl_startCounter, 1000);
}
}
else {
tl_timer_id = null;
}

$(window).on('load', function(){
$.ajax('https://redaalfarouk-eduact.talentlms.com/unit/enter/id:31265', {async: false});
});

$(window).on('beforeunload', function(){
if('fetch' in window){
fetch('https://redaalfarouk-eduact.talentlms.com/unit/exit/id:31265', {keepalive: true});
}
else{
$.ajax('https://redaalfarouk-eduact.talentlms.com/unit/exit/id:31265', {async: false});
}
});

});



var heartbeatInterval = 10790*1000; setInterval(function(){
myportal.app.ajax("https://redaalfarouk-eduact.talentlms.com/index/heartbeat", {
'type': 'GET'
});
}, heartbeatInterval);


</script> </div> </div>

<div id="tl-gamification-points-message" class="hide hidden-phone text-center tl-bold-item" style="z-index: 10000;"></div>
<div id="tl-gamification-badges-message" class="hide hidden-phone" style="z-index: 10000;">
<div class="tl-badge-image-message-wrapper">
<img class="tl-badge-image pull-left image60x60">
<div class="tl-badge-message text-center tl-bold-item"></div>
</div>
</div>
</div>

<div class="modal fade hide" id="tl-export-to-csv-modal" style="outline: none;" tabindex="-1">
<div class="modal-header"><h3>حفظ بصيغة CSV</h3></div>
<div class="modal-body">
<div class="text-center">جارٍ إنشاء ملف التصدير يُرجى الانتظار...</div>
<div class="progress progress-striped progress-success active" style="margin: 15px 0px;">
<div class="bar" style="width: 100%;"></div>
</div>
</div>
<div class="modal-footer">
<div class="pull-left span4 text-left hide" style="margin: 0px 5px 0px 0px;">
<span>يُرجى الانتظار بينما يتم إلغاء العملية</span>
</div>
<div class="pull-right">
<a href="javascript:void(0)" class="btn" id="tl-cancel-export">إلغاء</a>
</div>
</div>
</div>
<div id="tl-export-to-csv-token" class="hide"></div>

<div class="modal fade hide" id="tl-confirm" style="outline: none;" tabindex="-1">
<div class="modal-header">
<a href="javascript:void(0)" class="close" data-dismiss="modal">×</a>
<h3 class="tl-modal-header">إشعار</h3>
</div>
<div class="modal-body"><p id="tl-modal-body"></p></div>
<div class="modal-footer">
<a id="tl-confirm-submit" class="btn btn-danger"><i class="icon-trash"></i>&nbsp;حذف</a>
<a id="tl-confirm-continue" class="btn btn-danger hide"><i class="icon-trash"></i>&nbsp; حذف، و عدم السؤال</a>
<a class="btn" data-dismiss="modal">إلغاء</a>
</div>
</div>
<div class="modal fade hide" id="tl-confirm-double" style="outline: none;" tabindex="-1">
<div class="modal-header">
<a href="javascript:void(0)" class="close" data-dismiss="modal">×</a>
<h3 class="tl-modal-header-double">إشعار</h3>
</div>
<div class="modal-body"><p id="tl-modal-body-double"></p></div>
<div class="modal-footer">
<a id="tl-confirm-submit-double" class="btn btn-danger"><i class="icon-trash"></i>&nbsp;حذف</a>
<a id="tl-confirm-submit-double2" class="btn btn-danger"></a>
<a class="btn" data-dismiss="modal">إلغاء</a>
</div>
</div>
<div class="modal fade hide" id="tl_leavepage_confirm" style="outline: none;" tabindex="-1">
<div class="modal-header">
<a href="javascript:void(0)" class="close" data-dismiss="modal">×</a>
<h3>إشعار</h3>
</div>
<div class="modal-body"><p></p></div>
<div class="modal-footer">
<a id="tl-leavepage" class="btn btn-danger"><i class="icon-trash"></i>&nbsp;نبذ التغييرات</a>
<a class="btn" data-dismiss="modal">إلغاء</a>
</div>
</div>

<div class="modal fade hide" id="tl-relogin-modal" style="outline: none;" tabindex="-1">
<div class="modal-header text-center">
<h3>فقط من باب الاحتياط، سجّلنا خروجك</h3>
</div>
<div class="modal-body">
<div class="text-center" style="padding: 10px 0px;">
<img src="https://d3j0t7vrtr92dk.cloudfront.net/images/lockout.svg">
<div style="margin-top: 15px;">أدخل كلمة المرور للبدء من المكان الذي توقفت عنده</div>
<form name="tl-relogin-form" method="post" action="https://redaalfarouk-eduact.talentlms.com/unit/view/id:2263" class="tl-form form-horizontal" id="tl-relogin-form" data-submiturl="https://redaalfarouk-eduact.talentlms.com/index/relogin"><input type="hidden" name="_track_tl-relogin-form" value="1600170362" class="" id="235918544"><input type="hidden" name="_redirect_" value="" class="" id="_redirect_"><input type="hidden" name="_myToken" value="af2e48f47aa28b18c5267174c4f329ca" class="" id="_myToken"><input type="hidden" name="relogin_redirect_url" value="redaalfarouk-eduact.talentlms.com/unit/view/id:2263" class="" id="1642112323"><input type="hidden" name="appear_as_supervisor_after_relogin" value="1" class="" id="1337879131"><input type="hidden" name="relogin_role" value="learner" class="" id="937629397"><input type="hidden" name="relogin_username" value="ao161586" class="" id="2019389723"> <div class="control-group ">
<div class="controls">
<input type="password" name="relogin_password" value="" class="span4" id="934213468" placeholder="كلمة المرور" autocomplete="off" tabindex=""> <span class="help-block"></span>
</div>
</div>
<input type="submit" name="submit_relogin" value="دخول" class="btn btn-primary" id="1372709296" data-loading-text="جاري تسجيل الدخول" tabindex=""> </form> <div><a href="https://redaalfarouk-eduact.talentlms.com/index">خروج</a></div>
</div>
</div>
</div>

<div class="modal fade hide" id="tl-gamification-widget-modal" style="outline: none;" tabindex="-1">
<div class="modal-header">
<a href="javascript:void(0)" class="close" data-dismiss="modal">×</a>
<h3 class="font-weight-bold">مجلس الرواد</h3>
</div>
<div class="modal-body">
<ul class="nav nav-tabs">
<li class="hide" id="points-row"><a href="#" data-toggle="tab">نقاط</a></li>
<li class="hide" id="levels-row"><a href="#" data-toggle="tab">مستويات</a></li>
<li class="hide" id="badges-row"><a href="#" data-toggle="tab">شارات</a></li>
<li class="hide" id="courses-row"><a href="#" data-toggle="tab">دورات تعليمية </a></li>
<li class="hide" id="certifications-row"><a href="#" data-toggle="tab">شهادات</a></li>
<li class="hide" id="rewards-row"><a href="#" data-toggle="tab">المكافآت</a></li>
</ul>
<div class="widget-loading hide">
<img class="widget-loading-img" src="https://d3j0t7vrtr92dk.cloudfront.net/images/loading-small.gif">
</div>
<div id="widget-screen1" class="hide"></div>
<div id="widget-screen2" class="hide"></div>
<div id="widget-screen3" class="hide"></div>
</div>
<div class="modal-footer">
<div class="tl-gamification-points-footer tl-gamification-footer-section text-center hide">
<a id="tl-howto-collect-points" class="btn btn-primary" href="javascript:void(0)">
كيفية جمع النقاط </a>
</div>
<div class="tl-gamification-levels-footer tl-gamification-footer-section text-center hide">
<a id="tl-howto-upgrade-level" class="btn btn-primary" href="javascript:void(0)">
كيف تستطيع ترقية المستوى </a>
</div>
<div class="tl-gamification-badges-footer tl-gamification-footer-section text-center hide">
<a id="tl-goto-badges-leaderboard" class="btn btn-primary" href="javascript:void(0)">
مجموعة شاراتي </a>
</div>
<div class="tl-gamification-rewards-footer tl-gamification-footer-section text-center hide">
<a id="tl-goto-badges-leaderboard" class="btn btn-primary" href="javascript:void(0)">
مجموعة شاراتي </a>
</div>
<div class="tl-gamification-actions text-center hide">
<a id="tl-widget-goback" class="btn" href="javascript:void(0)">
<span>
رجوع </span>
</a>
</div>
</div>
</div>

<script id="tl-achievements-template" type="text/x-custom-template">
<div class="tl-achievements-wrapper">
<div class="tl-achievements-icon-wrapper">
<img class="tl-achievements-points-icon hide" src="https://d3j0t7vrtr92dk.cloudfront.net/images/ranking/icon_points.svg" />
<img class="tl-achievements-levels-icon hide" src="https://d3j0t7vrtr92dk.cloudfront.net/images/ranking/icon_levels.svg" />
<img class="tl-achievements-badges-icon hide" src="https://d3j0t7vrtr92dk.cloudfront.net/images/ranking/icon_badges.svg" />
<img class="tl-achievements-certifications-icon hide" src="https://d3j0t7vrtr92dk.cloudfront.net/images/ranking/icon_certifications.svg" />
</div>
<div class="tl-achievements-indicator">
<div class="tl-achievements-points hide">
<div class="tl-gamification-total"></div>
</div>
<div class="tl-achievements-levels hide">
<div class="tl-gamification-total"></div>
</div>
<div class="tl-achievements-badges hide">
<div class="tl-gamification-total"></div>
</div>
<div class="tl-achievements-certifications hide">
<div class="tl-gamification-total"></div>
</div>
</div>
</div>
</script>

<script type="text/javascript">
var pointsResetEntities = false;
var levelsResetEntities = false;
var badgesResetEntities = false;

var pointsDisabled = false;
var levelsDisabled = false;
var badgesDisabled = false;

var listDelayTime = 350;

var listLength = 6;

var cacheTimeout = 600000;

var pointsResponse = '';
var pointsResponseTimestamp = 0;

var levelsResponse = '';
var levelsResponseTimestamp = 0;

var badgesResponse = '';
var badgesResponseTimestamp = 0;

var coursesResponse = '';
var coursesResponseTimestamp = 0;

var certificationsResponse = '';
var certificationsResponseTimestamp = 0;

var rewardsResponse = '';
var rewardsResponseTimestamp = 0;

function clearWidgetScreen(id) {
$("#" + id).empty();
}

function hideAllScreens() {
$("#widget-screen1").addClass("hide");
$("#widget-screen3").addClass("hide");
}

function showWidgetScreen(id) {
$("#" + id).removeClass("hide");
}

var firstTabToTrigger = '';
function setFirstTab(name) {
if (firstTabToTrigger.length === 0) {
firstTabToTrigger = name;
}
}

function showWidgetLoading() {
$('.widget-loading').removeClass("hide");
}

function hideWidgetLoading() {
$('.widget-loading').addClass("hide");
}

function removeActiveTab() {
$("#tl-gamification-widget-modal .nav-tabs > li").each(function(){
$(this).removeClass("active");
})
}

var widgetCurrentTab = '';
function setCurrentTab(id, activate) {
widgetCurrentTab = id;

if (activate) {
$("#" + id).addClass("active");
}
}

function hideGamificationFooterSection() {
$(".tl-gamification-footer-section:not(.hide)").addClass("hide")
}

function showGamificationFooterSection(id) {
hideGamificationFooterSection();

if ($(".tl-gamification-"+id+"-footer").length > 0) {
$(".tl-gamification-"+id+"-footer").removeClass("hide");
}
}

function showGamificationActions() {
$(".tl-gamification-actions").removeClass("hide");
}

function hideGamificationActions() {
$(".tl-gamification-actions").addClass("hide");
}

$(document).ready(function(){
$('#tl-header-gamification-entrance, #tl-edit-user-gamification, #tl-user-infographics-gamification, #tl-microstats-gamification, #tl-compared-others-gamification').on('click', function(e){
var url = 'https://redaalfarouk-eduact.talentlms.com/gamification/widgetindex';

myportal.app.ajax(url, {
success: function(response){
var response = $.parseJSON(response);

if(response.success){
if(response.data.showPoints){
$('#points-row').show();
(response.data.pointsRanking != '') ? $('#points-row').data('goto', 'leaderboard') : $('#points-row').data('goto', 'conditions');
setFirstTab("points-row");

if(response.data.resetEntities){
pointsResetEntities = true;
}
}

if(response.data.showLevels){
$('#levels-row').show();
$('#levels-message').html(response.data.levelsMessage);
(response.data.levelsRanking != '') ? $('#levels-row').data('goto', 'leaderboard') : $('#levels-row').data('goto', 'conditions');
setFirstTab("levels-row");

if(response.data.resetEntities && response.data.userLevel > 0){
levelsResetEntities = true;
}
}

if(response.data.showBadges){
$('#badges-row').show();
(parseInt(response.data.badgesValue) > 0) ? $('#badges-message').html(response.data.badgesMessage + '<a class="btn btn-mini btn-success" style="margin-left: 5px;" >' + "عرض" + '</a>') : $('#badges-message').html(response.data.badgesMessage);
(response.data.badgesRanking != '') ? $('#badges-row').data('goto', 'leaderboard') : $('#badges-row').data('goto', 'mybadges');
setFirstTab("badges-row");

if(parseInt(response.data.badgesValue) == 0 && response.data.userBadgesCount == ''){
$('#badges-row').removeClass('tl-cursor-pointer').find('.icon-play:first').hide();
$('#badges-row').find('.icon-award-1:first').addClass('tl-cursor-default');
}

if(response.data.resetEntities){
badgesResetEntities = true;
}
}

if(response.data.showCourses){
$('#courses-row').show();
$('#courses-message').html(response.data.coursesMessage);
setFirstTab("courses-row");
}

if(response.data.showCertifications){
$('#certifications-row').show();
$('#certifications-message').html(response.data.certificationsMessage);
setFirstTab("certifications-row");
}

if(response.data.showRewards){
$('#rewards-row').show();
$('#rewards-message').html(response.data.rewardsMessage);
setFirstTab("rewards-row");
}

if (e.target.id !== "tl-microstats-gamification" && e.target.id !== "tl-user-infographics-gamification") {
removeActiveTab();
setCurrentTab(firstTabToTrigger, true);
$('#' + firstTabToTrigger).trigger("click");
}
}
}
});

$('#tl-gamification-widget-modal').modal('show');
});

$(document).on('hidden.bs.modal', '.modal', function () {
clearWidgetScreen("widget-screen1");
hideGamificationFooterSection();
removeActiveTab();
});

$('#points-row').on('click', debounce(function(event){
var $target = $(event.target);
setCurrentTab("points-row");
hideGamificationFooterSection();
hideGamificationActions();
hideAllScreens();
clearWidgetScreen("widget-screen1");
showWidgetLoading();

if($(this).data('goto') == 'leaderboard' && !$target.hasClass('quickEditPoints')){
var url = 'https://redaalfarouk-eduact.talentlms.com/gamification/getpointsleaderboard';

if(pointsResponse && pointsResponseTimestamp > (Date.now() - cacheTimeout)){
processPointsResponse(pointsResponse);
}
else{
myportal.app.ajax(url, {
success: function(response){
pointsResponse = response;
pointsResponseTimestamp = Date.now();
processPointsResponse(response);
}
}, false);
}
}
}, listDelayTime));

function processPointsResponse(response){
var response = $.parseJSON(response);
if (widgetCurrentTab == "points-row") {
if(response.success){
clearWidgetScreen("widget-screen1");
$('#widget-screen1').append('<div class="tl-gamification-list"><table class="table table-hover" id="tl-points-leaderboard"><tbody class="tl-bold-item"></tbody></table></div><div class="tl-gamification-my-list"><table class="table table-hover tl-gamification-current-user"><tbody class="tl-bold-item"></tbody></table></div>');

$.each(response.data.firstSubsetUsers, function(index, user){
$('#tl-points-leaderboard tbody').append('<tr '+(user.currentUser ? "class='tl-current-user'" : "")+'><td class="tl-ranking-align">' + user.ranking + '</td><td class="tl-gamification-user"><img src="' + user.avatar + '" class="avatar-square tl-gamification-avatar image40x40"/>' + user.name + '</td><td class="tl-gamification-points">' + user.points + '</td></tr>');

if (user.currentUser && pointsResetEntities) {
$('.tl-current-user .tl-gamification-points').prepend('<i class="icon-pencil ml-1 quickEditPoints" data-element-target="#tl-points-leaderboard .tl-current-user .tl-gamification-points" title="' + "تحرير" + '" data-points="'+ user.points +'" ></i>');
addQuickEditEvent();
}
});

if (response.data.currentUser) {
$('.tl-gamification-current-user tbody').append('<tr><td class="tl-ranking-align">' + response.data.currentUser.ranking + '</td><td class="tl-gamification-user"><img src="' + response.data.currentUser.avatar + '" class="avatar-square tl-gamification-avatar image40x40"/>' + response.data.currentUser.name + '</td><td class="tl-gamification-points tl-gamification-points-tab">' + response.data.currentUser.points + '</td></tr>');

if (pointsResetEntities) {
$('.tl-gamification-current-user .tl-gamification-points').append('<i class="icon-pencil ml-1 quickEditPoints" data-element-target=".tl-gamification-current-user .tl-gamification-points" title="' + "تحرير" + '" data-points="'+ response.data.currentUser.points +'" ></i>');
addQuickEditEvent();
}
}

if (response.data.firstSubsetUsers.length > listLength) { //after X users the list will auto scroll
$(".tl-gamification-current-user").addClass("tl-gamification-list-scrolled");
}

$('#tl-gamification-widget-modal .modal-header h3').text("مجلس الرواد");
$('#tl-widget-goback').data('current', 'screen2').data('goto', 'screen1').show();
hideWidgetLoading();
showWidgetScreen("widget-screen1");
} else {
var achivementsTemplate = $('#tl-achievements-template').html();
$('#widget-screen1').append(achivementsTemplate);
hideWidgetLoading();
showWidgetScreen("widget-screen1");
$(".tl-achievements-points-icon").removeClass("hide");
$('.tl-achievements-points').removeClass("hide");
$('.tl-achievements-points .tl-gamification-total').text(response.userPoints);
pointsDisabled = true;
$('#tl-gamification-widget-modal .modal-header h3').text("إنجازاتي");

if (pointsResetEntities) {
$('.tl-achievements-points').append('<i class="icon-pencil ml-1 d-inline-block quickEditPoints" data-element-target=".tl-achievements-points" title="' + "تحرير" + '" data-points="'+response.userPoints+'" ></i>');
addQuickEditEvent();
}
}

showGamificationFooterSection("points");
}
}

$('#levels-row').on('click', debounce(function(event){
var $target = $(event.target);
setCurrentTab("levels-row");
hideGamificationFooterSection();
hideGamificationActions();
hideAllScreens();
clearWidgetScreen("widget-screen1");
showWidgetLoading();

if($(this).data('goto') == 'leaderboard' && !$target.hasClass('icon-undo')){
var url = 'https://redaalfarouk-eduact.talentlms.com/gamification/getlevelsleaderboard';

if (levelsResponse && levelsResponseTimestamp > (Date.now() - cacheTimeout)){
processLevelsResponse(levelsResponse);
}
else{
myportal.app.ajax(url, {
success: function(response){
levelsResponse = response;
levelsResponseTimestamp = Date.now();
processLevelsResponse(response);
}
}, false);
}
}
else if($(this).data('goto') == 'conditions' && !$target.hasClass('icon-undo')){
showLevelsConditions('screen1');
}
else if($target.hasClass('icon-undo')){
var url = 'https://redaalfarouk-eduact.talentlms.com/gamification/resetuserlevel';

myportal.app.ajax(url, {
success: function(response){
var response = $.parseJSON(response);

if(response.success){
$('#levels-message').html(response.data.newLevel);
$('#levels-row .tl-gamification-ranking-text:first').text(response.data.newLevelRanking);
}
}
});
}
}, listDelayTime));

function processLevelsResponse(response){
var response = $.parseJSON(response);
if (widgetCurrentTab == "levels-row") {
if(response.success){
clearWidgetScreen("widget-screen1");
$('#widget-screen1').append('<div class="tl-gamification-list"><table class="table table-hover" id="tl-levels-leaderboard"><tbody class="tl-bold-item"></tbody></table></div><div class="tl-gamification-my-list"><table class="table table-hover tl-gamification-current-user"><tbody class="tl-bold-item"></tbody></table></div>');

$.each(response.data.firstSubsetUsers, function(index, user){
$('#tl-levels-leaderboard tbody').append('<tr '+(user.currentUser ? "class='tl-current-user'" : "")+'><td class="tl-ranking-align">' + user.ranking + '</td><td class="tl-gamification-user"><img src="' + user.avatar + '" class="avatar-square tl-gamification-avatar image40x40"/>' + user.name + '</td><td class="tl-gamification-points">' + user.level + '</td></tr>');

if (user.currentUser && levelsResetEntities) {
$('.tl-current-user .tl-gamification-points').append('<i class="icon-undo ml-1 d-inline-block tl-reset-levels" title="أعد تعيين"></i>');
}
});

if (response.data.currentUser) {
$('.tl-gamification-current-user tbody').append('<tr><td class="tl-ranking-align">' + response.data.currentUser.ranking + '</td><td class="tl-gamification-user"><img src="' + response.data.currentUser.avatar + '" class="avatar-square tl-gamification-avatar image40x40"/>' + response.data.currentUser.name + '</td><td class="tl-gamification-points tl-gamification-levels">' + response.data.currentUser.level + '</td></tr>');

if (levelsResetEntities) {
$('.tl-gamification-current-user .tl-gamification-points').append('<i class="icon-undo ml-1 d-inline-block tl-reset-levels" title="أعد تعيين"></i>');
}
}

if (response.data.firstSubsetUsers.length > listLength) { //after X users the list will auto scroll
$(".tl-gamification-current-user").addClass("tl-gamification-list-scrolled");
}

$('#tl-widget-goback').data('current', 'screen2').data('goto', 'screen1').show();
showGamificationFooterSection("levels");
hideWidgetLoading();
showWidgetScreen("widget-screen1");
$('#tl-gamification-widget-modal .modal-header h3').text("مجلس الرواد");
} else {
var achivementsTemplate = $('#tl-achievements-template').html();
$('#widget-screen1').append(achivementsTemplate);
showGamificationFooterSection("levels");
hideWidgetLoading();
showWidgetScreen("widget-screen1");
$(".tl-achievements-levels-icon").removeClass("hide");
$('.tl-achievements-levels').removeClass("hide");
$('.tl-achievements-levels .tl-gamification-total').text(response.userLevel);
levelsDisabled = true;
$('#tl-gamification-widget-modal .modal-header h3').text("إنجازاتي");

if (levelsResetEntities) {
$('.tl-achievements-levels').append('<i class="icon-undo ml-1 d-inline-block tl-reset-levels" title="أعد تعيين"></i>');
}
}

showGamificationFooterSection("levels");
}
}

$('#badges-row').on('click', debounce(function(event){
setCurrentTab("badges-row");
hideGamificationFooterSection();
hideGamificationActions();
hideAllScreens();
clearWidgetScreen("widget-screen1");
showWidgetLoading();
var $target = $(event.target);

if($(this).data('goto') == 'leaderboard' && !$target.hasClass('btn') && !$target.hasClass('icon-undo')){
var url = 'https://redaalfarouk-eduact.talentlms.com/gamification/getbadgesleaderboard';

if (badgesResponse && badgesResponseTimestamp > (Date.now() - cacheTimeout)){
processBadgesResponse(badgesResponse);
}
else{
myportal.app.ajax(url, {
success: function(response){
badgesResponse = response;
badgesResponseTimestamp = Date.now();
processBadgesResponse(response);
}
}, false);
}
}
else if(($(this).data('goto') == 'mybadges' || $target.hasClass('btn')) && !$target.hasClass('icon-undo')){
getUserBadges('https://redaalfarouk-eduact.talentlms.com/gamification/getuserbadges', 'screen1');
}
}, listDelayTime));

function processBadgesResponse(response){
var response = $.parseJSON(response);
showWidgetLoading();
if (widgetCurrentTab == "badges-row") {
if(response.success){
clearWidgetScreen("widget-screen1");
$('#widget-screen1').append('<div class="tl-gamification-list tl-list-no-footer '+ (!response.data.currentUser ? "tl-leaderboard-rounded-corners" : "")+'"><table class="table table-hover" id="tl-badges-leaderboard"><tbody class="tl-bold-item"></tbody></table></div><div class="tl-gamification-my-list"><table class="table table-hover tl-gamification-current-user tl-gamification-badges-user"><tbody class="tl-bold-item"></tbody></table></div>');

$.each(response.data.firstSubsetUsers, function(index, user){
var trClass = (user.sumbadges > 0) ? 'class="tl-cursor-pointer '+(user.currentUser ? "tl-current-user" : "")+'"' : '';
var trLastColumn = (user.sumbadges > 0) ? '<i class="icon-play tl-icon15"></i>' : '&nbsp';
var testSelector = ''.replace('##show-badges-user##', 'show-badges-user-' + user.id);
$('#tl-badges-leaderboard tbody').append('<tr ' + trClass + ' data-user="' + user.id + '" ' + testSelector + '><td class="tl-ranking-align">' + user.ranking + '</td><td class="tl-gamification-user"><img src="' + user.avatar + '" class="avatar-square tl-gamification-avatar image40x40"/>' + user.name + '</td><td class="tl-gamification-points">' + user.sumbadges + '</td><td>' + trLastColumn + '</td></tr>');

if (user.currentUser && badgesResetEntities) {
$('#tl-badges-leaderboard .tl-current-user .tl-gamification-points').append('<i class="icon-undo ml-1 d-inline-block tl-reset-badges" title="أعد تعيين"></i>');
}
});

if (response.data.currentUser) {
var trClassCurrentUser = (response.data.currentUser.sumbadges > 0) ? 'class="tl-cursor-pointer"' : '';
var trLastColumnUser = (response.data.currentUser.sumbadges > 0) ? '<td><i class="icon-play tl-icon15"></i></td>' : '';
$('.tl-gamification-current-user tbody').append('<tr ' + trClassCurrentUser + ' data-user="' + response.data.currentUser.id + '"><td class="tl-ranking-align">' + response.data.currentUser.ranking + '</td><td class="tl-gamification-user"><img src="' + response.data.currentUser.avatar + '" class="avatar-square tl-gamification-avatar image40x40"/>' + response.data.currentUser.name + '</td><td class="tl-gamification-points '+ ((response.data.currentUser.sumbadges == 0) ? "tl-gamification-no-badges" : "") +'">' + response.data.currentUser.sumbadges + '</td>' + trLastColumnUser + '</tr>');
}

if (response.data.firstSubsetUsers.length > listLength) { //after X users the list will auto scroll
$(".tl-gamification-current-user").addClass("tl-gamification-list-scrolled");
}

if (response.data.currentUser && response.data.currentUser.sumbadges > 0 && badgesResetEntities) {
$('.tl-gamification-current-user .tl-gamification-points').append('<i class="icon-undo ml-1 d-inline-block tl-reset-badges" title="أعد تعيين"></i>');
}

$('#tl-widget-goback').data('current', 'screen2').data('goto', 'screen1').show();
hideWidgetLoading();
showWidgetScreen("widget-screen1");
$('#tl-gamification-widget-modal .modal-header h3').text("مجلس الرواد");
} else {
var achivementsTemplate = $('#tl-achievements-template').html();
$('#widget-screen1').append(achivementsTemplate);
showGamificationFooterSection("badges");
hideWidgetLoading();
showWidgetScreen("widget-screen1");
$(".tl-achievements-badges-icon").removeClass("hide");
$('.tl-achievements-badges').removeClass("hide");
$('.tl-achievements-badges .tl-gamification-total').text(response.userBadgesCount);
badgesDisabled = true;
$('#tl-gamification-widget-modal .modal-header h3').text("إنجازاتي");

if (badgesResetEntities) {
$('.tl-achievements-badges').append('<i class="icon-undo ml-1 d-inline-block tl-reset-badges" title="أعد تعيين"></i>');
}
}
}
}

$('#courses-row').on('click', debounce(function(event){
var $target = $(event.target);
setCurrentTab("courses-row");
hideGamificationActions();
hideAllScreens();

if(!$target.hasClass('icon-undo')){
var url = 'https://redaalfarouk-eduact.talentlms.com/gamification/getcoursesleaderboard';
clearWidgetScreen("widget-screen1");
showWidgetLoading();


if (coursesResponse && coursesResponseTimestamp > (Date.now() - cacheTimeout)){
processCoursesResponse(coursesResponse);
}
else{
myportal.app.ajax(url, {
success: function(response){
coursesResponse = response;
coursesResponseTimestamp = Date.now();
processCoursesResponse(response);
}
}, false);
}
}
}, listDelayTime));

function processCoursesResponse(response){
var response = $.parseJSON(response);

if ( widgetCurrentTab == "courses-row") {
if(response.success){
clearWidgetScreen("widget-screen1");
$('#widget-screen1').append('<div class="tl-gamification-list tl-list-no-footer '+ (!response.data.currentUser ? "tl-leaderboard-rounded-corners" : "")+'"><table class="table table-hover" id="tl-courses-leaderboard"><tbody class="tl-bold-item"></tbody></table></div><div class="tl-gamification-my-list"><table class="table table-hover tl-gamification-current-user"><tbody class="tl-bold-item"></tbody></table></div>');

$.each(response.data.firstSubsetUsers, function(index, user){
$('#tl-courses-leaderboard tbody').append('<tr '+(user.currentUser ? "class='tl-current-user'" : "")+'><td class="tl-ranking-align">' + user.ranking + '</td><td class="tl-gamification-user"><img src="' + user.avatar + '" class="avatar-square tl-gamification-avatar image40x40"/>' + user.name + '</td><td class="tl-gamification-points">' + user.sumcourses + '</td></tr>');
});

if (response.data.currentUser) {
$('.tl-gamification-current-user tbody').append('<tr><td class="tl-ranking-align">' + response.data.currentUser.ranking + '</td><td class="tl-gamification-user"><img src="' + response.data.currentUser.avatar + '" class="avatar-square tl-gamification-avatar image40x40"/>' + response.data.currentUser.name + '</td><td class="tl-gamification-points">' + response.data.currentUser.sumcourses + '</td></tr>');
}

if (response.data.firstSubsetUsers.length > listLength) { //after X users the list will auto scroll
$(".tl-gamification-current-user").addClass("tl-gamification-list-scrolled");
}

hideGamificationFooterSection();
hideGamificationActions();
$('#tl-widget-goback').data('current', 'screen2').data('goto', 'screen1').show();
$('#tl-gamification-widget-modal .modal-header h3').text("مجلس الرواد");
hideWidgetLoading();
showWidgetScreen("widget-screen1");
}
}
}

$('#certifications-row').on('click', debounce(function(event){
var $target = $(event.target);
setCurrentTab("certifications-row");
hideGamificationFooterSection();
hideGamificationActions();
hideAllScreens();
clearWidgetScreen("widget-screen1");
showWidgetLoading();

if(!$target.hasClass('icon-undo')){
var url = 'https://redaalfarouk-eduact.talentlms.com/gamification/getcertificationsleaderboard';

if (certificationsResponse && certificationsResponseTimestamp > (Date.now() - cacheTimeout)){
processCertificationsResponse(certificationsResponse);
}
else{
myportal.app.ajax(url, {
success: function(response){
certificationsResponse = response;
certificationsResponseTimestamp = Date.now();
processCertificationsResponse(response);
}
}, false);
}
}
}, listDelayTime));

function processCertificationsResponse(response){
var response = $.parseJSON(response);
if (widgetCurrentTab == "certifications-row") {
if(response.success){
clearWidgetScreen("widget-screen1");
$('#widget-screen1').append('<div class="tl-gamification-list tl-list-no-footer '+ (!response.data.currentUser ? "tl-leaderboard-rounded-corners" : "")+'"><table class="table table-hover" id="tl-certifications-leaderboard"><tbody class="tl-bold-item"></tbody></table></div><div class="tl-gamification-my-list"><table class="table table-hover tl-gamification-current-user"><tbody class="tl-bold-item"></tbody></table></div>');

$.each(response.data.firstSubsetUsers, function(index, user){
$('#tl-certifications-leaderboard tbody').append('<tr '+(user.currentUser ? "class='tl-current-user'" : "")+'><td class="tl-ranking-align">' + user.ranking + '</td><td class="tl-gamification-user"><img src="' + user.avatar + '" class="avatar-square tl-gamification-avatar image40x40"/>' + user.name + '</td><td class="tl-gamification-points">' + user.sumcertifications + '</td></tr>');
});

if (response.data.currentUser) {
$('.tl-gamification-current-user tbody').append('<tr><td class="tl-ranking-align">' + response.data.currentUser.ranking + '</td><td class="tl-gamification-user"><img src="' + response.data.currentUser.avatar + '" class="avatar-square tl-gamification-avatar image40x40"/>' + response.data.currentUser.name + '</td><td class="tl-gamification-points">' + response.data.currentUser.sumcertifications + '</td></tr>');
}

if (response.data.firstSubsetUsers.length > listLength) { //after X users the list will auto scroll
$(".tl-gamification-current-user").addClass("tl-gamification-list-scrolled");
}

hideGamificationFooterSection();
hideGamificationActions();
$('#tl-gamification-widget-modal .modal-header h3').text("مجلس الرواد");
$('#tl-widget-goback').data('current', 'screen2').data('goto', 'screen1').show();
hideWidgetLoading();
showWidgetScreen("widget-screen1");
}
}
}

$('#rewards-row').on('click', debounce(function(){
var url = 'https://redaalfarouk-eduact.talentlms.com/gamification/getrewardsconditions';
setCurrentTab("rewards-row");
hideGamificationActions();
hideGamificationFooterSection();
hideAllScreens();
clearWidgetScreen("widget-screen1");
showWidgetLoading();


if (rewardsResponse && rewardsResponseTimestamp > (Date.now() - cacheTimeout)){
processRewardsResponse(rewardsResponse);
}
else{
myportal.app.ajax(url, {
success: function(response){
rewardsResponse = response;
rewardsResponseTimestamp = Date.now();
processRewardsResponse(response);
}
}, false);
}

}, listDelayTime));

function processRewardsResponse(response){
var response = $.parseJSON(response);
if (widgetCurrentTab == "rewards-row") {
if(response.success){
clearWidgetScreen("widget-screen1");
$('#widget-screen1').append("<div class='tl-rewards-row'><div class='tl-rewards-icon'><img src='https://d3j0t7vrtr92dk.cloudfront.net/images/ranking/icon_certifications.svg'></div></div>")

$('.tl-rewards-row').append('<ul id="tl-rewards-conditions"></ul>');

$.each(response.data.conditions, function(index, message){
$('#tl-rewards-conditions').append('<li>' + message + '</li>');
});

if(response.data.conditions.length > 1){
$('.tl-rewards-row').append('<div id="biggest-discount-note"><i class="icon-info-circle tl-cursor-default tl-icon17"></i>&nbsp;<i>' + "تم تنفيذ أكبر التخفيضات" + '</i></div>');
}

$('#tl-widget-goback').data('current', 'screen3').data('goto', 'screen1').show();
$('#tl-gamification-widget-modal .modal-header h3').text("مجلس الرواد");
hideWidgetLoading();
showWidgetScreen("widget-screen1");
}
}
}

$('#tl-goto-badges-leaderboard').on('click', function(){
getUserBadges('https://redaalfarouk-eduact.talentlms.com/gamification/getuserbadges', 'screen2');
});

$(document).on('click', '#tl-badges-leaderboard tbody tr, #tl-goto-badges-leaderboard, .tl-gamification-badges-user tbody tr', function(){
if(!$(this).hasClass('tl-cursor-pointer')){
return false;
}

getUserBadges('https://redaalfarouk-eduact.talentlms.com/gamification/getuserbadges/user-id:##user-id##'.replace('##user-id##', $(this).data('user')), 'screen2');
});

$('#tl-widget-goback').on('click', function(){
if ($(this).data("mode") != "badges") {
showGamificationFooterSection(widgetCurrentTab.replace("-row", ""));
} else if (badgesDisabled && $(this).data("mode") == "badges") {
showGamificationFooterSection(widgetCurrentTab.replace("-row", ""));
}

hideGamificationActions();
hideAllScreens();
showWidgetScreen("widget-screen1");

if (badgesDisabled && $(this).data("mode") == "badges") {
$('#tl-gamification-widget-modal .modal-header h3').text("إنجازاتي");
} else if (pointsDisabled && $(this).data("mode") == "points") {
$('#tl-gamification-widget-modal .modal-header h3').text("إنجازاتي");
} else if (levelsDisabled && $(this).data("mode") == "levels") {
$('#tl-gamification-widget-modal .modal-header h3').text("إنجازاتي");
} else {
$('#tl-gamification-widget-modal .modal-header h3').text("مجلس الرواد");
}

});

$('#tl-gamification-widget-modal').on('hidden', function(){
hideGamificationActions();
hideGamificationFooterSection();
hideAllScreens();
});

$('#tl-howto-collect-points').on('click', function(){
showPointsConditions('screen2');
});

$('#tl-howto-upgrade-level').on('click', function(){
showLevelsConditions('screen2');
});

$(document).on('click', '.tl-reset-levels', function(){
resetUserLevel();
});

$(document).on('click', '.tl-reset-badges', function(e){
e.stopPropagation();
resetBadgesLevel();
});

function resetBadgesLevel() {
var url = 'https://redaalfarouk-eduact.talentlms.com/gamification/resetuserbadges';

myportal.app.ajax(url, {
success: function(response){
var response = $.parseJSON(response);

if(response.success){
$('.tl-achievements-badges .tl-gamification-total').text(response.data.newBadges);

if (!badgesDisabled) {
badgesResponse = '';
$("#badges-row").trigger("click");
}
}
}
});
}

function resetUserLevel() {
var url = 'https://redaalfarouk-eduact.talentlms.com/gamification/resetuserlevel';

myportal.app.ajax(url, {
success: function(response){
var response = $.parseJSON(response);

if(response.success){
$('.tl-achievements-levels .tl-gamification-total').text(response.data.newLevel);

if (!levelsDisabled) {
levelsResponse = '';
$("#levels-row").trigger("click");
}
}
}
});
}

var showPointsConditions = function(source){
var url = 'https://redaalfarouk-eduact.talentlms.com/gamification/getpointsconditions';
hideAllScreens();
hideGamificationFooterSection();
showWidgetLoading();

myportal.app.ajax(url, {
success: function(response){
var response = $.parseJSON(response);

if(response.success){
clearWidgetScreen("widget-screen3");
$('#widget-screen3').append('<ul id="tl-get-points-conditions"></ul>');

$.each(response.conditions, function(condition, message){
if(condition == 'testCompletion'){
$('#tl-get-points-conditions').append('<li class="tl-bold-item">' + message + '&nbsp;<i class="icon-info-circle tl-info-icon" id="test-completion-points"></i></li>');
$('#test-completion-points').tooltip({placement: 'right', trigger: 'hover', title: "مضروبًا في نقاط الاختبار"}).on('show', function(e){ e.stopPropagation(); }).on('hidden', function(e){ e.stopPropagation(); });
}
else if(condition == 'assignmentCompletion'){
$('#tl-get-points-conditions').append('<li class="tl-bold-item">' + message + '&nbsp;<i class="icon-info-circle tl-info-icon" id="assignment-completion-points"></i></li>');
$('#assignment-completion-points').tooltip({placement: 'right', trigger: 'hover', title: "مضروبًا في درجة التكليف"}).on('show', function(e){ e.stopPropagation(); }).on('hidden', function(e){ e.stopPropagation(); });
}
else if(condition == 'iltCompletion'){
$('#tl-get-points-conditions').append('<li class="tl-bold-item">' + message + '&nbsp;<i class="icon-info-circle tl-info-icon" id="ilt-completion-points"></i></li>');
$('#ilt-completion-points').tooltip({placement: 'right', trigger: 'hover', title: "ضرب درجة وحدة التدريب بقيادة المدرب"}).on('show', function(e){ e.stopPropagation(); }).on('hidden', function(e){ e.stopPropagation(); });
}
else{
$('#tl-get-points-conditions').append('<li class="tl-bold-item">' + message + '</li>');
}
});

showGamificationActions();
$('#tl-widget-goback').data('current', 'screen3').data('goto', 'screen2').data('mode', 'points').show();
showWidgetScreen("widget-screen3");
$('#tl-gamification-widget-modal .modal-header h3').text("كيفية جمع النقاط");
hideWidgetLoading();
}
}
}, false);
}

var showLevelsConditions = function(source){
var url = 'https://redaalfarouk-eduact.talentlms.com/gamification/getlevelsconditions';
hideAllScreens();
hideGamificationFooterSection();
showWidgetLoading();

myportal.app.ajax(url, {
success: function(response){
var response = $.parseJSON(response);

if(response.success){
clearWidgetScreen("widget-screen3");
$('#widget-screen3').append('<ul id="tl-upgrade-levels-conditions"></ul>');

$.each(response.conditions, function(index, message){
$('#tl-upgrade-levels-conditions').append('<li class="tl-bold-item">' + message + '</li>');
});

showGamificationActions();
$('#tl-widget-goback').data('current', 'screen3').data('goto', 'screen2').data('mode', 'level').show();
showWidgetScreen("widget-screen3");
$('#tl-gamification-widget-modal .modal-header h3').text("كيف تستطيع ترقية المستوى");
hideWidgetLoading();
}
}
}, false);
}

var getUserBadges = function(url, source){
hideAllScreens();
clearWidgetScreen("widget-screen3");
hideGamificationFooterSection();
showWidgetLoading();

myportal.app.ajax(url, {
success: function(response){
var response = $.parseJSON(response);

if(response.success){

$('#widget-screen3').append('<table class="table table-hover" id="tl-user-badges"><tbody class="tl-bold-item"></tbody></table>');
$('#tl-user-badges tbody').append('<tr><td class="tl-ranking-align text-center">'+ response.data.ranking +'</td><td class="tl-gamification-user"><img src="' + response.data.avatarSrc + '" class="avatar-square tl-gamification-avatar image40x40"/>' + response.data.username + '</td><td class="tl-gamification-points">' + response.data.badgesCount + '</td></tr>');
$('#widget-screen3').append('<div id="tl-userbadges-images"></div>');

$.each(response.data.userBadges, function(index, badges){
$('#tl-userbadges-images').append('<div class="tl-badges-section">'+badges.name+'</div>');

$.each(badges.userBadges, function(index, badge){
$('#tl-userbadges-images').append('<img src="' + badge.image + '" title="' + badge.name + '<br/>' + badge.criteria + '"/>');
});
});

$('#tl-userbadges-images img').tooltip({placement: 'top', trigger: 'hover', html: true, container: '#tl-gamification-widget-modal'}).on('show', function(e){ e.stopPropagation(); }).on('hidden', function(e){ e.stopPropagation(); });

$('#tl-widget-goback').data('current', 'screen3').data('goto', 'screen2').data('mode', 'badges').show();
showWidgetScreen("widget-screen3");
showGamificationActions();
hideWidgetLoading();
}
}
}, false);
};
});

function quickEditPoints(event){
if(event.which == 13 || event.which == 1){
var newPoints = $('#quick-edit-points').val();
var quickEditpoints = $(event.target).data("element-target");
var elementShow = $(event.target).data('element-target');

if(newPoints >= 0){
var url = 'https://redaalfarouk-eduact.talentlms.com/gamification/edituserpoints/points:##points##'.replace('##points##', newPoints);
myportal.app.ajax(url, {
success: function(response){
var response = $.parseJSON(response);
if(response.success){
$(quickEditpoints).html('<div class="tl-gamification-total">'+response.data.newPoints+'</div><i class="icon-pencil ml-1 quickEditPoints" data-element-target="'+elementShow+'" title="تحرير" data-points="'+response.data.newPoints+'"></i>');
$('#points-row .tl-gamification-ranking-text:first').text(response.data.newPointsRanking);
$('#points-row').data('goto', $('#points-row').data('goto-old'));
$('#points-row').removeData('goto-old');
$('#levels-message').html(response.data.newLevel+'<i class="icon-undo" title="Reset"></i>');
$('#levels-row .tl-gamification-ranking-text:first').text(response.data.newLevelRanking);
addQuickEditEvent();

if (!pointsDisabled) {
pointsResponse = '';
$("#points-row").trigger("click");
}
}
}
});
}
return false;
}
else if(event.keyCode == 27){
hideEditPoints(event);
}
}

function addQuickEditEvent() {
$(".quickEditPoints").on("click", function() {
$points = $(this).data("points");
var elementShow = $(event.target).data('element-target');

$(elementShow).html(
'<input class="input-small" type="text" value="' + $points + '" onkeypress="return quickEditPoints(event);" onkeyup="return hideEditPointsChrome(event);" id="quick-edit-points" style="margin-bottom: 5px; margin-right: 3px; margin-top: 5px;" maxlength="9"/>n
<a href="javascript:void(0)" id="icon-save-points" class="icon-ok none-decoration quick-edit-icon tl-icon17" data-element-target="'+elementShow+'" onclick="quickEditPoints(event)" data-points="'+$points+'" ></a>n
<a href="javascript:void(0)" id="icon-remove-points" class="icon-remove none-decoration quick-edit-icon tl-icon17" onclick="hideEditPoints(event)" data-element-target="'+elementShow+'" data-points="'+$points+'" ></a>'
);
$('#quick-edit-points').focus();
$('#points-row').data('goto-old', $('#points-row').data('goto'));
$('#points-row').removeData('goto');
})
}

function hideEditPointsChrome(event, target){
if(event.keyCode == 27){
hideEditPoints(event, target);
}
}

function hideEditPoints(event, target){
var $points = $('#icon-remove-points').data('points');
var elementHide = $(event.target).data('element-target');

$(elementHide).html('<div class="tl-gamification-total">'+$points+'</div><i class="icon-pencil ml-1 quickEditPoints" data-element-target="'+elementHide+'" title="تحرير" data-points="'+$points+'"></i>');
$('#points-row').data('goto', $('#points-row').data('goto-old'));
$('#points-row').removeData('goto-old');
addQuickEditEvent();
event.stopPropagation();
}
</script>

<script type="text/javascript">
$('body').on('touchstart.dropdown', '.dropdown-menu', function(e){ e.stopPropagation(); }); // Fix for https://github.com/twitter/bootstrap/issues/2975#issuecomment-6659992, should be removed if fixed in twitter bs 2.1.2 (or whenever)
myportal.app.translations['search'] = "بحث";
myportal.app.translations['Completed'] = "منتهي";
myportal.app.translations['cancel'] = "إلغاء";
myportal.app.translations['ok'] = "طيب";
myportal.app.translations['save'] = "حفظ";
myportal.app.translations['save-as-new'] = "احفظ كجديد";
myportal.app.translations['more'] = "المزيد";
myportal.app.translations['less'] = "أقل";
myportal.app.translations['remove'] = "إزالة";
myportal.app.translations['reset'] = "أعد تعيين";
myportal.app.translations['refresh'] = "إنعاش";
myportal.app.translations['notice'] = "إشعار";
myportal.app.translations['reset-remove-certification'] = "إعادة تعيين وإزالة الشهادة";
myportal.app.translations['activate'] = "تنشيط";
myportal.app.translations['deactivate'] = "تعطيل";
myportal.app.translations['search-courses'] = "البحث في الدورات";
myportal.app.translations['add-image'] = "إضافة صورة";
myportal.app.translations['change-image'] = "تغيير الصورة";
myportal.app.translations['accepted-files'] = "الملفات المقبولة";
myportal.app.translations['max-file-size'] = "الحجم الأقصى للملف";
myportal.app.translations['switch-editor'] = "تبديل بين منظر المصدر ومنظر HTML";
myportal.app.translations['grid-more-results'] = "إظهار نتائج أكثر لكل صفحه";
myportal.app.translations['grid-less-results'] = "إظهار نتائج أقل لكل صفحه";
myportal.app.translations['image-course-files'] = "إستعمل صورة من ملفات الدورة";
myportal.app.translations['use-image-url'] = "إستعمل رابط الصورة (...//:http)";
myportal.app.translations['width'] = "العرض";
myportal.app.translations['padding'] = "حشو";
myportal.app.translations['align-default'] = "محاذاة";
myportal.app.translations['align-left'] = "محاذاة على الجهة اليسرى";
myportal.app.translations['align-right'] = "محاذاة على الجهة اليمنى";
myportal.app.translations['make-changes'] = "حفظ التعديلات";
myportal.app.translations['grid-start-end-total'] = "_START_ إلى _END_ من _TOTAL_";
myportal.app.translations['export'] = "تصدير";
myportal.app.translations['save-as-csv'] = "حفظ بصيغة CSV";
myportal.app.translations['active-file-upload'] = "يوجد تحميل ملف نشط";
myportal.app.translations['upload-leave-page'] = "هل أنت واثق أنك تريد مغادرة هذه الصفحه؟ تحميل الملف سوف يتوقف وستفقد كل المعلومات التي تم تحميلها.";
myportal.app.translations['unsaved-changes'] = "يوجد تعديلات غير محفوظه";
myportal.app.translations['changes-leave-page'] = "هل أنت واثق أنك تريد مغادرة هذه الصفحه؟ سوف تفقد أي تعديلات لم تقم بحفظها.";
myportal.app.translations['discard-draft'] = "هل أنت واثق من حذف الحفظ الآلي؟ هذا الأمر لا يمكن التراجع عنه.";
myportal.app.translations['restore-draft'] = "هل أنت واثق من استرجاع الحفظ الآلي؟ هذا الأمر لا يمكن التراجع عنه.";
myportal.app.translations['add'] = "أضف";
myportal.app.translations['added'] = "مضاف";
myportal.app.translations['processing'] = "جاري المعالجة";
myportal.app.translations['validate'] = "تأكيد الصلاحية";
myportal.app.translations['click-to-start'] = "إضغط للبدء";
myportal.app.translations['reset-password'] = "إعادة تعيين كلمة المرور";
myportal.app.translations['operation-completed-successfully'] = "تمت العملية بنجاح";
myportal.app.translations['points'] = "نقاط";
myportal.app.translations['badges'] = "شارات";
myportal.app.translations['help-videos-unavailable'] = "مقاطع الفيديو غير متاحه حاليا";
myportal.app.translations['next'] = "التالي";
myportal.app.translations['previous'] = "سابق";
myportal.app.translations['your-rating'] = "تقييمك";
myportal.app.translations['reset-your-rating'] = "إعادة تعيين تقييمك";
myportal.app.translations['creating-export'] = "جارٍ إنشاء ملف التصدير يُرجى الانتظار...";
myportal.app.translations['no-results-found'] = "لا توجد نتائج. حاول مرة أخرى.";
myportal.app.translations['login'] = "دخول";
myportal.app.translations['crop'] = "اقتصاص";
myportal.app.translations['apply'] = "استخدام";
myportal.app.translations['preview-certification-error'] = "حدث خطأ أثناء إنشاء المعاينة، الرجاء المحاولة مرة أخرى لاحقاً";
myportal.app.translations['preview'] = "معاينة";
myportal.app.translations['wait-preview-generation'] = "رجاءً انتظر ريثما ننشئ المعاينة";

var isMobile = false;
var isRtl = true;
var general_css = 'https://redaalfarouk-eduact.talentlms.com/index/css/fmt:1600151117,tn:41,tv:0,ct:1';
var editorMaxUploadSize = '10485760';
var editorFormattedMaxUploadSize = '10 MB';
var editorAcceptedFileTypes = 'gif|jpg|jpeg|png';
var editorFormattedAcceptedFileTypes = 'gif, jpg, jpeg, png';
var imageAcceptedFileTypes = 'gif|jpg|jpeg|png';
var imageMaxUploadSize = '3145728';

var courseImageCanvasSizeWidth = '120';
var courseImageCanvasSizeHeight = '80';

var datepickerFormat = 'dd/mm/yyyy';
var showSelect2 = true;
var currentUserId = "279";
var currentUserName = "Ali Osama";
var currentUserEmail = "[email protected]";
var currentUserCreatedOn = "1598700357";
var currentUserIntercomHash = '';
var myToken = "af2e48f47aa28b18c5267174c4f329ca";
var myEffectiveDomain = 'redaalfarouk-eduact.talentlms.com';
var myAdminDomain = '';
var gridExportChunkSize = 5000;
var gridExportProgressThreshold = 100;
var isDummy = false;
var sessionMaxLifeTime = 10800;
var checkSessionExpirationUrl = 'https://redaalfarouk-eduact.talentlms.com/index/checksessionexpiration';
var logourRedirectUrl = 'eduact.me';
var enableRelogin = true;
var smartTags = {"{username}":"Username","{first_name}":"First name","{last_name}":"Last name","{date}":"Date","{course_progress}":"Course progress","{course_start_date}":"Course start date","{course_completion_date}":"Course completion date","{course_time}":"Course time","{course_name}":"Course name","{system_time}":"System time","{completed_courses}":"Completed courses","{certifications}":"Certifications"};
</script>

<script type="text/javascript"></script><script type="text/javascript">
window.getTestIdAttr = function () {
return window.testIDAttr || "";
};
window.printTestId = function ( testID ) {
if ( window.testEnvActive && ( typeof testID !== 'undefined' ) ) {
return window.getTestIdAttr() + '=' + testID;
} else {
return '';
}
};
jQuery.fn.printTestId = function ( testID ) {
var el = $(this[0]);
if ( window.testEnvActive && ( typeof testID !== 'undefined' ) ) {
el.attr(window.getTestIdAttr(), testID);
}
return this;
};
</script>



</body></html>
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.