From 8d5441fe733552b8317989769493d7ef0d09f0ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Wed, 30 Mar 2016 00:15:26 +0200 Subject: [PATCH] Version 15.165.8 --- swad_changelog.h | 3 ++- swad_test.c | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index c6fe9e7bc..6775b85f6 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -135,13 +135,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.165.7 (2016-03-29)" +#define Log_PLATFORM_VERSION "SWAD 15.165.8 (2016-03-29)" #define CSS_FILE "swad15.165.5.css" #define JS_FILE "swad15.131.3.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.165.8: Mar 30, 2016 Changes related to image in test questions. (196896 lines) Version 15.165.7: Mar 29, 2016 New field for image in database table of test questions. (196879 lines) 1 change necessary in database: ALTER TABLE tst_questions ADD COLUMN Image CHAR(43) NOT NULL AFTER Stem; diff --git a/swad_test.c b/swad_test.c index 08dd8a2f7..88bd7d352 100644 --- a/swad_test.c +++ b/swad_test.c @@ -145,6 +145,7 @@ static void Tst_ShowTestQuestionsWhenSeeing (MYSQL_RES *mysql_res); static void Tst_ShowTstResultAfterAssess (long TstCod,unsigned *NumQstsNotBlank,double *TotalScore); static void Tst_WriteQstAndAnsExam (unsigned NumQst,long QstCod,MYSQL_ROW row, double *ScoreThisQst,bool *AnswerIsNotBlank); +static void Tst_WriteQstImage (const char *Image); static void Tst_UpdateScoreQst (long QstCod,float ScoreThisQst,bool AnswerIsNotBlank); static void Tst_UpdateMyNumAccessTst (unsigned NumAccessesTst); static void Tst_UpdateLastAccTst (void); @@ -966,6 +967,7 @@ static void Tst_WriteQstAndAnsExam (unsigned NumQst,long QstCod,MYSQL_ROW row, fprintf (Gbl.F.Out,"", Gbl.RowEvenOdd); Tst_WriteQstStem (row[4],"TEST_EXA"); + Tst_WriteQstImage (row[5]); if (Gbl.Action.Act == ActSeeTst) Tst_WriteAnswersOfAQstSeeExam (NumQst,QstCod,(Str_ConvertToUpperLetter (row[3][0]) == 'Y')); else // Assessing exam / Viewing old exam @@ -979,7 +981,7 @@ static void Tst_WriteQstAndAnsExam (unsigned NumQst,long QstCod,MYSQL_ROW row, } /*****************************************************************************/ -/******************* Write the heading of a test question ********************/ +/********************* Write the stem of a test question *********************/ /*****************************************************************************/ void Tst_WriteQstStem (const char *Stem,const char *ClassStem) @@ -1006,6 +1008,21 @@ void Tst_WriteQstStem (const char *Stem,const char *ClassStem) free ((void *) StemRigorousHTML); } +/*****************************************************************************/ +/******************** Write the image of a test question *********************/ +/*****************************************************************************/ + +static void Tst_WriteQstImage (const char *Image) + { + if (Image) + if (Image[0]) + /***** Write the image *****/ + fprintf (Gbl.F.Out,"
" + "%s" + "
", + Image); + } + /*****************************************************************************/ /******************* Write the feedback of a test question *******************/ /*****************************************************************************/ @@ -2644,6 +2661,7 @@ static void Tst_ListOneOrMoreQuestionsToEdit (unsigned long NumRows,MYSQL_RES *m fprintf (Gbl.F.Out,"", Gbl.RowEvenOdd); Tst_WriteQstStem (row[4],"TEST_EDI"); + Tst_WriteQstImage (row[5]); Tst_WriteQstFeedback (row[6],"TEST_EDI_LIGHT"); Tst_WriteAnswersOfAQstEdit (QstCod); fprintf (Gbl.F.Out,"");