<% include ../styles.ejs %> ADMI <% include ../header.ejs %> <% var all_assignments_details = {}; if(typeof assignments_details !='undefined'){ for(var a = 0; a< assignments_details.length; a++){ var curr = assignments_details[a]; if(typeof curr.coursetest != 'undefined'){ if(typeof curr.coursetest._id != 'undefined'){ all_assignments_details[curr.coursetest._id] = curr; } } } } var month_arr = ['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec']; %>
<% var rlm_res = rlm.resourcelevelmappings; var rlm_name_list_arr = {}; for(var r=0; r < rlm_res.length; r++) { var k = rlm_res[r].resourcelevelmapping_level._id; var v = rlm_res[r].resourcelevelmapping_name_list; rlm_name_list_arr[k] = v; } %> <% var allow_count = 0; var findRes = myworktask.findRes; if(typeof findRes != 'undefined'){ if(findRes && findRes.length > 0){ for(var i=0; i < findRes.length; i++) { allow_count++; var chk_arr = rlm_name_list_arr[findRes[i].resourceLevelId._id] var index = chk_arr.findIndex(x => (x._id) === user_id); var take = findRes[i].take; if(typeof findRes[i].attachment=='undefined'){ findRes[i].attachment = "no-image-available.jpg"; } else if(findRes[i].attachment==''){ findRes[i].attachment = "no-image-available.jpg"; } %>

<%= findRes[i].name %>

<% var desc = findRes[i].description; var noHTML = /(<([^>]+)>)/ig; // regex for removing HTML tags var clean_desc = desc.replace(noHTML, ''); // remove all html tags %> <%= clean_desc.substring(0,150) %>...
<% if(typeof findRes[i].created!='undefined'){ if(findRes[i].created!=''){ var d = new Date(findRes[i].created); var day = d.getDate(); var month = d.getMonth(); var year = d.getFullYear(); %> <% } } %> <%- findRes[i].reward_student %> (<%- findRes[i].resourceLevelId.resourcelevel_title %>)
<% if(index != -1){ if(take.indexOf(user_id) > -1){ %> <% } else if(take.length == 0){ %> <% } else if(take.length != 0){ %> <% } } else { %> <% } %>
<% } } } %> <% if(allow_count == 0){ %> <% } %>
<% include ../footer.ejs%> <% include ../scripts.ejs %>