Version19.68.1

This commit is contained in:
Antonio Cañas Vargas 2019-11-14 14:34:34 +01:00
parent 377302b6d8
commit 56b52e34be
7 changed files with 72 additions and 92 deletions

View File

@ -2158,7 +2158,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
/* ActSeeMyTstRes */{1084,-1,TabUnk,ActReqTst ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowMyTstResults ,NULL}, /* ActSeeMyTstRes */{1084,-1,TabUnk,ActReqTst ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowMyTstResults ,NULL},
/* ActSeeOneTstResMe */{1085,-1,TabUnk,ActReqTst ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowOneTstResult ,NULL}, /* ActSeeOneTstResMe */{1085,-1,TabUnk,ActReqTst ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowOneTstResult ,NULL},
/* ActReqSeeUsrTstRes*/{1080,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,Tst_SelUsrsToViewUsrsTstResults,NULL}, /* ActReqSeeUsrTstRes*/{1080,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,Tst_SelUsrsToViewUsrsTstResults,NULL},
/* ActSeeUsrTstRes */{1081,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowUsrsTstResults ,NULL}, /* ActSeeUsrTstRes */{1081,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_GetUsrsAndShowTstResults ,NULL},
/* ActSeeOneTstResOth*/{1082,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowOneTstResult ,NULL}, /* ActSeeOneTstResOth*/{1082,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowOneTstResult ,NULL},
/* ActSeeGam */{1650,-1,TabUnk,ActSeeAllGam ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Gam_SeeOneGame ,NULL}, /* ActSeeGam */{1650,-1,TabUnk,ActSeeAllGam ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Gam_SeeOneGame ,NULL},
@ -2184,7 +2184,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
/* ActSeeOneMchResMe */{1797,-1,TabUnk,ActSeeAllGam ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,McR_ShowOneMchResult ,NULL}, /* ActSeeOneMchResMe */{1797,-1,TabUnk,ActSeeAllGam ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,McR_ShowOneMchResult ,NULL},
/* ActReqSeeUsrMchRes*/{1798,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,McR_SelUsrsToViewUsrsMchResults,NULL}, /* ActReqSeeUsrMchRes*/{1798,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,McR_SelUsrsToViewUsrsMchResults,NULL},
/* ActSeeUsrMchRes */{1799,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,McR_ShowUsrsMchResults ,NULL}, /* ActSeeUsrMchRes */{1799,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,McR_GetUsrsAndShowMchResults ,NULL},
/* ActSeeOneMchResOth*/{1800,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,McR_ShowOneMchResult ,NULL}, /* ActSeeOneMchResOth*/{1800,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,McR_ShowOneMchResult ,NULL},
/* ActChgVisResMchUsr*/{1801,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Mch_ToggleVisibilResultsMchUsr ,NULL}, /* ActChgVisResMchUsr*/{1801,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Mch_ToggleVisibilResultsMchUsr ,NULL},

View File

