<commit_before><%@page import="com.liferay.lms.service.LearningActivityTryLocalServiceUtil"%>
<%@page import="com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil"%>
<%@page import="com.liferay.portal.kernel.dao.orm.Criterion"%>
<%@page import="com.liferay.portal.kernel.dao.orm.DynamicQuery"%>
<%@page import="com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil"%>
<%@page import="com.liferay.lms.model.LearningActivityTry"%>
<%@page import="com.liferay.lms.service.ClpSerializer"%>
<%@page import="com.liferay.portal.kernel.bean.PortletBeanLocatorUtil"%>
<%@page import="com.liferay.portal.kernel.exception.PortalException"%>
<%@page import="com.liferay.portlet.asset.service.AssetEntryLocalServiceUtil"%>
<%@page import="com.liferay.portlet.asset.model.AssetEntry"%>
<%@page import="com.liferay.lms.service.LearningActivityLocalServiceUtil"%>
<%@page import="com.liferay.lms.model.LearningActivity"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@ include file="/init.jsp" %>

<liferay-portlet:renderURL var="selectResource" windowState="<%=LiferayWindowState.POP_UP.toString() %>">
	<liferay-portlet:param name="jspPage" value="/html/resourceInternalActivity/admin/searchresource.jsp"/>
</liferay-portlet:renderURL>


<%
long resId = ParamUtil.getLong(request, "resId");
long resModuleId = ParamUtil.getLong(request, "resModuleId");

long assetId=ParamUtil.getLong(request, "assertId");
String assetTitle=StringPool.BLANK;
String disabled = "disabled=\"disabled\"";

if(assetId!=0){
	try{
		AssetEntry entry=AssetEntryLocalServiceUtil.getEntry(assetId);
		assetId=entry.getEntryId();
		assetTitle=entry.getTitle(renderRequest.getLocale());
	}catch(Exception e){
		assetId=0;
	}
}

LearningActivity learningActivity=(LearningActivity)request.getAttribute("activity");
if(learningActivity!=null) {	
	if ((learningActivity.getExtracontent()!=null)&&(learningActivity.getExtracontent().trim().length()!=0)) {
		try{
			AssetEntry entry=AssetEntryLocalServiceUtil.getEntry(
				GetterUtil.getLong(LearningActivityLocalServiceUtil.getExtraContentValue(learningActivity.getActId(),"assetEntry")));
			assetId=entry.getEntryId();
			assetTitle=entry.getTitle(renderRequest.getLocale());	
		}
		catch(PortalException e){}
	}	
}

if(LearningActivityLocalServiceUtil.canBeEdited(learningActivity, user.getUserId())) disabled="";

%>

<aui:input type="hidden" name="assetEntryId" ignoreRequestValue="true" value="<%=Long.toString(assetId) %>"/>
<aui:field-wrapper name="resourceinternalactivity.edit.asserts" cssClass="search-button-container">
	<aui:input type="text" name="assetEntryName" ignoreRequestValue="true" value="<%=assetTitle %>" label="" inlineField="true" disabled="true"  size="50"/>
	
	
		<liferay-portlet:renderURL var="buscarRecurso" >
			<liferay-portlet:param name="mvcPath" value="/html/resourceInternalActivity/admin/searchresource.jsp" />
			<liferay-portlet:param name="resId" value="<%=String.valueOf(resId) %>" /><commit_msg>-- corregido error, no se cambiaba el recurso elegido al editar una actividad resourceInternalActivity<commit_after><%@page import="com.liferay.lms.service.LearningActivityTryLocalServiceUtil"%>
<%@page import="com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil"%>
<%@page import="com.liferay.portal.kernel.dao.orm.Criterion"%>
<%@page import="com.liferay.portal.kernel.dao.orm.DynamicQuery"%>
<%@page import="com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil"%>
<%@page import="com.liferay.lms.model.LearningActivityTry"%>
<%@page import="com.liferay.lms.service.ClpSerializer"%>
<%@page import="com.liferay.portal.kernel.bean.PortletBeanLocatorUtil"%>
<%@page import="com.liferay.portal.kernel.exception.PortalException"%>
<%@page import="com.liferay.portlet.asset.service.AssetEntryLocalServiceUtil"%>
<%@page import="com.liferay.portlet.asset.model.AssetEntry"%>
<%@page import="com.liferay.lms.service.LearningActivityLocalServiceUtil"%>
<%@page import="com.liferay.lms.model.LearningActivity"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@ include file="/init.jsp" %>

<liferay-portlet:renderURL var="selectResource" windowState="<%=LiferayWindowState.POP_UP.toString() %>">
	<liferay-portlet:param name="jspPage" value="/html/resourceInternalActivity/admin/searchresource.jsp"/>
</liferay-portlet:renderURL>


<%
long resId = ParamUtil.getLong(request, "resId");
long resModuleId = ParamUtil.getLong(request, "resModuleId");

long assetId=ParamUtil.getLong(request, "assertId");
String assetTitle=StringPool.BLANK;
String disabled = "disabled=\"disabled\"";

if(assetId!=0){
	try{
		AssetEntry entry=AssetEntryLocalServiceUtil.getEntry(assetId);
		assetId=entry.getEntryId();
		assetTitle=entry.getTitle(renderRequest.getLocale());
	}catch(Exception e){
		assetId=0;
	}
}

LearningActivity learningActivity=(LearningActivity)request.getAttribute("activity");
if(learningActivity!=null) {	
	if ((learningActivity.getExtracontent()!=null)&&(learningActivity.getExtracontent().trim().length()!=0)) {
		try{
			if(assetId==0){
				AssetEntry entry=AssetEntryLocalServiceUtil.getEntry(
					GetterUtil.getLong(LearningActivityLocalServiceUtil.getExtraContentValue(learningActivity.getActId(),"assetEntry")));
				assetId=entry.getEntryId();
				assetTitle=entry.getTitle(renderRequest.getLocale());	
			}
		}
		catch(PortalException e){}
	}	
}

if(LearningActivityLocalServiceUtil.canBeEdited(learningActivity, user.getUserId())) disabled="";

%>

<aui:input type="hidden" name="assetEntryId" ignoreRequestValue="true" value="<%=Long.toString(assetId) %>"/>
<aui:field-wrapper name="resourceinternalactivity.edit.asserts" cssClass="search-button-container">
	<aui:input type="text" name="assetEntryName" ignoreRequestValue="true" value="<%=assetTitle %>" label="" inlineField="true" disabled="true"  size="50"/>
	
	
		<liferay-portlet:renderURL var="buscarRecurso" >
			<liferay-portlet:param name="mvcPath" value="/html/resourceInternalActivity/admin/searchresource.jsp" />
			<liferay-portlet:param name="resId" value="<%=String.valueOf(resId) %>" />
{'fraction_non_alphanumeric': 0.16905349794238683, 'fraction_numerical': 0.0018106995884773663, 'mean_word_length': 8.434782608695652, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1557886', 'n_tokens_mistral': 2044, 'n_tokens_neox': 2047, 'n_words': 220}