From 32e5b7f41e729d30e4779eac13ab62c3bd0df40e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 2 Mar 2015 19:53:19 +0100 Subject: [PATCH] Version 14.76.1 --- swad_changelog.h | 3 ++- swad_record.c | 44 +++++++++++++++++++++++++++++++++++++------- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 83ac5d8be..8dfd8868f 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -103,11 +103,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.76 (2015/03/02)" +#define Log_PLATFORM_VERSION "SWAD 14.76.1 (2015/03/02)" // 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 | tail -1 /* + Version 14.76.1: Mar 02, 2015 Button in student record to view student's test exams. (178225 lines) Version 14.76: Mar 02, 2015 Button in student record to view student's works. (178197 lines) Version 14.75.2: Mar 02, 2015 New icon for new notifications. (178176 lines) Version 14.75.1: Mar 02, 2015 Fixed bug in file browser, reported by Germán Luzón González and Javier Fernández Baldomero. (178175 lines) diff --git a/swad_record.c b/swad_record.c index cad7b4e19..4a87010ea 100644 --- a/swad_record.c +++ b/swad_record.c @@ -1991,6 +1991,7 @@ void Rec_ShowCommonRecord (Rec_RecordViewType_t TypeOfView, extern const char *Txt_Nickname; extern const char *Txt_Write_a_message_to_X; extern const char *Txt_View_works; + extern const char *Txt_See_exams; extern const char *Txt_Email; extern const char *Txt_Sex; extern const char *Txt_Role; @@ -2163,6 +2164,8 @@ void Rec_ShowCommonRecord (Rec_RecordViewType_t TypeOfView, " text-align:center; vertical-align:top;\">", Rec_INSTITUTION_LOGO_SIZE + 8); + fprintf (Gbl.F.Out,"
" "\"%s\"" + " style=\"width:16px;height:16px;margin:0 3px;\" alt=\"%s\" />" "
" "" "", @@ -2191,7 +2194,7 @@ void Rec_ShowCommonRecord (Rec_RecordViewType_t TypeOfView, Act_LinkFormSubmit (Gbl.Title,ClassData); fprintf (Gbl.F.Out,"
" "\"%s\"" + " style=\"width:16px;height:16px;margin:0 3px;\" alt=\"%s\" />" "
" "" "", @@ -2199,25 +2202,52 @@ void Rec_ShowCommonRecord (Rec_RecordViewType_t TypeOfView, Gbl.Title); } - if (Gbl.CurrentCrs.Crs.CrsCod > 0 && // Course selected - UsrDat->RoleInCurrentCrsDB == Rol_ROLE_STUDENT) // He/she is a student in the current course + if (Gbl.CurrentCrs.Crs.CrsCod > 0 && // Course selected + UsrDat->RoleInCurrentCrsDB == Rol_ROLE_STUDENT && // He/she is a student in the current course + (ItsMe || IAmTeacher || IAmSuperuser)) // I can view { /***** Button to view user's assignments and works *****/ - Act_FormStart (ActAdmAsgWrkCrs); + if (ItsMe) // I am a student + Act_FormStart (ActAdmAsgWrkUsr); + else // I am a teacher or superuser + { + Act_FormStart (ActAdmAsgWrkCrs); + Par_PutHiddenParamString ("UsrCodStd",UsrDat->EncryptedUsrCod); + } Grp_PutParamAllGroups (); Par_PutHiddenParamChar ("FullTree",'Y'); // By default, show all files - Par_PutHiddenParamString ("UsrCodStd",UsrDat->EncryptedUsrCod); Act_LinkFormSubmit (Txt_View_works,ClassData); fprintf (Gbl.F.Out,"
" "\"%s\"" + " style=\"width:16px;height:16px;margin:0 3px;\" alt=\"%s\" />" "
" "" "", Gbl.Prefs.IconsURL, Txt_View_works); + + /***** Button to view user's test exams *****/ + if (ItsMe) + Act_FormStart (ActSeeMyTstExa); + else + { + Act_FormStart (ActSeeUsrTstExa); + Par_PutHiddenParamString ("UsrCodStd",UsrDat->EncryptedUsrCod); + } + Grp_PutParamAllGroups (); + Act_LinkFormSubmit (Txt_See_exams,ClassData); + fprintf (Gbl.F.Out,"
" + "\"%s\"" + "
" + "" + "", + Gbl.Prefs.IconsURL, + Txt_See_exams); } + fprintf (Gbl.F.Out,""); + /***** Full name *****/ fprintf (Gbl.F.Out,"" "