swad-core/swad_exam_session.h

77 lines
3.0 KiB
C
Raw Permalink Normal View History

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.
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,
Frm_PutForm_t PutFormSession);
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
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
void ExaSes_PutParsEdit (void *Exams);
void ExaSes_GetAndCheckPars (struct Exa_Exams *Exams,
struct ExaSes_Session *Session);
2020-04-20 01:26:46 +02:00
void ExaSes_ReqCreatOrEditSes (void);
void ExaSes_ReceiveSession (void);
2020-04-20 01:26:46 +02:00
Usr_ICan_t ExaSes_CheckIfICanAnswerThisSession (const struct Exa_Exam *Exam,
const struct ExaSes_Session *Session);
Usr_ICan_t ExaSes_CheckIfICanListThisSessionBasedOnGrps (long SesCod);
2020-04-20 01:26:46 +02:00
#endif