Fix warning messages. Add formula notation. Now picks random float values even if edge values seem integers (like 10.00 or 20.0)

1.9.x
Imanol Losada 12 years ago
parent b39bee24fd
commit ce8f8d4301
  1. 28
      main/exercice/calculated_answer.class.php
  2. 38
      main/exercice/evalmathnotation.php
  3. 61
      main/lang/english/trad4all.inc.php
  4. 67
      main/lang/spanish/trad4all.inc.php

@ -133,7 +133,23 @@ class CalculatedAnswer extends Question
$form->addElement('label', null, get_lang('IfYouWantOnlyIntegerValuesWriteBothLimitsWithoutDecimals'));
$form->addElement('html', '<div id="blanks_weighting"></div>');
$form->addElement('label', null, get_lang('FormulaExample').': &radic;<span style="text-decoration:overline;">&nbsp;x &divide y&nbsp;</span> &times e <sup>(ln(pi))</sup> = sqrt([x]/[y])*(e^(ln(pi)))');
$notationListButton = Display::url(
get_lang('NotationList'),
api_get_path(WEB_PATH).'main/exercice/evalmathnotation.php',
array(
'class' => 'btn ajax',
'_target' => '_blank'
)
);
$form->addElement(
'html',
'<div class="control-group">
<label class="control-label"></label>
<div class="controls">'.$notationListButton.'</div>
</div>');
$form->addElement('label', null, get_lang('FormulaExample'));
$form->addElement('text', 'formula', get_lang('Formula'), array('id' => 'formula', 'class' => 'span4'));
$form->addRule('formula', get_lang('GiveFormula'), 'required');
@ -183,8 +199,12 @@ class CalculatedAnswer extends Question
$replace = array("[", "]");
$newBlankItem = str_replace($replace, "", $blankItem);
$newBlankItem = "[".trim($newBlankItem)."]";
$randomValue = mt_rand($lowestValues[$i],$highestValues[$i]);
//$randomValue = mt_rand($lowestValues[$i]*100,$highestValues[$i]*100)/100;
// take random float values when one or both edge values have a decimal point
$randomValue =
(strpos($lowestValues[$i],'.') !== false ||
strpos($highestValues[$i],'.') !== false) ?
mt_rand($lowestValues[$i]*100,$highestValues[$i]*100)/100 :
mt_rand($lowestValues[$i],$highestValues[$i]);
$auxAnswer = str_replace($blankItem, $randomValue, $auxAnswer);
$auxFormula = str_replace($blankItem, $randomValue, $auxFormula);
}
@ -203,7 +223,7 @@ class CalculatedAnswer extends Question
}
$this->save();
$objAnswer = new answer($this->id);
$objAnswer->createAnswer($auxAnswer, 1, '', $this->weighting, array());
$objAnswer->createAnswer($auxAnswer, 1, '', $this->weighting, null);
$objAnswer->position = array();
$objAnswer->save();

@ -0,0 +1,38 @@
<?php
/* For licensing terms, see /license.txt */
require_once "../inc/global.inc.php";
echo "<pre>".
get_lang('SummationPlus')."\n".
get_lang('SubstractionMinus')."\n".
get_lang('MultiplicationStar')."\n".
get_lang('DivisionSlash')."\n".
get_lang('ExponentiationCircumflex')."\n".
"\n".
get_lang('SquareRootSqrt')."\n".
get_lang('AbsoluteValueAbs')."\n".
get_lang('NaturalLogarithmLn')."\n".
get_lang('LogarithmLog')."\n".
get_lang('ENumberE')."\n".
get_lang('PiNumberPi')."\n".
"\n".
get_lang('SineSin')."\n".
get_lang('HyperbolicSineSinh')."\n".
get_lang('ArcsineArcsin')."\n".
get_lang('InverseSineAsin')."\n".
get_lang('HyperbolicArcsineArcsinh')."\n".
get_lang('InverseHyperbolicSineAsinh')."\n".
"\n".
get_lang('CosineCos')."\n".
get_lang('HyperbolicCosineCosh')."\n".
get_lang('ArccosineArccos')."\n".
get_lang('InverseCosineAcos')."\n".
get_lang('HyperbolicArccosineArccosh')."\n".
get_lang('InverseHyperbolicCosineAcosh')."\n".
"\n".
get_lang('TangentTan')."\n".
get_lang('HyperbolicTangentTanh')."\n".
get_lang('ArctangentArctan')."\n".
get_lang('InverseTangentAtan')."\n".
get_lang('HyperbolicArctangentArctanh')."\n".
get_lang('InverseHyperbolicTangentAtanh').
"</pre>";

