mirror of https://github.com/acanas/swad-core.git
Version 20.96.2: Sep 08, 2021 Queries moved to module swad_exam_database.
This commit is contained in:
parent
0e5ed54fa2
commit
5611c0e7e7
|
@ -1017,7 +1017,7 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
|
|||
|
||||
/***** Remove test, exams and matches made by user in all courses *****/
|
||||
TstPrn_RemovePrintsMadeByUsrInAllCrss (UsrDat->UsrCod);
|
||||
Exa_DB_RemovePrintQuestionsMadeByUsrInAllCrss (UsrDat->UsrCod);
|
||||
Exa_DB_RemovePrintQstsMadeByUsrInAllCrss (UsrDat->UsrCod);
|
||||
Exa_DB_RemovePrintsMadeByUsrInAllCrss (UsrDat->UsrCod);
|
||||
Mch_RemoveMatchesMadeByUsrInAllCrss (UsrDat->UsrCod);
|
||||
|
||||
|
|
|
@ -602,13 +602,14 @@ TODO: FIX BUG, URGENT! En las fechas como par
|
|||
|
||||
TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo.
|
||||
*/
|
||||
#define Log_PLATFORM_VERSION "SWAD 20.96.1 (2021-07-30)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 20.96.2 (2021-09-08)"
|
||||
#define CSS_FILE "swad20.45.css"
|
||||
#define JS_FILE "swad20.69.1.js"
|
||||
/*
|
||||
TODO: Rename CENTRE to CENTER in help wiki.
|
||||
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
|
||||
|
||||
Version 20.96.2: Sep 08, 2021 Queries moved to module swad_exam_database. (314362 lines)
|
||||
Version 20.96.1: Jul 30, 2021 Fix bugs removing exams. (314373 lines)
|
||||
Version 20.96: Jul 27, 2021 Queries moved to module swad_exam_database. (314247 lines)
|
||||
Version 20.95.3: Jul 20, 2021 Queries moved to module swad_exam_database. (314210 lines)
|
||||
|
|
|
@ -3212,7 +3212,7 @@ static void Enr_EffectivelyRemUsrFromCrs (struct UsrData *UsrDat,
|
|||
|
||||
/* Remove tests, exams and matches results made by user in course */
|
||||
TstPrn_RemovePrintsMadeByUsrInCrs (UsrDat->UsrCod,Crs->CrsCod);
|
||||
Exa_DB_RemovePrintsQuestionsMadeByUsrInCrs (UsrDat->UsrCod,Crs->CrsCod);
|
||||
Exa_DB_RemovePrintQstsMadeByUsrInCrs (UsrDat->UsrCod,Crs->CrsCod);
|
||||
Exa_DB_RemovePrintsMadeByUsrInCrs (UsrDat->UsrCod,Crs->CrsCod);
|
||||
Mch_RemoveMatchesMadeByUsrInCrs (UsrDat->UsrCod,Crs->CrsCod);
|
||||
}
|
||||
|
|
20
swad_exam.c
20
swad_exam.c
|
@ -1078,12 +1078,14 @@ void Exa_RemoveExam (void)
|
|||
|
||||
static void Exa_RemoveExamFromAllTables (long ExaCod)
|
||||
{
|
||||
/***** Remove questions of exams prints, and exam prints, of this exam *****/
|
||||
Exa_DB_RemovePrintQuestionsFromExam (ExaCod);
|
||||
Exa_DB_RemovePrintsFromExam (ExaCod);
|
||||
/***** Remove questions of exams prints, and exam prints, in this exam *****/
|
||||
// TODO: DO NOT REMOVE EXAMS PRINTS. Instead move them to tables of deleted prints
|
||||
Exa_DB_RemovePrintQstsFromExa (ExaCod);
|
||||
Exa_DB_RemovePrintsFromExa (ExaCod);
|
||||
|
||||
/***** Remove all sessions in this exam *****/
|
||||
Exa_DB_RemoveSessionsInExamFromAllTables (ExaCod);
|
||||
/***** Remove groups associated to sessions, and sessions, in this exam *****/
|
||||
Exa_DB_RemoveGrpsFromExa (ExaCod);
|
||||
Exa_DB_RemoveSessionsFromExam (ExaCod);
|
||||
|
||||
/***** Remove media associated to exam questions in the exam *****/
|
||||
Exa_RemoveAllMedFilesFromStemOfAllQstsFromExam (ExaCod);
|
||||
|
@ -1108,11 +1110,13 @@ void Exa_RemoveCrsExams (long CrsCod)
|
|||
{
|
||||
/***** Remove questions of exams prints, and exam prints,
|
||||
made in the given course *****/
|
||||
Exa_DB_RemovePrintQuestionsFromCrs (CrsCod);
|
||||
// TODO: DO NOT REMOVE EXAMS PRINTS. Instead move them to tables of deleted prints
|
||||
Exa_DB_RemovePrintQstsFromCrs (CrsCod);
|
||||
Exa_DB_RemovePrintsFromCrs (CrsCod);
|
||||
|
||||
/***** Remove all sessions in the course *****/
|
||||
Exa_DB_RemoveSessionInCourseFromAllTables (CrsCod);
|
||||
/***** Remove groups associated to sessions, and sessions, in this course *****/
|
||||
Exa_DB_RemoveGrpsFromCrs (CrsCod);
|
||||
Exa_DB_RemoveSessionsFromCrs (CrsCod);
|
||||
|
||||
/***** Remove media associated to test questions in the course *****/
|
||||
Exa_RemoveAllMedFilesFromStemOfAllQstsFromCrs (CrsCod);
|
||||
|
|
|
@ -873,26 +873,6 @@ void Exa_DB_HideUnhideSession (const struct ExaSes_Session *Session,bool Hide)
|
|||
|
||||
void Exa_DB_RemoveSessionFromAllTables (long SesCod)
|
||||
{
|
||||
/* To delete orphan exam prints:
|
||||
// DELETE FROM exa_print_questions WHERE PrnCod IN (SELECT PrnCod FROM exa_prints WHERE SesCod NOT IN (SELECT SesCod FROM exa_sessions));
|
||||
// DELETE FROM exa_prints WHERE SesCod NOT IN (SELECT SesCod FROM exa_sessions);
|
||||
*/
|
||||
/***** Remove exam prints in this session *****/
|
||||
/*
|
||||
* TODO: DO NOT REMOVE EXAMS PRINTS. Instead move them to tables of deleted prints
|
||||
DB_QueryDELETE ("can not remove exam print questions in exam session",
|
||||
"DELETE FROM exa_print_questions"
|
||||
" USING exa_print_questions,
|
||||
"exa_prints"
|
||||
" WHERE exa_prints.SesCod=%ld"
|
||||
" AND exa_prints.PrnCod=exa_print_questions.PrnCod",
|
||||
SesCod);
|
||||
DB_QueryDELETE ("can not remove exam prints in exam session",
|
||||
"DELETE FROM exa_prints"
|
||||
" WHERE exa_prints.SesCod=%ld",
|
||||
SesCod);
|
||||
*/
|
||||
|
||||
/***** Remove groups associated to this exam session *****/
|
||||
DB_QueryDELETE ("can not remove groups associated to exam session",
|
||||
"DELETE FROM exa_groups"
|
||||
|
@ -907,42 +887,11 @@ void Exa_DB_RemoveSessionFromAllTables (long SesCod)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**************** Remove exam session in exam from all tables ****************/
|
||||
/*********************** Remove exam sessions from exam **********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemoveSessionsInExamFromAllTables (long ExaCod)
|
||||
void Exa_DB_RemoveSessionsFromExam (long ExaCod)
|
||||
{
|
||||
/***** Remove exam prints in this session *****/
|
||||
/*
|
||||
* TODO: DO NOT REMOVE EXAMS PRINTS. Instead move them to tables of deleted prints
|
||||
DB_QueryDELETE ("can not remove exam print questions in exam",
|
||||
"DELETE FROM exa_print_questions"
|
||||
" USING exa_print_questions,
|
||||
"exa_prints,
|
||||
"exa_sessions"
|
||||
" WHERE exa_sessions.ExaCod=%ld"
|
||||
" AND exa_sessions.SesCod=exa_prints.SesCod"
|
||||
" AND exa_prints.PrnCod=exa_print_questions.PrnCod",
|
||||
ExaCod);
|
||||
DB_QueryDELETE ("can not remove exam prints in exam",
|
||||
"DELETE FROM exa_prints"
|
||||
" USING exa_prints,
|
||||
"exa_sessions"
|
||||
" WHERE exa_sessions.ExaCod=%ld"
|
||||
" AND exa_sessions.SesCod=exa_prints.SesCod",
|
||||
ExaCod);
|
||||
*/
|
||||
|
||||
/***** Remove groups associated to exam sessions of this exam *****/
|
||||
DB_QueryDELETE ("can not remove groups associated to sessions of an exam",
|
||||
"DELETE FROM exa_groups"
|
||||
" USING exa_sessions,"
|
||||
"exa_groups"
|
||||
" WHERE exa_sessions.ExaCod=%ld"
|
||||
" AND exa_sessions.SesCod=exa_groups.SesCod",
|
||||
ExaCod);
|
||||
|
||||
/***** Remove sessions from main table *****/
|
||||
DB_QueryDELETE ("can not remove sessions of an exam",
|
||||
"DELETE FROM exa_sessions"
|
||||
" WHERE ExaCod=%ld",
|
||||
|
@ -950,48 +899,11 @@ void Exa_DB_RemoveSessionsInExamFromAllTables (long ExaCod)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*************** Remove exam session in course from all tables ***************/
|
||||
/********************** Remove exam sessions from course *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemoveSessionInCourseFromAllTables (long CrsCod)
|
||||
void Exa_DB_RemoveSessionsFromCrs (long CrsCod)
|
||||
{
|
||||
/***** Remove exam prints in this course *****/
|
||||
/*
|
||||
* TODO: DO NOT REMOVE EXAMS PRINTS. Instead move them to tables of deleted prints
|
||||
DB_QueryDELETE ("can not remove exam print questions in course",
|
||||
"DELETE FROM exa_print_questions"
|
||||
" USING exa_print_questions,
|
||||
"exa_prints,
|
||||
"exa_sessions,
|
||||
"exa_exams"
|
||||
" WHERE exa_exams.CrsCod=%ld"
|
||||
" AND exa_exams.ExaCod=exa_sessions"
|
||||
" AND exa_sessions.SesCod=exa_prints.SesCod"
|
||||
" AND exa_prints.PrnCod=exa_print_questions.PrnCod",
|
||||
CrsCod);
|
||||
DB_QueryDELETE ("can not remove exam print questions in course",
|
||||
"DELETE FROM exa_prints"
|
||||
" USING exa_prints,
|
||||
"exa_sessions,
|
||||
"exa_exams"
|
||||
" WHERE exa_exams.CrsCod=%ld"
|
||||
" AND exa_exams.ExaCod=exa_sessions"
|
||||
" AND exa_sessions.SesCod=exa_prints.SesCod",
|
||||
CrsCod);
|
||||
*/
|
||||
|
||||
/***** Remove sessions from table of sessions groups *****/
|
||||
DB_QueryDELETE ("can not remove sessions of a course",
|
||||
"DELETE FROM exa_groups"
|
||||
" USING exa_exams,"
|
||||
"exa_sessions,"
|
||||
"exa_groups"
|
||||
" WHERE exa_exams.CrsCod=%ld"
|
||||
" AND exa_exams.ExaCod=exa_sessions.ExaCod"
|
||||
" AND exa_sessions.SesCod=exa_groups.SesCod",
|
||||
CrsCod);
|
||||
|
||||
/***** Remove sessions from exam sessions table *****/
|
||||
DB_QueryDELETE ("can not remove sessions of a course",
|
||||
"DELETE FROM exa_sessions"
|
||||
" USING exa_exams,"
|
||||
|
@ -1035,7 +947,7 @@ static void Exa_DB_RemoveUsrSesResultsInCrs (long UsrCod,long CrsCod,const char
|
|||
/**************** Create group associated to an exam session *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_CreateGrpAssociatedToSession (long SesCod,long GrpCod)
|
||||
void Exa_DB_CreateGrpAssociatedToSes (long SesCod,long GrpCod)
|
||||
{
|
||||
DB_QueryINSERT ("can not associate a group to an exam session",
|
||||
"INSERT INTO exa_groups"
|
||||
|
@ -1050,7 +962,7 @@ void Exa_DB_CreateGrpAssociatedToSession (long SesCod,long GrpCod)
|
|||
/*********** Get groups associated to an exam session from database **********/
|
||||
/*****************************************************************************/
|
||||
|
||||
unsigned Exa_DB_GetGrpsAssociatedToSession (MYSQL_RES **mysql_res,long SesCod)
|
||||
unsigned Exa_DB_GetGrpsAssociatedToSes (MYSQL_RES **mysql_res,long SesCod)
|
||||
{
|
||||
return (unsigned)
|
||||
DB_QuerySELECT (mysql_res,"can not get groups of an exam session",
|
||||
|
@ -1094,7 +1006,7 @@ bool Exa_DB_CheckIfICanListThisSessionBasedOnGrps (long SesCod)
|
|||
/******************** Remove all groups from one session *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemoveAllGrpsAssociatedToSession (long SesCod)
|
||||
void Exa_DB_RemoveGrpsFromSes (long SesCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove groups associated to a session",
|
||||
"DELETE FROM exa_groups"
|
||||
|
@ -1102,11 +1014,43 @@ void Exa_DB_RemoveAllGrpsAssociatedToSession (long SesCod)
|
|||
SesCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********* Remove groups associated to exam sessions of a given exam *********/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemoveGrpsFromExa (long ExaCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove groups associated to sessions of an exam",
|
||||
"DELETE FROM exa_groups"
|
||||
" USING exa_sessions,"
|
||||
"exa_groups"
|
||||
" WHERE exa_sessions.ExaCod=%ld"
|
||||
" AND exa_sessions.SesCod=exa_groups.SesCod",
|
||||
ExaCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******** Remove groups associated to exam sessions of a given course ********/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemoveGrpsFromCrs (long CrsCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove sessions of a course",
|
||||
"DELETE FROM exa_groups"
|
||||
" USING exa_exams,"
|
||||
"exa_sessions,"
|
||||
"exa_groups"
|
||||
" WHERE exa_exams.CrsCod=%ld"
|
||||
" AND exa_exams.ExaCod=exa_sessions.ExaCod"
|
||||
" AND exa_sessions.SesCod=exa_groups.SesCod",
|
||||
CrsCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**************** Remove groups of one type from all sessions ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemoveGroupsOfType (long GrpTypCod)
|
||||
void Exa_DB_RemoveGrpsOfType (long GrpTypCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove groups of a type"
|
||||
" from the associations between sessions and groups",
|
||||
|
@ -1122,7 +1066,7 @@ void Exa_DB_RemoveGroupsOfType (long GrpTypCod)
|
|||
/******************** Remove one group from all sessions *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemoveGrpAssociatedToExamSessions (long GrpCod)
|
||||
void Exa_DB_RemoveGrpAssociatedToExamSess (long GrpCod)
|
||||
{
|
||||
/***** Remove group from all the sessions *****/
|
||||
DB_QueryDELETE ("can not remove group"
|
||||
|
@ -1256,11 +1200,23 @@ void Exa_DB_RemovePrintsMadeByUsrInCrs (long UsrCod,long CrsCod)
|
|||
UsrCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************ Remove exams prints made in the given exam session *************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemovePrintsFromSes (long SesCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove exam prints in exam session",
|
||||
"DELETE FROM exa_prints"
|
||||
" WHERE exa_prints.SesCod=%ld",
|
||||
SesCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**************** Remove exams prints made in the given exam *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemovePrintsFromExam (long ExaCod)
|
||||
void Exa_DB_RemovePrintsFromExa (long ExaCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove exams prints in a course",
|
||||
"DELETE FROM exa_prints"
|
||||
|
@ -1378,7 +1334,7 @@ double Exa_DB_ComputeTotalScoreOfPrint (long PrnCod)
|
|||
/*************** Remove exam prints questions for a given user ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemovePrintQuestionsMadeByUsrInAllCrss (long UsrCod)
|
||||
void Exa_DB_RemovePrintQstsMadeByUsrInAllCrss (long UsrCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove exam prints made by a user",
|
||||
"DELETE FROM exa_print_questions"
|
||||
|
@ -1393,7 +1349,7 @@ void Exa_DB_RemovePrintQuestionsMadeByUsrInAllCrss (long UsrCod)
|
|||
/* Remove questions of exams prints made by the given user in a given course */
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemovePrintsQuestionsMadeByUsrInCrs (long UsrCod,long CrsCod)
|
||||
void Exa_DB_RemovePrintQstsMadeByUsrInCrs (long UsrCod,long CrsCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove exams prints made by a user in a course",
|
||||
"DELETE FROM exa_print_questions"
|
||||
|
@ -1410,11 +1366,26 @@ void Exa_DB_RemovePrintsQuestionsMadeByUsrInCrs (long UsrCod,long CrsCod)
|
|||
UsrCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************ Remove questions of exams prints in a given session ************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemovePrintQstsFromSes (long SesCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove exam print questions in exam session",
|
||||
"DELETE FROM exa_print_questions"
|
||||
" USING exa_prints,"
|
||||
"exa_print_questions"
|
||||
" WHERE exa_prints.SesCod=%ld"
|
||||
" AND exa_prints.PrnCod=exa_print_questions.PrnCod",
|
||||
SesCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************ Remove questions of exams prints in a given course *************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemovePrintQuestionsFromExam (long ExaCod)
|
||||
void Exa_DB_RemovePrintQstsFromExa (long ExaCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove exams prints in an exam",
|
||||
"DELETE FROM exa_print_questions"
|
||||
|
@ -1431,7 +1402,7 @@ void Exa_DB_RemovePrintQuestionsFromExam (long ExaCod)
|
|||
/************ Remove questions of exams prints in a given course *************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemovePrintQuestionsFromCrs (long CrsCod)
|
||||
void Exa_DB_RemovePrintQstsFromCrs (long CrsCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove exams prints in a course",
|
||||
"DELETE FROM exa_print_questions"
|
||||
|
|
|
@ -89,16 +89,18 @@ unsigned Exa_DB_GetDataOfSessionByCod (MYSQL_RES **mysql_res,long SesCod);
|
|||
void Exa_DB_ToggleVisResultsSesUsr (const struct ExaSes_Session *Session);
|
||||
void Exa_DB_HideUnhideSession (const struct ExaSes_Session *Session,bool Hide);
|
||||
void Exa_DB_RemoveSessionFromAllTables (long SesCod);
|
||||
void Exa_DB_RemoveSessionsInExamFromAllTables (long ExaCod);
|
||||
void Exa_DB_RemoveSessionInCourseFromAllTables (long CrsCod);
|
||||
void Exa_DB_RemoveSessionsFromExam (long ExaCod);
|
||||
void Exa_DB_RemoveSessionsFromCrs (long CrsCod);
|
||||
void Exa_DB_RemoveUsrFromSessionTablesInCrs (long UsrCod,long CrsCod);
|
||||
|
||||
void Exa_DB_CreateGrpAssociatedToSession (long SesCod,long GrpCod);
|
||||
unsigned Exa_DB_GetGrpsAssociatedToSession (MYSQL_RES **mysql_res,long SesCod);
|
||||
void Exa_DB_CreateGrpAssociatedToSes (long SesCod,long GrpCod);
|
||||
unsigned Exa_DB_GetGrpsAssociatedToSes (MYSQL_RES **mysql_res,long SesCod);
|
||||
bool Exa_DB_CheckIfICanListThisSessionBasedOnGrps (long SesCod);
|
||||
void Exa_DB_RemoveAllGrpsAssociatedToSession (long SesCod);
|
||||
void Exa_DB_RemoveGroupsOfType (long GrpTypCod);
|
||||
void Exa_DB_RemoveGrpAssociatedToExamSessions (long GrpCod);
|
||||
void Exa_DB_RemoveGrpsFromExa (long ExaCod);
|
||||
void Exa_DB_RemoveGrpsFromCrs (long CrsCod);
|
||||
void Exa_DB_RemoveGrpsFromSes (long SesCod);
|
||||
void Exa_DB_RemoveGrpsOfType (long GrpTypCod);
|
||||
void Exa_DB_RemoveGrpAssociatedToExamSess (long GrpCod);
|
||||
|
||||
long Exa_DB_CreatePrint (const struct ExaPrn_Print *Print);
|
||||
void Exa_DB_UpdatePrint (const struct ExaPrn_Print *Print);
|
||||
|
@ -107,7 +109,8 @@ unsigned Exa_DB_GetDataOfPrintBySesCodAndUsrCod (MYSQL_RES **mysql_res,
|
|||
long SesCod,long UsrCod);
|
||||
void Exa_DB_RemovePrintsMadeByUsrInAllCrss (long UsrCod);
|
||||
void Exa_DB_RemovePrintsMadeByUsrInCrs (long UsrCod,long CrsCod);
|
||||
void Exa_DB_RemovePrintsFromExam (long ExaCod);
|
||||
void Exa_DB_RemovePrintsFromSes (long SesCod);
|
||||
void Exa_DB_RemovePrintsFromExa (long ExaCod);
|
||||
void Exa_DB_RemovePrintsFromCrs (long CrsCod);
|
||||
|
||||
void Exa_DB_StoreOneQstOfPrint (const struct ExaPrn_Print *Print,
|
||||
|
@ -117,10 +120,11 @@ void Exa_DB_GetAnswersFromQstInPrint (long PrnCod,long QstCod,
|
|||
char StrAnswers[Tst_MAX_BYTES_ANSWERS_ONE_QST + 1]);
|
||||
unsigned Exa_DB_GetNumQstsNotBlankInPrint (long PrnCod);
|
||||
double Exa_DB_ComputeTotalScoreOfPrint (long PrnCod);
|
||||
void Exa_DB_RemovePrintQuestionsMadeByUsrInAllCrss (long UsrCod);
|
||||
void Exa_DB_RemovePrintsQuestionsMadeByUsrInCrs (long UsrCod,long CrsCod);
|
||||
void Exa_DB_RemovePrintQuestionsFromExam (long ExaCod);
|
||||
void Exa_DB_RemovePrintQuestionsFromCrs (long CrsCod);
|
||||
void Exa_DB_RemovePrintQstsMadeByUsrInAllCrss (long UsrCod);
|
||||
void Exa_DB_RemovePrintQstsMadeByUsrInCrs (long UsrCod,long CrsCod);
|
||||
void Exa_DB_RemovePrintQstsFromSes (long SesCod);
|
||||
void Exa_DB_RemovePrintQstsFromExa (long ExaCod);
|
||||
void Exa_DB_RemovePrintQstsFromCrs (long CrsCod);
|
||||
|
||||
bool Exa_DB_CheckIfSessionIsTheSameAsTheLast (long PrnCod);
|
||||
bool Exa_DB_CheckIfUserAgentIsTheSameAsTheLast (long PrnCod,const char *UserAgentDB);
|
||||
|
|
|
@ -1045,37 +1045,45 @@ static void ExaRes_ShowResults (struct Exa_Exams *Exams,
|
|||
}
|
||||
|
||||
/***** Write totals for this user *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
ExaRes_ShowResultsSummaryRow (NumResults,&NumTotalQsts,&TotalScore,TotalGrade);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Columns for dates and title */
|
||||
HTM_TD_Begin ("colspan=\"3\" class=\"LINE_BOTTOM COLOR%u\"",Gbl.RowEvenOdd);
|
||||
HTM_TD_Begin ("colspan=\"3\" class=\"LINE_BOTTOM COLOR%u\"",
|
||||
Gbl.RowEvenOdd);
|
||||
HTM_TD_End ();
|
||||
|
||||
/* Columns for questions */
|
||||
HTM_TD_Begin ("colspan=\"3\" class=\"LINE_BOTTOM LINE_LEFT COLOR%u\"",Gbl.RowEvenOdd);
|
||||
HTM_TD_Begin ("colspan=\"3\" class=\"LINE_BOTTOM LINE_LEFT COLOR%u\"",
|
||||
Gbl.RowEvenOdd);
|
||||
HTM_TD_End ();
|
||||
|
||||
/* Columns for answers */
|
||||
HTM_TD_Begin ("colspan=\"5\" class=\"LINE_BOTTOM LINE_LEFT COLOR%u\"",Gbl.RowEvenOdd);
|
||||
HTM_TD_Begin ("colspan=\"5\" class=\"LINE_BOTTOM LINE_LEFT COLOR%u\"",
|
||||
Gbl.RowEvenOdd);
|
||||
HTM_TD_End ();
|
||||
|
||||
/* Columns for score */
|
||||
HTM_TD_Begin ("colspan=\"2\" class=\"LINE_BOTTOM LINE_LEFT COLOR%u\"",Gbl.RowEvenOdd);
|
||||
HTM_TD_Begin ("colspan=\"2\" class=\"LINE_BOTTOM LINE_LEFT COLOR%u\"",
|
||||
Gbl.RowEvenOdd);
|
||||
HTM_TD_End ();
|
||||
|
||||
/* Column for grade */
|
||||
HTM_TD_Begin ("class=\"LINE_BOTTOM LINE_LEFT COLOR%u\"",Gbl.RowEvenOdd);
|
||||
HTM_TD_Begin ("class=\"LINE_BOTTOM LINE_LEFT COLOR%u\"",
|
||||
Gbl.RowEvenOdd);
|
||||
HTM_TD_End ();
|
||||
|
||||
/* Column for link to show the result */
|
||||
HTM_TD_Begin ("class=\"LINE_BOTTOM LINE_LEFT COLOR%u\"",Gbl.RowEvenOdd);
|
||||
HTM_TD_Begin ("class=\"LINE_BOTTOM LINE_LEFT COLOR%u\"",
|
||||
Gbl.RowEvenOdd);
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
}
|
||||
|
||||
/***** End last row *****/
|
||||
HTM_TR_End ();
|
||||
|
||||
/***** Free structure that stores the query result *****/
|
||||
DB_FreeMySQLResult (&mysql_res);
|
||||
|
||||
|
@ -1094,9 +1102,6 @@ static void ExaRes_ShowResultsSummaryRow (unsigned NumResults,
|
|||
extern const char *Txt_Sessions;
|
||||
unsigned NumTotalQstsInvalid;
|
||||
|
||||
/***** Begin row *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
/***** Row title *****/
|
||||
HTM_TD_Begin ("colspan=\"3\" class=\"DAT_N RM LINE_TOP LINE_BOTTOM COLOR%u\"",Gbl.RowEvenOdd);
|
||||
HTM_TxtColonNBSP (Txt_Sessions);
|
||||
|
@ -1186,9 +1191,6 @@ static void ExaRes_ShowResultsSummaryRow (unsigned NumResults,
|
|||
/***** Last cell *****/
|
||||
HTM_TD_Begin ("class=\"DAT_N LINE_TOP LINE_BOTTOM LINE_LEFT COLOR%u\"",Gbl.RowEvenOdd);
|
||||
HTM_TD_End ();
|
||||
|
||||
/***** End row *****/
|
||||
HTM_TR_End ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -582,7 +582,7 @@ static void ExaSes_GetAndWriteNamesOfGrpsAssociatedToSession (const struct ExaSe
|
|||
unsigned NumGrp;
|
||||
|
||||
/***** Get groups *****/
|
||||
NumGrps = Exa_DB_GetGrpsAssociatedToSession (&mysql_res,Session->SesCod);
|
||||
NumGrps = Exa_DB_GetGrpsAssociatedToSes (&mysql_res,Session->SesCod);
|
||||
|
||||
/***** Write heading *****/
|
||||
HTM_DIV_Begin ("class=\"%s\"",Session->Hidden ? "ASG_GRP_LIGHT":
|
||||
|
@ -853,6 +853,15 @@ void ExaSes_RemoveSession (void)
|
|||
if (!ExaSes_CheckIfICanEditThisSession (&Session))
|
||||
Err_NoPermissionExit ();
|
||||
|
||||
/***** Remove questions of exams prints, and exam prints, in this session *****/
|
||||
//* TODO: DO NOT REMOVE EXAMS PRINTS. Instead move them to tables of deleted prints
|
||||
/* To delete orphan exam prints:
|
||||
// DELETE FROM exa_print_questions WHERE PrnCod IN (SELECT PrnCod FROM exa_prints WHERE SesCod NOT IN (SELECT SesCod FROM exa_sessions));
|
||||
// DELETE FROM exa_prints WHERE SesCod NOT IN (SELECT SesCod FROM exa_sessions);
|
||||
*/
|
||||
Exa_DB_RemovePrintQstsFromSes (Session.SesCod);
|
||||
Exa_DB_RemovePrintsFromSes (Session.SesCod);
|
||||
|
||||
/***** Remove the exam session from all database tables *****/
|
||||
Exa_DB_RemoveSessionFromAllTables (Session.SesCod);
|
||||
|
||||
|
@ -1298,7 +1307,7 @@ static void ExaSes_UpdateSession (struct ExaSes_Session *Session)
|
|||
Exa_DB_UpdateSession (Session);
|
||||
|
||||
/***** Update groups associated to the exam session *****/
|
||||
Exa_DB_RemoveAllGrpsAssociatedToSession (Session->SesCod); // Remove all groups associated to this session
|
||||
Exa_DB_RemoveGrpsFromSes (Session->SesCod); // Remove all groups associated to this session
|
||||
if (Gbl.Crs.Grps.LstGrpsSel.NumGrps)
|
||||
ExaSes_CreateGrpsAssociatedToExamSession (Session->SesCod,&Gbl.Crs.Grps.LstGrpsSel); // Associate new groups
|
||||
}
|
||||
|
@ -1317,7 +1326,7 @@ static void ExaSes_CreateGrpsAssociatedToExamSession (long SesCod,
|
|||
NumGrpSel < LstGrpsSel->NumGrps;
|
||||
NumGrpSel++)
|
||||
/* Create group */
|
||||
Exa_DB_CreateGrpAssociatedToSession (SesCod,LstGrpsSel->GrpCods[NumGrpSel]);
|
||||
Exa_DB_CreateGrpAssociatedToSes (SesCod,LstGrpsSel->GrpCods[NumGrpSel]);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -3507,7 +3507,7 @@ static void Grp_RemoveGroupTypeCompletely (void)
|
|||
Att_DB_RemoveGroupsOfType (Gbl.Crs.Grps.GrpTyp.GrpTypCod);
|
||||
|
||||
/***** Remove the associations of exam sessions to groups of this type *****/
|
||||
Exa_DB_RemoveGroupsOfType (Gbl.Crs.Grps.GrpTyp.GrpTypCod);
|
||||
Exa_DB_RemoveGrpsOfType (Gbl.Crs.Grps.GrpTyp.GrpTypCod);
|
||||
|
||||
/***** Remove the associations of matches to groups of this type *****/
|
||||
Mch_DB_RemoveGroupsOfType (Gbl.Crs.Grps.GrpTyp.GrpTypCod);
|
||||
|
@ -3563,7 +3563,7 @@ static void Grp_RemoveGroupCompletely (void)
|
|||
Mch_DB_RemoveGroup (GrpDat.GrpCod);
|
||||
|
||||
/***** Remove this group from all exam sessions *****/
|
||||
Exa_DB_RemoveGrpAssociatedToExamSessions (GrpDat.GrpCod);
|
||||
Exa_DB_RemoveGrpAssociatedToExamSess (GrpDat.GrpCod);
|
||||
|
||||
/***** Remove this group from all surveys *****/
|
||||
Svy_DB_RemoveGroup (GrpDat.GrpCod);
|
||||
|
|
Loading…
Reference in New Issue