mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-15 21:24:07 +02:00
Version19.78.2
This commit is contained in:
parent
9fac82d1d8
commit
9974f5ea4d
38
swad_HTML.c
38
swad_HTML.c
|
@ -1189,7 +1189,7 @@ void HTM_INPUT_PASSWORD (const char *Name,const char *PlaceHolder,
|
||||||
fprintf (Gbl.F.Out," />");
|
fprintf (Gbl.F.Out," />");
|
||||||
}
|
}
|
||||||
|
|
||||||
void HTM_INPUT_NUMBER (const char *Name,long Min,long Max,long Value,bool Disabled,
|
void HTM_INPUT_LONG (const char *Name,long Min,long Max,long Value,bool Disabled,
|
||||||
const char *fmt,...)
|
const char *fmt,...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
@ -1223,6 +1223,42 @@ void HTM_INPUT_NUMBER (const char *Name,long Min,long Max,long Value,bool Disabl
|
||||||
fprintf (Gbl.F.Out," />");
|
fprintf (Gbl.F.Out," />");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HTM_INPUT_FLOAT (const char *Name,double Min,double Max,double Step,double Value,bool Disabled,
|
||||||
|
const char *fmt,...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
int NumBytesPrinted;
|
||||||
|
char *Attr;
|
||||||
|
|
||||||
|
Str_SetDecimalPointToUS (); // To print the floating point as a dot
|
||||||
|
fprintf (Gbl.F.Out,"<input type=\"number\" name=\"%s\""
|
||||||
|
" min=\"%lg\" max=\"%lg\" step=\"%lg\" value=\"%lg\"",
|
||||||
|
Name,
|
||||||
|
Min,Max,Step,Value);
|
||||||
|
Str_SetDecimalPointToLocal (); // Return to local system
|
||||||
|
if (Disabled)
|
||||||
|
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||||
|
|
||||||
|
if (fmt)
|
||||||
|
{
|
||||||
|
if (fmt[0])
|
||||||
|
{
|
||||||
|
va_start (ap,fmt);
|
||||||
|
NumBytesPrinted = vasprintf (&Attr,fmt,ap);
|
||||||
|
va_end (ap);
|
||||||
|
if (NumBytesPrinted < 0) // -1 if no memory or any other error
|
||||||
|
Lay_NotEnoughMemoryExit ();
|
||||||
|
|
||||||
|
/***** Print attributes *****/
|
||||||
|
fprintf (Gbl.F.Out," %s",Attr);
|
||||||
|
|
||||||
|
free (Attr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf (Gbl.F.Out," />");
|
||||||
|
}
|
||||||
|
|
||||||
void HTM_INPUT_RADIO (const char *Name,bool SubmitOnClick,
|
void HTM_INPUT_RADIO (const char *Name,bool SubmitOnClick,
|
||||||
const char *fmt,...)
|
const char *fmt,...)
|
||||||
{
|
{
|
||||||
|
|
|
@ -127,7 +127,9 @@ void HTM_INPUT_IMAGE (const char *URL,const char *Icon,const char *Title,const c
|
||||||
void HTM_INPUT_PASSWORD (const char *Name,const char *PlaceHolder,
|
void HTM_INPUT_PASSWORD (const char *Name,const char *PlaceHolder,
|
||||||
const char *AutoComplete,bool Required,
|
const char *AutoComplete,bool Required,
|
||||||
const char *fmt,...);
|
const char *fmt,...);
|
||||||
void HTM_INPUT_NUMBER (const char *Name,long Min,long Max,long Value,bool Disabled,
|
void HTM_INPUT_LONG (const char *Name,long Min,long Max,long Value,bool Disabled,
|
||||||
|
const char *fmt,...);
|
||||||
|
void HTM_INPUT_FLOAT (const char *Name,double Min,double Max,double Step,double Value,bool Disabled,
|
||||||
const char *fmt,...);
|
const char *fmt,...);
|
||||||
void HTM_INPUT_RADIO (const char *Name,bool SubmitOnClick,
|
void HTM_INPUT_RADIO (const char *Name,bool SubmitOnClick,
|
||||||
const char *fmt,...);
|
const char *fmt,...);
|
||||||
|
|
|
@ -490,7 +490,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
|
||||||
En OpenSWAD:
|
En OpenSWAD:
|
||||||
ps2pdf source.ps destination.pdf
|
ps2pdf source.ps destination.pdf
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 19.78.1 (2019-11-27)"
|
#define Log_PLATFORM_VERSION "SWAD 19.78.2 (2019-11-27)"
|
||||||
#define CSS_FILE "swad19.78.1.css"
|
#define CSS_FILE "swad19.78.1.css"
|
||||||
#define JS_FILE "swad19.70.js"
|
#define JS_FILE "swad19.70.js"
|
||||||
/*
|
/*
|
||||||
|
@ -498,6 +498,7 @@ ps2pdf source.ps destination.pdf
|
||||||
// TODO: Impedir la creación y edición de proyectos si no son editables.
|
// TODO: Impedir la creación y edición de proyectos si no son editables.
|
||||||
// TODO: En cada juego, poder listar los resultados en una tabla como la de resultados globales
|
// TODO: En cada juego, poder listar los resultados en una tabla como la de resultados globales
|
||||||
|
|
||||||
|
Version 19.78.2: Nov 27, 2019 New field maximum grade in game form. Not finished. (247168 lines)
|
||||||
Version 19.78.1: Nov 27, 2019 Changes in edition of games, attendance, events, assignments. (247123 lines)
|
Version 19.78.1: Nov 27, 2019 Changes in edition of games, attendance, events, assignments. (247123 lines)
|
||||||
Version 19.78: Nov 25, 2019 Filtering of match results by games. (247106 lines)
|
Version 19.78: Nov 25, 2019 Filtering of match results by games. (247106 lines)
|
||||||
1 change necessary in database:
|
1 change necessary in database:
|
||||||
|
|
16
swad_game.c
16
swad_game.c
|
@ -26,6 +26,7 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define _GNU_SOURCE // For asprintf
|
#define _GNU_SOURCE // For asprintf
|
||||||
|
#include <float.h> // For DBL_MAX
|
||||||
#include <linux/limits.h> // For PATH_MAX
|
#include <linux/limits.h> // For PATH_MAX
|
||||||
#include <linux/stddef.h> // For NULL
|
#include <linux/stddef.h> // For NULL
|
||||||
#include <stdio.h> // For asprintf
|
#include <stdio.h> // For asprintf
|
||||||
|
@ -1162,6 +1163,7 @@ static void Gam_PutFormsEditionGame (struct Game *Game,bool ItsANewGame)
|
||||||
extern const char *Txt_New_game;
|
extern const char *Txt_New_game;
|
||||||
extern const char *Txt_Edit_game;
|
extern const char *Txt_Edit_game;
|
||||||
extern const char *Txt_Title;
|
extern const char *Txt_Title;
|
||||||
|
extern const char *Txt_Maximum_grade;
|
||||||
extern const char *Txt_Description;
|
extern const char *Txt_Description;
|
||||||
extern const char *Txt_Create_game;
|
extern const char *Txt_Create_game;
|
||||||
extern const char *Txt_Save_changes;
|
extern const char *Txt_Save_changes;
|
||||||
|
@ -1212,6 +1214,20 @@ static void Gam_PutFormsEditionGame (struct Game *Game,bool ItsANewGame)
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
||||||
|
/***** Maximum grade *****/
|
||||||
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
|
HTM_TD_Begin ("class=\"%s RM\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
|
||||||
|
HTM_TxtF ("%s:",Txt_Maximum_grade);
|
||||||
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
HTM_TD_Begin ("class=\"LM\"");
|
||||||
|
HTM_INPUT_FLOAT ("MaxGrade",(double) 0.0,(double) DBL_MAX,(double) 0.01,(double) 10.0,false,
|
||||||
|
NULL);
|
||||||
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
HTM_TR_End ();
|
||||||
|
|
||||||
/***** Game text *****/
|
/***** Game text *****/
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
|
|
|
@ -3534,7 +3534,7 @@ static void Prj_PutFormProject (struct Project *Prj,bool ItsANewProject)
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"LM\"");
|
HTM_TD_Begin ("class=\"LM\"");
|
||||||
HTM_INPUT_NUMBER ("NumStds",(long) 0,(long) UINT_MAX,(long) Prj->NumStds,false,
|
HTM_INPUT_LONG ("NumStds",(long) 0,(long) UINT_MAX,(long) Prj->NumStds,false,
|
||||||
NULL);
|
NULL);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
|
|
@ -680,27 +680,6 @@ static unsigned Str_FindHTMLEntity (const char *Ptr)
|
||||||
0; // No HTML entity found
|
0; // No HTML entity found
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/**************** Check if a URL adreess looks as** valid ********************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
/*
|
|
||||||
bool Str_URLLooksValid (const char *URL)
|
|
||||||
{
|
|
||||||
***** If it's a NULL pointer *****
|
|
||||||
if (!URL)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
***** If it's the empty string *****
|
|
||||||
if (!URL[0])
|
|
||||||
return false;
|
|
||||||
|
|
||||||
***** Check if start by http:// or https:// *****
|
|
||||||
if (!strncasecmp (URL,"http://",7) || !strncasecmp (URL,"https://",8))
|
|
||||||
return (bool) (strchr (URL,(int) '.') != NULL); // There is any . in the URL
|
|
||||||
else // There's no http:// nor https://
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***** Convert a string to title: first uppercase and the rest lowercase *****/
|
/***** Convert a string to title: first uppercase and the rest lowercase *****/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -84,7 +84,6 @@ typedef enum
|
||||||
|
|
||||||
void Str_InsertLinks (char *Txt,unsigned long MaxLength,size_t MaxCharsURLOnScreen);
|
void Str_InsertLinks (char *Txt,unsigned long MaxLength,size_t MaxCharsURLOnScreen);
|
||||||
size_t Str_LimitLengthHTMLStr (char *Str,size_t MaxCharsOnScreen);
|
size_t Str_LimitLengthHTMLStr (char *Str,size_t MaxCharsOnScreen);
|
||||||
// bool Str_URLLooksValid (const char *URL);
|
|
||||||
void Str_ConvertToTitleType (char *Str);
|
void Str_ConvertToTitleType (char *Str);
|
||||||
void Str_ConvertToComparable (char *Str);
|
void Str_ConvertToComparable (char *Str);
|
||||||
char *Str_ConvertToUpperText (char *Str);
|
char *Str_ConvertToUpperText (char *Str);
|
||||||
|
|
|
@ -361,7 +361,7 @@ void Tst_ShowFormAskTst (void)
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"LM\"");
|
HTM_TD_Begin ("class=\"LM\"");
|
||||||
HTM_INPUT_NUMBER ("NumQst",
|
HTM_INPUT_LONG ("NumQst",
|
||||||
(long) Gbl.Test.Config.Min,
|
(long) Gbl.Test.Config.Min,
|
||||||
(long) Gbl.Test.Config.Max,
|
(long) Gbl.Test.Config.Max,
|
||||||
(long) Gbl.Test.Config.Def,
|
(long) Gbl.Test.Config.Def,
|
||||||
|
|
21
swad_text.c
21
swad_text.c
|
@ -18224,6 +18224,27 @@ const char *Txt_maximum =
|
||||||
"máximo";
|
"máximo";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
const char *Txt_Maximum_grade =
|
||||||
|
#if L==1 // ca
|
||||||
|
"Nota màxima";
|
||||||
|
#elif L==2 // de
|
||||||
|
"Höchstnote";
|
||||||
|
#elif L==3 // en
|
||||||
|
"Maximum grade";
|
||||||
|
#elif L==4 // es
|
||||||
|
"Nota máxima";
|
||||||
|
#elif L==5 // fr
|
||||||
|
"Note maximale";
|
||||||
|
#elif L==6 // gn
|
||||||
|
"Nota máxima"; // Okoteve traducción
|
||||||
|
#elif L==7 // it
|
||||||
|
"Voto massimo";
|
||||||
|
#elif L==8 // pl
|
||||||
|
"Maksymalna ocena";
|
||||||
|
#elif L==9 // pt
|
||||||
|
"Nota máxima";
|
||||||
|
#endif
|
||||||
|
|
||||||
const char *Txt_Members = // Project members
|
const char *Txt_Members = // Project members
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Membres";
|
"Membres";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user