Version 16.220.13

This commit is contained in:
Antonio Cañas Vargas 2017-05-22 21:03:14 +02:00
parent 5d92078a14
commit 731e749ddd
6 changed files with 52 additions and 17 deletions

View File

@ -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)

View File

@ -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);

View File

@ -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];

View File

@ -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:

View File

@ -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,"</td>"
@ -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,"<td ");
@ -7543,8 +7551,21 @@ static void Tst_ShowDataUsr (struct UsrData *UsrDat,unsigned NumTestResults)
fprintf (Gbl.F.Out,"rowspan=\"%u\"",NumTestResults + 1);
fprintf (Gbl.F.Out," class=\"LEFT_TOP COLOR%u\">",
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);

View File

@ -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&auml;ften gefunden."
"Keine nicht bearbeiteter Lehrkr&auml;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&eacute;."
"Aucun enseignant non-&eacute;diteur trouv&eacute;."
#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&aogon;cy."
#elif L==9
"Nenhum professor encontrado."
"Nenhum professor n&atilde;o editor encontrado."
#endif
,
#if L==1 // Rol_TCH