@ -487,7 +487,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD: En OpenSWAD:
ps2pdf source.ps destination.pdf ps2pdf source.ps destination.pdf
*/ */
#define Log_PLATFORM_VERSION "SWAD 19.68 (2019-11-14)" #define Log_PLATFORM_VERSION "SWAD 19.68.1 (2019-11-14)"
#define CSS_FILE "swad19.47.css" #define CSS_FILE "swad19.47.css"
#define JS_FILE "swad19.65.js" #define JS_FILE "swad19.65.js"
/* /*
@ -495,6 +495,8 @@ ps2pdf source.ps destination.pdf
// TODO: Impedir la creación y edición de proyectos si no son editables. // TODO: Impedir la creación y edición de proyectos si no son editables.
// TODO: Code refactoring in HTML h1, title, meta, video, p, iframe, input hidden, area // TODO: Code refactoring in HTML h1, title, meta, video, p, iframe, input hidden, area
Version 19.68.1: Nov 14, 2019 Code refactoring in match results.
Code refactoring in test results. (246623 lines)
Version 19.68: Nov 14, 2019 Code refactoring in projects. (246642 lines) Version 19.68: Nov 14, 2019 Code refactoring in projects. (246642 lines)
1 change necessary in database: 1 change necessary in database:
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1805','es','N','Seleccionar usuarios para ver sus proyectos'); INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1805','es','N','Seleccionar usuarios para ver sus proyectos');

View File

@ -69,6 +69,7 @@ extern struct Globals Gbl;
/***************************** Private prototypes ****************************/ /***************************** Private prototypes ****************************/
/*****************************************************************************/ /*****************************************************************************/
static void McR_ShowUsrsMchResults (void);
static void McR_ShowHeaderMchResults (Usr_MeOrOther_t MeOrOther); static void McR_ShowHeaderMchResults (Usr_MeOrOther_t MeOrOther);
static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther); static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther);
static void McR_ShowMchResultsSummaryRow (bool ShowSummaryResults, static void McR_ShowMchResultsSummaryRow (bool ShowSummaryResults,
@ -256,59 +257,51 @@ void McR_SelUsrsToViewUsrsMchResults (void)
Grp_FreeListCodSelectedGrps (); Grp_FreeListCodSelectedGrps ();
} }
/*****************************************************************************/
/****************** Get users and show their matches results *****************/
/*****************************************************************************/
void McR_GetUsrsAndShowMchResults (void)
{
Usr_GetSelectedUsrsAndGoToAct (McR_ShowUsrsMchResults,
McR_SelUsrsToViewUsrsMchResults);
}
/*****************************************************************************/ /*****************************************************************************/
/****************** Show matches results for several users *******************/ /****************** Show matches results for several users *******************/
/*****************************************************************************/ /*****************************************************************************/
void McR_ShowUsrsMchResults (void) static void McR_ShowUsrsMchResults (void)
{ {
extern const char *Hlp_ASSESSMENT_Games_results; extern const char *Hlp_ASSESSMENT_Games_results;
extern const char *Txt_Results; extern const char *Txt_Results;
extern const char *Txt_You_must_select_one_ore_more_users;
const char *Ptr; const char *Ptr;
/***** Get list of the selected users's IDs *****/
Usr_GetListsSelectedUsrsCods ();
/***** Get starting and ending dates *****/ /***** Get starting and ending dates *****/
Dat_GetIniEndDatesFromForm (); Dat_GetIniEndDatesFromForm ();
/***** Check the number of users whose matches results will be shown *****/ /***** Begin box and table *****/
if (Usr_CheckIfThereAreUsrsInListOfSelectedEncryptedUsrCods ()) // If some users are selected... Box_StartBoxTable (NULL,Txt_Results,NULL,
Hlp_ASSESSMENT_Games_results,Box_NOT_CLOSABLE,2);
/***** Header of the table with the list of users *****/
McR_ShowHeaderMchResults (Usr_OTHER);
/***** List the matches results of the selected users *****/
Ptr = Gbl.Usrs.Selected.List[Rol_UNK];
while (*Ptr)
{ {
/***** Begin box and table *****/ Par_GetNextStrUntilSeparParamMult (&Ptr,Gbl.Usrs.Other.UsrDat.EncryptedUsrCod,
Box_StartBoxTable (NULL,Txt_Results,NULL, Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64);
Hlp_ASSESSMENT_Games_results,Box_NOT_CLOSABLE,2); Usr_GetUsrCodFromEncryptedUsrCod (&Gbl.Usrs.Other.UsrDat);
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Usr_DONT_GET_PREFS)) // Get of the database the data of the user
/***** Header of the table with the list of users *****/ if (Usr_CheckIfICanViewMch (&Gbl.Usrs.Other.UsrDat))
McR_ShowHeaderMchResults (Usr_OTHER); /***** Show matches results *****/
McR_ShowMchResults (Usr_OTHER);
/***** List the matches results of the selected users *****/
Ptr = Gbl.Usrs.Selected.List[Rol_UNK];
while (*Ptr)
{
Par_GetNextStrUntilSeparParamMult (&Ptr,Gbl.Usrs.Other.UsrDat.EncryptedUsrCod,
Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64);
Usr_GetUsrCodFromEncryptedUsrCod (&Gbl.Usrs.Other.UsrDat);
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Usr_DONT_GET_PREFS)) // Get of the database the data of the user
if (Usr_CheckIfICanViewMch (&Gbl.Usrs.Other.UsrDat))
/***** Show matches results *****/
McR_ShowMchResults (Usr_OTHER);
}
/***** End table and box *****/
Box_EndBoxTable ();
}
else // If no users are selected...
{
// ...write warning alert
Ale_ShowAlert (Ale_WARNING,Txt_You_must_select_one_ore_more_users);
// ...and show again the form
McR_SelUsrsToViewUsrsMchResults ();
} }
/***** Free memory used by list of selected users' codes *****/ /***** End table and box *****/
Usr_FreeListsSelectedEncryptedUsrsCods (); Box_EndBoxTable ();
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -39,7 +39,7 @@ void McR_PutFormToViewMchResults (Act_Action_t Action);
void McR_SelDatesToSeeMyMchResults (void); void McR_SelDatesToSeeMyMchResults (void);
void McR_ShowMyMchResults (void); void McR_ShowMyMchResults (void);
void McR_SelUsrsToViewUsrsMchResults (void); void McR_SelUsrsToViewUsrsMchResults (void);
void McR_ShowUsrsMchResults (void); void McR_GetUsrsAndShowMchResults (void);
void McR_ShowOneMchResult (void); void McR_ShowOneMchResult (void);
void McR_GetMatchResultQuestionsFromDB (long MchCod,long UsrCod, void McR_GetMatchResultQuestionsFromDB (long MchCod,long UsrCod,
unsigned *NumQsts,unsigned *NumQstsNotBlank); unsigned *NumQsts,unsigned *NumQstsNotBlank);

