From 731e749dddd2b2d16e71da0ba21db74b485caa8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 22 May 2017 21:03:14 +0200 Subject: [PATCH] Version 16.220.13 --- swad_changelog.h | 3 ++- swad_survey.c | 13 +++++++++++++ swad_survey.h | 2 +- swad_tab.c | 2 +- swad_test.c | 31 ++++++++++++++++++++++++++----- swad_text.c | 18 +++++++++--------- 6 files changed, 52 insertions(+), 17 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 15c67c6e9..1731c6c22 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -233,13 +233,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.220.12 (2017-05-22)" +#define Log_PLATFORM_VERSION "SWAD 16.220.13 (2017-05-22)" #define CSS_FILE "swad16.209.3.css" #define JS_FILE "swad16.206.3.js" // 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 sql/swad*.sql | tail -1 /* + Version 16.220.13:May 22, 2017 Changes related with new role. Not finished. (220190 lines) Version 16.220.12:May 22, 2017 Changes related with new role. Not finished. (220155 lines) Version 16.220.11:May 22, 2017 Changes related with new role. Not finished. (220019 lines) Version 16.220.10:May 22, 2017 Changes related with new role. Not finished. (219775 lines) diff --git a/swad_survey.c b/swad_survey.c index 753887d6e..b671641e6 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -619,6 +619,7 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst, "ASG_GRP_LIGHT", Txt_Users); Rol_WriteSelectorRoles (1 << Rol_STD | + 1 << Rol_NET | 1 << Rol_TCH, Svy.Roles, true,false); @@ -1261,6 +1262,17 @@ void Svy_GetDataOfSurveyByCod (struct Survey *Svy) Svy->Status.IHaveAnswered; Svy->Status.ICanEdit = false; break; + case Rol_NET: + Svy->Status.ICanViewResults = (Svy->Scope == Sco_SCOPE_CRS || + Svy->Scope == Sco_SCOPE_DEG || + Svy->Scope == Sco_SCOPE_CTR || + Svy->Scope == Sco_SCOPE_INS || + Svy->Scope == Sco_SCOPE_CTY || + Svy->Scope == Sco_SCOPE_SYS) && + Svy->NumQsts != 0 && + !Svy->Status.ICanAnswer; + Svy->Status.ICanEdit = false; + break; case Rol_TCH: Svy->Status.ICanViewResults = (Svy->Scope == Sco_SCOPE_CRS || Svy->Scope == Sco_SCOPE_DEG || @@ -1861,6 +1873,7 @@ void Svy_RequestCreatOrEditSvy (void) The_ClassForm[Gbl.Prefs.Theme], Txt_Users); Rol_WriteSelectorRoles (1 << Rol_STD | + 1 << Rol_NET | 1 << Rol_TCH, Svy.Roles, false,false); diff --git a/swad_survey.h b/swad_survey.h index 753536056..9f991b960 100644 --- a/swad_survey.h +++ b/swad_survey.h @@ -48,7 +48,7 @@ struct Survey long SvyCod; Sco_Scope_t Scope; long Cod; // Country, institution, centre, degree or course code - unsigned Roles; // Example: if survey can be made by students and teachers, Roles == (1 << Rol_STD) | (1 << Rol_TCH) + unsigned Roles; // Example: if survey can be made by students, Roles == (1 << Rol_STD) long UsrCod; char Title[Svy_MAX_BYTES_SURVEY_TITLE + 1]; time_t TimeUTC[Svy_NUM_DATES]; diff --git a/swad_tab.c b/swad_tab.c index 5c08b4b42..46d9de2bc 100644 --- a/swad_tab.c +++ b/swad_tab.c @@ -188,7 +188,7 @@ static bool Tab_CheckIfICanViewTab (Tab_Tab_t Tab) return (Gbl.CurrentCrs.Crs.CrsCod > 0); // Course selected case TabAss: return (Gbl.CurrentCrs.Crs.CrsCod > 0 || // Course selected - Gbl.Usrs.Me.LoggedRole >= Rol_STD);// Surveys not available for unknown users and guests + Gbl.Usrs.Me.LoggedRole >= Rol_STD); // Surveys not available for unknown users and guests case TabFil: return (Gbl.CurrentIns.Ins.InsCod > 0); // Institution selected default: diff --git a/swad_test.c b/swad_test.c index a1c52a3b3..77d48cad7 100644 --- a/swad_test.c +++ b/swad_test.c @@ -305,6 +305,7 @@ void Tst_ShowFormAskTst (void) case Rol_STD: Tst_PutFormToViewResultsOfUsersTests (ActReqSeeMyTstRes); break; + case Rol_NET: case Rol_TCH: case Rol_SYS_ADM: Tst_PutFormToViewResultsOfUsersTests (ActReqSeeUsrTstRes); @@ -6967,10 +6968,12 @@ void Tst_SelUsrsToSeeUsrsTestResults (void) Grp_GetParCodsSeveralGrpsToShowUsrs (); /***** Get and order lists of users from this course *****/ - Usr_GetListUsrs (Rol_TCH,Sco_SCOPE_CRS); Usr_GetListUsrs (Rol_STD,Sco_SCOPE_CRS); - NumTotalUsrs = Gbl.Usrs.LstUsrs[Rol_TCH].NumUsrs + - Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs; + Usr_GetListUsrs (Rol_NET,Sco_SCOPE_CRS); + Usr_GetListUsrs (Rol_TCH,Sco_SCOPE_CRS); + NumTotalUsrs = Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs + + Gbl.Usrs.LstUsrs[Rol_NET].NumUsrs + + Gbl.Usrs.LstUsrs[Rol_TCH].NumUsrs; /***** Start frame *****/ Lay_StartRoundFrame (NULL,Txt_Test_results, @@ -7001,6 +7004,7 @@ void Tst_SelUsrsToSeeUsrsTestResults (void) The_ClassForm[Gbl.Prefs.Theme]); Lay_StartTable (2); Usr_ListUsersToSelect (Rol_TCH); + Usr_ListUsersToSelect (Rol_NET); Usr_ListUsersToSelect (Rol_STD); Lay_EndTable (); fprintf (Gbl.F.Out,"" @@ -7026,6 +7030,7 @@ void Tst_SelUsrsToSeeUsrsTestResults (void) /***** Free memory for users' list *****/ Usr_FreeUsrsList (Rol_TCH); + Usr_FreeUsrsList (Rol_NET); Usr_FreeUsrsList (Rol_STD); /***** Free memory used by list of selected users' codes *****/ @@ -7303,6 +7308,7 @@ static void Tst_ShowTestResults (struct UsrData *UsrDat) ICanViewScore = ItsMe && Gbl.Test.Config.FeedbackType != Tst_FEEDBACK_NOTHING; break; + case Rol_NET: case Rol_TCH: case Rol_DEG_ADM: case Rol_CTR_ADM: @@ -7426,6 +7432,7 @@ static void Tst_ShowTestResults (struct UsrData *UsrDat) ICanViewTotalScore = ItsMe && Gbl.Test.Config.FeedbackType != Tst_FEEDBACK_NOTHING; break; + case Rol_NET: case Rol_TCH: case Rol_DEG_ADM: case Rol_CTR_ADM: @@ -7524,6 +7531,7 @@ static void Tst_ShowDataUsr (struct UsrData *UsrDat,unsigned NumTestResults) { bool ShowPhoto; char PhotoURL[PATH_MAX + 1]; + Act_Action_t NextAction; /***** Show user's photo and name *****/ fprintf (Gbl.F.Out,"", Gbl.RowEvenOdd); - Act_FormStart (UsrDat->RoleInCurrentCrsDB == Rol_STD ? ActSeeRecOneStd : - ActSeeRecOneTch); + switch (UsrDat->RoleInCurrentCrsDB) + { + case Rol_STD: + NextAction = ActSeeRecOneStd; + break; + case Rol_NET: + case Rol_TCH: + NextAction = ActSeeRecOneTch; + break; + default: + NextAction = ActUnk; + Lay_ShowErrorAndExit ("Wrong role."); + break; + } + Act_FormStart (NextAction); Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); Act_LinkFormSubmit (UsrDat->FullName,"AUTHOR_TXT",NULL); diff --git a/swad_text.c b/swad_text.c index ee1ddd7f0..6778cf631 100644 --- a/swad_text.c +++ b/swad_text.c @@ -25608,23 +25608,23 @@ const char *Txt_No_users_found[Rol_NUM_ROLES] = #endif , #if L==1 // Rol_NET - "No hi ha professors." + "No hi ha professors no editors." #elif L==2 - "Keine Lehrkräften gefunden." + "Keine nicht bearbeiteter Lehrkräften gefunden." #elif L==3 - "No teachers found." + "No non-editing teachers found." #elif L==4 - "No hay profesores." + "No hay profesores no editores." #elif L==5 - "Aucun enseignant trouvé." + "Aucun enseignant non-éditeur trouvé." #elif L==6 - "No hay profesores." // Okoteve traducción + "No hay profesores no editores." // Okoteve traducción #elif L==7 - "Non ci sono professori." + "Non ci sono professori non-editing." #elif L==8 - "Nie znaleziono nauczycieli." + "Nie znaleziono nauczycieli nie edytujący." #elif L==9 - "Nenhum professor encontrado." + "Nenhum professor não editor encontrado." #endif , #if L==1 // Rol_TCH