diff --git a/swad_action.c b/swad_action.c index bc8435d54..25336fa4d 100644 --- a/swad_action.c +++ b/swad_action.c @@ -2172,12 +2172,12 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActRenTag */{ 143,-1,TabAss,ActReqTst ,0x110,0x100,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Tst_RenameTag ,NULL}, /* ActRcvCfgTst */{ 454,-1,TabAss,ActReqTst ,0x110,0x100,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Tst_ReceiveConfigTst ,NULL}, - /* ActReqSeeMyTstExa */{1083,-1,TabAss,ActReqTst ,0x108,0x100,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Tst_SelDatesToSeeMyTstExams ,NULL}, - /* ActSeeMyTstExa */{1084,-1,TabAss,ActReqTst ,0x108,0x100,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Tst_ShowMyTestResults ,NULL}, - /* ActSeeOneTstExaMe */{1085,-1,TabAss,ActReqTst ,0x108,0x100,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Tst_ShowOneTestExam ,NULL}, - /* ActReqSeeUsrTstExa*/{1080,-1,TabAss,ActReqTst ,0x110,0x100,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,Tst_SetIniEndDates ,Tst_SelUsrsToSeeUsrsTstExams ,NULL}, - /* ActSeeUsrTstExa */{1081,-1,TabAss,ActReqTst ,0x110,0x100,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Tst_ShowUsrsTestResults ,NULL}, - /* ActSeeOneTstExaOth*/{1082,-1,TabAss,ActReqTst ,0x110,0x100,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Tst_ShowOneTestExam ,NULL}, + /* ActReqSeeMyTstExa */{1083,-1,TabAss,ActReqTst ,0x108,0x100,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,Tst_SetIniEndDates ,Tst_SelDatesToSeeMyExams ,NULL}, + /* ActSeeMyTstExa */{1084,-1,TabAss,ActReqTst ,0x108,0x100,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Tst_ShowMyExams ,NULL}, + /* ActSeeOneTstExaMe */{1085,-1,TabAss,ActReqTst ,0x108,0x100,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Tst_ShowOneExam ,NULL}, + /* ActReqSeeUsrTstExa*/{1080,-1,TabAss,ActReqTst ,0x110,0x100,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,Tst_SetIniEndDates ,Tst_SelUsrsToSeeUsrsExams ,NULL}, + /* ActSeeUsrTstExa */{1081,-1,TabAss,ActReqTst ,0x110,0x100,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Tst_ShowUsrsExams ,NULL}, + /* ActSeeOneTstExaOth*/{1082,-1,TabAss,ActReqTst ,0x110,0x100,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Tst_ShowOneExam ,NULL}, /* ActPrnCal */{ 71,-1,TabAss,ActSeeCal ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_NEW_WINDOW ,NULL ,Cal_DrawCalendar ,NULL}, /* ActChgCal1stDay */{1485,-1,TabAss,ActSeeCal ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_MAIN_WINDOW,Cal_ChangeFirstDayOfWeek ,Cal_DrawCalendar ,NULL}, diff --git a/swad_changelog.h b/swad_changelog.h index ed433e224..f76ff283e 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -136,19 +136,19 @@ // TODO: Fix bug in copy-paste from Briefcase to another file browser // TODO: Fix bug: Asignatura: Arquitectura de Computadores, Crear ZIP de todos los trabajos del grupo C3 // TODO: Fix bug: se oculta el único descriptor de unas preguntas de test, y luego se renombra dicho descriptor --> el descriptor desaparece -// TODO: Fix bug: Student cant not see their test results /*****************************************************************************/ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.212.2 (2016-05-30)" +#define Log_PLATFORM_VERSION "SWAD 15.212.3 (2016-05-30)" #define CSS_FILE "swad15.210.css" #define JS_FILE "swad15.197.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 15.212.3: May 30, 2016 Fixed bug in test question. A student can see now his/her test results. (201522 lines) Version 15.212.2: May 30, 2016 Fixed bug in test question. Button "Add a new question" in tests will not be available for students. (201516 lines) Version 15.212.1: May 30, 2016 Fixed bug in course information. (201515 lines) Version 15.212: May 30, 2016 Fixed bug in edition of syllabus, reported by Raymon Moreno Colina and Javier Fernández Baldomero. diff --git a/swad_test.c b/swad_test.c index b1b73def7..d2aa5f64a 100644 --- a/swad_test.c +++ b/swad_test.c @@ -140,7 +140,7 @@ extern struct Globals Gbl; /***************************** Internal prototypes ***************************/ /*****************************************************************************/ -static void Tst_PutFormToSeeResultsOfUsersTests (void); +static void Tst_PutFormToSeeResultsOfUsersTests (Act_Action_t Action); static void Tst_GetQuestionsAndAnswersFromForm (void); static void Tst_ShowTstTotalMark (double TotalScore); @@ -288,12 +288,18 @@ void Tst_ShowFormAskTst (void) /***** Read test configuration from database *****/ Tst_GetConfigTstFromDB (); - /***** Put form to go to test edition and configuration *****/ - if (ICanEdit) + /***** Put link to view tests results (exams) *****/ + switch (Gbl.Usrs.Me.LoggedRole) { - fprintf (Gbl.F.Out,"
"); - Tst_PutFormToSeeResultsOfUsersTests (); - fprintf (Gbl.F.Out,"
"); + case Rol_STUDENT: + Tst_PutFormToSeeResultsOfUsersTests (ActReqSeeMyTstExa); + break; + case Rol_TEACHER: + case Rol_SYS_ADM: + Tst_PutFormToSeeResultsOfUsersTests (ActReqSeeUsrTstExa); + break; + default: + break; } /***** Start frame *****/ @@ -360,14 +366,14 @@ void Tst_ShowFormAskTst (void) /*************** Write a form to go to result of users' tests ****************/ /*****************************************************************************/ -static void Tst_PutFormToSeeResultsOfUsersTests (void) +static void Tst_PutFormToSeeResultsOfUsersTests (Act_Action_t Action) { extern const char *Txt_Results_tests; - Lay_PutContextualLink (Gbl.Usrs.Me.LoggedRole == Rol_STUDENT ? ActReqSeeMyTstExa : - ActReqSeeUsrTstExa, - NULL,"file64x64.gif", + fprintf (Gbl.F.Out,"
"); + Lay_PutContextualLink (Action,NULL,"file64x64.gif", Txt_Results_tests,Txt_Results_tests); + fprintf (Gbl.F.Out,"
"); } /*****************************************************************************/ @@ -6778,7 +6784,7 @@ static unsigned Tst_GetNumCoursesWithPluggableTstQuestions (Sco_Scope_t Scope,Ts /******* Select users and dates to show their results in test exams **********/ /*****************************************************************************/ -void Tst_SelUsrsToSeeUsrsTstExams (void) +void Tst_SelUsrsToSeeUsrsExams (void) { extern const char *The_ClassForm[The_NUM_THEMES]; extern const char *Txt_Exams; @@ -6863,7 +6869,7 @@ void Tst_SelUsrsToSeeUsrsTstExams (void) /************** Select dates to show my results in test exams ****************/ /*****************************************************************************/ -void Tst_SelDatesToSeeMyTstExams (void) +void Tst_SelDatesToSeeMyExams (void) { extern const char *Txt_Exams; extern const char *Txt_See_exams; @@ -6925,7 +6931,7 @@ static void Tst_StoreScoreOfTestExamInDB (long TstCod, /*************** Show results in test exams for several users ****************/ /*****************************************************************************/ -void Tst_ShowUsrsTestResults (void) +void Tst_ShowUsrsExams (void) { extern const char *Txt_Exams; extern const char *Txt_You_must_select_one_ore_more_users; @@ -6966,7 +6972,7 @@ void Tst_ShowUsrsTestResults (void) // ...write warning alert Lay_ShowAlert (Lay_WARNING,Txt_You_must_select_one_ore_more_users); // ...and show again the form - Tst_SelUsrsToSeeUsrsTstExams (); + Tst_SelUsrsToSeeUsrsExams (); } /***** Free the memory used for the list of users *****/ @@ -7025,7 +7031,7 @@ static void Tst_ShowHeaderTestResults (void) /************************ Show my results in test exams **********************/ /*****************************************************************************/ -void Tst_ShowMyTestResults (void) +void Tst_ShowMyExams (void) { extern const char *Txt_Exams; @@ -7370,7 +7376,7 @@ static long Tst_GetParamTstCod (void) /******************* Show one test exam of another user **********************/ /*****************************************************************************/ -void Tst_ShowOneTestExam (void) +void Tst_ShowOneExam (void) { extern const char *Txt_Test_result; extern const char *Txt_ROLES_SINGUL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS]; diff --git a/swad_test.h b/swad_test.h index 99cce6bff..5ab001804 100644 --- a/swad_test.h +++ b/swad_test.h @@ -161,11 +161,11 @@ void Tst_FreeTagsList (void); void Tst_GetTestStats (Tst_AnswerType_t AnsType,struct Tst_Stats *Stats); -void Tst_SelUsrsToSeeUsrsTstExams (void); -void Tst_SelDatesToSeeMyTstExams (void); -void Tst_ShowUsrsTestResults (void); -void Tst_ShowMyTestResults (void); -void Tst_ShowOneTestExam (void); +void Tst_SelUsrsToSeeUsrsExams (void); +void Tst_SelDatesToSeeMyExams (void); +void Tst_ShowUsrsExams (void); +void Tst_ShowMyExams (void); +void Tst_ShowOneExam (void); void Tst_RemoveExamsMadeByUsrInAllCrss (long UsrCod); void Tst_RemoveExamsMadeByUsrInCrs (long UsrCod,long CrsCod); void Tst_RemoveCrsExams (long CrsCod);