View File

@ -275,12 +275,8 @@ void Prj_SeeProjects (void)
Prj_ShowProjectsInCurrentPage (); Prj_ShowProjectsInCurrentPage ();
break; break;
case Usr_WHO_SELECTED: case Usr_WHO_SELECTED:
// if (Gbl.Prjs.Filter.ReqUsrs) // Request the selection of users /* Get selected users and show their projects */
/* List users to select some of them */ Prj_GetSelectedUsrsAndShowPrjs ();
// Prj_ReqListUsrsToSelect ();
//else
/* Show projects of selected users */
Prj_GetSelectedUsrsAndShowPrjs ();
break; break;
default: default:
break; break;
@ -294,7 +290,7 @@ void Prj_SeeProjects (void)
static void Prj_GetSelectedUsrsAndShowPrjs (void) static void Prj_GetSelectedUsrsAndShowPrjs (void)
{ {
Usr_GetSelectedUsrsAndGoToAct (Prj_ShowProjectsInCurrentPage,// when user(s) selected Usr_GetSelectedUsrsAndGoToAct (Prj_ShowProjectsInCurrentPage,// when user(s) selected
Prj_ReqUsrsToSelect); // when no user selected Prj_ReqUsrsToSelect); // when no user selected
} }
/*****************************************************************************/ /*****************************************************************************/
@ -816,10 +812,6 @@ static void Prj_GetParamWho (void)
/***** Get which users I want to see *****/ /***** Get which users I want to see *****/
Gbl.Prjs.Filter.Who = Usr_GetHiddenParamWho (); Gbl.Prjs.Filter.Who = Usr_GetHiddenParamWho ();
/***** If parameter Who is not present, get it from database *****/
// if (Gbl.Prjs.Filter.Who == Usr_WHO_UNKNOWN)
// Gbl.Prjs.Filter.Who = Prj_GetWhoFromDB ();
/***** If parameter Who is unknown, set it to default *****/ /***** If parameter Who is unknown, set it to default *****/
if (Gbl.Prjs.Filter.Who == Usr_WHO_UNKNOWN) if (Gbl.Prjs.Filter.Who == Usr_WHO_UNKNOWN)
Gbl.Prjs.Filter.Who = Prj_FILTER_WHO_DEFAULT; Gbl.Prjs.Filter.Who = Prj_FILTER_WHO_DEFAULT;

View File

