diff --git a/swad_changelog.h b/swad_changelog.h index 6ab2f8be1..34eff70c7 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -131,13 +131,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.180.7 (2016-04-05)" +#define Log_PLATFORM_VERSION "SWAD 15.181 (2016-04-05)" #define CSS_FILE "swad15.178.2.css" #define JS_FILE "swad15.178.2.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.181: Apr 05, 2016 New fields in test questions with the title/attribution of images. (198515 lines) Version 15.180.7: Apr 05, 2016 Changes in layout of editor of question. (198473 lines) Version 15.180.6: Apr 05, 2016 Changes in layout of editor of question. (198490 lines) Version 15.180.5: Apr 05, 2016 Changes in layout of editor of question. (198512 lines) diff --git a/swad_test.c b/swad_test.c index 5d64f2b4e..73b1acd7e 100644 --- a/swad_test.c +++ b/swad_test.c @@ -156,8 +156,10 @@ static void Tst_ShowTstResultAfterAssess (long TstCod,unsigned *NumQstsNotBlank, static void Tst_WriteQstAndAnsExam (unsigned NumQst,long QstCod,MYSQL_ROW row, double *ScoreThisQst,bool *AnswerIsNotBlank); static void Tst_PutFormToEditQstImage (struct Image *Image,const char *ClassImg, + const char *TitleAttribution,const char *ClassTitle, const char *ParamAction, const char *ParamFile, + const char *ParamTitle, bool OptionsDisabled); static void Tst_UpdateScoreQst (long QstCod,float ScoreThisQst,bool AnswerIsNotBlank); static void Tst_UpdateMyNumAccessTst (unsigned NumAccessesTst); @@ -1045,8 +1047,10 @@ void Tst_WriteQstStem (const char *Stem,const char *ClassStem) /*****************************************************************************/ static void Tst_PutFormToEditQstImage (struct Image *Image,const char *ClassImg, + const char *TitleAttribution,const char *ClassTitle, const char *ParamAction, const char *ParamFile, + const char *ParamTitle, bool OptionsDisabled) { extern const char *The_ClassForm[The_NUM_THEMES]; @@ -1055,9 +1059,13 @@ static void Tst_PutFormToEditQstImage (struct Image *Image,const char *ClassImg, extern const char *Txt_Change_image; extern const char *Txt_Image; extern const char *Txt_optional; + extern const char *Txt_Image_title_attribution; static unsigned UniqueId = 0; - /***** No image *****/ + /***** Start container *****/ + fprintf (Gbl.F.Out,"
"); + + /***** Choice 1: No image *****/ fprintf (Gbl.F.Out,"Name[0]) @@ -1071,7 +1079,7 @@ static void Tst_PutFormToEditQstImage (struct Image *Image,const char *ClassImg, The_ClassForm[Gbl.Prefs.Theme], Txt_No_image); - /***** Current image *****/ + /***** Choice 2: Current image *****/ if (Image->Name[0]) { fprintf (Gbl.F.Out,"Name[0]) // Image exists { @@ -1117,13 +1125,32 @@ static void Tst_PutFormToEditQstImage (struct Image *Image,const char *ClassImg, "", The_ClassForm[Gbl.Prefs.Theme],Txt_Image,Txt_optional); } + + /***** Image file *****/ fprintf (Gbl.F.Out,"", + fprintf (Gbl.F.Out," onchange=\"document.getElementById('chg_img_%u').checked = true;\" />" + "
", UniqueId); + + /***** Image title/attribution *****/ + fprintf (Gbl.F.Out,"
" + ""); + + /***** End container *****/ + fprintf (Gbl.F.Out,"
"); } /*****************************************************************************/ @@ -4305,6 +4332,7 @@ static void Tst_PutFormEditOneQst (char *Stem,char *Feedback) bool OptionsDisabled; char ParamAction[32]; char ParamFile[32]; + char ParamTitle[32]; /***** If no receiving the question, but editing a new or existing question ==> init or edit data of question *****/ @@ -4421,21 +4449,15 @@ static void Tst_PutFormEditOneQst (char *Stem,char *Feedback) The_ClassForm[Gbl.Prefs.Theme], Txt_Stem, Stem); - Tst_PutFormToEditQstImage (&Gbl.Test.Image, - "TEST_IMG_EDIT_ONE_STEM", - "ImgAct","FileImg",false); - fprintf (Gbl.F.Out,"" - ""); + Tst_PutFormToEditQstImage (&Gbl.Test.Image,"TEST_IMG_EDIT_ONE_STEM", + NULL,"STEM", // Title / attribution + "ImgAct","FileImg","TitImg",false); /***** Feedback *****/ - fprintf (Gbl.F.Out,"" - "" - "