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.
|
2024-02-07 00:40:28 +01:00
|
|
|
|
Copyright (C) 1999-2024 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 ***********************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2021-09-13 23:55:28 +02:00
|
|
|
|
#include "swad_browser.h"
|
2014-12-01 23:55:08 +01:00
|
|
|
|
#include "swad_date.h"
|
2017-03-08 14:12:33 +01:00
|
|
|
|
#include "swad_notification.h"
|
2014-12-01 23:55:08 +01:00
|
|
|
|
#include "swad_user.h"
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************************** Public types and constants ***********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2017-03-08 14:12:33 +01:00
|
|
|
|
#define Asg_MAX_CHARS_ASSIGNMENT_TITLE (128 - 1) // 127
|
|
|
|
|
#define Asg_MAX_BYTES_ASSIGNMENT_TITLE ((Asg_MAX_CHARS_ASSIGNMENT_TITLE + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
|
2014-12-01 23:55:08 +01:00
|
|
|
|
|
|
|
|
|
#define Asg_NUM_TYPES_SEND_WORK 2
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
2024-04-19 12:00:30 +02:00
|
|
|
|
Asg_DONT_SEND_WORK = 0,
|
|
|
|
|
Asg_SEND_WORK = 1,
|
2014-12-01 23:55:08 +01:00
|
|
|
|
} Asg_SendWork_t;
|
|
|
|
|
|
2020-04-08 03:06:45 +02:00
|
|
|
|
struct Asg_Assignment
|
2014-12-01 23:55:08 +01:00
|
|
|
|
{
|
|
|
|
|
long AsgCod;
|
2023-06-06 22:18:31 +02:00
|
|
|
|
HidVis_HiddenOrVisible_t HiddenOrVisible;
|
2014-12-01 23:55:08 +01:00
|
|
|
|
long UsrCod;
|
2016-12-15 00:39:52 +01:00
|
|
|
|
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
2024-04-13 21:33:16 +02:00
|
|
|
|
CloOpe_ClosedOrOpen_t ClosedOrOpen;
|
2017-03-07 01:56:41 +01:00
|
|
|
|
char Title[Asg_MAX_BYTES_ASSIGNMENT_TITLE + 1];
|
2014-12-01 23:55:08 +01:00
|
|
|
|
Asg_SendWork_t SendWork;
|
2017-03-08 22:23:52 +01:00
|
|
|
|
char Folder[Brw_MAX_BYTES_FOLDER + 1];
|
2024-04-19 12:00:30 +02:00
|
|
|
|
Usr_Can_t ICanDo; // 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
|
|
|
|
};
|
|
|
|
|
|
2022-09-29 21:35:08 +02:00
|
|
|
|
struct Asg_Assignments
|
|
|
|
|
{
|
|
|
|
|
bool LstIsRead; // Is the list already read from database...
|
|
|
|
|
// ...or it needs to be read?
|
|
|
|
|
unsigned Num; // Number of assignments
|
|
|
|
|
long *LstAsgCods; // List of assigment codes
|
|
|
|
|
Dat_StartEndTime_t SelectedOrder;
|
|
|
|
|
unsigned CurrentPage;
|
|
|
|
|
struct Asg_Assignment Asg; // Selected/current assignment
|
|
|
|
|
};
|
|
|
|
|
|
2021-09-18 18:22:26 +02:00
|
|
|
|
#define Asg_ORDER_DEFAULT Dat_STR_TIME
|
2014-12-01 23:55:08 +01:00
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/***************************** Public prototypes *****************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2022-09-21 10:46:14 +02:00
|
|
|
|
void Asg_ResetAssignments (struct Asg_Assignments *Assignments);
|
|
|
|
|
|
2014-12-01 23:55:08 +01:00
|
|
|
|
void Asg_SeeAssignments (void);
|
2022-09-21 10:46:14 +02:00
|
|
|
|
void Asg_ShowAllAssignments (struct Asg_Assignments *Assignments);
|
2022-09-21 00:48:44 +02:00
|
|
|
|
void Asg_SeeOneAssignment (void);
|
2017-05-02 10:24:47 +02:00
|
|
|
|
void Asg_PrintOneAssignment (void);
|
|
|
|
|
|
2022-09-21 10:46:14 +02:00
|
|
|
|
void Asg_ShowOneAssignmentInBox (struct Asg_Assignments *Assignments);
|
|
|
|
|
|
2023-03-10 00:13:55 +01:00
|
|
|
|
Dat_StartEndTime_t Asg_GetParAsgOrder (void);
|
2022-09-21 10:46:14 +02:00
|
|
|
|
|
2023-03-17 12:51:11 +01:00
|
|
|
|
void Asg_ReqCreatOrEditAsg (void);
|
2023-03-23 09:35:20 +01:00
|
|
|
|
void Asg_GetAssignmentDataByCod (struct Asg_Assignment *Asg);
|
|
|
|
|
void Asg_GetAssignmentDataByFolder (struct Asg_Assignment *Asg);
|
2014-12-01 23:55:08 +01:00
|
|
|
|
|
2017-03-08 14:12:33 +01:00
|
|
|
|
void Asg_GetNotifAssignment (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
|
2017-03-06 13:01:16 +01:00
|
|
|
|
char **ContentStr,
|
2023-11-05 19:44:03 +01:00
|
|
|
|
long AsgCod,Ntf_GetContent_t GetContent);
|
2014-12-01 23:55:08 +01:00
|
|
|
|
|
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);
|
2021-05-11 18:22:00 +02:00
|
|
|
|
void Asg_UnhideAssignment (void);
|
2024-03-20 09:39:04 +01:00
|
|
|
|
void Asg_ReceiveAssignment (void);
|
2014-12-01 23:55:08 +01:00
|
|
|
|
void Asg_RemoveCrsAssignments (long CrsCod);
|
|
|
|
|
|
2023-09-29 14:28:36 +02:00
|
|
|
|
void Asg_WriteDatesAssignment (const struct Asg_Assignment *Asg);
|
2024-04-19 12:00:30 +02:00
|
|
|
|
Usr_Can_t Asg_CheckIfICanCreateIntoAssigment (const struct Asg_Assignment *Asg);
|
2023-09-29 14:42:04 +02:00
|
|
|
|
void Asg_SetFolder (struct Asg_Assignment *Asg,unsigned Level);
|
2023-09-29 14:28:36 +02:00
|
|
|
|
|
2023-09-22 14:47:56 +02:00
|
|
|
|
unsigned Asg_GetNumAssignments (Hie_Level_t Level,unsigned *NumNotif);
|
2014-12-01 23:55:08 +01:00
|
|
|
|
|
2022-01-03 02:47:16 +01:00
|
|
|
|
//-------------------------------- Figures ------------------------------------
|
|
|
|
|
void Asg_GetAndShowAssignmentsStats (void);
|
|
|
|
|
|
2014-12-01 23:55:08 +01:00
|
|
|
|
#endif
|