*** empty log message ***
This commit is contained in:
@@ -0,0 +1,256 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Documentos de Moodle: Reglas para el código</title>
|
||||
<link rel="stylesheet" href="../theme/standard/styles.php"
|
||||
type="TEXT/CSS">
|
||||
<meta http-equiv="Content-Type"
|
||||
content="text/html; charset=iso-8859-1">
|
||||
<style type="text/css">
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
li {
|
||||
|
||||
padding-top: 10px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.question {
|
||||
|
||||
|
||||
|
||||
font-size: medium;
|
||||
|
||||
|
||||
|
||||
font-weight: bold;
|
||||
|
||||
|
||||
|
||||
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
|
||||
|
||||
|
||||
|
||||
border: 1px dotted;
|
||||
|
||||
|
||||
|
||||
padding: 10px;
|
||||
|
||||
|
||||
|
||||
background-color: #EEEEEE;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.answer {
|
||||
|
||||
|
||||
|
||||
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
|
||||
|
||||
|
||||
|
||||
font-size: medium;
|
||||
|
||||
|
||||
|
||||
border: none;
|
||||
|
||||
|
||||
|
||||
padding-left: 40px;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
-->
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
<style type="text/css">
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
|
||||
|
||||
.normaltext {
|
||||
|
||||
|
||||
|
||||
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
|
||||
|
||||
|
||||
|
||||
font-size: medium;
|
||||
|
||||
|
||||
|
||||
border: none;
|
||||
|
||||
|
||||
|
||||
padding-left: 10px;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.answercode {
|
||||
|
||||
|
||||
|
||||
font-family: "Courier New", Courier, mono;
|
||||
|
||||
|
||||
|
||||
font-size: small;
|
||||
|
||||
|
||||
|
||||
border: none;
|
||||
|
||||
|
||||
|
||||
padding-left: 60px;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.questionlink {
|
||||
|
||||
|
||||
|
||||
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
|
||||
|
||||
|
||||
|
||||
font-size: medium;
|
||||
|
||||
|
||||
|
||||
border: none;
|
||||
|
||||
|
||||
|
||||
padding-left: 40px;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
-->
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
<style type="text/css">
|
||||
|
||||
<!--
|
||||
|
||||
.examplecode {
|
||||
|
||||
font-family: "Courier New", Courier, mono;
|
||||
|
||||
font-size: small;
|
||||
|
||||
border: thin dashed #999999;
|
||||
|
||||
background-color: #FBFBFB;
|
||||
|
||||
margin: auto;
|
||||
|
||||
padding: 30px;
|
||||
|
||||
height: auto;
|
||||
|
||||
width: auto;
|
||||
|
||||
}
|
||||
|
||||
-->
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body bgcolor="#ffffff">
|
||||
<h2>Reglas generales para generar código en Moodle<br>
|
||||
</h2>
|
||||
<h2 class="normaltext">Reglas Generales<br>
|
||||
</h2>
|
||||
<ol class="normaltext">
|
||||
<li>Todos los archivos deben utilizar la extensión .php.</li>
|
||||
<li>Deben mantenerse todas las notas de copyright. Ud. puede colocar
|
||||
la suya si es necesario.</li>
|
||||
<li>Cada archivo debe incluir el config.php principal.</li>
|
||||
<li>Cada archivo debe certificar que el usuario esté
|
||||
correctamente autenticado, utilizando require_login() and isadmin(),
|
||||
isteacher(), iscreator() o isstudent().</li>
|
||||
<li>Todo acceso a la base de datos debe utilizar las funciones
|
||||
incluidas en lib/datalib.php en cuanto sea posible --esto permite la
|
||||
compatibilidad entre un amplio rango de bases de datos. Con esas
|
||||
funciones es posible hacer casi todo. Cualquier otra instrucción
|
||||
SQL debe ser: inter-plataforma, restringida a funciones
|
||||
específicas dentro del código (a menudo un archivo
|
||||
lib.php), y señalado con claridad.</li>
|
||||
<li>Todas las cadenas deben ser traducibles --crear nuevos textos en
|
||||
los archivos de "lang/en" y llamarlos utilizando get_string() o
|
||||
print_string().</li>
|
||||
<li>Todos los archivos de ayuda deben ser traducibles --crear nuevos
|
||||
textos en los archivos de "lang/en/help" y llamarlos utilizando
|
||||
helpbutton().</li>
|
||||
</ol>
|
||||
<p> </p>
|
||||
<h2 class="normaltext">Coding Style</h2>
|
||||
<ol class="normaltext">
|
||||
<li>No utilice tabuladores. Use sangría consistente con 4
|
||||
espacio.</li>
|
||||
<li>Siempre se deben utilizar llaves para los bloques de
|
||||
código (aunque sean de una sola línea). Moodle usa este
|
||||
estilo:
|
||||
<p class="examplecode"> <font color="#006600">if (</font><font
|
||||
color="#0000cc">$quiz</font><font color="#006600">-></font><font
|
||||
color="#0000cc">attempts</font><font color="#006600">) {<br>
|
||||
if (</font><font color="#0000cc">$numattempts </font><font
|
||||
color="#006600">> </font><font color="#0000cc">$quiz</font><font
|
||||
color="#006600">-></font><font color="#0000cc">attempts</font><font
|
||||
color="#006600">) {<br>
|
||||
</font><font
|
||||
color="#0000cc">error</font><font color="#006600">(</font><font
|
||||
color="#cc0000">$strtoomanyattempts</font><font color="#006600">, </font><font
|
||||
color="#cc0000">"view.php?id=$cm</font><font color="#006600">-></font><font
|
||||
color="#cc0000">id"</font><font color="#006600">);<br>
|
||||
}<br>
|
||||
}</font></p>
|
||||
</li>
|
||||
<li>Más por venir... este documento aún no está
|
||||
completo.</li>
|
||||
</ol>
|
||||
<p align="center" class="normaltext"> </p>
|
||||
<hr>
|
||||
<p align="center"><font size="1"><a href="." target="_top">Moodle
|
||||
Documentation</a></font></p>
|
||||
<p align="center"><font size="1">Version: $Id: faq.html,v 1.6
|
||||
2003/03/30 13:54:28 moodler Exp $</font></p>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user