Version 15.165.8

This commit is contained in:
Antonio Cañas Vargas 2016-03-30 00:15:26 +02:00
parent a4894ce39a
commit 8d5441fe73
2 changed files with 21 additions and 2 deletions

View File

@ -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;

View File

@ -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,"<td class=\"LEFT_TOP COLOR%u\">",
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,"<div>"
"%s"
"</div>",
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,"<td class=\"LEFT_TOP COLOR%u\">",
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,"</td>");