From 17756d67e3d5a36b1534ad8b614a6a81e58d64b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sun, 27 Nov 2016 14:34:36 +0100 Subject: [PATCH] Version 16.72.1 --- swad_changelog.h | 3 ++- swad_test.c | 15 +++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index e212d014e..0efc4e526 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -178,13 +178,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.72 (2016-11-27)" +#define Log_PLATFORM_VERSION "SWAD 16.72.1 (2016-11-27)" #define CSS_FILE "swad16.69.css" #define JS_FILE "swad16.46.1.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.72.1: Nov 27, 2016 Fixed bug in answers of test questions, reported by Javier Fernández Baldomero. (207704 lines) Version 16.72: Nov 27, 2016 Link to show all users' data. Code refactoring in scopes. (207698 lines) Version 16.71.9: Nov 27, 2016 Fixed bug in list of students, reported by Javier Fernández Baldomero. (207641 lines) diff --git a/swad_test.c b/swad_test.c index fafa1c09a..4211d1793 100644 --- a/swad_test.c +++ b/swad_test.c @@ -3737,7 +3737,11 @@ static void Tst_WriteTextAnsAssessTest (unsigned NumQst,MYSQL_RES *mysql_res, { /* Filter the user answer */ strcpy (TextAnsUsr,Gbl.Test.StrAnswersOneQst[NumQst]); - Str_ReplaceSeveralSpacesForOne (TextAnsUsr); // Join several spaces into one in answer + + /* In order to compare student answer to stored answer, + the text answers are stored avoiding two or more consecurive spaces */ + Str_ReplaceSeveralSpacesForOne (TextAnsUsr); + Str_ConvertToComparable (TextAnsUsr); for (NumOpt = 0; @@ -4419,8 +4423,8 @@ void Tst_ShowFormEditOneQst (void) /*****************************************************************************/ // This function may be called from three places: -// 1. Pressing edition of question in the menu -// 2. Pressing button to edit question in a listing of existing questions +// 1. By clicking "New question" icon +// 2. By clicking "Edit" icon in a listing of existing questions // 3. From the action associated to reception of a question, on error in the parameters received from the form static void Tst_PutFormEditOneQst (char *Stem,char *Feedback) @@ -5341,7 +5345,10 @@ static void Tst_GetQstFromForm (char *Stem,char *Feedback) /* Get answer */ sprintf (AnsStr,"AnsStr%u",NumOpt); Par_GetParToHTML (AnsStr,Gbl.Test.Answer.Options[NumOpt].Text,Tst_MAX_BYTES_ANSWER_OR_FEEDBACK); - Str_ReplaceSeveralSpacesForOne (Gbl.Test.Answer.Options[NumOpt].Text); // Join several spaces into one in answer + if (Gbl.Test.AnswerType == Tst_ANS_TEXT) + /* In order to compare student answer to stored answer, + the text answers are stored avoiding two or more consecurive spaces */ + Str_ReplaceSeveralSpacesForOne (Gbl.Test.Answer.Options[NumOpt].Text); /* Get feedback */ sprintf (FbStr,"FbStr%u",NumOpt);