From 0c3dd22b3c7ce0ad16b35ac58c748ad688ccfd9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Thu, 7 Apr 2016 17:14:35 +0200 Subject: [PATCH] Version 15.186 --- css/{swad15.184.7.css => swad15.186.css} | 13 +++- js/{swad15.184.8.js => swad15.186.js} | 9 ++- swad_changelog.h | 9 +-- swad_test.c | 83 +++++++++++------------- 4 files changed, 62 insertions(+), 52 deletions(-) rename css/{swad15.184.7.css => swad15.186.css} (99%) rename js/{swad15.184.8.js => swad15.186.js} (99%) diff --git a/css/swad15.184.7.css b/css/swad15.186.css similarity index 99% rename from css/swad15.184.7.css rename to css/swad15.186.css index d1c0b624e..30d7d6afc 100644 --- a/css/swad15.184.7.css +++ b/css/swad15.186.css @@ -1728,7 +1728,7 @@ a:hover img.CENTRE_PHOTO_SHOW .ANS {color:#404040; font-size:13pt; font-weight:bold;} .ANS_OK {color:#008000; font-size:13pt; font-weight:bold;} .ANS_BAD {color:red; font-size:13pt; font-weight:bold;} -.ANS_STR {box-sizing:border-box; width:625px;} +.ANS_STR {box-sizing:border-box; width:600px;} .TEST_SUBTITLE { margin:10px; @@ -1752,14 +1752,21 @@ a:hover img.CENTRE_PHOTO_SHOW .TEST_EDI_ANS_LEFT_COL { box-sizing:border-box; - width:74px; + width:50px; text-align:left; vertical-align:top; } +.TEST_EDI_ANS_CENTER_COL + { + box-sizing:border-box; + width:50px; + text-align:right; + vertical-align:top; + } .TEST_EDI_ANS_RIGHT_COL { box-sizing:border-box; - width:630px; + width:604px; text-align:left; vertical-align:top; } diff --git a/js/swad15.184.8.js b/js/swad15.186.js similarity index 99% rename from js/swad15.184.8.js rename to js/swad15.186.js index 2ae81e8ba..9ad7adce8 100644 --- a/js/swad15.184.8.js +++ b/js/swad15.186.js @@ -642,7 +642,14 @@ function contractTextarea (textareaElem,idButton,rows) { } } -//Change display of a element (hidden or visible) +// Change display of a test answer +function toggleAnswer (option) { + toggleDisplay('ans_' + option); + toggleDisplay('con_' + option); + toggleDisplay('exp_' + option); +} + +// Change display of a element (hidden or visible) function toggleDisplay (elementID) { var stl = document.getElementById (elementID).style; stl.display = (stl.display === 'none') ? '' : 'none'; diff --git a/swad_changelog.h b/swad_changelog.h index 8853e1726..6f3b34d83 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -132,14 +132,15 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.185.4 (2016-04-07)" -#define CSS_FILE "swad15.184.7.css" -#define JS_FILE "swad15.184.8.js" +#define Log_PLATFORM_VERSION "SWAD 15.186 (2016-04-07)" +#define CSS_FILE "swad15.186.css" +#define JS_FILE "swad15.186.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.185.4: Apr 07, 2016 Change in edition of a test question. (198832 lines) + Version 15.186: Apr 07, 2016 Changes in edition of a test question. (198840 lines) + Version 15.185.4: Apr 07, 2016 Changes in edition of a test question. (198832 lines) Version 15.185.3: Apr 07, 2016 Changed icons to expand / contract. (198801 lines) Copy file icon/expand64x64.png to icon directory Copy file icon/contract64x64.png to icon directory diff --git a/swad_test.c b/swad_test.c index e6d74a26f..197904400 100644 --- a/swad_test.c +++ b/swad_test.c @@ -1602,7 +1602,7 @@ static void Tst_ShowFormSelTags (unsigned long NumRows,MYSQL_RES *mysql_res, The_ClassForm[Gbl.Prefs.Theme]); if (Gbl.Test.Tags.All) fprintf (Gbl.F.Out," checked=\"checked\""); - fprintf (Gbl.F.Out," onclick=\"togglecheckChildren(this,'ChkTag')\" />" + fprintf (Gbl.F.Out," onclick=\"togglecheckChildren(this,'ChkTag');\" />" " %s" "" "", @@ -1645,7 +1645,7 @@ static void Tst_ShowFormSelTags (unsigned long NumRows,MYSQL_RES *mysql_res, fprintf (Gbl.F.Out," checked=\"checked\""); } } - fprintf (Gbl.F.Out," onclick=\"checkParent(this,'AllTags')\" />" + fprintf (Gbl.F.Out," onclick=\"checkParent(this,'AllTags');\" />" " %s" "" "", @@ -2218,7 +2218,7 @@ static void Tst_ShowFormAnswerTypes (unsigned NumCols) The_ClassForm[Gbl.Prefs.Theme]); if (Gbl.Test.AllAnsTypes) fprintf (Gbl.F.Out," checked=\"checked\""); - fprintf (Gbl.F.Out," onclick=\"togglecheckChildren(this,'AnswerType')\" />" + fprintf (Gbl.F.Out," onclick=\"togglecheckChildren(this,'AnswerType');\" />" " %s" "" "", @@ -2240,7 +2240,7 @@ static void Tst_ShowFormAnswerTypes (unsigned NumCols) if (Tst_ConvertFromUnsignedStrToAnsTyp (UnsignedStr) == AnsType) fprintf (Gbl.F.Out," checked=\"checked\""); } - fprintf (Gbl.F.Out," onclick=\"checkParent(this,'AllAnsTypes')\" />" + fprintf (Gbl.F.Out," onclick=\"checkParent(this,'AllAnsTypes');\" />" " %s" "" "", @@ -3330,7 +3330,7 @@ static void Tst_WriteChoiceAnsSeeExam (unsigned NumQst,long QstCod,bool Shuffle) Par_PutHiddenParamUnsigned (ParamName,Index); fprintf (Gbl.F.Out,"%s 
", + fprintf (Gbl.F.Out," onclick=\"enableDisableAns(this.form);\" />" + "%s 
", Txt_TST_STR_ANSWER_TYPES[AnsType]); } fprintf (Gbl.F.Out,"" @@ -4639,12 +4641,13 @@ static void Tst_PutFormEditOneQst (char *Stem,char *Feedback) if (Gbl.Test.Answer.Options[NumOpt].Text) if (Gbl.Test.Answer.Options[NumOpt].Text[0]) AnswerHasContent = true; + DisplayRightColumn = NumOpt == 0 || AnswerHasContent; - /***** Left column: selectors and letter of the answer *****/ + /***** Left column: selectors *****/ fprintf (Gbl.F.Out,"" - "" + "" " %c) ", + fprintf (Gbl.F.Out," />" + ""); + + /***** Center column: letter of the answer and expand / contract icon *****/ + fprintf (Gbl.F.Out,"" + "%c)", + The_ClassForm[Gbl.Prefs.Theme],Gbl.RowEvenOdd, 'a' + (char) NumOpt); - // Icon to expand - sprintf (Gbl.Title,"%s %c",Txt_Expand,'a' + (char) NumOpt); - fprintf (Gbl.F.Out,"
" - "" + fprintf (Gbl.F.Out," onclick=\"toggleAnswer('%u'); return false;\" />" "\"%s\"" - "" - "
", - NumOpt,NumOpt,NumOpt, - Gbl.Prefs.IconsURL, - Gbl.Title, - Gbl.Title); + " alt=\"%s\" title=\"%s\" class=\"ICON20x20\" />" + "", + NumOpt,Gbl.Prefs.IconsURL, + Gbl.Title,Gbl.Title); - // Icon to contract - sprintf (Gbl.Title,"%s %c",Txt_Contract,'a' + (char) NumOpt); - fprintf (Gbl.F.Out,"
" - "" + fprintf (Gbl.F.Out," onclick=\"toggleAnswer(%u); return false;\" />" "\"%s\"" - "" - "
", - NumOpt,NumOpt,NumOpt, - Gbl.Prefs.IconsURL, - Gbl.Title, - Gbl.Title); + " alt=\"%s\" title=\"%s\" class=\"ICON20x20\" />" + "", + NumOpt,Gbl.Prefs.IconsURL, + Gbl.Title,Gbl.Title); fprintf (Gbl.F.Out,""); /***** Right column: content of the answer *****/ fprintf (Gbl.F.Out,"" - "
");