mirror of https://github.com/acanas/swad-core.git
Version 15.190.2
This commit is contained in:
parent
735f44fa8e
commit
9fa78476a4
|
@ -133,13 +133,14 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.190.1 (2016-04-08)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.190.2 (2016-04-09)"
|
||||
#define CSS_FILE "swad15.190.1.css"
|
||||
#define JS_FILE "swad15.190.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 15.190.2: Apr 09, 2016 Fixed bug in test images. (199144 lines)
|
||||
Version 15.190.1: Apr 08, 2016 Removed unused JavaScript code. (199132 lines)
|
||||
Version 15.190: Apr 08, 2016 Get image attached to a social comment. (199142 lines)
|
||||
2 changes necessary in database:
|
||||
|
|
20
swad_image.c
20
swad_image.c
|
@ -63,8 +63,6 @@ extern struct Globals Gbl;
|
|||
/***************************** Internal prototypes ***************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Img_FreeImageTitle (struct Image *Image);
|
||||
|
||||
static void Img_ProcessImage (const char *FileNameImgOriginal,
|
||||
const char *FileNameImgProcessed,
|
||||
unsigned Width,unsigned Height,unsigned Quality);
|
||||
|
@ -72,20 +70,30 @@ static void Img_ProcessImage (const char *FileNameImgOriginal,
|
|||
/*****************************************************************************/
|
||||
/*************************** Reset image fields ******************************/
|
||||
/*****************************************************************************/
|
||||
// Every struct Image must be initialized to zero where it is declared
|
||||
// Every call to Img_InitImage must have a call to Img_FreeImage
|
||||
// Every struct Image must be initialized with this function Img_ImageConstructor after it is declared
|
||||
// Every call to Img_ImageConstructor must have a call to Img_ImageDestructor
|
||||
|
||||
void Img_ImageConstructor (struct Image *Image)
|
||||
{
|
||||
Img_ResetImageExceptTitle (Image);
|
||||
Image->Title = NULL;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************* Reset image fields except title ***********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Img_ResetImageExceptTitle (struct Image *Image)
|
||||
{
|
||||
Image->Action = Img_ACTION_NO_IMAGE;
|
||||
Image->Status = Img_FILE_NONE;
|
||||
Image->Name[0] = '\0';
|
||||
Image->Title = NULL;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************************** Free image *********************************/
|
||||
/*****************************************************************************/
|
||||
// Every call to Img_ImageConstructor must have a call to Img_ImageDestructor
|
||||
|
||||
void Img_ImageDestructor (struct Image *Image)
|
||||
{
|
||||
|
@ -96,7 +104,7 @@ void Img_ImageDestructor (struct Image *Image)
|
|||
/*************************** Reset image title *******************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Img_FreeImageTitle (struct Image *Image)
|
||||
void Img_FreeImageTitle (struct Image *Image)
|
||||
{
|
||||
// Image->Title must be initialized to NULL after declaration
|
||||
if (Image->Title)
|
||||
|
|
|
@ -96,7 +96,9 @@ struct Image
|
|||
/*****************************************************************************/
|
||||
|
||||
void Img_ImageConstructor (struct Image *Image);
|
||||
void Img_ResetImageExceptTitle (struct Image *Image);
|
||||
void Img_ImageDestructor (struct Image *Image);
|
||||
void Img_FreeImageTitle (struct Image *Image);
|
||||
|
||||
void Img_GetImageNameAndTitleFromRow (const char *Name,const char *Title,
|
||||
struct Image *Image);
|
||||
|
|
20
swad_test.c
20
swad_test.c
|
@ -221,7 +221,7 @@ static void Tst_PutFormEditOneQst (char *Stem,char *Feedback);
|
|||
static void Tst_FreeTextChoiceAnswers (void);
|
||||
static void Tst_FreeTextChoiceAnswer (unsigned NumOpt);
|
||||
|
||||
// static void Tst_InitImagesOfQuestion (void);
|
||||
static void Tst_InitImagesOfQuestion (void);
|
||||
static void Tst_FreeImagesOfQuestion (void);
|
||||
|
||||
static void Tst_GetQstDataFromDB (char *Stem,char *Feedback);
|
||||
|
@ -4866,21 +4866,25 @@ static void Tst_FreeTextChoiceAnswer (unsigned NumOpt)
|
|||
/*****************************************************************************/
|
||||
/***************** Initialize images of a question to zero *******************/
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
|
||||
static void Tst_InitImagesOfQuestion (void)
|
||||
{
|
||||
unsigned NumOpt;
|
||||
|
||||
***** Initialize image *****
|
||||
Img_ResetImage (&Gbl.Test.Image);
|
||||
/***** Initialize image *****/
|
||||
Img_ResetImageExceptTitle (&Gbl.Test.Image);
|
||||
Img_FreeImageTitle (&Gbl.Test.Image);
|
||||
|
||||
for (NumOpt = 0;
|
||||
NumOpt < Tst_MAX_OPTIONS_PER_QUESTION;
|
||||
NumOpt++)
|
||||
***** Initialize image *****
|
||||
Img_ResetImage (&Gbl.Test.Answer.Options[NumOpt].Image);
|
||||
{
|
||||
/***** Initialize image *****/
|
||||
Img_ResetImageExceptTitle (&Gbl.Test.Answer.Options[NumOpt].Image);
|
||||
Img_FreeImageTitle (&Gbl.Test.Image);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
/*********************** Free images of a question ***************************/
|
||||
/*****************************************************************************/
|
||||
|
@ -5129,7 +5133,7 @@ void Tst_ReceiveQst (void)
|
|||
else // Question is wrong
|
||||
{
|
||||
/***** Whether images has been received or not, reset images *****/
|
||||
// Tst_InitImagesOfQuestion ();
|
||||
Tst_InitImagesOfQuestion ();
|
||||
|
||||
/***** Put form to edit question again *****/
|
||||
Tst_PutFormEditOneQst (Stem,Feedback);
|
||||
|
|
Loading…
Reference in New Issue