mirror of https://github.com/acanas/swad-core.git
Version 20.96.1: Jul 30, 2021 Fix bugs removing exams.
This commit is contained in:
parent
ef2e43cdcc
commit
0e5ed54fa2
|
@ -40,7 +40,7 @@
|
|||
#include "swad_duplicate_database.h"
|
||||
#include "swad_enrolment_database.h"
|
||||
#include "swad_error.h"
|
||||
#include "swad_exam_print.h"
|
||||
#include "swad_exam_database.h"
|
||||
#include "swad_follow.h"
|
||||
#include "swad_form.h"
|
||||
#include "swad_forum.h"
|
||||
|
@ -1017,7 +1017,8 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
|
|||
|
||||
/***** Remove test, exams and matches made by user in all courses *****/
|
||||
TstPrn_RemovePrintsMadeByUsrInAllCrss (UsrDat->UsrCod);
|
||||
ExaPrn_RemovePrintsMadeByUsrInAllCrss (UsrDat->UsrCod);
|
||||
Exa_DB_RemovePrintQuestionsMadeByUsrInAllCrss (UsrDat->UsrCod);
|
||||
Exa_DB_RemovePrintsMadeByUsrInAllCrss (UsrDat->UsrCod);
|
||||
Mch_RemoveMatchesMadeByUsrInAllCrss (UsrDat->UsrCod);
|
||||
|
||||
/***** Remove user's notifications *****/
|
||||
|
|
|
@ -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 (2021-07-27)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 20.96.1 (2021-07-30)"
|
||||
#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.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)
|
||||
Version 20.95.2: Jul 16, 2021 Queries moved to module swad_exam_database. (314137 lines)
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include "swad_enrolment.h"
|
||||
#include "swad_enrolment_database.h"
|
||||
#include "swad_error.h"
|
||||
#include "swad_exam_print.h"
|
||||
#include "swad_exam_database.h"
|
||||
#include "swad_form.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_hierarchy.h"
|
||||
|
@ -3212,7 +3212,8 @@ static void Enr_EffectivelyRemUsrFromCrs (struct UsrData *UsrDat,
|
|||
|
||||
/* Remove tests, exams and matches results made by user in course */
|
||||
TstPrn_RemovePrintsMadeByUsrInCrs (UsrDat->UsrCod,Crs->CrsCod);
|
||||
ExaPrn_RemovePrintsMadeByUsrInCrs (UsrDat->UsrCod,Crs->CrsCod);
|
||||
Exa_DB_RemovePrintsQuestionsMadeByUsrInCrs (UsrDat->UsrCod,Crs->CrsCod);
|
||||
Exa_DB_RemovePrintsMadeByUsrInCrs (UsrDat->UsrCod,Crs->CrsCod);
|
||||
Mch_RemoveMatchesMadeByUsrInCrs (UsrDat->UsrCod,Crs->CrsCod);
|
||||
}
|
||||
|
||||
|
|
142
swad_exam.c
142
swad_exam.c
|
@ -137,8 +137,10 @@ static Exa_Order_t Exa_GetParamOrder (void);
|
|||
|
||||
static void Exa_RemoveExamFromAllTables (long ExaCod);
|
||||
|
||||
static void Exa_RemoveAllMedFilesFromStemOfAllQstsInCrs (long CrsCod);
|
||||
static void Exa_RemoveAllMedFilesFromAnsOfAllQstsInCrs (long CrsCod);
|
||||
static void Exa_RemoveAllMedFilesFromStemOfAllQstsFromExam (long ExaCod);
|
||||
static void Exa_RemoveAllMedFilesFromStemOfAllQstsFromCrs (long CrsCod);
|
||||
static void Exa_RemoveAllMedFilesFromAnsOfAllQstsFromExam (long ExaCod);
|
||||
static void Exa_RemoveAllMedFilesFromAnsOfAllQstsFromCrs (long CrsCod);
|
||||
|
||||
static bool Exa_DB_CheckIfSimilarExamExists (const struct Exa_Exam *Exam);
|
||||
|
||||
|
@ -1076,29 +1078,26 @@ 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 all sessions in this exam *****/
|
||||
Exa_DB_RemoveSessionsInExamFromAllTables (ExaCod);
|
||||
|
||||
/***** Remove exam questions *****/
|
||||
DB_QueryDELETE ("can not remove exam questions",
|
||||
"DELETE FROM exa_set_questions"
|
||||
" USING exa_sets,"
|
||||
"exa_set_questions"
|
||||
" WHERE exa_sets.ExaCod=%ld"
|
||||
" AND exa_sets.SetCod=exa_set_questions.SetCod",
|
||||
ExaCod);
|
||||
/***** Remove media associated to exam questions in the exam *****/
|
||||
Exa_RemoveAllMedFilesFromStemOfAllQstsFromExam (ExaCod);
|
||||
Exa_RemoveAllMedFilesFromAnsOfAllQstsFromExam (ExaCod);
|
||||
|
||||
/***** Remove the answers and the questions in sets of questions *****/
|
||||
Exa_DB_RemoveSetAnswersFromExam (ExaCod);
|
||||
Exa_DB_RemoveSetQuestionsFromExam (ExaCod);
|
||||
|
||||
/***** Remove exam sets *****/
|
||||
DB_QueryDELETE ("can not remove exam sets",
|
||||
"DELETE FROM exa_sets"
|
||||
" WHERE ExaCod=%ld",
|
||||
ExaCod);
|
||||
Exa_DB_RemoveSetsFromExam (ExaCod);
|
||||
|
||||
/***** Remove exam *****/
|
||||
DB_QueryDELETE ("can not remove exam",
|
||||
"DELETE FROM exa_exams"
|
||||
" WHERE ExaCod=%ld",
|
||||
ExaCod);
|
||||
Exa_DB_RemoveExam (ExaCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1107,61 +1106,60 @@ static void Exa_RemoveExamFromAllTables (long ExaCod)
|
|||
|
||||
void Exa_RemoveCrsExams (long CrsCod)
|
||||
{
|
||||
/***** Remove all exams prints made in the course *****/
|
||||
ExaPrn_RemoveCrsPrints (CrsCod);
|
||||
/***** Remove questions of exams prints, and exam prints,
|
||||
made in the given course *****/
|
||||
Exa_DB_RemovePrintQuestionsFromCrs (CrsCod);
|
||||
Exa_DB_RemovePrintsFromCrs (CrsCod);
|
||||
|
||||
/***** Remove all sessions in the course *****/
|
||||
Exa_DB_RemoveSessionInCourseFromAllTables (CrsCod);
|
||||
|
||||
/***** Remove media associated to test questions in the course *****/
|
||||
Exa_RemoveAllMedFilesFromStemOfAllQstsInCrs (CrsCod);
|
||||
Exa_RemoveAllMedFilesFromAnsOfAllQstsInCrs (CrsCod);
|
||||
Exa_RemoveAllMedFilesFromStemOfAllQstsFromCrs (CrsCod);
|
||||
Exa_RemoveAllMedFilesFromAnsOfAllQstsFromCrs (CrsCod);
|
||||
|
||||
/***** Remove the answers in set of questions *****/
|
||||
DB_QueryDELETE ("can not remove answers in course exams",
|
||||
"DELETE FROM exa_set_answers"
|
||||
" USING exa_exams,"
|
||||
"exa_sets,"
|
||||
"exa_set_questions,"
|
||||
"exa_set_answers"
|
||||
" WHERE exa_exams.CrsCod=%ld"
|
||||
" AND exa_exams.ExaCod=exa_sets.ExaCod",
|
||||
" AND exa_sets.SetCod=exa_set_questions.SetCod"
|
||||
" AND exa_set_questions.QstCod=exa_set_answers.QstCod",
|
||||
CrsCod);
|
||||
|
||||
/***** Remove the questions in set of questions *****/
|
||||
DB_QueryDELETE ("can not remove questions in course exams",
|
||||
"DELETE FROM exa_set_questions"
|
||||
" USING exa_exams,"
|
||||
"exa_sets,"
|
||||
"exa_set_questions"
|
||||
" WHERE exa_exams.CrsCod=%ld"
|
||||
" AND exa_exams.ExaCod=exa_sets.ExaCod",
|
||||
" AND exa_sets.SetCod=exa_set_questions.SetCod",
|
||||
CrsCod);
|
||||
/***** Remove the answers and the questions in sets of questions *****/
|
||||
Exa_DB_RemoveSetAnswersFromCrs (CrsCod);
|
||||
Exa_DB_RemoveSetQuestionsFromCrs (CrsCod);
|
||||
|
||||
/***** Remove the sets of questions in exams *****/
|
||||
DB_QueryDELETE ("can not remove sets in course exams",
|
||||
"DELETE FROM exa_sets"
|
||||
" USING exa_exams,"
|
||||
"exa_sets"
|
||||
" WHERE exa_exams.CrsCod=%ld"
|
||||
" AND exa_exams.ExaCod=exa_sets.ExaCod",
|
||||
CrsCod);
|
||||
Exa_DB_RemoveSetsFromCrs (CrsCod);
|
||||
|
||||
/***** Remove the exams *****/
|
||||
DB_QueryDELETE ("can not remove course exams",
|
||||
"DELETE FROM exa_exams"
|
||||
" WHERE CrsCod=%ld",
|
||||
CrsCod);
|
||||
Exa_DB_RemoveExamsFromCrs (CrsCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********* Remove all media associated to stems of an exam questions *********/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Exa_RemoveAllMedFilesFromStemOfAllQstsFromExam (long ExaCod)
|
||||
{
|
||||
MYSQL_RES *mysql_res;
|
||||
unsigned NumMedia;
|
||||
|
||||
/***** Get media codes associated to stems of an exam questions from database *****/
|
||||
NumMedia = (unsigned)
|
||||
DB_QuerySELECT (&mysql_res,"can not get media",
|
||||
"SELECT exa_set_questions.MedCod"
|
||||
" FROM exa_sets,"
|
||||
"exa_set_questions"
|
||||
" WHERE exa_sets.ExaCod=%ld"
|
||||
" AND exa_sets.SetCod=exa_set_questions.SetCod",
|
||||
ExaCod);
|
||||
|
||||
/***** Go over result removing media files *****/
|
||||
Med_RemoveMediaFromAllRows (NumMedia,mysql_res);
|
||||
|
||||
/***** Free structure that stores the query result *****/
|
||||
DB_FreeMySQLResult (&mysql_res);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/** Remove all media associated to stems of all exam questions in a course ***/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Exa_RemoveAllMedFilesFromStemOfAllQstsInCrs (long CrsCod)
|
||||
static void Exa_RemoveAllMedFilesFromStemOfAllQstsFromCrs (long CrsCod)
|
||||
{
|
||||
MYSQL_RES *mysql_res;
|
||||
unsigned NumMedia;
|
||||
|
@ -1185,11 +1183,39 @@ static void Exa_RemoveAllMedFilesFromStemOfAllQstsInCrs (long CrsCod)
|
|||
DB_FreeMySQLResult (&mysql_res);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/** Remove media associated to all answers of all exam questions in an exam **/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Exa_RemoveAllMedFilesFromAnsOfAllQstsFromExam (long ExaCod)
|
||||
{
|
||||
MYSQL_RES *mysql_res;
|
||||
unsigned NumMedia;
|
||||
|
||||
/***** Get names of media files associated to answers of exam questions from database *****/
|
||||
NumMedia = (unsigned)
|
||||
DB_QuerySELECT (&mysql_res,"can not get media",
|
||||
"SELECT exa_set_answers.MedCod"
|
||||
" FROM exa_sets,"
|
||||
"exa_set_questions,"
|
||||
"exa_set_answers"
|
||||
" WHERE exa_sets.ExaCod=%ld"
|
||||
" AND exa_sets.SetCod=exa_set_questions.SetCod"
|
||||
" AND exa_set_questions.QstCod=exa_set_answers.QstCod",
|
||||
ExaCod);
|
||||
|
||||
/***** Go over result removing media files *****/
|
||||
Med_RemoveMediaFromAllRows (NumMedia,mysql_res);
|
||||
|
||||
/***** Free structure that stores the query result *****/
|
||||
DB_FreeMySQLResult (&mysql_res);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Remove media associated to all answers of all exam questions in a course **/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Exa_RemoveAllMedFilesFromAnsOfAllQstsInCrs (long CrsCod)
|
||||
static void Exa_RemoveAllMedFilesFromAnsOfAllQstsFromCrs (long CrsCod)
|
||||
{
|
||||
MYSQL_RES *mysql_res;
|
||||
unsigned NumMedia;
|
||||
|
|
|
@ -168,6 +168,30 @@ void Exa_DB_GetExamTxt (long ExaCod,char Txt[Cns_MAX_BYTES_TEXT + 1])
|
|||
ExaCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************************* Remove exam *******************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemoveExam (long ExaCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove exam",
|
||||
"DELETE FROM exa_exams"
|
||||
" WHERE ExaCod=%ld",
|
||||
ExaCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************** Remove all exams from a course ***********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemoveExamsFromCrs (long CrsCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove course exams",
|
||||
"DELETE FROM exa_exams"
|
||||
" WHERE CrsCod=%ld",
|
||||
CrsCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************** Create a new set of questions ************************/
|
||||
/*****************************************************************************/
|
||||
|
@ -419,6 +443,33 @@ unsigned Exa_DB_GetNextSetIndexInExam (long ExaCod,unsigned SetInd)
|
|||
SetInd);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************** Remove the sets of questions from an course ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemoveSetsFromExam (long ExaCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove exam sets",
|
||||
"DELETE FROM exa_sets"
|
||||
" WHERE ExaCod=%ld",
|
||||
ExaCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************ Remove the sets of questions from exams in a course ************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemoveSetsFromCrs (long CrsCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove sets in course exams",
|
||||
"DELETE FROM exa_sets"
|
||||
" USING exa_exams,"
|
||||
"exa_sets"
|
||||
" WHERE exa_exams.CrsCod=%ld"
|
||||
" AND exa_exams.ExaCod=exa_sets.ExaCod",
|
||||
CrsCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************* Get number of questions in a set **********************/
|
||||
/*****************************************************************************/
|
||||
|
@ -469,6 +520,38 @@ unsigned Exa_DB_GetValidityAndTypeOfQuestion (MYSQL_RES **mysql_res,long QstCod)
|
|||
QstCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********* Remove the questions in sets of questions from an exam ************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemoveSetQuestionsFromExam (long ExaCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove exam questions",
|
||||
"DELETE FROM exa_set_questions"
|
||||
" USING exa_sets,"
|
||||
"exa_set_questions"
|
||||
" WHERE exa_sets.ExaCod=%ld"
|
||||
" AND exa_sets.SetCod=exa_set_questions.SetCod",
|
||||
ExaCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********* Remove the questions in sets of questions from a course ***********/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemoveSetQuestionsFromCrs (long CrsCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove questions in course exams",
|
||||
"DELETE FROM exa_set_questions"
|
||||
" USING exa_exams,"
|
||||
"exa_sets,"
|
||||
"exa_set_questions"
|
||||
" WHERE exa_exams.CrsCod=%ld"
|
||||
" AND exa_exams.ExaCod=exa_sets.ExaCod",
|
||||
" AND exa_sets.SetCod=exa_set_questions.SetCod",
|
||||
CrsCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************** Get answers text for a question in an exam set ***************/
|
||||
/*****************************************************************************/
|
||||
|
@ -498,6 +581,42 @@ unsigned Exa_DB_GetQstAnswersCorrFromSet (MYSQL_RES **mysql_res,long QstCod)
|
|||
QstCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********** Remove the answers in sets of questions from an exam *************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemoveSetAnswersFromExam (long ExaCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove exam answers",
|
||||
"DELETE FROM exa_set_answers"
|
||||
" USING exa_sets,"
|
||||
"exa_set_questions,"
|
||||
"exa_set_answers"
|
||||
" WHERE exa_sets.ExaCod=%ld"
|
||||
" AND exa_sets.SetCod=exa_set_questions.SetCod",
|
||||
" AND exa_set_questions.QstCod=exa_set_answers.QstCod",
|
||||
ExaCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********** Remove the answers in sets of questions from a course ************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemoveSetAnswersFromCrs (long CrsCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove answers in course exams",
|
||||
"DELETE FROM exa_set_answers"
|
||||
" USING exa_exams,"
|
||||
"exa_sets,"
|
||||
"exa_set_questions,"
|
||||
"exa_set_answers"
|
||||
" WHERE exa_exams.CrsCod=%ld"
|
||||
" AND exa_exams.ExaCod=exa_sets.ExaCod",
|
||||
" AND exa_sets.SetCod=exa_set_questions.SetCod"
|
||||
" AND exa_set_questions.QstCod=exa_set_answers.QstCod",
|
||||
CrsCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************************* Create a new exam session *************************/
|
||||
/*****************************************************************************/
|
||||
|
@ -1138,10 +1257,25 @@ void Exa_DB_RemovePrintsMadeByUsrInCrs (long UsrCod,long CrsCod)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******* Remove exams prints made by the given user in the given course ******/
|
||||
/**************** Remove exams prints made in the given exam *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemovePrintsInCrs (long CrsCod)
|
||||
void Exa_DB_RemovePrintsFromExam (long ExaCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove exams prints in a course",
|
||||
"DELETE FROM exa_prints"
|
||||
" USING exa_sessions,"
|
||||
"exa_prints"
|
||||
" WHERE exa_sessions.ExaCod=%ld"
|
||||
" AND exa_sessions.SesCod=exa_prints.SesCod",
|
||||
ExaCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*************** Remove exams prints made in the given course ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemovePrintsFromCrs (long CrsCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove exams prints in a course",
|
||||
"DELETE FROM exa_prints"
|
||||
|
@ -1277,10 +1411,27 @@ void Exa_DB_RemovePrintsQuestionsMadeByUsrInCrs (long UsrCod,long CrsCod)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Remove questions of exams prints made by the given user in a given course */
|
||||
/************ Remove questions of exams prints in a given course *************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemovePrintQuestionsInCrs (long CrsCod)
|
||||
void Exa_DB_RemovePrintQuestionsFromExam (long ExaCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove exams prints in an exam",
|
||||
"DELETE FROM exa_print_questions"
|
||||
" USING exa_sessions,"
|
||||
"exa_prints,"
|
||||
"exa_print_questions"
|
||||
" WHERE exa_sessions.ExaCod=%ld"
|
||||
" AND exa_sessions.SesCod=exa_prints.SesCod"
|
||||
" AND exa_prints.PrnCod=exa_print_questions.PrnCod",
|
||||
ExaCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************ Remove questions of exams prints in a given course *************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_DB_RemovePrintQuestionsFromCrs (long CrsCod)
|
||||
{
|
||||
DB_QueryDELETE ("can not remove exams prints in a course",
|
||||
"DELETE FROM exa_print_questions"
|
||||
|
|
|
@ -45,6 +45,8 @@ unsigned Exa_DB_GetListExams (MYSQL_RES **mysql_res,Exa_Order_t SelectedOrder);
|
|||
unsigned Exa_DB_GetDataOfExamByCod (MYSQL_RES **mysql_res,long ExaCod);
|
||||
unsigned Exa_DB_GetExamStartEnd (MYSQL_RES **mysql_res,long ExaCod);
|
||||
void Exa_DB_GetExamTxt (long ExaCod,char Txt[Cns_MAX_BYTES_TEXT + 1]);
|
||||
void Exa_DB_RemoveExam (long ExaCod);
|
||||
void Exa_DB_RemoveExamsFromCrs (long CrsCod);
|
||||
|
||||
long Exa_DB_CreateSet (const struct ExaSet_Set *Set,unsigned SetInd);
|
||||
void Exa_DB_UpdateSet (const struct ExaSet_Set *Set);
|
||||
|
@ -63,13 +65,20 @@ long Exa_DB_GetSetCodFromSetInd (long ExaCod,unsigned SetInd);
|
|||
unsigned Exa_DB_GetMaxSetIndexInExam (long ExaCod);
|
||||
unsigned Exa_DB_GetPrevSetIndexInExam (long ExaCod,unsigned SetInd);
|
||||
unsigned Exa_DB_GetNextSetIndexInExam (long ExaCod,unsigned SetInd);
|
||||
void Exa_DB_RemoveSetsFromExam (long ExaCod);
|
||||
void Exa_DB_RemoveSetsFromCrs (long CrsCod);
|
||||
|
||||
unsigned Exa_DB_GetNumQstsInSet (long SetCod);
|
||||
unsigned Exa_DB_GetSomeQstsFromSetToPrint (MYSQL_RES **mysql_res,
|
||||
long SetCod,unsigned NumQstsToPrint);
|
||||
unsigned Exa_DB_GetValidityAndTypeOfQuestion (MYSQL_RES **mysql_res,long QstCod);
|
||||
void Exa_DB_RemoveSetQuestionsFromExam (long ExaCod);
|
||||
void Exa_DB_RemoveSetQuestionsFromCrs (long CrsCod);
|
||||
|
||||
unsigned Exa_DB_GetQstAnswersTextFromSet (MYSQL_RES **mysql_res,long QstCod);
|
||||
unsigned Exa_DB_GetQstAnswersCorrFromSet (MYSQL_RES **mysql_res,long QstCod);
|
||||
void Exa_DB_RemoveSetAnswersFromExam (long ExaCod);
|
||||
void Exa_DB_RemoveSetAnswersFromCrs (long CrsCod);
|
||||
|
||||
long Exa_DB_CreateSession (const struct ExaSes_Session *Session);
|
||||
void Exa_DB_UpdateSession (const struct ExaSes_Session *Session);
|
||||
|
@ -98,7 +107,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_RemovePrintsInCrs (long CrsCod);
|
||||
void Exa_DB_RemovePrintsFromExam (long ExaCod);
|
||||
void Exa_DB_RemovePrintsFromCrs (long CrsCod);
|
||||
|
||||
void Exa_DB_StoreOneQstOfPrint (const struct ExaPrn_Print *Print,
|
||||
unsigned QstInd);
|
||||
|
@ -109,7 +119,8 @@ 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_RemovePrintQuestionsInCrs (long CrsCod);
|
||||
void Exa_DB_RemovePrintQuestionsFromExam (long ExaCod);
|
||||
void Exa_DB_RemovePrintQuestionsFromCrs (long CrsCod);
|
||||
|
||||
bool Exa_DB_CheckIfSessionIsTheSameAsTheLast (long PrnCod);
|
||||
bool Exa_DB_CheckIfUserAgentIsTheSameAsTheLast (long PrnCod,const char *UserAgentDB);
|
||||
|
|
|
@ -1320,42 +1320,3 @@ static void ExaPrn_GetCorrectTxtAnswerFromDB (struct Tst_Question *Question)
|
|||
/***** Free structure that stores the query result *****/
|
||||
DB_FreeMySQLResult (&mysql_res);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************** Remove exam prints made by a user ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void ExaPrn_RemovePrintsMadeByUsrInAllCrss (long UsrCod)
|
||||
{
|
||||
/***** Remove exam prints questions for the given user *****/
|
||||
Exa_DB_RemovePrintQuestionsMadeByUsrInAllCrss (UsrCod);
|
||||
|
||||
/***** Remove exam prints made by the given user *****/
|
||||
Exa_DB_RemovePrintsMadeByUsrInAllCrss (UsrCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*************** Remove exam prints made by a user in a course ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void ExaPrn_RemovePrintsMadeByUsrInCrs (long UsrCod,long CrsCod)
|
||||
{
|
||||
/***** Remove questions of exams prints made by the given user in the given course *****/
|
||||
Exa_DB_RemovePrintsQuestionsMadeByUsrInCrs (UsrCod,CrsCod);
|
||||
|
||||
/***** Remove exams prints made by the given user in the given course *****/
|
||||
Exa_DB_RemovePrintsMadeByUsrInCrs (UsrCod,CrsCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************** Remove all exams prints made in a course *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void ExaPrn_RemoveCrsPrints (long CrsCod)
|
||||
{
|
||||
/***** Remove questions of exams prints made by the given user in the given course *****/
|
||||
Exa_DB_RemovePrintQuestionsInCrs (CrsCod);
|
||||
|
||||
/***** Remove exams prints made by the given user in the given course *****/
|
||||
Exa_DB_RemovePrintsInCrs (CrsCod);
|
||||
}
|
||||
|
|
|
@ -90,8 +90,4 @@ void ExaPrn_ReceivePrintAnswer (void);
|
|||
void ExaPrn_ComputeAnswerScore (struct TstPrn_PrintedQuestion *PrintedQuestion,
|
||||
struct Tst_Question *Question);
|
||||
|
||||
void ExaPrn_RemovePrintsMadeByUsrInAllCrss (long UsrCod);
|
||||
void ExaPrn_RemovePrintsMadeByUsrInCrs (long UsrCod,long CrsCod);
|
||||
void ExaPrn_RemoveCrsPrints (long CrsCod);
|
||||
|
||||
#endif
|
||||
|
|
10
swad_match.c
10
swad_match.c
|
@ -141,7 +141,7 @@ static void Mch_RemoveMatchFromAllTables (long MchCod);
|
|||
static void Mch_DB_RemoveMatchFromTable (long MchCod,const char *TableName);
|
||||
static void Mch_DB_RemoveMatchesInGameFromTable (long GamCod,const char *TableName);
|
||||
static void Mch_DB_RemoveMatchesInCourseFromTable (long CrsCod,const char *TableName);
|
||||
static void Mch_RemoveMatchesMadeByUsrFromTable (long UsrCod,const char *TableName);
|
||||
static void Mch_DB_RemoveMatchesMadeByUsrFromTable (long UsrCod,const char *TableName);
|
||||
static void Mch_RemoveMatchesMadeByUsrInCrsFromTable (long UsrCod,long CrsCod,const char *TableName);
|
||||
|
||||
static void Mch_PutParamsPlay (void *MchCod);
|
||||
|
@ -1293,12 +1293,12 @@ static void Mch_DB_RemoveMatchesInCourseFromTable (long CrsCod,const char *Table
|
|||
void Mch_RemoveMatchesMadeByUsrInAllCrss (long UsrCod)
|
||||
{
|
||||
/***** Remove student from secondary tables *****/
|
||||
Mch_RemoveMatchesMadeByUsrFromTable (UsrCod,"mch_players");
|
||||
Mch_RemoveMatchesMadeByUsrFromTable (UsrCod,"mch_results");
|
||||
Mch_RemoveMatchesMadeByUsrFromTable (UsrCod,"mch_answers");
|
||||
Mch_DB_RemoveMatchesMadeByUsrFromTable (UsrCod,"mch_players");
|
||||
Mch_DB_RemoveMatchesMadeByUsrFromTable (UsrCod,"mch_results");
|
||||
Mch_DB_RemoveMatchesMadeByUsrFromTable (UsrCod,"mch_answers");
|
||||
}
|
||||
|
||||
static void Mch_RemoveMatchesMadeByUsrFromTable (long UsrCod,const char *TableName)
|
||||
static void Mch_DB_RemoveMatchesMadeByUsrFromTable (long UsrCod,const char *TableName)
|
||||
{
|
||||
/***** Remove matches in course from secondary table *****/
|
||||
DB_QueryDELETE ("can not remove matches of a user from table",
|
||||
|
|
Loading…
Reference in New Issue