swad-core/swad_exam.h

119 lines
4.0 KiB
C
Raw Normal View History

2014-12-01 23:55:08 +01:00
// swad_exam.h: exam announcements
#ifndef _SWAD_EXA
#define _SWAD_EXA
/*
SWAD (Shared Workspace At a Distance in Spanish),
is a web platform developed at the University of Granada (Spain),
and used to support university teaching.
This file is part of SWAD core.
2019-01-07 21:52:19 +01:00
Copyright (C) 1999-2019 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 ***********************************/
/*****************************************************************************/
2015-10-16 02:24:29 +02:00
#include <stdbool.h> // For boolean type
2014-12-01 23:55:08 +01:00
2016-12-12 02:21:41 +01:00
#include "swad_constant.h"
2017-01-13 01:51:23 +01:00
#include "swad_course.h"
2016-12-12 02:21:41 +01:00
#include "swad_date.h"
2017-03-08 14:12:33 +01:00
#include "swad_notification.h"
2016-12-12 02:21:41 +01:00
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
/************************** Public types and constants ***********************/
/*****************************************************************************/
2016-12-27 11:33:13 +01:00
#define Exa_NUM_VIEWS 3
2014-12-01 23:55:08 +01:00
typedef enum
{
Exa_NORMAL_VIEW,
Exa_PRINT_VIEW,
2015-11-13 01:27:44 +01:00
Exa_FORM_VIEW,
} Exa_TypeViewExamAnnouncement_t;
2014-12-01 23:55:08 +01:00
2016-12-12 02:21:41 +01:00
#define Exa_NUM_STATUS 3
2014-12-01 23:55:08 +01:00
typedef enum
{
2016-12-12 02:21:41 +01:00
Exa_VISIBLE_EXAM_ANNOUNCEMENT = 0,
Exa_HIDDEN_EXAM_ANNOUNCEMENT = 1,
Exa_DELETED_EXAM_ANNOUNCEMENT = 2,
2014-12-01 23:55:08 +01:00
} Exa_ExamAnnouncementStatus_t; // Don't change these numbers because they are used in database
2017-03-08 14:12:33 +01:00
#define Exa_MAX_CHARS_SESSION (128 - 1) // 127
#define Exa_MAX_BYTES_SESSION ((Exa_MAX_CHARS_SESSION + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
2016-12-12 02:21:41 +01:00
struct ExamData
{
long CrsCod;
Exa_ExamAnnouncementStatus_t Status;
2017-03-08 14:12:33 +01:00
char CrsFullName[Hie_MAX_BYTES_FULL_NAME + 1];
2016-12-12 02:21:41 +01:00
unsigned Year; // Number of year (0 (N.A.), 1, 2, 3, 4, 5, 6) in the degree
2017-03-08 14:12:33 +01:00
char Session[Exa_MAX_BYTES_SESSION + 1]; // Exam session is june, september, etc.
2016-12-12 02:21:41 +01:00
struct Date CallDate;
struct Date ExamDate;
struct Hour StartTime;
struct Hour Duration;
char *Place;
char *Mode;
char *Structure;
char *DocRequired;
char *MatRequired;
char *MatAllowed;
char *OtherInfo;
};
2019-03-25 19:05:10 +01:00
struct Exa_ExamCodeAndDate
{
long ExaCod;
struct Date ExamDate;
};
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
/***************************** Public prototypes *****************************/
/*****************************************************************************/
void Exa_PutFrmEditAExamAnnouncement (void);
2016-12-12 02:21:41 +01:00
void Exa_ReceiveExamAnnouncement1 (void);
void Exa_ReceiveExamAnnouncement2 (void);
2014-12-01 23:55:08 +01:00
void Exa_PrintExamAnnouncement (void);
2016-12-11 21:02:22 +01:00
void Exa_ReqRemoveExamAnnouncement (void);
2016-12-12 02:21:41 +01:00
void Exa_RemoveExamAnnouncement1 (void);
void Exa_RemoveExamAnnouncement2 (void);
2019-03-25 19:05:10 +01:00
void Exa_HideExamAnnouncement (void);
void Exa_UnhideExamAnnouncement (void);
2016-12-12 02:21:41 +01:00
2014-12-01 23:55:08 +01:00
void Exa_FreeMemExamAnnouncement (void);
void Exa_FreeListExamAnnouncements (void);
void Exa_ListExamAnnouncementsSee (void);
2019-03-25 19:05:10 +01:00
void Exa_ListExamAnnouncementsEdit (void);
2016-06-01 19:34:44 +02:00
2016-06-03 10:37:00 +02:00
void Exa_GetExaCodToHighlight (void);
void Exa_GetDateToHighlight (void);
2016-06-01 19:34:44 +02:00
2016-12-12 02:21:41 +01:00
void Exa_CreateListDatesOfExamAnnouncements (void);
2016-06-03 10:37:00 +02:00
void Exa_PutHiddenParamExaCod (long ExaCod);
2019-03-25 19:05:10 +01:00
void Exa_SetAnchorStr (long ExaCod,char **Anchor);
void Exa_FreeAnchorStr (char *Anchor);
2017-03-08 14:12:33 +01:00
void Exa_GetSummaryAndContentExamAnnouncement (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
2017-01-15 22:58:26 +01:00
char **ContentStr,
2017-03-06 13:01:16 +01:00
long ExaCod,bool GetContent);
2014-12-01 23:55:08 +01:00
#endif