Version 14.111

This commit is contained in:
Antonio Cañas Vargas 2015-04-11 20:18:30 +02:00
parent fa71f5af49
commit 0d0b59b0e6
6 changed files with 119 additions and 152 deletions

View File

@ -1054,7 +1054,7 @@ void Asg_RequestCreatOrEditAsg (void)
extern const char *Txt_Folder;
extern const char *Txt_Description;
extern const char *Txt_Create_assignment;
extern const char *Txt_Modify_assignment;
extern const char *Txt_Save;
struct Assignment Asg;
bool ItsANewAssignment;
Asg_StartOrEndTime_t StartOrEndTime;
@ -1215,7 +1215,7 @@ void Asg_RequestCreatOrEditAsg (void)
if (ItsANewAssignment)
Lay_PutCreateButton (Txt_Create_assignment);
else
Lay_PutConfirmButton (Txt_Modify_assignment);
Lay_PutConfirmButton (Txt_Save);
fprintf (Gbl.F.Out,"</td>"
"</tr>");

View File

@ -1024,7 +1024,7 @@ void Att_RequestCreatOrEditAttEvent (void)
extern const char *Txt_Visible_MALE_PLURAL;
extern const char *Txt_Description;
extern const char *Txt_Create_event;
extern const char *Txt_Modify_event;
extern const char *Txt_Save;
struct AttendanceEvent Att;
bool ItsANewAttEvent;
Att_StartOrEndTime_t StartOrEndTime;
@ -1190,7 +1190,7 @@ void Att_RequestCreatOrEditAttEvent (void)
if (ItsANewAttEvent)
Lay_PutCreateButton (Txt_Create_event);
else
Lay_PutConfirmButton (Txt_Modify_event);
Lay_PutConfirmButton (Txt_Save);
fprintf (Gbl.F.Out,"</td>"
"</tr>");
@ -2656,7 +2656,7 @@ void Usr_ReqListAttendanceStdsCrs (void)
/* Send button */
fprintf (Gbl.F.Out,"<tr>"
"<td>");
"<td colspan=\"10\">");
Lay_PutConfirmButton (Txt_Show_list);
fprintf (Gbl.F.Out,"</td>"
"</tr>");

View File

@ -103,12 +103,15 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 14.110.14 (2015/04/11)"
#define Log_PLATFORM_VERSION "SWAD 14.111 (2015/04/11)"
// 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 14.110.14:Apr 11, 2015 Changes in layout of surveys. (? lines)
Version 14.111: Apr 11, 2015 Changes in layout of surveys.
Fixed bugs in surveys.
Changes in layout of edition of test questions.
Changes in layout of users' attendance. (184723 lines)
Version 14.110.13:Apr 11, 2015 Changes in layout of users' attendance. (184750 lines)
Version 14.110.12:Apr 11, 2015 Changes in layout of users' works. (184728 lines)
Version 14.110.11:Apr 11, 2015 Changes in layout of selection of class photo / list. (184722 lines)

View File

