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 .
2024-02-07 00:40:28 +01:00
Copyright ( C ) 1999 - 2024 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 ,
2023-11-06 00:32:41 +01:00
Frm_PutForm_t PutFormSession ) ;
2023-03-23 09:35:20 +01:00
void ExaSes_GetSessionDataByCod ( 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
2023-03-17 12:51:11 +01:00
void ExaSes_ReqRemSession ( void ) ;
2020-05-17 02:28:30 +02:00
void ExaSes_RemoveSession ( void ) ;
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
2023-03-10 00:13:55 +01:00
void ExaSes_PutParsEdit ( void * Exams ) ;
void ExaSes_GetAndCheckPars ( struct Exa_Exams * Exams ,
2023-03-27 09:14:16 +02:00
struct ExaSes_Session * Session ) ;
2020-04-20 01:26:46 +02:00
2023-03-17 12:51:11 +01:00
void ExaSes_ReqCreatOrEditSes ( void ) ;
2024-03-20 09:39:04 +01:00
void ExaSes_ReceiveSession ( void ) ;
2020-04-20 01:26:46 +02:00
2024-04-19 12:00:30 +02:00
Usr_Can_t ExaSes_CheckIfICanAnswerThisSession ( const struct Exa_Exam * Exam ,
2024-04-01 17:59:51 +02:00
const struct ExaSes_Session * Session ) ;
2024-04-19 12:00:30 +02:00
Usr_Can_t ExaSes_CheckIfICanListThisSessionBasedOnGrps ( long SesCod ) ;
2020-04-20 01:26:46 +02:00
# endif