diff --git a/swad_changelog.h b/swad_changelog.h index e3d308bbb..15af66542 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -183,18 +183,21 @@ // TODO: Draw future dates in attendance, surveys, assignments in blue? // TODO: Fix bug in generate a test: after entering a number of questions with empty tags and type of answers, number of questions is not remembered +// TODO: Fix big when editing a test question with images: when "Change image" is selected but no image is uploades, other images (for example in answers) are lost /*****************************************************************************/ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.106.20 (2016-12-26)" +#define Log_PLATFORM_VERSION "SWAD 16.107 (2016-12-26)" #define CSS_FILE "swad16.106.5.css" #define JS_FILE "swad16.101.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 16.107: Dec 26, 2016 Changes in behaviour of labels in forms. + Code refactoring in tests. (211510 lines) Version 16.106.20:Dec 26, 2016 Changes in warning about next time to take a test. (211486 lines) Version 16.106.19:Dec 26, 2016 Changes in login form (autofocus). (211494 lines) Version 16.106.18:Dec 25, 2016 Changes in behaviour of labels in forms. (211496 lines) diff --git a/swad_test.c b/swad_test.c index 5b5cbdcb7..4a458780c 100644 --- a/swad_test.c +++ b/swad_test.c @@ -172,6 +172,8 @@ static void Tst_ShowFormEditTags (void); static void Tst_PutIconEnable (long TagCod,const char *TagTxt); static void Tst_PutIconDisable (long TagCod,const char *TagTxt); static void Tst_ShowFormConfigTst (void); +static void Tst_PutInputFieldNumQst (const char *Field,const char *Label, + unsigned Value); static void Tst_GetConfigTstFromDB (void); static Tst_Pluggable_t Tst_GetPluggableFromForm (void); static Tst_Feedback_t Tst_GetFeedbackTypeFromForm (void); @@ -214,6 +216,8 @@ static bool Tst_GetCreateXMLFromForm (void); static int Tst_CountNumTagsInList (void); static int Tst_CountNumAnswerTypesInList (void); static void Tst_PutFormEditOneQst (char *Stem,char *Feedback); +static void Tst_PutFloatInputField (const char *Label,const char *Field, + double Value); static void Tst_FreeTextChoiceAnswers (void); static void Tst_FreeTextChoiceAnswer (unsigned NumOpt); @@ -1830,18 +1834,21 @@ static void Tst_ShowFormConfigTst (void) "" "%s:" "" - "", + "", The_ClassForm[Gbl.Prefs.Theme], Txt_Plugins); for (Pluggable = Tst_PLUGGABLE_NO; Pluggable <= Tst_PLUGGABLE_YES; Pluggable++) { - fprintf (Gbl.F.Out,"" + "%s
", + fprintf (Gbl.F.Out," />" + "%s" + "
", Txt_TST_PLUGGABLE[Pluggable]); } fprintf (Gbl.F.Out,"" @@ -1852,60 +1859,30 @@ static void Tst_ShowFormConfigTst (void) "" "%s:" "" - "" + "" "", The_ClassForm[Gbl.Prefs.Theme], Txt_No_of_questions); - - /* Minimum number of questions in a test */ - fprintf (Gbl.F.Out,"" - "" - "
" - "%s" - "" - "" + Tst_PutInputFieldNumQst ("NumQstMin",Txt_minimum, + Gbl.Test.Config.Min); // Minimum number of questions + Tst_PutInputFieldNumQst ("NumQstDef",Txt_default, + Gbl.Test.Config.Def); // Default number of questions + Tst_PutInputFieldNumQst ("NumQstMax",Txt_maximum, + Gbl.Test.Config.Max); // Maximum number of questions + fprintf (Gbl.F.Out,"
" "" - "", - Txt_minimum,Gbl.Test.Config.Min); - - /* Default number of questions in a test */ - fprintf (Gbl.F.Out,"" - "" - "%s" - "" - "" - "" - "" - "", - Txt_default,Gbl.Test.Config.Def); - - /* Maximum number of questions in a test */ - fprintf (Gbl.F.Out,"" - "" - "%s" - "" - "" - "" - "" - "" - "" - "" - "", - Txt_maximum,Gbl.Test.Config.Max); + ""); /***** Minimum time between consecutive tests, per question *****/ fprintf (Gbl.F.Out,"" - "" + "" + "" "" - "" - "" + "" "" @@ -1919,17 +1896,20 @@ static void Tst_ShowFormConfigTst (void) "" "%s:" "" - "", + "", The_ClassForm[Gbl.Prefs.Theme],Txt_Feedback_to_students); for (FeedbTyp = (Tst_Feedback_t) 0; FeedbTyp < Tst_NUM_TYPES_FEEDBACK; FeedbTyp++) { - fprintf (Gbl.F.Out,"" + "%s
", + fprintf (Gbl.F.Out," />" + "%s" + "
", Txt_TST_STR_FEEDBACK[FeedbTyp]); } fprintf (Gbl.F.Out,"" @@ -1950,6 +1930,29 @@ static void Tst_ShowFormConfigTst (void) /*************** Get configuration of test for current course ****************/ /*****************************************************************************/ +static void Tst_PutInputFieldNumQst (const char *Field,const char *Label, + unsigned Value) + { + fprintf (Gbl.F.Out,"" + "" + "" + "" + "" + "" + "" + "", + Field,Label, + Field,Field, + Value); + } + +/*****************************************************************************/ +/*************** Get configuration of test for current course ****************/ +/*****************************************************************************/ + static void Tst_GetConfigTstFromDB (void) { char Query[512]; @@ -3394,20 +3397,29 @@ static void Tst_WriteChoiceAnsViewTest (unsigned NumQst,long QstCod,bool Shuffle Par_PutHiddenParamUnsigned (ParamName,Index); fprintf (Gbl.F.Out," ", - NumQst,Index); - fprintf (Gbl.F.Out,"" - "%c) " + fprintf (Gbl.F.Out," id=\"Ans%06u_%u\" name=\"Ans%06u\" value=\"%u\" />" "", - 'a' + (char) NumOpt); + NumQst,NumOpt, + NumQst,Index); + fprintf (Gbl.F.Out,"" + "" + "", + NumQst,NumOpt, + 'a' + (char) NumOpt); /***** Write the option text *****/ - fprintf (Gbl.F.Out,"" - "%s", + fprintf (Gbl.F.Out,"" + "", + NumQst,NumOpt, Gbl.Test.Answer.Options[NumOpt].Text); Img_ShowImage (&Gbl.Test.Answer.Options[NumOpt].Image, "TEST_IMG_SHOW_ANS_CONTAINER", @@ -4618,14 +4630,13 @@ static void Tst_PutFormEditOneQst (char *Stem,char *Feedback) /***** Answers *****/ /* Integer answer */ fprintf (Gbl.F.Out,"" - "" - "" "" - "" - "%s: " - "" + "" "" ""); /* Floating point answer */ fprintf (Gbl.F.Out,"" "" - "" - "%s " - "" - " %s " - "" - "" + ""); + Tst_PutFloatInputField (Txt_Real_number_between_A_and_B_1,"AnsFloatMin", + Gbl.Test.Answer.FloatingPoint[0]); + Tst_PutFloatInputField (Txt_Real_number_between_A_and_B_2,"AnsFloatMax", + Gbl.Test.Answer.FloatingPoint[1]); + fprintf (Gbl.F.Out,"" ""); /* T/F answer */ @@ -4851,6 +4851,29 @@ static void Tst_PutFormEditOneQst (char *Stem,char *Feedback) Lay_EndRoundFrame (); } +/*****************************************************************************/ +/********************* Put input field for floating answer *******************/ +/*****************************************************************************/ + +static void Tst_PutFloatInputField (const char *Label,const char *Field, + double Value) + { + extern const char *The_ClassForm[The_NUM_THEMES]; + + fprintf (Gbl.F.Out,""); + } + /*****************************************************************************/ /********************* Initialize a new question to zero *********************/ /*****************************************************************************/ diff --git a/swad_text.c b/swad_text.c index f99fa8de6..50cf4390d 100644 --- a/swad_text.c +++ b/swad_text.c @@ -29927,23 +29927,23 @@ const char *Txt_Real_number_between_A_and_B_1 = const char *Txt_Real_number_between_A_and_B_2 = #if L==1 - "y"; // Necessita traduccio + " i"; #elif L==2 - "und"; + " und"; #elif L==3 - "and"; + " and"; #elif L==4 - "y"; + " y"; #elif L==5 - "et"; + " et"; #elif L==6 - "y"; // Okoteve traducción + " y"; // Okoteve traducción #elif L==7 - "e"; + " e"; #elif L==8 - "i"; + " i"; #elif L==9 - "e"; + " e"; #endif const char *Txt_Recommended_aspect_ratio =