<FIELDNAME="grade"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="100"SEQUENCE="false"ENUM="false"COMMENT="This is maximum grade for instance"PREVIOUS="name"/>
<FIELDNAME="grade"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="100"SEQUENCE="false"COMMENT="This is maximum grade for instance"PREVIOUS="name"/>
</FIELDS>
</FIELDS>
<KEYS>
<KEYS>
<KEYNAME="primary"TYPE="primary"FIELDS="id"COMMENT="Primary key for attforblock"/>
<KEYNAME="primary"TYPE="primary"FIELDS="id"COMMENT="Primary key for attforblock"/>
@ -20,15 +20,15 @@
</TABLE>
</TABLE>
<TABLENAME="attendance_sessions"COMMENT="attendance_sessions table retrofitted from MySQL"PREVIOUS="attforblock"NEXT="attendance_log">
<TABLENAME="attendance_sessions"COMMENT="attendance_sessions table retrofitted from MySQL"PREVIOUS="attforblock"NEXT="attendance_log">
<FIELDNAME="statusid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"ENUM="false"COMMENT="link with attendance_status table"PREVIOUS="studentid"NEXT="statusset"/>
<FIELDNAME="statusid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="link with attendance_status table"PREVIOUS="studentid"NEXT="statusset"/>
<FIELDNAME="timetaken"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"ENUM="false"COMMENT="When attendance of this student was taken"PREVIOUS="statusset"NEXT="takenby"/>
<FIELDNAME="timetaken"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="When attendance of this student was taken"PREVIOUS="statusset"NEXT="takenby"/>
@ -89,7 +89,7 @@ $string['nosessionexists'] = 'No Session exists for this course';
$string['notfound'] = 'Attendance activity not found in this course!';
$string['notfound'] = 'Attendance activity not found in this course!';
$string['olddate'] = 'Old date';
$string['olddate'] = 'Old date';
$string['period'] = 'Frequency';
$string['period'] = 'Frequency';
$string['remarks'] = 'Remarks';
$string['pluginname'] = 'Attendance';
$string['report'] = 'Report';
$string['report'] = 'Report';
$string['resetdescription'] = 'Remember that deleting attendance data will erase information from database. You can just hide older sessions having changed start date of course!';
$string['resetdescription'] = 'Remember that deleting attendance data will erase information from database. You can just hide older sessions having changed start date of course!';
$string['resetstatuses'] = 'Reset statuses to default';
$string['resetstatuses'] = 'Reset statuses to default';
@ -89,6 +89,7 @@ $string['nosessionexists'] = 'No existen Sesiones para este curso';
$string['notfound'] = 'No se ha encontrado ninguna actividad Asistencia en este curso';
$string['notfound'] = 'No se ha encontrado ninguna actividad Asistencia en este curso';
$string['olddate'] = 'Fecha Anterior';
$string['olddate'] = 'Fecha Anterior';
$string['period'] = 'Frecuencia';
$string['period'] = 'Frecuencia';
$string['pluginname'] = 'Asistencia';
$string['remarks'] = 'Observaciones';
$string['remarks'] = 'Observaciones';
$string['report'] = 'Informe';
$string['report'] = 'Informe';
$string['resetdescription'] = 'Recuerde que eliminando los datos de la asistencia provocará el borrado de información en la base de datos. Usted puede ocultar sesiones anteriores cambiando la fecha de inicio del curso en la zona de administración.';
$string['resetdescription'] = 'Recuerde que eliminando los datos de la asistencia provocará el borrado de información en la base de datos. Usted puede ocultar sesiones anteriores cambiando la fecha de inicio del curso en la zona de administración.';
if(!count_records_select('attendance_sessions', "courseid = $course->id AND sessdate >= $course->startdate")) { // no session exists for this course
if(!$DB->count_records_select('attendance_sessions', "courseid = ? AND sessdate >= ?", array($course->id, $course->startdate))) { // no session exists for this course