Version19.8.1

This commit is contained in:
Antonio Cañas Vargas 2019-09-22 14:15:38 +02:00
parent e727a66f68
commit 138b24327c
4 changed files with 54 additions and 3 deletions

View File

@ -468,10 +468,11 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 19.8 (2019-09-22)"
#define Log_PLATFORM_VERSION "SWAD 19.8.1 (2019-09-22)"
#define CSS_FILE "swad19.3.css"
#define JS_FILE "swad18.130.2.js"
/*
Version 19.8.1: Sep 22, 2019 View matches results. Not finished. (245474 lines)
Version 19.8: Sep 22, 2019 View matches results. Not finished.
Help links related to test and match results changed. (245412 lines)
1 change necessary in database:

View File

@ -2663,7 +2663,7 @@ void Mch_ShowUsrsMchResults (void)
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)) // TODO: Change to matches results
if (Usr_CheckIfICanViewMch (&Gbl.Usrs.Other.UsrDat))
/***** Show matches results *****/
Mch_ShowMchResults (&Gbl.Usrs.Other.UsrDat);
}

View File

@ -1259,7 +1259,7 @@ bool Usr_CheckIfICanViewRecordTch (struct UsrData *UsrDat)
}
/*****************************************************************************/
/************** Check if I can view test exams of another user ***************/
/************ Check if I can view test results of another user ***************/
/*****************************************************************************/
bool Usr_CheckIfICanViewTst (const struct UsrData *UsrDat)
@ -1307,6 +1307,55 @@ bool Usr_CheckIfICanViewTst (const struct UsrData *UsrDat)
}
}
/*****************************************************************************/
/*********** Check if I can view matches results of another user *************/
/*****************************************************************************/
bool Usr_CheckIfICanViewMch (const struct UsrData *UsrDat)
{
bool ItsMe;
/***** 1. Fast check: Am I logged? *****/
if (!Gbl.Usrs.Me.Logged)
return false;
/***** 2. Fast check: Is it a valid user code? *****/
if (UsrDat->UsrCod <= 0)
return false;
/***** 3. Fast check: Is it a course selected? *****/
if (Gbl.Hierarchy.Crs.CrsCod <= 0)
return false;
/***** 4. Fast check: Am I a system admin? *****/
if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
return true;
/***** 5. Fast check: Do I belong to the current course? *****/
if (!Gbl.Usrs.Me.IBelongToCurrentCrs)
return false;
/***** 6. Fast check: It's me? *****/
ItsMe = Usr_ItsMe (UsrDat->UsrCod);
if (ItsMe)
return true;
/***** 7. Fast check: Does he/she belong to the current course? *****/
if (!Usr_CheckIfUsrBelongsToCurrentCrs (UsrDat))
return false;
/***** 8. Fast / slow check depending on roles *****/
switch (Gbl.Usrs.Me.Role.Logged)
{
case Rol_NET:
return Grp_CheckIfUsrSharesAnyOfMyGrpsInCurrentCrs (UsrDat);
case Rol_TCH:
return true;
default:
return false;
}
}
/*****************************************************************************/
/********** Check if I can view assigments / works of another user ***********/
/*****************************************************************************/

View File

@ -300,6 +300,7 @@ bool Usr_CheckIfUsrHasAcceptedInCurrentCrs (const struct UsrData *UsrDat);
bool Usr_CheckIfICanViewRecordStd (const struct UsrData *UsrDat);
bool Usr_CheckIfICanViewRecordTch (struct UsrData *UsrDat);
bool Usr_CheckIfICanViewTst (const struct UsrData *UsrDat);
bool Usr_CheckIfICanViewMch (const struct UsrData *UsrDat);
bool Usr_CheckIfICanViewAsgWrk (const struct UsrData *UsrDat);
bool Usr_CheckIfICanViewAtt (const struct UsrData *UsrDat);
bool Usr_CheckIfICanViewUsrAgenda (struct UsrData *UsrDat);