@ -2,13 +2,46 @@
/*
for more information: see languages.txt in the lang folder.
*/
$InverseHyperbolicTangentAtanh = "Inverse hyperbolic tangent:\tatanh(x)";
$HyperbolicArctangentArctanh = "Hyperbolic arctangent:\t\tarctanh(x)";
$InverseTangentAtan = "Inverse tangent:\t\tatan(x)";
$ArctangentArctan = "Arctangent:\t\t\tarctan(x)";
$HyperbolicTangentTanh = "Hyperbolic tangent:\t\ttanh(x)";
$TangentTan = "Tangent:\t\t\ttan(x)";
$InverseHyperbolicCosineAcosh = "Inverse hyperbolic cosine:\tacosh(x)";
$HyperbolicArccosineArccosh = "Hyperbolic arccosine:\t\tarccosh(x)";
$InverseCosineAcos = "Inverse cosine:\t\t\tacos(x)";
$ArccosineArccos = "Arccosine:\t\t\tarccos(x)";
$HyperbolicCosineCosh = "Hyperbolic cosine:\t\tcosh(x)";
$CosineCos = "Cosine:\t\t\t\tcos(x)";
$InverseHyperbolicSineAsinh = "Inverse hyperbolic sine:\tasinh(x)";
$HyperbolicArcsineArcsinh = "Hyperbolic arcsine:\t\tarcsinh(x)";
$InverseSineAsin = "Inverse sine:\t\t\tasin(x)";
$ArcsineArcsin = "Arcsine:\t\t\tarcsin(x)";
$HyperbolicSineSinh = "Hyperbolic sine:\t\tsinh(x)";
$SineSin = "Sine:\t\t\t\tsin(x)";
$PiNumberPi = "Pi number:\t\t\tpi";
$ENumberE = "E number:\t\t\te";
$LogarithmLog = "Logarithm:\t\t\tlog(x)";
$NaturalLogarithmLn = "Natural logarithm:\t\tln(x)";
$AbsoluteValueAbs = "Absolute value:\t\t\tabs(x)";
$SquareRootSqrt = "Square root:\t\t\tsqrt(x)";
$ExponentiationCircumflex = "Exponentiation:\t\t\t^";
$DivisionSlash = "Division:\t\t\t/";
$MultiplicationStar = "Multiplication:\t\t\t*";
$SubstractionMinus = "Substraction:\t\t\t-";
$SummationPlus = "Summation:\t\t\t+";
$NotationList = "Formula notation";
$SubscribeToSessionRequest = "Request for subscription to a session";
$PleaseSubscribeMeToSession = "Please consider subscribing me to session";
$SearchActiveSessions = "Search active sessions";
$UserNameHasDash = "The username cannot contain the '-' character";
$IfYouWantOnlyIntegerValuesWriteBothLimitsWithoutDecimals = "If you want only integer values write both limits without decimals";
$GiveAnswerVariations = "Please, write how many question variations you want";
$AnswerVariations = "Question variations";
$GiveFormula = "Please, write the formula";
$Formula = "Formula";
$FormulaExample = "Formula sample";
$FormulaExample = "Formula sample: sqrt( [x] / [y] ) * ( e ^ ( ln(pi) ) )";
$VariableRanges = "Variable ranges";
$ExampleValue = "Range value";
$CalculatedAnswer = "Calculated question";
@ -17,7 +50,7 @@ $OnlyBestAttempts = "Only best attempts";
$IncludeAllUsers = "Include all users";
$HostingWarningReached = "Hosting warning reached";
$SessionName = "Session name";
$MobilePhoneNumberWrong = "Mobile phone number is incomplete or contains not valid characters";
$MobilePhoneNumberWrong = "Mobile phone number is incomplete or contains invalid characters";
$CountryDialCode = "Include the country dial code";
$FieldTypeMobilePhoneNumber = "Mobile phone number";
$CheckUniqueEmail = "Check unique email";
@ -137,6 +170,7 @@ $RegisteredClasses = "Registered classes";
$DeleteItemsNotInFile = "Delete items not in file";
$ImportGroups = "Import groups";
$HereIsYourFeedback = "Here is your feedback";
$SearchSessions = "Session Search";
$ShowSystemFolders = "Show system folders.";
$LoginToGoToThisCourse = "Please login to go to this course";
$LoginDate = "Login date";
@ -221,6 +255,7 @@ $ReplyShort = "Re:";
$SendToAllUsers = "Send to all users";
$SelectACategory = "Select a category";
$AdvancedEdit = "Advanced edit";
$NoTimeLimits = "No time limits";
$SearchXapianModuleNotInstalled = "The Xapian search module is not installed";
$Title = "Title";
$By = "By";
@ -1259,13 +1294,13 @@ $YouMustAcceptLicence = "You must accept the licence";
$SelectOne = "Select one";
$ContactInformationHasBeenSent = "Contact information has been sent";
$UserInactivedSinceX = "User inactive since %s";
$ContactInformationDescription = "Dear user,<br />
<br />You are about to start using one of the best open-source e-learning platform on the market. Like many other open-source project, this project is backed up by a large community of students, teachers, developers and content creators who would like to promote the project better.<br />
<br />
By knowing a little bit more about you, one of our most important users, who will manage this e-learning system, we will be able to let people know that our software is used and let you know when we organize events that might be relevant to you.<br />
<br />
By filling this form, you accept that the Chamilo association or its members might send you information by e-mail about important events or updates in the Chamilo software or community. This will help the community grow as an organized entity where information flow, with a permanent respect of your time and your privacy.<br />
<br />
$ContactInformationDescription = "Dear user,<br />
<br />You are about to start using one of the best open-source e-learning platform on the market. Like many other open-source project, this project is backed up by a large community of students, teachers, developers and content creators who would like to promote the project better.<br />
<br />
By knowing a little bit more about you, one of our most important users, who will manage this e-learning system, we will be able to let people know that our software is used and let you know when we organize events that might be relevant to you.<br />
<br />
By filling this form, you accept that the Chamilo association or its members might send you information by e-mail about important events or updates in the Chamilo software or community. This will help the community grow as an organized entity where information flow, with a permanent respect of your time and your privacy.<br />
<br />
Please note that you are <b>not required</b> to fill this form. If you want to remain anonymous, we will loose the opportunity to offer you all the privileges of being a registered portal administrator, but we will respect your decision. Simply leave this form empty and click \"Next\".<br /><br />";
$CompanyActivity = "Your company's activity";
$DateUnLock = "Unlock date";
@ -1473,7 +1508,7 @@ $SaveForNow = "Save and continue later";
$NoQuicktime = "Your browser does not have the QuickTime plugin installed. You can still use the platform, but to run a larger number of media file types, we suggest you might want to install it.";
$NoJavaSun = "Your browser doesn't seem to have the Sun Java plugin installed. You can still use the platform, but you will lose a few of its capabilities.";
$NoJava = "Your browser does not support Java";
$JavaSun24 = "Your browser has a Java version not supported by this tool.
$JavaSun24 = "Your browser has a Java version not supported by this tool.
To use it you have to install a Java Sun version higher than 24";
$NoMessageAnywere = "If you do not want to see this message again during this session, click here";
$Attempts = "Attempts";
@ -1638,8 +1673,4 @@ $DataTableSearch = "Search";
$HideColumn = "Hide column";
$DisplayColumn = "Show column";
$LegalAgreementAccepted = "Legal agreement accepted";
$FieldTypeMobilePhoneNumber = "Mobile phone";
$CountryDialCode = "Include the country dial code";
$MobilePhoneNumberWrong = "Mobile phone number is incomplete or contains invalid characters";
$SessionName = "Session name";
?>
?>