@ -418,33 +418,6 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,bool Sh
Gbl.ColorRows[Gbl.RowEvenOdd]);
fprintf (Gbl.F.Out,"\">");
Svy_WriteStatus (&Svy);
if (!ShowOnlyThisSvyComplete)
{
/* 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,"</td>"
"</tr>");
@ -472,7 +445,7 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,bool Sh
fprintf (Gbl.F.Out,"\">");
/* Scope of the survey */
fprintf (Gbl.F.Out,"<p class=\"%s\">%s: ",
fprintf (Gbl.F.Out,"<div class=\"%s\">%s: ",
Svy.Status.Visible ? "ASG_GRP" :
"ASG_GRP_LIGHT",
Txt_Scope);
@ -484,10 +457,10 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,bool Sh
Txt_Degree,Gbl.CurrentDeg.Deg.ShortName);
else
fprintf (Gbl.F.Out,"%s",Cfg_PLATFORM_SHORT_NAME);
fprintf (Gbl.F.Out,"</p>");
fprintf (Gbl.F.Out,"</div>");
/* Users' roles who can answer the survey */
fprintf (Gbl.F.Out,"<p class=\"%s\">%s:",
fprintf (Gbl.F.Out,"<div class=\"%s\">%s:",
Svy.Status.Visible ? "ASG_GRP" :
"ASG_GRP_LIGHT",
Txt_Users);
@ -505,7 +478,7 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,bool Sh
fprintf (Gbl.F.Out," checked=\"checked\"");
fprintf (Gbl.F.Out," />%s",Txt_ROLES_PLURAL_abc[Role][Usr_SEX_UNKNOWN]);
}
fprintf (Gbl.F.Out,"</p>");
fprintf (Gbl.F.Out,"</div>");
/* Groups whose users can answer this survey */
if (Svy.CrsCod > 0)
@ -518,21 +491,54 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,bool Sh
Txt,Cns_MAX_BYTES_TEXT,false); // Convert from HTML to recpectful HTML
Str_InsertLinkInURLs (Txt,Cns_MAX_BYTES_TEXT,60); // Insert links
fprintf (Gbl.F.Out,"<p class=\"%s\" style=\"text-align:justify;\">"
"<br />%s<br />&nbsp;</p></td>"
"%s"
"</p>"
"</td>"
"</tr>",
Svy.Status.Visible ? "DAT" :
"DAT_LIGHT",
Txt);
/***** Write questions of this survey *****/
fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"4\"");
if (ShowOnlyThisSvyComplete)
{
fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"4\">");
fprintf (Gbl.F.Out,">");
/* Write questions of this survey **/
Svy_ListSvyQuestions (&Svy,SvyQst);
fprintf (Gbl.F.Out,"</td>"
"</tr>");
}
else
{
fprintf (Gbl.F.Out," style=\"background-color:%s;\">",
Gbl.ColorRows[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,"</td>"
"</tr>");
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
@ -1489,7 +1495,7 @@ void Svy_RequestCreatOrEditSvy (void)
extern const char *Txt_Description;
extern const char *Txt_Users;
extern const char *Txt_Create_survey;
extern const char *Txt_Modify_survey;
extern const char *Txt_Save;
struct Survey Svy;
struct SurveyQuestion SvyQst;
bool ItsANewSurvey;
@ -1671,7 +1677,7 @@ void Svy_RequestCreatOrEditSvy (void)
if (ItsANewSurvey)
Lay_PutCreateButton (Txt_Create_survey);
else
Lay_PutConfirmButton (Txt_Modify_survey);
Lay_PutConfirmButton (Txt_Save);
fprintf (Gbl.F.Out,"</td>"
"</tr>");
@ -2162,7 +2168,7 @@ static void Svy_GetAndWriteNamesOfGrpsAssociatedToSvy (struct Survey *Svy)
NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get groups of a survey");
/***** Write heading *****/
fprintf (Gbl.F.Out,"<p class=\"%s\">%s: ",
fprintf (Gbl.F.Out,"<div class=\"%s\">%s: ",
Svy->Status.Visible ? "ASG_GRP" :
"ASG_GRP_LIGHT",
NumRows == 1 ? Txt_Group :
@ -2196,7 +2202,7 @@ static void Svy_GetAndWriteNamesOfGrpsAssociatedToSvy (struct Survey *Svy)
fprintf (Gbl.F.Out,"%s %s",
Txt_The_whole_course,Gbl.CurrentCrs.Crs.ShortName);
fprintf (Gbl.F.Out,"</p>");
fprintf (Gbl.F.Out,"</div>");
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
@ -2364,6 +2370,7 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst,ch
extern const char *Txt_Type;
extern const char *Txt_SURVEY_STR_ANSWER_TYPES[Svy_NUM_ANS_TYPES];
extern const char *Txt_Save;
extern const char *Txt_Create_question;
char Query[512];
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -2512,7 +2519,7 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst,ch
if (SvyQst->QstCod > 0) // If the question already has assigned a code
Lay_PutConfirmButton (Txt_Save);
else
Lay_PutCreateButton (Txt_Save);
Lay_PutCreateButton (Txt_Create_question);
fprintf (Gbl.F.Out,"</td>"
"</tr>");
@ -2940,6 +2947,10 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ
MYSQL_ROW row;
unsigned NumQsts;
unsigned NumQst;
bool Editing = (Gbl.CurrentAct == ActEdiOneSvy ||
Gbl.CurrentAct == ActEdiOneSvyQst ||
Gbl.CurrentAct == ActRcvSvyQst);
bool FormAnswerSurvey = Svy->Status.ICanAnswer && !Editing;
/***** Get data of questions from database *****/
sprintf (Query,"SELECT QstCod,QstInd,AnsType,Stem"
@ -2947,19 +2958,15 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ
Svy->SvyCod);
NumQsts = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get data of a question");
if (Svy->Status.ICanAnswer)
if (FormAnswerSurvey)
{
/***** Start form to send answers to survey *****/
Act_FormStart (ActAnsSvy);
Svy_PutParamSvyCod (Svy->SvyCod);
}
Lay_StartRoundFrameTable10 (NULL,0,NULL);
/***** Heading title *****/
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"DAT\" style=\"text-align:center;\">");
Lay_WriteTitle (Txt_Survey_questions);
fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_4\">");
/***** Start frame *****/
Lay_StartRoundFrameTable10 (NULL,2,Txt_Survey_questions);
if (NumQsts)
{
@ -3066,46 +3073,41 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ
"</tr>",
Txt_This_survey_has_no_questions);
fprintf (Gbl.F.Out,"</table>"
"</td>"
"</tr>");
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
if (Svy->Status.ICanAnswer)
if (FormAnswerSurvey)
{
/***** Table end *****/
Lay_EndRoundFrameTable10 ();
/***** Button to create/modify survey *****/
fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"5\">");
Lay_PutConfirmButton (Txt_Send_survey);
fprintf (Gbl.F.Out,"</td>"
"</tr>");
}
else if (Svy->Status.ICanEdit && Editing)
{
/***** Put form to add a new question in this survey *****/
fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"5\">");
Act_FormStart (ActEdiOneSvyQst);
Svy_PutParamSvyCod (Svy->SvyCod);
Svy_PutHiddenParamSvyOrderType ();
Grp_PutParamWhichGrps ();
Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage);
Act_LinkFormSubmit (Txt_New_question,The_ClassFormulB[Gbl.Prefs.Theme]);
Lay_PutSendIcon ("new",Txt_New_question,Txt_New_question);
Act_FormEnd ();
fprintf (Gbl.F.Out,"</td>"
"</tr>");
}
/***** Table end *****/
Lay_EndRoundFrameTable10 ();
if (FormAnswerSurvey)
/***** End form *****/
Act_FormEnd ();
}
else
{
if (Svy->Status.ICanEdit)
{
/***** Put form to add a new question in this survey *****/
fprintf (Gbl.F.Out,"<tr>"
"<td style=\"text-align:center;\">");
Act_FormStart (ActEdiOneSvyQst);
Svy_PutParamSvyCod (Svy->SvyCod);
Svy_PutHiddenParamSvyOrderType ();
Grp_PutParamWhichGrps ();
Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage);
Act_LinkFormSubmit (Txt_New_question,The_ClassFormulB[Gbl.Prefs.Theme]);
Lay_PutSendIcon ("new",Txt_New_question,Txt_New_question);
Act_FormEnd ();
fprintf (Gbl.F.Out,"</td>"
"</tr>");
}
/***** Table end *****/
Lay_EndRoundFrameTable10 ();
}
}
/*****************************************************************************/
@ -3140,9 +3142,9 @@ static void Svy_WriteQstStem (const char *Stem,const char *TextStyle)
/* Write the stem */
fprintf (Gbl.F.Out,"<td class=\"%s\" style=\"text-align:left;"
" vertical-align:top; background-color:%s;\">"
"<p style=\"text-align:justify;\">"
"<div style=\"text-align:justify;\">"
"<tt>%s</tt>"
"</p>",
"</div>",
TextStyle,Gbl.ColorRows[Gbl.RowEvenOdd],HeadingRigorousHTML);
/* Free memory allocated for the stem */

