2020-05-17 02:28:30 +02:00
// swad_exam_session.h: exam sessions (each ocurrence of an exam)
2020-04-20 01:26:46 +02:00
2020-05-17 02:28:30 +02:00
# ifndef _SWAD_EXA_SES
# define _SWAD_EXA_SES
2020-04-20 01:26:46 +02:00
/*
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 .
2021-02-09 12:43:45 +01:00
Copyright ( C ) 1999 - 2021 Antonio Ca <EFBFBD> as Vargas
2020-04-20 01:26:46 +02: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 ***********************************/
/*****************************************************************************/
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-05-17 02:28:30 +02:00
# define ExaSes_NEW_SESSION_SECTION_ID "new_session"
2020-04-20 01:26:46 +02:00
2020-05-17 02:28:30 +02:00
# define ExaSes_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 session is finished
2020-04-20 01:26:46 +02:00
2020-05-17 02:28:30 +02:00
struct ExaSes_UsrAnswer
2020-04-20 01:26:46 +02:00
{
int NumOpt ; // < 0 ==> no answer selected
int AnsInd ; // < 0 ==> no answer selected
} ;
/*****************************************************************************/
/***************************** Public prototypes *****************************/
/*****************************************************************************/
2020-05-17 02:28:30 +02:00
void ExaSes_ResetSession ( struct ExaSes_Session * Session ) ;
2020-04-23 23:09:28 +02:00
2020-05-17 02:28:30 +02:00
void ExaSes_ListSessions ( struct Exa_Exams * Exams ,
struct Exa_Exam * Exam ,
struct ExaSes_Session * Session ,
bool PutFormSession ) ;
void ExaSes_GetDataOfSessionByCod ( struct ExaSes_Session * Session ) ;
2020-04-20 01:26:46 +02:00
2020-05-17 02:28:30 +02:00
void ExaSes_ToggleVisResultsSesUsr ( void ) ;
2020-04-20 01:26:46 +02:00
2020-05-17 02:28:30 +02:00
void ExaSes_RequestRemoveSession ( void ) ;
void ExaSes_RemoveSession ( void ) ;
2020-04-20 01:26:46 +02:00
2020-05-17 02:28:30 +02:00
void ExaSes_RemoveSessionsInExamFromAllTables ( long ExaCod ) ;
void ExaSes_RemoveSessionInCourseFromAllTables ( long CrsCod ) ;
void ExaSes_RemoveUsrFromSessionTablesInCrs ( long UsrCod , long CrsCod ) ;
2020-04-20 01:26:46 +02:00
2020-05-17 02:28:30 +02:00
void ExaSes_HideSession ( void ) ;
void ExaSes_UnhideSession ( void ) ;
2020-05-05 20:09:28 +02:00
2020-05-17 02:28:30 +02:00
void ExaSes_PutParamsEdit ( void * Exams ) ;
2020-05-17 20:12:37 +02:00
void ExaSes_PutParamSesCod ( long SesCod ) ;
2020-05-17 02:28:30 +02:00
void ExaSes_GetAndCheckParameters ( struct Exa_Exams * Exams ,
2020-04-20 01:26:46 +02:00
struct Exa_Exam * Exam ,
2020-05-17 02:28:30 +02:00
struct ExaSes_Session * Session ) ;
long ExaSes_GetParamSesCod ( void ) ;
2020-04-20 01:26:46 +02:00
2020-05-17 02:28:30 +02:00
void ExaSes_PutButtonNewSession ( struct Exa_Exams * Exams , long ExaCod ) ;
void ExaSes_RequestCreatOrEditSession ( void ) ;
void ExaSes_ReceiveFormSession ( void ) ;
2020-04-20 01:26:46 +02:00
2020-05-17 02:28:30 +02:00
void ExaSes_RemoveGroup ( long GrpCod ) ;
void ExaSes_RemoveGroupsOfType ( long GrpTypCod ) ;
2020-04-20 01:26:46 +02:00
2020-05-17 02:28:30 +02:00
unsigned ExaSes_GetNumSessionsInExam ( long ExaCod ) ;
unsigned ExaSes_GetNumOpenSessionsInExam ( long ExaCod ) ;
2020-04-20 01:26:46 +02:00
2020-05-21 16:59:14 +02:00
bool ExaSes_CheckIfICanAnswerThisSession ( const struct Exa_Exam * Exam ,
const struct ExaSes_Session * Session ) ;
2020-05-17 02:28:30 +02:00
bool ExaSes_CheckIfICanListThisSessionBasedOnGrps ( long SesCod ) ;
2020-04-20 01:26:46 +02:00
# endif