@ -2,13 +2,44 @@
/*
for more information: see languages.txt in the lang folder.
*/
$InverseHyperbolicTangentAtanh = "Tangente hiperbólica inversa:\tatanh(x)";
$HyperbolicArctangentArctanh = "Arcotangente hiperbólica:\tarctanh(x)";
$InverseTangentAtan = "Tangente inversa:\t\tatan(x)";
$ArctangentArctan = "Arcotangente:\t\t\tarctan(x)";
$HyperbolicTangentTanh = "Tangente hiperbólica:\t\ttanh(x)";
$TangentTan = "Tangente:\t\t\ttan(x)";
$InverseHyperbolicCosineAcosh = "Coseno hiperbólico inverso:\tacosh(x)";
$HyperbolicArccosineArccosh = "Arcocoseno hiperbólico:\t\tarccosh(x)";
$InverseCosineAcos = "Coseno inverso:\t\t\tacos(x)";
$ArccosineArccos = "Arcocoseno:\t\t\tarccos(x)";
$HyperbolicCosineCosh = "Coseno hiperbólico:\t\tcosh(x)";
$CosineCos = "Coseno:\t\t\t\tcos(x)";
$InverseHyperbolicSineAsinh = "Seno hiperbólico inverso:\tasinh(x)";
$HyperbolicArcsineArcsinh = "Arcoseno hiperbólico:\t\tarcsinh(x)";
$InverseSineAsin = "Seno inverso:\t\t\tasin(x)";
$ArcsineArcsin = "Arcoseno:\t\t\tarcsin(x)";
$HyperbolicSineSinh = "Seno hiperbólico:\t\tsinh(x)";
$SineSin = "Seno:\t\t\t\tsin(x)";
$PiNumberPi = "Número pi:\t\t\tpi";
$ENumberE = "Número e:\t\t\te";
$LogarithmLog = "Logaritmo:\t\t\tlog(x)";
$NaturalLogarithmLn = "Logaritmo natural:\t\tln(x)";
$AbsoluteValueAbs = "Valor absoluto:\t\t\tabs(x)";
$SquareRootSqrt = "Raíz cuadrada:\t\t\tsqrt(x)";
$ExponentiationCircumflex = "Potencia:\t\t\t^";
$DivisionSlash = "División:\t\t\t/";
$MultiplicationStar = "Multiplicación:\t\t\t*";
$SubstractionMinus = "Resta:\t\t\t\t-";
$SummationPlus = "Suma:\t\t\t\t+";
$NotationList = "Notación para fórmula";
$SearchActiveSessions = "Buscar sesiones activas";
$UserNameHasDash = "El nombre de usuario no puede contener el caracter '-'";
$IfYouWantOnlyIntegerValuesWriteBothLimitsWithoutDecimals = "Si desea sólo números enteros escriba ambos límites sin decimales";
$GiveAnswerVariations = "Por favor, escriba cuántos problemas desea generar";
$AnswerVariations = "Problemas a generar";
$GiveFormula = "Por favor, escriba la fórmula";
$Formula = "Fórmula";
$FormulaExample = "Ejemplo de fórmula";
$FormulaExample = "Ejemplo de fórmula: sqrt( [x] / [y] ) * ( e ^ ( ln(pi) ) )";
$VariableRanges = "Rangos de las variables";
$ExampleValue = "Valor del rango";
$CalculatedAnswer = "Pregunta calculada";
@ -137,6 +168,7 @@ $RegisteredClasses = "Clases subscritas";
$DeleteItemsNotInFile = "Eliminar elementos que no se encuentran en el archivo";
$ImportGroups = "Importar grupos";
$HereIsYourFeedback = "Respuesta del profesor:";
$SearchSessions = "Búsqueda de sesiones";
$ShowSystemFolders = "Mostrar directorios del sistema.";
$LoginToGoToThisCourse = "Conectarse para entrar al curso";
$LoginDate = "Fecha de ingreso";
@ -221,6 +253,7 @@ $ReplyShort = "Re:";
$SendToAllUsers = "Enviar a todos los usuarios";
$SelectACategory = "Seleccione una categoría";
$AdvancedEdit = "Edición avanzada";
$NoTimeLimits = "Sin límite de tiempo";
$SearchXapianModuleNotInstalled = "El modulo Xapian de PHP no está configurado en su servidor, póngase en contacto con su administrador";
$Title = "Título";
$By = "Publicado por";
@ -1082,7 +1115,7 @@ $YouCanAccessTheExercise = "Ir a la prueba";
$YouHaveBeenRegisteredToCourseX = "Ha sido inscrito en el curso %s";
$DashboardPluginsHaveBeenUpdatedSucesslly = "Los plugins del panel de control han sido actualizados correctamente";
$LoginEnter = "Entrar";
$AttendanceSheetDescription = "Las listas de asistencia permiten registrar las faltas de asistencia de los estudiantes. En caso de ausencia de un estudiante, el profesor deberá registrarlo manualmente en la casilla correspondiente.
$AttendanceSheetDescription = "Las listas de asistencia permiten registrar las faltas de asistencia de los estudiantes. En caso de ausencia de un estudiante, el profesor deberá registrarlo manualmente en la casilla correspondiente.
Es posible crear más de una lista de asistencia por cada curso; así por ejemplo, podrá registrar separadamente la asistencia a las clases teóricas y prácticas.";
$ThereAreNoRegisteredLearnersInsidetheCourse = "No hay estudiantes inscritos en este curso";
$GoToAttendanceCalendarList = "Ir al calendario de asistencia";
@ -1260,14 +1293,14 @@ $YouMustAcceptLicence = "Debe aceptar la licencia para poder usar este software"
$SelectOne = "Seleccione uno";
$ContactInformationHasBeenSent = "Información de contacto enviada";
$UserInactivedSinceX = "Usuario inactivo desde %s";
$ContactInformationDescription = "Estimado usuario,
está a punto de instalar una de las mejores plataformas e-learning de código abierto que existen en el mercado. Al igual de muchos otros proyectos de código abierto, Chamilo está respaldado por una amplia comunidad de profesores, estudiantes, desarrolladores y creadores de contenido.
Si sabemos algo más de quien va a gestionar este sistema e-learning, podremos dar a conocer a otros que nuestro software lo utiliza y a usted podremos informarle sobre eventos que pueden ser de su interés.
Cumplimentar este formulario, implica la aceptación de que la asociación Chamilo o sus miembros puedan enviarle información por correo electrónico sobre eventos importantes o actualizaciones en el software Chamilo. Esto ayudará a crecer a la comunidad como una entidad organizada, donde el flujo de información, se haga con respeto permanente a su tiempo y su privacidad.
$ContactInformationDescription = "Estimado usuario,
está a punto de instalar una de las mejores plataformas e-learning de código abierto que existen en el mercado. Al igual de muchos otros proyectos de código abierto, Chamilo está respaldado por una amplia comunidad de profesores, estudiantes, desarrolladores y creadores de contenido.
Si sabemos algo más de quien va a gestionar este sistema e-learning, podremos dar a conocer a otros que nuestro software lo utiliza y a usted podremos informarle sobre eventos que pueden ser de su interés.
Cumplimentar este formulario, implica la aceptación de que la asociación Chamilo o sus miembros puedan enviarle información por correo electrónico sobre eventos importantes o actualizaciones en el software Chamilo. Esto ayudará a crecer a la comunidad como una entidad organizada, donde el flujo de información, se haga con respeto permanente a su tiempo y su privacidad.
De cualquier forma, tenga en cuenta que no tiene la obligación de rellenar este formulario. Si desea permanecer en el anonimato, perderemos la oportunidad de ofrecerle todos los privilegios de ser un administrador de portal registrado, pero respetaremos su decisión. Basta con dejar vacío este formulario y hacer clic en \"Siguiente\" para seguir instalando Chamilo.";
$CompanyActivity = "Sector";
$DateUnLock = "Desbloquear fecha";
@ -1467,11 +1500,11 @@ $CertificateOnlineLink = "Vínculo al certificado en línea";
$NewExercises = "Nuevo ejercicio";
$MyAverage = "Mi promedio";
$AllAttempts = "Todos los intentos";
$NoCookies = "Las cookies no están activadas en su navegador.
$NoCookies = "Las cookies no están activadas en su navegador.
Chamilo utiliza \"cookies\" para almacenar sus datos de conexión, por lo que no le será posible entrar si las cookies no están habilitadas. Por favor, cambie la configuración de su navegador y recargue esta página.";
$NoJavascript = "Su navegador no tiene activado JavaScript.
$NoJavascript = "Su navegador no tiene activado JavaScript.
Chamilo se sirve de JavaScript para proporcionar un interfaz más dinámico. Es probable que muchas prestaciones sigan funcionando pero otras no lo harán, especialmente las relacionadas con la usabilidad. Le recomendamos que cambie la configuración de su navegador y recargue esta página.";
$NoFlash = "Su navegador no tiene activado el soporte de Flash.
$NoFlash = "Su navegador no tiene activado el soporte de Flash.
Chamilo sólo se apoya en Flash para algunas de sus funciones por lo que su ausencia no le impedirá continuar. Pero si quiere beneficiarse del conjunto de las herramientas de Chamilo, le recomendamos que instale-active el plugin de Flash y reinicialice su navegador.";
$Attempt = "Intento";
$SaveForNow = "Guardar y continuar más tarde";
@ -1552,7 +1585,7 @@ $LoginX = "Nombre de usuario: %s";
$ChatConnected = "Chat (Conectado)";
$ChatDisconnected = "Chat (Desconectado)";
$ThingsToDo = "Primeras actividades sugeridas";
$WamiFlashDialog = "Se mostrará un cuadro de diálogo en el que se le pedirá permiso para poder acceder al micrófono, responda afirmativamente y cierre el cuadro de diálogo (si no desea que vuelva a aparecer, antes de cerrar marque la opción
$WamiFlashDialog = "Se mostrará un cuadro de diálogo en el que se le pedirá permiso para poder acceder al micrófono, responda afirmativamente y cierre el cuadro de diálogo (si no desea que vuelva a aparecer, antes de cerrar marque la opción
recordar)";
$WamiStartRecorder = "Inicie la grabación pulsando el micrófono y deténgala pulsándolo de nuevo. Cada vez que haga esto se generará un archivo.";
$InputNameHere = "Escriba el nombre aquí";
@ -1643,8 +1676,4 @@ $DataTableSearch = "Buscar";
$HideColumn = "Ocultar columna";
$DisplayColumn = "Mostrar columna";
$LegalAgreementAccepted = "Condiciones legales aceptadas";
$FieldTypeMobilePhoneNumber = "Número de móvil";
$CountryDialCode = "Incluya el prefijo de llamada del país";
$MobilePhoneNumberWrong = "El número de móvil que ha escrito está incompleto o contiene caracteres no válidos.";
$SessionName = "Nombre de la sesión";
?>
?>
Loading…
Cancel
Save