diff --git a/swad_action.c b/swad_action.c index 9c5546a1..60d9a044 100644 --- a/swad_action.c +++ b/swad_action.c @@ -2084,7 +2084,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActSeeTst */{ 29,-1,TabUnk,ActReqTst ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowNewTest ,NULL}, /* ActAssTst */{ 98,-1,TabUnk,ActReqTst ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_AssessTest ,NULL}, - /* ActEdiTstQst */{ 104,-1,TabUnk,ActReqTst ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Tst_SetIniEndDates ,Tst_ShowFormAskEditTsts ,NULL}, + /* ActEdiTstQst */{ 104,-1,TabUnk,ActReqTst ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,Tst_ShowFormAskEditTsts ,NULL}, /* ActEdiOneTstQst */{ 105,-1,TabUnk,ActReqTst ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowFormEditOneQst ,NULL}, /* ActReqImpTstQst */{1007,-1,TabUnk,ActReqTst ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TsI_ShowFormImportQstsFromXML ,NULL}, /* ActImpTstQst */{1008,-1,TabUnk,ActReqTst ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_DATA,Act_BRW_1ST_TAB,NULL ,TsI_ImportQstsFromXML ,NULL}, @@ -2100,10 +2100,10 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActRenTag */{ 143,-1,TabUnk,ActReqTst ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_RenameTag ,NULL}, /* ActRcvCfgTst */{ 454,-1,TabUnk,ActReqTst ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ReceiveConfigTst ,NULL}, - /* ActReqSeeMyTstRes */{1083,-1,TabUnk,ActReqTst ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Tst_SetIniEndDates ,Tst_SelDatesToSeeMyTestResults ,NULL}, + /* ActReqSeeMyTstRes */{1083,-1,TabUnk,ActReqTst ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,Tst_SelDatesToSeeMyTestResults ,NULL}, /* ActSeeMyTstRes */{1084,-1,TabUnk,ActReqTst ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowMyTestResults ,NULL}, /* ActSeeOneTstResMe */{1085,-1,TabUnk,ActReqTst ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowOneTestResult ,NULL}, - /* ActReqSeeUsrTstRes*/{1080,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Tst_SetIniEndDates ,Tst_SelUsrsToSeeUsrsTestResults,NULL}, + /* ActReqSeeUsrTstRes*/{1080,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,Tst_SelUsrsToSeeUsrsTestResults,NULL}, /* ActSeeUsrTstRes */{1081,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowUsrsTestResults ,NULL}, /* ActSeeOneTstResOth*/{1082,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowOneTestResult ,NULL}, diff --git a/swad_changelog.h b/swad_changelog.h index 2a179dfe..9cdfd268 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -365,8 +365,6 @@ Buenos d // TODO: Arreglar tamaņo de iconos al ver la asistencia de un estudiante. -// TODO: Fix bug: En una ficha de un alumno, al pulsar sobre "Ver test" no se ven los test que ha hecho - // TODO: Sale de vez en cuando un mensaje "Can not get information about a file or folder.", por ejemplo en el timeline. /*****************************************************************************/ @@ -388,10 +386,11 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.33.3 (2019-02-11)" +#define Log_PLATFORM_VERSION "SWAD 18.34 (2019-02-11)" #define CSS_FILE "swad18.33.css" #define JS_FILE "swad18.32.1.js" /* + Version 18.34: Feb 11, 2019 Fixed bug in test results. (239110 lines) Version 18.33.3: Feb 11, 2019 Changed Type to Role in some stats. (239093 lines) Version 18.33.2: Feb 11, 2019 Icon to view places in centre configuration. (239093 lines) Version 18.33.1: Jan 15, 2019 Fixed bug in file browser, reported by Miguel Damas. diff --git a/swad_date.c b/swad_date.c index 64162e04..4fc28ace 100644 --- a/swad_date.c +++ b/swad_date.c @@ -917,6 +917,26 @@ void Dat_GetDateFromForm (const char *ParamNameDay,const char *ParamNameMonth,co *Year = (unsigned) Par_GetParToUnsignedLong (ParamNameYear ,0,UINT_MAX,0); } +/*****************************************************************************/ +/******* Set initial date to distant past and end date to current date *******/ +/*****************************************************************************/ + +void Dat_SetIniEndDates (void) + { + Gbl.DateRange.TimeUTC[0] = (time_t) 0; + Gbl.DateRange.TimeUTC[1] = Gbl.StartExecutionTimeUTC; + } + +/*****************************************************************************/ +/******** Write parameters of initial and final dates *****/ +/*****************************************************************************/ + +void Dat_WriteParamsIniEndDates (void) + { + Par_PutHiddenParamUnsigned ("StartTimeUTC",Gbl.DateRange.TimeUTC[0]); + Par_PutHiddenParamUnsigned ("EndTimeUTC" ,Gbl.DateRange.TimeUTC[1]); + } + /*****************************************************************************/ /************************** Get initial and end dates ************************/ /*****************************************************************************/ diff --git a/swad_date.h b/swad_date.h index 6615ccc6..be9b07e4 100644 --- a/swad_date.h +++ b/swad_date.h @@ -160,6 +160,8 @@ void Dat_WriteFormDate (unsigned FirstYear,unsigned LastYear, void Dat_GetDateFromForm (const char *ParamNameDay,const char *ParamNameMonth,const char *ParamNameYear, unsigned *Day,unsigned *Month,unsigned *Year); +void Dat_SetIniEndDates (void); +void Dat_WriteParamsIniEndDates (void); void Dat_GetIniEndDatesFromForm (void); void Dat_WriteRFC822DateFromTM (FILE *File,struct tm *tm); diff --git a/swad_record.c b/swad_record.c index 09d06b5d..925b43dc 100644 --- a/swad_record.c +++ b/swad_record.c @@ -106,6 +106,8 @@ static void Rec_ShowMyCrsRecordUpdated (void); static bool Rec_CheckIfICanEditField (Rec_VisibilityRecordFields_t Visibility); static void Rec_PutIconsCommands (void); +static void Rec_PutParamsMyTsts (void); +static void Rec_PutParamsStdTsts (void); static void Rec_PutParamsWorks (void); static void Rec_PutParamsStudent (void); static void Rec_PutParamsMsgUsr (void); @@ -2621,12 +2623,13 @@ static void Rec_PutIconsCommands (void) if (Usr_CheckIfICanViewTst (Gbl.Record.UsrDat)) { if (ItsMe) - Lay_PutContextualLinkOnlyIcon (ActSeeMyTstRes,NULL,NULL, + Lay_PutContextualLinkOnlyIcon (ActSeeMyTstRes,NULL, + Rec_PutParamsMyTsts, "check.svg", Txt_View_test_results); else // Not me Lay_PutContextualLinkOnlyIcon (ActSeeUsrTstRes,NULL, - Rec_PutParamsStudent, + Rec_PutParamsStdTsts, "check.svg", Txt_View_test_results); } @@ -2702,6 +2705,19 @@ void Rec_PutParamUsrCodEncrypted (void) Usr_PutParamUsrCodEncrypted (Gbl.Record.UsrDat->EncryptedUsrCod); } +static void Rec_PutParamsMyTsts (void) + { + Dat_SetIniEndDates (); + Dat_WriteParamsIniEndDates (); + } + +static void Rec_PutParamsStdTsts (void) + { + Rec_PutParamsStudent (); + Dat_SetIniEndDates (); + Dat_WriteParamsIniEndDates (); + } + static void Rec_PutParamsWorks (void) { Rec_PutParamsStudent (); diff --git a/swad_statistic.c b/swad_statistic.c index a84faba4..8a4f8bf5 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -1703,7 +1703,7 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql if (FirstRow > 1) { Frm_StartFormAnchor (ActSeeAccCrs,Sta_STAT_RESULTS_SECTION_ID); - Sta_WriteParamsDatesSeeAccesses (); + Dat_WriteParamsIniEndDates (); Par_PutHiddenParamUnsigned ("GroupedBy",(unsigned) Sta_CLICKS_CRS_DETAILED_LIST); Par_PutHiddenParamUnsigned ("StatAct" ,(unsigned) Gbl.Stat.NumAction); Par_PutHiddenParamLong ("FirstRow",FirstRow - Gbl.Stat.RowsPerPage); @@ -1739,7 +1739,7 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql if (LastRow < NumRows) { Frm_StartFormAnchor (ActSeeAccCrs,Sta_STAT_RESULTS_SECTION_ID); - Sta_WriteParamsDatesSeeAccesses (); + Dat_WriteParamsIniEndDates (); Par_PutHiddenParamUnsigned ("GroupedBy",(unsigned) Sta_CLICKS_CRS_DETAILED_LIST); Par_PutHiddenParamUnsigned ("StatAct" ,(unsigned) Gbl.Stat.NumAction); Par_PutHiddenParamUnsigned ("FirstRow" ,(unsigned) (LastRow + 1)); @@ -2215,7 +2215,7 @@ static void Sta_ShowDistrAccessesPerDayAndHour (unsigned long NumRows,MYSQL_RES "