swad-core/swad_attendance.h

125 lines
4.3 KiB
C
Raw Normal View History

2014-12-01 23:55:08 +01:00
// swad_attendance.h: control of attendance
#ifndef _SWAD_ATT
#define _SWAD_ATT
/*
SWAD (Shared Workspace At a Distance),
is a web platform developed at the University of Granada (Spain),
and used to support university teaching.
This file is part of SWAD core.
2017-01-13 01:51:23 +01:00
Copyright (C) 1999-2017 Antonio Ca<EFBFBD>as Vargas
2014-12-01 23:55:08 +01:00
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*****************************************************************************/
/********************************* Headers ***********************************/
/*****************************************************************************/
#include "swad_date.h"
#include "swad_user.h"
/*****************************************************************************/
/************************** Public types and constants ***********************/
/*****************************************************************************/
2017-03-07 01:56:41 +01:00
#define Att_MAX_CHARS_ATTENDANCE_EVENT_TITLE (256 - 1)
#define Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE (Att_MAX_CHARS_ATTENDANCE_EVENT_TITLE * Str_MAX_BYTES_PER_CHAR)
2014-12-01 23:55:08 +01:00
#define Att_NUM_DATES 2
typedef enum
{
Att_START_TIME = 0,
Att_END_TIME = 1,
} Att_StartOrEndTime_t;
struct AttendanceEvent
{
2017-01-17 14:52:13 +01:00
/* Fields stored in database */
2014-12-01 23:55:08 +01:00
long AttCod;
long CrsCod;
bool Hidden;
long UsrCod;
2015-10-23 13:20:42 +02:00
time_t TimeUTC[Att_NUM_DATES];
2014-12-01 23:55:08 +01:00
bool Open;
2017-03-07 01:56:41 +01:00
char Title[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1];
2014-12-01 23:55:08 +01:00
bool CommentTchVisible;
2017-01-17 14:52:13 +01:00
/* Fields computed, not associated to the event in database */
2014-12-01 23:55:08 +01:00
unsigned NumStdsTotal; // Number total of students who have assisted to the event
unsigned NumStdsFromList; // Number of students (taken from a list) who has assisted to the event
2017-01-17 14:52:13 +01:00
bool Selected; // I have selected this attendance event
2014-12-01 23:55:08 +01:00
};
typedef enum
{
Att_NEWEST_FIRST,
Att_OLDEST_FIRST,
} Att_OrderTime_t;
2017-01-29 12:42:19 +01:00
#define Att_ORDER_DEFAULT Dat_START_TIME
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
/***************************** Public prototypes *****************************/
/*****************************************************************************/
void Att_SeeAttEvents (void);
2017-01-29 12:42:19 +01:00
void Att_PutHiddenParamAttOrder (void);
2014-12-01 23:55:08 +01:00
void Att_RequestCreatOrEditAttEvent (void);
bool Att_GetDataOfAttEventByCod (struct AttendanceEvent *Att);
void Att_FreeListAttEvents (void);
void Att_PutParamAttCod (long AttCod);
long Att_GetParamAttCod (void);
2016-09-06 18:29:13 +02:00
2014-12-01 23:55:08 +01:00
void Att_AskRemAttEvent (void);
2016-09-06 18:29:13 +02:00
void Att_GetAndRemAttEvent (void);
void Att_RemoveAttEventFromDB (long AttCod);
2014-12-01 23:55:08 +01:00
void Att_HideAttEvent (void);
void Att_ShowAttEvent (void);
void Att_RecFormAttEvent (void);
void Att_CreateAttEvent (struct AttendanceEvent *Att,const char *Txt);
void Att_UpdateAttEvent (struct AttendanceEvent *Att,const char *Txt);
bool Att_CheckIfAttEventIsAssociatedToGrps (long AttCod);
bool Att_CheckIfAttEventIsAssociatedToGrp (long AsgCod,long GrpCod);
2016-09-06 18:29:13 +02:00
void Att_RemoveGroupsOfType (long GrpTypCod);
void Att_RemoveGroup (long GrpCod);
2014-12-01 23:55:08 +01:00
void Att_RemoveUsrFromAllAttEvents (long UsrCod);
void Att_RemoveUsrFromCrsAttEvents (long UsrCod,long CrsCod);
2016-09-06 18:29:13 +02:00
2014-12-01 23:55:08 +01:00
void Att_RemoveCrsAttEvents (long CrsCod);
2016-09-06 18:29:13 +02:00
2014-12-01 23:55:08 +01:00
unsigned Att_GetNumAttEventsInCrs(long CrsCod);
unsigned Att_GetNumCoursesWithAttEvents (Sco_Scope_t Scope);
unsigned Att_GetNumAttEvents (Sco_Scope_t Scope,unsigned *NumNotif);
void Att_SeeOneAttEvent (void);
void Att_RegisterMeAsStdInAttEvent (void);
void Att_RegisterStudentsInAttEvent (void);
void Att_RegUsrInAttEventNotChangingComments (long AttCod,long UsrCod);
void Att_RemoveUsrsAbsentWithoutCommentsFromAttEvent (long AttCod);
2015-11-13 01:27:44 +01:00
void Usr_ReqListStdsAttendanceCrs (void);
void Usr_ListMyAttendanceCrs (void);
void Usr_PrintMyAttendanceCrs (void);
void Usr_ListStdsAttendanceCrs (void);
void Usr_PrintStdsAttendanceCrs (void);
2014-12-01 23:55:08 +01:00
#endif