swad-core/swad_exam_event.h

95 lines
3.7 KiB
C
Raw Normal View History

2020-04-20 01:26:46 +02:00
// swad_exam_event.h: exam events (each ocurrence of an exam)
#ifndef _SWAD_EXA_EVE
#define _SWAD_EXA_EVE
/*
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.
Copyright (C) 1999-2020 Antonio Ca<EFBFBD>as Vargas
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 ***********************************/
/*****************************************************************************/
2020-05-05 21:49:00 +02:00
#include "swad_exam_type.h"
2020-04-20 01:26:46 +02:00
#include "swad_test.h"
/*****************************************************************************/
/************************** Public types and constants ***********************/
/*****************************************************************************/
2020-04-22 03:15:04 +02:00
#define ExaEvt_NEW_EVENT_SECTION_ID "new_event"
2020-04-20 01:26:46 +02:00
#define ExaEvt_AFTER_LAST_QUESTION ((unsigned)((1UL << 31) - 1)) // 2^31 - 1, don't change this number because it is used in database to indicate that a event is finished
struct ExaEvt_UsrAnswer
{
int NumOpt; // < 0 ==> no answer selected
int AnsInd; // < 0 ==> no answer selected
};
/*****************************************************************************/
/***************************** Public prototypes *****************************/
/*****************************************************************************/
2020-04-23 23:09:28 +02:00
void ExaEvt_ResetEvent (struct ExaEvt_Event *Event);
2020-04-20 01:26:46 +02:00
void ExaEvt_ListEvents (struct Exa_Exams *Exams,
struct Exa_Exam *Exam,
2020-05-05 21:49:00 +02:00
struct ExaEvt_Event *Event,
bool PutFormEvent);
2020-04-22 03:15:04 +02:00
void ExaEvt_GetDataOfEventByCod (struct ExaEvt_Event *Event);
2020-05-15 01:07:46 +02:00
bool ExaEvt_CheckIfEventIsVisibleAndOpen (long EvtCod);
2020-04-20 01:26:46 +02:00
2020-05-16 02:04:36 +02:00
void ExaEvt_ToggleVisResultsEvtUsr (void);
2020-04-20 01:26:46 +02:00
void ExaEvt_RequestRemoveEvent (void);
void ExaEvt_RemoveEvent (void);
void ExaEvt_RemoveEventsInExamFromAllTables (long ExaCod);
void ExaEvt_RemoveEventInCourseFromAllTables (long CrsCod);
void ExaEvt_RemoveUsrFromEventTablesInCrs (long UsrCod,long CrsCod);
2020-05-05 20:09:28 +02:00
void ExaEvt_HideEvent (void);
void ExaEvt_UnhideEvent (void);
2020-04-20 01:26:46 +02:00
void ExaEvt_PutParamsEdit (void *Exams);
void ExaEvt_GetAndCheckParameters (struct Exa_Exams *Exams,
struct Exa_Exam *Exam,
2020-04-22 03:15:04 +02:00
struct ExaEvt_Event *Event);
2020-04-20 01:26:46 +02:00
long ExaEvt_GetParamEvtCod (void);
2020-04-28 03:14:25 +02:00
void ExaEvt_PutButtonNewEvent (struct Exa_Exams *Exams,long ExaCod);
2020-05-05 21:49:00 +02:00
void ExaEvt_RequestCreatOrEditEvent (void);
void ExaEvt_ReceiveFormEvent (void);
2020-04-20 01:26:46 +02:00
void ExaEvt_RemoveGroup (long GrpCod);
void ExaEvt_RemoveGroupsOfType (long GrpTypCod);
unsigned ExaEvt_GetNumEventsInExam (long ExaCod);
2020-05-07 01:14:50 +02:00
unsigned ExaEvt_GetNumOpenEventsInExam (long ExaCod);
2020-04-20 01:26:46 +02:00
2020-05-15 01:07:46 +02:00
bool ExaEvt_CheckIfICanAnswerThisEvent (const struct ExaEvt_Event *Event);
2020-05-16 02:04:36 +02:00
bool ExaEvt_CheckIfICanListThisEventBasedOnGrps (long EvtCod);
2020-04-20 01:26:46 +02:00
void ExaEvt_GetQstAnsFromDB (long EvtCod,long UsrCod,unsigned QstInd,
struct ExaEvt_UsrAnswer *UsrAnswer);
#endif