diff --git a/swad_changelog.h b/swad_changelog.h index 3ef611829..aaa3304f0 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -123,7 +123,6 @@ // TODO: To avoid wrong email addresses, when a user fills his/her email address, check if the domain is in the white list of allowed domains. If not, ask for confirmation. // TODO: Important!!!! E-mail should not be visible for not logged users // TODO: Fix bug in marks reported by Francisco Ocaņa -// TODO: Button to see result of a survey in listing of surveys should be smaller? // TODO: Icon to the left in list of forums is not correct when scope is system // TODO: Move info about number of files to bottom of file browsers @@ -132,13 +131,15 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.162.5 (2016-03-24)" +#define Log_PLATFORM_VERSION "SWAD 15.162.6 (2016-03-24)" #define CSS_FILE "swad15.162.1.css" #define JS_FILE "swad15.131.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 15.162.6: Mar 24, 2016 Smaller buttons to see results of surveys. + Fix bug in surveys. (196615 lines) Version 15.162.5: Mar 24, 2016 Default role in registration form will be teacher for the creator of a course. (196615 lines) Version 15.162.4: Mar 24, 2016 Changes in button shown after editing institutions. (196612 lines) Version 15.162.3: Mar 24, 2016 Changes in button shown after editing centres. (196609 lines) diff --git a/swad_survey.c b/swad_survey.c index 515259883..2d7d78215 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -461,6 +461,37 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,bool Sh fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out,"\">"); Svy_WriteStatus (&Svy); + + if (!ShowOnlyThisSvyComplete) + { + /* Possible button to answer this survey */ + if (Svy.Status.ICanAnswer) + { + fprintf (Gbl.F.Out,"
"); + Act_FormStart (ActSeeOneSvy); + Svy_PutParamSvyCod (Svy.SvyCod); + Svy_PutHiddenParamSvyOrderType (); + Grp_PutParamWhichGrps (); + Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); + Lay_PutCreateButtonInline (Txt_Answer_survey); + Act_FormEnd (); + fprintf (Gbl.F.Out,"
"); + } + /* Possible button to see the result of the survey */ + else if (Svy.Status.ICanViewResults) + { + fprintf (Gbl.F.Out,"
"); + Act_FormStart (ActSeeOneSvy); + Svy_PutParamSvyCod (Svy.SvyCod); + Svy_PutHiddenParamSvyOrderType (); + Grp_PutParamWhichGrps (); + Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); + Lay_PutConfirmButtonInline (Txt_View_survey_results); + Act_FormEnd (); + fprintf (Gbl.F.Out,"
"); + } + } + fprintf (Gbl.F.Out,"" ""); @@ -530,44 +561,14 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,bool Sh Txt); /***** Write questions of this survey *****/ - fprintf (Gbl.F.Out,"" - ""); - - /* Write questions of this survey **/ + fprintf (Gbl.F.Out,"" + ""); Svy_ListSvyQuestions (&Svy,SvyQst); + fprintf (Gbl.F.Out,"" + ""); } - else - { - fprintf (Gbl.F.Out," class=\"COLOR%u\">",Gbl.RowEvenOdd); - - /* Possible button to answer this survey */ - if (Svy.Status.ICanAnswer) - { - Act_FormStart (ActSeeOneSvy); - Svy_PutParamSvyCod (Svy.SvyCod); - Svy_PutHiddenParamSvyOrderType (); - Grp_PutParamWhichGrps (); - Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - Lay_PutConfirmButton (Txt_Answer_survey); - Act_FormEnd (); - } - /* Possible button to see the result of the survey */ - else if (Svy.Status.ICanViewResults) - { - Act_FormStart (ActSeeOneSvy); - Svy_PutParamSvyCod (Svy.SvyCod); - Svy_PutHiddenParamSvyOrderType (); - Grp_PutParamWhichGrps (); - Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - Lay_PutConfirmButton (Txt_View_survey_results); - Act_FormEnd (); - } - } - fprintf (Gbl.F.Out,"" - ""); Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd; @@ -2798,7 +2799,7 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ extern const char *Txt_Question; extern const char *Txt_SURVEY_STR_ANSWER_TYPES[Svy_NUM_ANS_TYPES]; extern const char *Txt_This_survey_has_no_questions; - extern const char *Txt_Send_survey; + extern const char *Txt_Done; extern const char *Txt_Edit_question; char Query[512]; MYSQL_RES *mysql_res; @@ -2809,7 +2810,6 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ Gbl.Action.Act == ActEdiOneSvyQst || Gbl.Action.Act == ActRcvSvyQst); bool PutFormAnswerSurvey = Svy->Status.ICanAnswer && !Editing; - bool ICanEdit = Svy_CheckIfICanCreateSvy (); /***** Get data of questions from database *****/ sprintf (Query,"SELECT QstCod,QstInd,AnsType,Stem" @@ -2820,8 +2820,8 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ /***** Start frame *****/ Gbl.Svys.SvyCodToEdit = Svy->SvyCod; Lay_StartRoundFrame (NULL,Txt_Questions, - ICanEdit ? Svy_PutIconToAddNewQuestion : - NULL); + Svy->Status.ICanEdit ? Svy_PutIconToAddNewQuestion : + NULL); if (NumQsts) { @@ -2924,7 +2924,7 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ if (PutFormAnswerSurvey) { /***** Button to create/modify survey *****/ - Lay_PutConfirmButton (Txt_Send_survey); + Lay_PutConfirmButton (Txt_Done); /***** End form *****/ Act_FormEnd ();