From b95f78957f30fc16ef108e87570ef1a665ed42cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 9 Mar 2015 11:03:55 +0100 Subject: [PATCH] Version 14.80.12 --- swad_changelog.h | 3 +- swad_test.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) diff --git a/swad_changelog.h b/swad_changelog.h index 628d65af6..b89fa8259 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -103,11 +103,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.80.11 (2015/03/09)" +#define Log_PLATFORM_VERSION "SWAD 14.80.12 (2015/03/09)" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h | tail -1 /* + Version 14.80.12: Mar 09, 2015 Scope country for statistic of tests. (179340 lines) Version 14.80.11: Mar 09, 2015 Scope country for statistic of notifications. (179267 lines) Version 14.80.10: Mar 09, 2015 Scope country for statistic of notices. (179211 lines) Version 14.80.9: Mar 09, 2015 Scope country for statistic of messages. (179187 lines) diff --git a/swad_test.c b/swad_test.c index 981c541ea..da0c082e4 100644 --- a/swad_test.c +++ b/swad_test.c @@ -5520,6 +5520,28 @@ static unsigned Tst_GetNumTstQuestions (Sco_Scope_t Scope,Tst_AnswerType_t AnsTy " WHERE AnsType='%s'", Tst_StrAnswerTypesDB[AnsType]); break; + case Sco_SCOPE_CTY: + if (AnsType == Tst_ANS_ALL) + sprintf (Query,"SELECT COUNT(*),SUM(NumHits),SUM(Score)" + " FROM institutions,centres,degrees,courses,tst_questions" + " WHERE institutions.CtyCod='%ld'" + " AND institutions.InsCod=centres.InsCod" + " AND centres.CtrCod=degrees.CtrCod" + " AND degrees.DegCod=courses.DegCod" + " AND courses.CrsCod=tst_questions.CrsCod", + Gbl.CurrentCty.Cty.CtyCod); + else + sprintf (Query,"SELECT COUNT(*),SUM(NumHits),SUM(Score)" + " FROM institutions,centres,degrees,courses,tst_questions" + " WHERE institutions.CtyCod='%ld'" + " AND institutions.InsCod=centres.InsCod" + " AND centres.CtrCod=degrees.CtrCod" + " AND degrees.DegCod=courses.DegCod" + " AND courses.CrsCod=tst_questions.CrsCod" + " AND tst_questions.AnsType='%s'", + Gbl.CurrentCty.Cty.CtyCod, + Tst_StrAnswerTypesDB[AnsType]); + break; case Sco_SCOPE_INS: if (AnsType == Tst_ANS_ALL) sprintf (Query,"SELECT COUNT(*),SUM(NumHits),SUM(Score)" @@ -5646,6 +5668,28 @@ static unsigned Tst_GetNumCoursesWithTstQuestions (Sco_Scope_t Scope,Tst_AnswerT " WHERE AnsType='%s'", Tst_StrAnswerTypesDB[AnsType]); break; + case Sco_SCOPE_CTY: + if (AnsType == Tst_ANS_ALL) + sprintf (Query,"SELECT COUNT(DISTINCT (tst_questions.CrsCod))" + " FROM institutions,centres,degrees,courses,tst_questions" + " WHERE institutions.CtyCod='%ld'" + " AND institutions.InsCod=centres.InsCod" + " AND centres.CtrCod=degrees.CtrCod" + " AND degrees.DegCod=courses.DegCod" + " AND courses.CrsCod=tst_questions.CrsCod", + Gbl.CurrentCty.Cty.CtyCod); + else + sprintf (Query,"SELECT COUNT(DISTINCT (tst_questions.CrsCod))" + " FROM institutions,centres,degrees,courses,tst_questions" + " WHERE institutions.CtyCod='%ld'" + " AND institutions.InsCod=centres.InsCod" + " AND centres.CtrCod=degrees.CtrCod" + " AND degrees.DegCod=courses.DegCod" + " AND courses.CrsCod=tst_questions.CrsCod" + " AND tst_questions.AnsType='%s'", + Gbl.CurrentCty.Cty.CtyCod, + Tst_StrAnswerTypesDB[AnsType]); + break; case Sco_SCOPE_INS: if (AnsType == Tst_ANS_ALL) sprintf (Query,"SELECT COUNT(DISTINCT (tst_questions.CrsCod))" @@ -5763,6 +5807,34 @@ static unsigned Tst_GetNumCoursesWithPluggableTstQuestions (Sco_Scope_t Scope,Ts Tst_StrAnswerTypesDB[AnsType], Tst_PluggableDB[Tst_PLUGGABLE_YES]); break; + case Sco_SCOPE_CTY: + if (AnsType == Tst_ANS_ALL) + sprintf (Query,"SELECT COUNT(DISTINCT (tst_questions.CrsCod))" + " FROM institutions,centres,degrees,courses,tst_questions,tst_config" + " WHERE institutions.CtyCod='%ld'" + " AND institutions.InsCod=centres.InsCod" + " AND centres.CtrCod=degrees.CtrCod" + " AND degrees.DegCod=courses.DegCod" + " AND courses.CrsCod=tst_questions.CrsCod" + " AND tst_questions.CrsCod=tst_config.CrsCod" + " AND tst_config.pluggable='%s'", + Gbl.CurrentCty.Cty.CtyCod, + Tst_PluggableDB[Tst_PLUGGABLE_YES]); + else + sprintf (Query,"SELECT COUNT(DISTINCT (tst_questions.CrsCod))" + " FROM institutions,centres,degrees,courses,tst_questions,tst_config" + " WHERE institutions.CtyCod='%ld'" + " AND institutions.InsCod=centres.InsCod" + " AND centres.CtrCod=degrees.CtrCod" + " AND degrees.DegCod=courses.DegCod" + " AND courses.CrsCod=tst_questions.CrsCod" + " AND tst_questions.AnsType='%s'" + " AND tst_questions.CrsCod=tst_config.CrsCod" + " AND tst_config.pluggable='%s'", + Gbl.CurrentCty.Cty.CtyCod, + Tst_StrAnswerTypesDB[AnsType], + Tst_PluggableDB[Tst_PLUGGABLE_YES]); + break; case Sco_SCOPE_INS: if (AnsType == Tst_ANS_ALL) sprintf (Query,"SELECT COUNT(DISTINCT (tst_questions.CrsCod))"