swad-core/swad_assignment.h

98 lines
3.4 KiB
C
Raw Normal View History

2014-12-01 23:55:08 +01:00
// swad_assignment.h: assignments
#ifndef _SWAD_ASG
#define _SWAD_ASG
/*
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-01-13 01:51:23 +01:00
#define Asg_MAX_LENGTH_ASSIGNMENT_TITLE (256-1)
2014-12-01 23:55:08 +01:00
#define Asg_MAX_LENGTH_FOLDER 32
#define Asg_NUM_TYPES_SEND_WORK 2
typedef enum
{
Asg_DO_NOT_SEND_WORK = 0,
Asg_SEND_WORK = 1,
} Asg_SendWork_t;
struct Assignment
{
long AsgCod;
bool Hidden;
long UsrCod;
2016-12-15 00:39:52 +01:00
time_t TimeUTC[Dat_NUM_START_END_TIME];
2014-12-01 23:55:08 +01:00
bool Open;
2017-01-17 03:10:43 +01:00
char Title[Asg_MAX_LENGTH_ASSIGNMENT_TITLE + 1];
2014-12-01 23:55:08 +01:00
Asg_SendWork_t SendWork;
2017-01-17 03:10:43 +01:00
char Folder[Asg_MAX_LENGTH_FOLDER + 1];
2015-11-10 02:23:55 +01:00
bool IBelongToCrsOrGrps; // I can do this assignment
// (it is associated to no groups
// or, if associated to groups,
// I belong to any of the groups)
2014-12-01 23:55:08 +01:00
};
2017-01-29 12:42:19 +01:00
#define Asg_ORDER_DEFAULT Dat_START_TIME
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
/***************************** Public prototypes *****************************/
/*****************************************************************************/
void Asg_SeeAssignments (void);
2017-01-29 12:42:19 +01:00
void Asg_PutHiddenParamAsgOrder (void);
2014-12-01 23:55:08 +01:00
void Asg_RequestCreatOrEditAsg (void);
void Asg_GetListAssignments (void);
void Asg_GetDataOfAssignmentByCod (struct Assignment *Asg);
void Asg_GetDataOfAssignmentByFolder (struct Assignment *Asg);
void Asg_FreeListAssignments (void);
2017-03-06 13:01:16 +01:00
void Asg_GetNotifAssignment (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
char **ContentStr,
long AsgCod,bool GetContent);
2014-12-01 23:55:08 +01:00
long Asg_GetParamAsgCod (void);
2016-12-11 21:02:22 +01:00
void Asg_ReqRemAssignment (void);
2014-12-01 23:55:08 +01:00
void Asg_RemoveAssignment (void);
void Asg_HideAssignment (void);
void Asg_ShowAssignment (void);
void Asg_RecFormAssignment (void);
bool Asg_CheckIfAsgIsAssociatedToGrp (long AsgCod,long GrpCod);
void Asg_RemoveGroup (long GrpCod);
void Asg_RemoveGroupsOfType (long GrpTypCod);
void Asg_RemoveCrsAssignments (long CrsCod);
unsigned Asg_GetNumAssignmentsInCrs(long CrsCod);
unsigned Asg_GetNumCoursesWithAssignments (Sco_Scope_t Scope);
unsigned Asg_GetNumAssignments (Sco_Scope_t Scope,unsigned *NumNotif);
#endif