@ -283,6 +283,7 @@ static unsigned Tst_GetNumCoursesWithPluggableTstQuestions (Hie_Level_t Scope,Ts
static long Tst_CreateTestResultInDB (void); static long Tst_CreateTestResultInDB (void);
static void Tst_StoreScoreOfTestResultInDB (long TstCod, static void Tst_StoreScoreOfTestResultInDB (long TstCod,
unsigned NumQstsNotBlank,double Score); unsigned NumQstsNotBlank,double Score);
static void Tst_ShowUsrsTstResults (void);
static void Tst_ShowHeaderTestResults (void); static void Tst_ShowHeaderTestResults (void);
static void Tst_ShowTstResults (struct UsrData *UsrDat); static void Tst_ShowTstResults (struct UsrData *UsrDat);
static void Tst_PutParamTstCod (long TstCod); static void Tst_PutParamTstCod (long TstCod);
@ -7628,59 +7629,51 @@ static void Tst_StoreScoreOfTestResultInDB (long TstCod,
Str_SetDecimalPointToLocal (); // Return to local system Str_SetDecimalPointToLocal (); // Return to local system
} }
/*****************************************************************************/
/******************* Get users and show their test results *******************/
/*****************************************************************************/
void Tst_GetUsrsAndShowTstResults (void)
{
Usr_GetSelectedUsrsAndGoToAct (Tst_ShowUsrsTstResults,
Tst_SelUsrsToViewUsrsTstResults);
}
/*****************************************************************************/ /*****************************************************************************/
/******************** Show test results for several users ********************/ /******************** Show test results for several users ********************/
/*****************************************************************************/ /*****************************************************************************/
void Tst_ShowUsrsTstResults (void) static void Tst_ShowUsrsTstResults (void)
{ {
extern const char *Hlp_ASSESSMENT_Tests_results; extern const char *Hlp_ASSESSMENT_Tests_results;
extern const char *Txt_Results; extern const char *Txt_Results;
extern const char *Txt_You_must_select_one_ore_more_users;
const char *Ptr; const char *Ptr;
/***** Get list of the selected users's IDs *****/
Usr_GetListsSelectedUsrsCods ();
/***** Get starting and ending dates *****/ /***** Get starting and ending dates *****/
Dat_GetIniEndDatesFromForm (); Dat_GetIniEndDatesFromForm ();
/***** Check the number of users whose tests results will be shown *****/ /***** Begin box and table *****/
if (Usr_CheckIfThereAreUsrsInListOfSelectedEncryptedUsrCods ()) // If some users are selected... Box_StartBoxTable (NULL,Txt_Results,NULL,
Hlp_ASSESSMENT_Tests_results,Box_NOT_CLOSABLE,2);
/***** Header of the table with the list of users *****/
Tst_ShowHeaderTestResults ();
/***** List the test exams of the selected users *****/
Ptr = Gbl.Usrs.Selected.List[Rol_UNK];
while (*Ptr)
{ {
/***** Begin box and table *****/ Par_GetNextStrUntilSeparParamMult (&Ptr,Gbl.Usrs.Other.UsrDat.EncryptedUsrCod,
Box_StartBoxTable (NULL,Txt_Results,NULL, Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64);
Hlp_ASSESSMENT_Tests_results,Box_NOT_CLOSABLE,2); Usr_GetUsrCodFromEncryptedUsrCod (&Gbl.Usrs.Other.UsrDat);
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Usr_DONT_GET_PREFS)) // Get of the database the data of the user
/***** Header of the table with the list of users *****/ if (Usr_CheckIfICanViewTst (&Gbl.Usrs.Other.UsrDat))
Tst_ShowHeaderTestResults (); /***** Show test results *****/
Tst_ShowTstResults (&Gbl.Usrs.Other.UsrDat);
/***** List the test exams of the selected users *****/
Ptr = Gbl.Usrs.Selected.List[Rol_UNK];
while (*Ptr)
{
Par_GetNextStrUntilSeparParamMult (&Ptr,Gbl.Usrs.Other.UsrDat.EncryptedUsrCod,
Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64);
Usr_GetUsrCodFromEncryptedUsrCod (&Gbl.Usrs.Other.UsrDat);
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Usr_DONT_GET_PREFS)) // Get of the database the data of the user
if (Usr_CheckIfICanViewTst (&Gbl.Usrs.Other.UsrDat))
/***** Show test results *****/
Tst_ShowTstResults (&Gbl.Usrs.Other.UsrDat);
}
/***** End table and box *****/
Box_EndBoxTable ();
}
else // If no users are selected...
{
// ...write warning alert
Ale_ShowAlert (Ale_WARNING,Txt_You_must_select_one_ore_more_users);
// ...and show again the form
Tst_SelUsrsToViewUsrsTstResults ();
} }
/***** Free memory used by list of selected users' codes *****/ /***** End table and box *****/
Usr_FreeListsSelectedEncryptedUsrsCods (); Box_EndBoxTable ();
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -211,7 +211,7 @@ void Tst_GetTestStats (Tst_AnswerType_t AnsType,struct Tst_Stats *Stats);
void Tst_SelUsrsToViewUsrsTstResults (void); void Tst_SelUsrsToViewUsrsTstResults (void);
void Tst_SelDatesToSeeMyTstResults (void); void Tst_SelDatesToSeeMyTstResults (void);
void Tst_ShowMyTstResults (void); void Tst_ShowMyTstResults (void);
void Tst_ShowUsrsTstResults (void); void Tst_GetUsrsAndShowTstResults (void);
void Tst_ShowOneTstResult (void); void Tst_ShowOneTstResult (void);
void Tst_ShowTestResult (struct UsrData *UsrDat, void Tst_ShowTestResult (struct UsrData *UsrDat,
unsigned NumQsts,time_t TstTimeUTC); unsigned NumQsts,time_t TstTimeUTC);