diff --git a/swad_HTML.c b/swad_HTML.c index d455d748..87b6951a 100644 --- a/swad_HTML.c +++ b/swad_HTML.c @@ -63,6 +63,7 @@ static unsigned HTM_DIV_NestingLevel = 0; static unsigned HTM_UL_NestingLevel = 0; static unsigned HTM_LI_NestingLevel = 0; static unsigned HTM_A_NestingLevel = 0; +static unsigned HTM_TEXTAREA_NestingLevel = 0; /*****************************************************************************/ /***************************** Private prototypes ****************************/ @@ -84,6 +85,8 @@ static void HTM_LI_BeginWithoutAttr (void); static void HTM_A_BeginWithoutAttr (void); +static void HTM_TEXTAREA_BeginWithoutAttr (void); + /*****************************************************************************/ /******************************* Start/end table *****************************/ /*****************************************************************************/ @@ -704,6 +707,58 @@ void HTM_A_End (void) HTM_A_NestingLevel--; } +/*****************************************************************************/ +/********************************* Text areas ********************************/ +/*****************************************************************************/ + +void HTM_TEXTAREA_Begin (const char *fmt,...) + { + va_list ap; + int NumBytesPrinted; + char *Attr; + + if (fmt) + { + if (fmt[0]) + { + va_start (ap,fmt); + NumBytesPrinted = vasprintf (&Attr,fmt,ap); + va_end (ap); + + if (NumBytesPrinted < 0) // If memory allocation wasn't possible, + // or some other error occurs, + // vasprintf will return -1 + Lay_NotEnoughMemoryExit (); + + /***** Print HTML *****/ + fprintf (Gbl.F.Out,""); + + HTM_TEXTAREA_NestingLevel--; + } + /*****************************************************************************/ /********************************** Images ***********************************/ /*****************************************************************************/ diff --git a/swad_HTML.h b/swad_HTML.h index 5f677784..5c9f3d41 100644 --- a/swad_HTML.h +++ b/swad_HTML.h @@ -83,6 +83,9 @@ void HTM_LI_End (void); void HTM_A_Begin (const char *fmt,...); void HTM_A_End (void); +void HTM_TEXTAREA_Begin (const char *fmt,...); +void HTM_TEXTAREA_End (void); + void HTM_IMG (const char *URL,const char *Icon,const char *Title, const char *fmt,...); diff --git a/swad_agenda.c b/swad_agenda.c index 0adf4ba7..591b93a6 100644 --- a/swad_agenda.c +++ b/swad_agenda.c @@ -1547,11 +1547,10 @@ void Agd_RequestCreatOrEditEvent (void) HTM_TD_End (); HTM_TD_Begin ("class=\"LT\""); - fprintf (Gbl.F.Out,""); + HTM_TEXTAREA_End (); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_announcement.c b/swad_announcement.c index 508047db..0f402623 100644 --- a/swad_announcement.c +++ b/swad_announcement.c @@ -459,10 +459,9 @@ static void Ann_PutSubjectMessage (const char *Field,const char *Label, HTM_TD_End (); HTM_TD_Begin ("class=\"LT\""); - fprintf (Gbl.F.Out,"", - Field,Field,Rows); + HTM_TEXTAREA_Begin ("id=\"%s\" name=\"%s\" cols=\"75\" rows=\"%u\"", + Field,Field,Rows); + HTM_TEXTAREA_End (); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_assignment.c b/swad_assignment.c index 733e6272..b6442adc 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -1208,11 +1208,10 @@ void Asg_RequestCreatOrEditAsg (void) HTM_TD_End (); HTM_TD_Begin ("class=\"LT\""); - fprintf (Gbl.F.Out,""); + HTM_TEXTAREA_End (); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_attendance.c b/swad_attendance.c index 3ebb492d..594ff8c5 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -1154,11 +1154,10 @@ void Att_RequestCreatOrEditAttEvent (void) HTM_TD_End (); HTM_TD_Begin ("class=\"LT\""); - fprintf (Gbl.F.Out,""); + HTM_TEXTAREA_End (); HTM_TD_End (); HTM_TR_End (); @@ -2138,11 +2137,12 @@ static void Att_WriteRowUsrToCallTheRoll (unsigned NumUsr, /***** Student's comment: write form or text */ HTM_TD_Begin ("class=\"DAT_SMALL LT COLOR%u\"",Gbl.RowEvenOdd); if (ICanEditStdComment) // Show with form - fprintf (Gbl.F.Out,"", - UsrDat->UsrCod,CommentStd); + { + HTM_TEXTAREA_Begin ("name=\"CommentStd%ld\" cols=\"40\" rows=\"3\"", + UsrDat->UsrCod); + fprintf (Gbl.F.Out,"%s",CommentStd); + HTM_TEXTAREA_End (); + } else // Show without form { Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML, @@ -2154,11 +2154,12 @@ static void Att_WriteRowUsrToCallTheRoll (unsigned NumUsr, /***** Teacher's comment: write form, text or nothing */ HTM_TD_Begin ("class=\"DAT_SMALL LT COLOR%u\"",Gbl.RowEvenOdd); if (ICanEditTchComment) // Show with form - fprintf (Gbl.F.Out,"", - UsrDat->UsrCod,CommentTch); + { + HTM_TEXTAREA_Begin ("name=\"CommentTch%ld\" cols=\"40\" rows=\"3\"", + UsrDat->UsrCod); + fprintf (Gbl.F.Out,"%s",CommentTch); + HTM_TEXTAREA_End (); + } else if (Att->CommentTchVisible) // Show without form { Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML, diff --git a/swad_centre.c b/swad_centre.c index d87e0b6f..c173f200 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -386,13 +386,12 @@ static void Ctr_Configuration (bool PrintView) { HTM_DIV_Begin ("class=\"CM\""); Frm_StartForm (ActChgCtrPhoAtt); - fprintf (Gbl.F.Out,""); + HTM_TEXTAREA_End (); Frm_EndForm (); HTM_DIV_End (); } diff --git a/swad_changelog.h b/swad_changelog.h index c5abf613..cd0f5929 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -487,15 +487,18 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.47.1 (2019-10-31)" +#define Log_PLATFORM_VERSION "SWAD 19.48 (2019-10-31)" #define CSS_FILE "swad19.47.css" #define JS_FILE "swad19.39.js" /* // TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.) // TODO: Impedir la creación y edición de proyectos si no son editables. +// TODO: Importante: filtrar proyectos por usuarios (igual que en trabajos o en asistencia) + Version 19.48: Oct 31, 2019 Code refactoring in HTML textarea. (246038 lines) + Version 19.47.2: Oct 31, 2019 Removed obsolete function to activate results in match questions. (246009 lines) Version 19.47.1: Oct 31, 2019 Removed obsolete messages. (246033 lines) - Version 19.47: Oct 31, 2019 Return to old way to activate showing of results in match question. (246230 lines) + Version 19.47: Oct 31, 2019 Return to old way to activate results in match questions. (246230 lines) Version 19.46.10: Oct 31, 2019 Code refactoring in HTML images. (246196 lines) Version 19.46.9: Oct 30, 2019 Code refactoring in HTML images. (246241 lines) Version 19.46.8: Oct 30, 2019 Code refactoring in HTML images. (246244 lines) diff --git a/swad_country.c b/swad_country.c index 0ee9ade8..e40efee4 100644 --- a/swad_country.c +++ b/swad_country.c @@ -296,13 +296,12 @@ static void Cty_Configuration (bool PrintView) { HTM_DIV_Begin ("class=\"CM\""); Frm_StartForm (ActChgCtyMapAtt); - fprintf (Gbl.F.Out,""); + HTM_TEXTAREA_End (); Frm_EndForm (); HTM_DIV_End (); } diff --git a/swad_enrolment.c b/swad_enrolment.c index ae623147..c5ed7198 100644 --- a/swad_enrolment.c +++ b/swad_enrolment.c @@ -929,9 +929,8 @@ static void Enr_PutAreaToEnterUsrsIDs (void) HTM_TD_End (); HTM_TD_Begin ("class=\"LT\""); - fprintf (Gbl.F.Out,""); + HTM_TEXTAREA_Begin ("id=\"UsrsIDs\" name=\"UsrsIDs\" cols=\"60\" rows=\"10\""); + HTM_TEXTAREA_End (); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_exam.c b/swad_exam.c index 6ce730fa..2cd8635e 100644 --- a/swad_exam.c +++ b/swad_exam.c @@ -1312,11 +1312,12 @@ static void Exa_ShowExamAnnouncement (long ExaCod, HTM_TD_Begin ("class=\"%s LT\"",StyleNormal); if (TypeViewExamAnnouncement == Exa_FORM_VIEW) - fprintf (Gbl.F.Out,"", + { + HTM_TEXTAREA_Begin ("id=\"Place\" name=\"Place\" cols=\"40\" rows=\"4\""); + fprintf (Gbl.F.Out,"%s", Gbl.ExamAnns.ExaDat.Place); + HTM_TEXTAREA_End (); + } else { Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML, @@ -1338,11 +1339,11 @@ static void Exa_ShowExamAnnouncement (long ExaCod, HTM_TD_Begin ("class=\"%s LT\"",StyleNormal); if (TypeViewExamAnnouncement == Exa_FORM_VIEW) - fprintf (Gbl.F.Out,"", - Gbl.ExamAnns.ExaDat.Mode); + { + HTM_TEXTAREA_Begin ("id=\"ExamMode\" name=\"ExamMode\" cols=\"40\" rows=\"2\""); + fprintf (Gbl.F.Out,"%s",Gbl.ExamAnns.ExaDat.Mode); + HTM_TEXTAREA_End (); + } else { Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML, @@ -1364,11 +1365,11 @@ static void Exa_ShowExamAnnouncement (long ExaCod, HTM_TD_Begin ("class=\"%s LT\"",StyleNormal); if (TypeViewExamAnnouncement == Exa_FORM_VIEW) - fprintf (Gbl.F.Out,"", - Gbl.ExamAnns.ExaDat.Structure); + { + HTM_TEXTAREA_Begin ("id=\"Structure\" name=\"Structure\" cols=\"40\" rows=\"8\""); + fprintf (Gbl.F.Out,"%s",Gbl.ExamAnns.ExaDat.Structure); + HTM_TEXTAREA_End (); + } else { Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML, @@ -1390,11 +1391,11 @@ static void Exa_ShowExamAnnouncement (long ExaCod, HTM_TD_Begin ("class=\"%s LT\"",StyleNormal); if (TypeViewExamAnnouncement == Exa_FORM_VIEW) - fprintf (Gbl.F.Out,"", - Gbl.ExamAnns.ExaDat.DocRequired); + { + HTM_TEXTAREA_Begin ("id=\"DocRequired\" name=\"DocRequired\" cols=\"40\" rows=\"2\""); + fprintf (Gbl.F.Out,"%s",Gbl.ExamAnns.ExaDat.DocRequired); + HTM_TEXTAREA_End (); + } else { Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML, @@ -1416,11 +1417,11 @@ static void Exa_ShowExamAnnouncement (long ExaCod, HTM_TD_Begin ("class=\"%s LT\"",StyleNormal); if (TypeViewExamAnnouncement == Exa_FORM_VIEW) - fprintf (Gbl.F.Out,"", - Gbl.ExamAnns.ExaDat.MatRequired); + { + HTM_TEXTAREA_Begin ("id=\"MatRequired\" name=\"MatRequired\" cols=\"40\" rows=\"4\""); + fprintf (Gbl.F.Out,"%s",Gbl.ExamAnns.ExaDat.MatRequired); + HTM_TEXTAREA_End (); + } else { Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML, @@ -1442,11 +1443,11 @@ static void Exa_ShowExamAnnouncement (long ExaCod, HTM_TD_Begin ("class=\"%s LT\"",StyleNormal); if (TypeViewExamAnnouncement == Exa_FORM_VIEW) - fprintf (Gbl.F.Out,"", - Gbl.ExamAnns.ExaDat.MatAllowed); + { + HTM_TEXTAREA_Begin ("id=\"MatAllowed\" name=\"MatAllowed\" cols=\"40\" rows=\"4\""); + fprintf (Gbl.F.Out,"%s",Gbl.ExamAnns.ExaDat.MatAllowed); + HTM_TEXTAREA_End (); + } else { Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML, @@ -1468,11 +1469,11 @@ static void Exa_ShowExamAnnouncement (long ExaCod, HTM_TD_Begin ("class=\"%s LT\"",StyleNormal); if (TypeViewExamAnnouncement == Exa_FORM_VIEW) - fprintf (Gbl.F.Out,"", - Gbl.ExamAnns.ExaDat.OtherInfo); + { + HTM_TEXTAREA_Begin ("id=\"OtherInfo\" name=\"OtherInfo\" cols=\"40\" rows=\"5\""); + fprintf (Gbl.F.Out,"%s",Gbl.ExamAnns.ExaDat.OtherInfo); + HTM_TEXTAREA_End (); + } else { Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML, diff --git a/swad_forum.c b/swad_forum.c index ffb1cfba..c6af5d93 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -3931,10 +3931,8 @@ static void For_WriteFormForumPst (bool IsReply,const char *Subject) HTM_TD_End (); HTM_TD_Begin ("class=\"LT\""); - fprintf (Gbl.F.Out,""); + HTM_TEXTAREA_Begin ("id=\"Content\" name=\"Content\" class=\"MSG_CONTENT\" rows=\"10\""); + HTM_TEXTAREA_End (); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_game.c b/swad_game.c index 168000fd..36b1adfc 100644 --- a/swad_game.c +++ b/swad_game.c @@ -1166,11 +1166,10 @@ static void Gam_PutFormsEditionGame (struct Game *Game,bool ItsANewGame) HTM_TD_End (); HTM_TD_Begin ("class=\"LT\""); - fprintf (Gbl.F.Out,""); + HTM_TEXTAREA_End (); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_info.c b/swad_info.c index d62940cf..a12d794e 100644 --- a/swad_info.c +++ b/swad_info.c @@ -2081,10 +2081,9 @@ void Inf_EditPlainTxtInfo (void) /***** Edition area *****/ HTM_DIV_Begin ("class=\"CM\""); Lay_HelpPlainEditor (); - fprintf (Gbl.F.Out,"", - TxtHTML); + HTM_TEXTAREA_Begin ("name=\"Txt\" cols=\"80\" rows=\"20\""); + fprintf (Gbl.F.Out,"%s",TxtHTML); + HTM_TEXTAREA_End (); HTM_DIV_End (); /***** Send button and end box *****/ @@ -2132,10 +2131,9 @@ void Inf_EditRichTxtInfo (void) /***** Edition area *****/ HTM_DIV_Begin ("class=\"CM\""); Lay_HelpRichEditor (); - fprintf (Gbl.F.Out,"", - TxtHTML); + HTM_TEXTAREA_Begin ("name=\"Txt\" cols=\"80\" rows=\"20\""); + fprintf (Gbl.F.Out,"%s",TxtHTML); + HTM_TEXTAREA_End (); HTM_DIV_End (); /***** Send button and end box *****/ diff --git a/swad_match.c b/swad_match.c index be64ec65..a2c9ef64 100644 --- a/swad_match.c +++ b/swad_match.c @@ -163,7 +163,6 @@ static void Mch_ShowFormColumns (struct Match *Match); static void Mch_PutParamNumCols (unsigned NumCols); static void Mch_ShowMatchTitle (struct Match *Match); -// static void Mch_ShowFormViewResult (struct Match *Match); static void Mch_PutCheckboxResult (struct Match *Match); static void Mch_ShowQuestionAndAnswersTch (struct Match *Match); static void Mch_WriteAnswersMatchResult (struct Match *Match, @@ -2118,10 +2117,8 @@ static void Mch_ShowLeftColumnTch (struct Match *Match) Mch_PutMatchControlButtons (Match); /***** Put forms to choice which projects to show *****/ - /* 1st. row */ Set_StartSettingsHead (); Mch_ShowFormColumns (Match); - // Mch_ShowFormViewResult (Match); Set_EndSettingsHead (); /***** Write button to request viewing results *****/ @@ -2404,33 +2401,6 @@ static void Mch_PutParamNumCols (unsigned NumCols) // Number of columns Par_PutHiddenParamUnsigned ("NumCols",NumCols); } -/*****************************************************************************/ -/******************* Put form to select if show results **********************/ -/*****************************************************************************/ -/* -static void Mch_ShowFormViewResult (struct Match *Match) - { - extern const char *Txt_View_results; - - ***** Begin selector ***** - Set_StartOneSettingSelector (); - HTM_DIV_Begin ("class=\"%s\"",(Match->Status.ShowQstResults) ? "PREF_ON" : - "PREF_OFF"); - - ***** Begin form ***** - Frm_StartForm (ActChgVisResMchQst); - Mch_PutParamMchCod (Match->MchCod); // Current match being played - - Ico_PutSettingIconLink ("poll-h.svg",Txt_View_results); - - ***** End form ***** - Frm_EndForm (); - - ***** End selector ***** - HTM_DIV_End (); - Set_EndOneSettingSelector (); - } -*/ /*****************************************************************************/ /***************** Put checkbox to select if show results ********************/ /*****************************************************************************/ diff --git a/swad_message.c b/swad_message.c index 79234ca4..bdbf07e5 100644 --- a/swad_message.c +++ b/swad_message.c @@ -496,10 +496,9 @@ static void Msg_WriteFormUsrsIDsOrNicksOtherRecipients (void) HTM_TR_Begin (NULL); HTM_TD_Begin ("colspan=\"%u\" class=\"LM\"",ColSpan); - fprintf (Gbl.F.Out,""); + HTM_TEXTAREA_End (); HTM_TD_End (); HTM_TR_End (); @@ -544,8 +543,8 @@ static void Msg_WriteFormSubjectAndContentMsgToUsrs (char Content[Cns_MAX_BYTES_ HTM_TD_End (); HTM_TD_Begin ("class=\"LM\""); - fprintf (Gbl.F.Out,"",Gbl.Msg.Subject); + fprintf (Gbl.F.Out,"%s",Gbl.Msg.Subject); + + HTM_TEXTAREA_End (); HTM_TD_End (); HTM_TR_End (); @@ -594,8 +595,8 @@ static void Msg_WriteFormSubjectAndContentMsgToUsrs (char Content[Cns_MAX_BYTES_ HTM_TD_End (); HTM_TD_Begin ("class=\"LM\""); - fprintf (Gbl.F.Out,"",Gbl.Msg.Subject); + fprintf (Gbl.F.Out,"%s",Gbl.Msg.Subject); + + HTM_TEXTAREA_End (); HTM_TD_End (); HTM_TR_End (); @@ -629,8 +632,8 @@ static void Msg_WriteFormSubjectAndContentMsgToUsrs (char Content[Cns_MAX_BYTES_ HTM_TD_End (); HTM_TD_Begin ("class=\"LM\""); - fprintf (Gbl.F.Out,""); + + HTM_TEXTAREA_End (); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_notice.c b/swad_notice.c index 0bdca574..821d2b71 100644 --- a/swad_notice.c +++ b/swad_notice.c @@ -113,9 +113,9 @@ void Not_ShowFormNotice (void) Hlp_MESSAGES_Notices,Box_NOT_CLOSABLE); /***** Message body *****/ - fprintf (Gbl.F.Out,""); + HTM_TEXTAREA_Begin ("name=\"Content\" cols=\"30\" rows=\"10\"" + " autofocus=\"autofocus\" required=\"required\""); + HTM_TEXTAREA_End (); /***** Send button and end box *****/ Box_EndBoxWithButton (Btn_CREATE_BUTTON,Txt_Create_notice); diff --git a/swad_project.c b/swad_project.c index c4435f70..583120ca 100644 --- a/swad_project.c +++ b/swad_project.c @@ -3459,11 +3459,11 @@ static void Prj_EditOneProjectTxtArea (const char *Id, HTM_TD_End (); HTM_TD_Begin ("class=\"LT\""); - fprintf (Gbl.F.Out,"",TxtField); + HTM_TEXTAREA_Begin ("id=\"%s\" name=\"%s\" cols=\"60\" rows=\"%u\"%s", + Id,Id,NumRows,Required ? " required=\"required\"" : + ""); + fprintf (Gbl.F.Out,"%s",TxtField); + HTM_TEXTAREA_End (); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_record.c b/swad_record.c index 71759b0f..5c29072c 100644 --- a/swad_record.c +++ b/swad_record.c @@ -1826,13 +1826,13 @@ static void Rec_ShowCrsRecord (Rec_CourseRecordViewType_t TypeOfView, HTM_TD_Begin ("class=\"REC_C2_BOT REC_DAT_BOLD LT COLOR%u\"",Gbl.RowEvenOdd); if (ICanEditThisField) // Show with form { - fprintf (Gbl.F.Out,""); + HTM_TEXTAREA_End (); } else // Show without form { @@ -3573,11 +3573,12 @@ static void Rec_ShowComments (struct UsrData *UsrDat, if (ShowData) { if (ICanEdit) - fprintf (Gbl.F.Out,"", - UsrDat->Comments); + { + HTM_TEXTAREA_Begin ("id=\"Comments\" name=\"Comments\"" + " rows=\"4\" class=\"REC_C2_BOT_INPUT\""); + fprintf (Gbl.F.Out,"%s",UsrDat->Comments); + HTM_TEXTAREA_End (); + } else if (UsrDat->Comments[0]) { Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML, // Convert from HTML to rigorous HTML diff --git a/swad_survey.c b/swad_survey.c index a80e8ef3..5d1bad98 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -1937,11 +1937,10 @@ void Svy_RequestCreatOrEditSvy (void) HTM_TD_End (); HTM_TD_Begin ("class=\"LT\""); - fprintf (Gbl.F.Out,""); + HTM_TEXTAREA_End (); HTM_TD_End (); HTM_TR_End (); @@ -2731,10 +2730,9 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst, HTM_TD_End (); HTM_TD_Begin ("class=\"LT\""); - fprintf (Gbl.F.Out,"", - Txt); + HTM_TEXTAREA_Begin ("id=\"Txt\" name=\"Txt\" cols=\"60\" rows=\"4\""); + fprintf (Gbl.F.Out,"%s",Txt); + HTM_TEXTAREA_End (); HTM_TD_End (); HTM_TR_End (); @@ -2788,12 +2786,11 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst, /* Answer text */ HTM_TD_Begin ("class=\"RT\""); - fprintf (Gbl.F.Out,""); + HTM_TEXTAREA_End (); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_test.c b/swad_test.c index 015469c9..4ac7153b 100644 --- a/swad_test.c +++ b/swad_test.c @@ -5157,26 +5157,25 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1], HTM_TD_End (); HTM_TD_Begin ("class=\"LT\""); - fprintf (Gbl.F.Out,"
", - Stem); + HTM_TEXTAREA_Begin ("id=\"Stem\" name=\"Stem\" class=\"STEM_TEXTAREA\"" + " rows=\"5\" required=\"required\""); + fprintf (Gbl.F.Out,"%s",Stem); + HTM_TEXTAREA_End (); + fprintf (Gbl.F.Out,"
"); Tst_PutFormToEditQstMedia (&Gbl.Test.Media,-1, false); /***** Feedback *****/ fprintf (Gbl.F.Out,""); + HTM_TEXTAREA_End (); + fprintf (Gbl.F.Out,""); HTM_TD_End (); HTM_TR_End (); @@ -5363,15 +5362,12 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1], " style=\"display:none;\""); // Answer does not have content ==> Hide column /* Answer text */ - fprintf (Gbl.F.Out,""); + HTM_TEXTAREA_End (); /* Media */ Tst_PutFormToEditQstMedia (&Gbl.Test.Answer.Options[NumOpt].Media, @@ -5379,19 +5375,16 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1], OptionsDisabled); /* Feedback */ - fprintf (Gbl.F.Out,""); + HTM_TEXTAREA_End (); + fprintf (Gbl.F.Out,""); /* End of right column */ HTM_DIV_End (); diff --git a/swad_test_import.c b/swad_test_import.c index 5bd3c37d..fc316f39 100644 --- a/swad_test_import.c +++ b/swad_test_import.c @@ -509,11 +509,11 @@ static void TsI_ImportQuestionsFromXMLBuffer (const char *XMLBuffer) /***** Print XML tree *****/ HTM_DIV_Begin ("class=\"TEST_FILE_CONTENT\""); - fprintf (Gbl.F.Out,""); + HTM_TEXTAREA_End (); HTM_DIV_End (); /***** Get questions from XML tree and print them *****/ diff --git a/swad_timeline.c b/swad_timeline.c index e600d486..38a23b1f 100644 --- a/swad_timeline.c +++ b/swad_timeline.c @@ -2366,14 +2366,13 @@ static void TL_PutTextarea (const char *Placeholder,const char *ClassTextArea) Frm_SetUniqueId (IdDivImgButton); /***** Textarea to write the content *****/ - fprintf (Gbl.F.Out,"", - TL_MAX_CHARS_IN_POST, - Placeholder,ClassTextArea, - IdDivImgButton); + HTM_TEXTAREA_Begin ("name=\"Content\" rows=\"1\" maxlength=\"%u\"" + " placeholder=\"%s…\" class=\"%s\"" + " onfocus=\"expandTextarea(this,'%s','6');\"", + TL_MAX_CHARS_IN_POST, + Placeholder,ClassTextArea, + IdDivImgButton); + HTM_TEXTAREA_End (); /***** Start concealable div *****/ HTM_DIV_Begin ("id=\"%s\" style=\"display:none;\"",IdDivImgButton);