View File

@ -4095,6 +4095,7 @@ static void Tst_PutFormEditOneQst (char *Stem,char *Feedback)
extern const char *Txt_Answer;
extern const char *Txt_Shuffle;
extern const char *Txt_Save;
extern const char *Txt_Create_question;
char Title[512];
char Query[512];
MYSQL_RES *mysql_res;
@ -4513,7 +4514,10 @@ static void Tst_PutFormEditOneQst (char *Stem,char *Feedback)
/***** Send button *****/
fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"2\">");
Lay_PutConfirmButton (Txt_Save);
if (Gbl.Test.QstCod > 0) // The question already has assigned a code
Lay_PutConfirmButton (Txt_Save);
else
Lay_PutCreateButton (Txt_Create_question);
fprintf (Gbl.F.Out,"</td>"
"</tr>");

View File

@ -5848,6 +5848,27 @@ const char *Txt_Create_plugin =
"Criar plugin";
#endif
const char *Txt_Create_question =
#if L==0
"Crear pregunta";
#elif L==1
"Frage erstellen";
#elif L==2
"Create question";
#elif L==3
"Crear pregunta";
#elif L==4
"Cr&eacute;er question";
#elif L==5
"Crear pregunta"; // Okoteve traducción
#elif L==6
"Crea domanda";
#elif L==7
"Tworzenie pytanie";
#elif L==8
"Criar quest&atilde;o";
#endif
const char *Txt_Create_record_field =
#if L==0
"Crear campo de ficha"; // Necessita traduccio
@ -20544,48 +20565,6 @@ const char *Txt_minutes =
"minutos";
#endif
const char *Txt_Modify_assignment =
#if L==0
"Modificar actividad"; // Necessita traduccio
#elif L==1
"&Auml;ndern Aufgabe";
#elif L==2
"Modify assignment";
#elif L==3
"Modificar actividad";
#elif L==4
"Modifier activit&eacute;";
#elif L==5
"Modificar actividad"; // Okoteve traducción
#elif L==6
"Modifica attivit&agrave;";
#elif L==7
"Modyfikacja zadania";
#elif L==8
"Modificar atividade";
#endif
const char *Txt_Modify_event =
#if L==0
"Modificar evento"; // Necessita traduccio
#elif L==1
"&Auml;ndern Ereignis";
#elif L==2
"Modify event";
#elif L==3
"Modificar evento";
#elif L==4
"Modifier &eacute;v&eacute;nement";
#elif L==5
"Modificar evento"; // Okoteve traducción
#elif L==6
"Modifica evento";
#elif L==7
"Modyfikacja wydarzenie";
#elif L==8
"Modificar evento";
#endif
const char *Txt_Modify_me_in_the_course_X = // Warning: it is very important to include %s in the following sentences
#if L==0
"Modificarme en l'assignatura <strong>%s</strong>";
@ -20628,27 +20607,6 @@ const char *Txt_Modify_user_in_the_course_X = // Warning: it is very important t
"Modificar utilizador na disciplina <strong>%s</strong>";
#endif
const char *Txt_Modify_survey =
#if L==0
"Modifier sondage"; // Necessita traduccio
#elif L==1
"&Auml;ndern Umfrage";
#elif L==2
"Modify survey";
#elif L==3
"Modificar encuesta";
#elif L==4
"Modifier sondage";
#elif L==5
"Modificar encuesta"; // Okoteve traducción
#elif L==6
"Modifica sondaggio";
#elif L==7
"Badanie Modyfikuj";
#elif L==8
"Modificar inqu&eacute;rito";
#endif
const char *Txt_Month =
#if L==0
"Mes"; // Necessita traduccio