mirror of https://github.com/acanas/swad-core.git
Version19.254.2
This commit is contained in:
parent
b797c3ff17
commit
71ea7e1190
|
@ -556,7 +556,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.254.1 (2020-06-23)"
|
#define Log_PLATFORM_VERSION "SWAD 19.254.2 (2020-06-23)"
|
||||||
#define CSS_FILE "swad19.253.css"
|
#define CSS_FILE "swad19.253.css"
|
||||||
#define JS_FILE "swad19.254.js"
|
#define JS_FILE "swad19.254.js"
|
||||||
/*
|
/*
|
||||||
|
@ -568,6 +568,8 @@ TODO: No limitar el n
|
||||||
TODO: Que al generar un examen sólo se cojan preguntas válidas. Y si ya está generado, al entrar de nuevo, que se vean en rojo.
|
TODO: Que al generar un examen sólo se cojan preguntas válidas. Y si ya está generado, al entrar de nuevo, que se vean en rojo.
|
||||||
TODO: Dentro de las funciones TstPrn_ShowUsrPrints y TstPrn_ShowOnePrint crear y llamar a una función común similar a ExaRes_CheckIfICanSeePrintResult
|
TODO: Dentro de las funciones TstPrn_ShowUsrPrints y TstPrn_ShowOnePrint crear y llamar a una función común similar a ExaRes_CheckIfICanSeePrintResult
|
||||||
|
|
||||||
|
Version 19.254.2: Jun 23, 2020 Matches results can only be changed to visible when match is at the end.
|
||||||
|
If teacher goes back in match, the results change antumatically to hidden. (303667 lines)
|
||||||
Version 19.254.1: Jun 23, 2020 Code refactoring in matches results. (303646 lines)
|
Version 19.254.1: Jun 23, 2020 Code refactoring in matches results. (303646 lines)
|
||||||
Version 19.254: Jun 22, 2020 Fixed bug in Javascript related to quotes. Reported by Laura García Rejón. (303653 lines)
|
Version 19.254: Jun 22, 2020 Fixed bug in Javascript related to quotes. Reported by Laura García Rejón. (303653 lines)
|
||||||
Version 19.253: Jun 22, 2020 More details in listing of exams. (303643 lines)
|
Version 19.253: Jun 22, 2020 More details in listing of exams. (303643 lines)
|
||||||
|
|
|
@ -531,8 +531,8 @@ static bool ExaSes_CheckIfVisibilityOfResultsCanBeChanged (const struct ExaSes_S
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void ExaSes_ListOneOrMoreSessionsIcons (struct Exa_Exams *Exams,
|
static void ExaSes_ListOneOrMoreSessionsIcons (struct Exa_Exams *Exams,
|
||||||
const struct ExaSes_Session *Session,
|
const struct ExaSes_Session *Session,
|
||||||
const char *Anchor)
|
const char *Anchor)
|
||||||
{
|
{
|
||||||
/***** Begin cell *****/
|
/***** Begin cell *****/
|
||||||
HTM_TD_Begin ("class=\"BT%u\"",Gbl.RowEvenOdd);
|
HTM_TD_Begin ("class=\"BT%u\"",Gbl.RowEvenOdd);
|
||||||
|
|
45
swad_match.c
45
swad_match.c
|
@ -113,6 +113,7 @@ static void Mch_ListOneOrMoreMatches (struct Gam_Games *Games,
|
||||||
static void Mch_ListOneOrMoreMatchesHeading (bool ICanEditMatches);
|
static void Mch_ListOneOrMoreMatchesHeading (bool ICanEditMatches);
|
||||||
static bool Mch_CheckIfICanEditMatches (void);
|
static bool Mch_CheckIfICanEditMatches (void);
|
||||||
static bool Mch_CheckIfICanEditThisMatch (const struct Mch_Match *Match);
|
static bool Mch_CheckIfICanEditThisMatch (const struct Mch_Match *Match);
|
||||||
|
static bool Mch_CheckIfVisibilityOfResultsCanBeChanged (const struct Mch_Match *Match);
|
||||||
static void Mch_ListOneOrMoreMatchesIcons (struct Gam_Games *Games,
|
static void Mch_ListOneOrMoreMatchesIcons (struct Gam_Games *Games,
|
||||||
const struct Mch_Match *Match);
|
const struct Mch_Match *Match);
|
||||||
static void Mch_ListOneOrMoreMatchesAuthor (const struct Mch_Match *Match);
|
static void Mch_ListOneOrMoreMatchesAuthor (const struct Mch_Match *Match);
|
||||||
|
@ -598,6 +599,20 @@ static bool Mch_CheckIfICanEditThisMatch (const struct Mch_Match *Match)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*********** Check if visibility of match results can be changed *************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static bool Mch_CheckIfVisibilityOfResultsCanBeChanged (const struct Mch_Match *Match)
|
||||||
|
{
|
||||||
|
if (Match->Status.ShowUsrResults || // Results are currently visible
|
||||||
|
Match->Status.Showing == Mch_END) // Match has finished
|
||||||
|
if (Mch_CheckIfICanEditThisMatch (Match))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************* Put a column for icons ****************************/
|
/************************* Put a column for icons ****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -854,18 +869,19 @@ static void Mch_ListOneOrMoreMatchesResultTch (struct Gam_Games *Games,
|
||||||
extern const char *Txt_Hidden_results;
|
extern const char *Txt_Hidden_results;
|
||||||
extern const char *Txt_Results;
|
extern const char *Txt_Results;
|
||||||
|
|
||||||
/***** Can I edit match vivibility? *****/
|
Games->GamCod = Match->GamCod;
|
||||||
if (Mch_CheckIfICanEditThisMatch (Match))
|
Games->MchCod = Match->MchCod;
|
||||||
{
|
|
||||||
Games->GamCod = Match->GamCod;
|
|
||||||
Games->MchCod = Match->MchCod;
|
|
||||||
|
|
||||||
/* Show match results */
|
/***** Show match results *****/
|
||||||
|
if (Mch_CheckIfICanEditThisMatch (Match))
|
||||||
Lay_PutContextualLinkOnlyIcon (ActSeeUsrMchResMch,MchRes_RESULTS_BOX_ID,
|
Lay_PutContextualLinkOnlyIcon (ActSeeUsrMchResMch,MchRes_RESULTS_BOX_ID,
|
||||||
Mch_PutParamsEdit,Games,
|
Mch_PutParamsEdit,Games,
|
||||||
"trophy.svg",
|
"trophy.svg",
|
||||||
Txt_Results);
|
Txt_Results);
|
||||||
|
|
||||||
|
/***** Check if visibility of session results can be changed *****/
|
||||||
|
if (Mch_CheckIfVisibilityOfResultsCanBeChanged (Match))
|
||||||
|
{
|
||||||
/* I can edit visibility */
|
/* I can edit visibility */
|
||||||
Lay_PutContextualLinkOnlyIcon (ActChgVisResMchUsr,NULL,
|
Lay_PutContextualLinkOnlyIcon (ActChgVisResMchUsr,NULL,
|
||||||
Mch_PutParamsEdit,Games,
|
Mch_PutParamsEdit,Games,
|
||||||
|
@ -902,8 +918,8 @@ void Mch_ToggleVisResultsMchUsr (void)
|
||||||
/***** Get and check parameters *****/
|
/***** Get and check parameters *****/
|
||||||
Mch_GetAndCheckParameters (&Games,&Game,&Match);
|
Mch_GetAndCheckParameters (&Games,&Game,&Match);
|
||||||
|
|
||||||
/***** Check if I have permission to change visibility *****/
|
/***** Check if visibility of match results can be changed *****/
|
||||||
if (!Mch_CheckIfICanEditThisMatch (&Match))
|
if (!Mch_CheckIfVisibilityOfResultsCanBeChanged (&Match))
|
||||||
Lay_NoPermissionExit ();
|
Lay_NoPermissionExit ();
|
||||||
|
|
||||||
/***** Toggle visibility of match results *****/
|
/***** Toggle visibility of match results *****/
|
||||||
|
@ -1804,7 +1820,8 @@ static void Mch_UpdateMatchStatusInDB (const struct Mch_Match *Match)
|
||||||
"mch_matches.Showing='%s',"
|
"mch_matches.Showing='%s',"
|
||||||
"mch_matches.Countdown=%ld,"
|
"mch_matches.Countdown=%ld,"
|
||||||
"mch_matches.NumCols=%u,"
|
"mch_matches.NumCols=%u,"
|
||||||
"mch_matches.ShowQstResults='%c'"
|
"mch_matches.ShowQstResults='%c',"
|
||||||
|
"mch_matches.ShowUsrResults='%c'"
|
||||||
" WHERE mch_matches.MchCod=%ld"
|
" WHERE mch_matches.MchCod=%ld"
|
||||||
" AND mch_matches.GamCod=gam_games.GamCod"
|
" AND mch_matches.GamCod=gam_games.GamCod"
|
||||||
" AND gam_games.CrsCod=%ld", // Extra check
|
" AND gam_games.CrsCod=%ld", // Extra check
|
||||||
|
@ -1813,7 +1830,10 @@ static void Mch_UpdateMatchStatusInDB (const struct Mch_Match *Match)
|
||||||
Mch_ShowingStringsDB[Match->Status.Showing],
|
Mch_ShowingStringsDB[Match->Status.Showing],
|
||||||
Match->Status.Countdown,
|
Match->Status.Countdown,
|
||||||
Match->Status.NumCols,
|
Match->Status.NumCols,
|
||||||
Match->Status.ShowQstResults ? 'Y' : 'N',
|
Match->Status.ShowQstResults ? 'Y' :
|
||||||
|
'N',
|
||||||
|
Match->Status.ShowUsrResults ? 'Y' :
|
||||||
|
'N',
|
||||||
Match->MchCod,Gbl.Hierarchy.Crs.CrsCod);
|
Match->MchCod,Gbl.Hierarchy.Crs.CrsCod);
|
||||||
free (MchSubQuery);
|
free (MchSubQuery);
|
||||||
|
|
||||||
|
@ -2115,7 +2135,10 @@ static void Mch_SetMatchStatusToPrev (struct Mch_Match *Match)
|
||||||
Match->Status.Showing = Mch_ANSWERS;
|
Match->Status.Showing = Mch_ANSWERS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Match->Status.Countdown = -1L; // No countdown
|
Match->Status.Countdown = -1L; // No countdown
|
||||||
|
|
||||||
|
/***** Force showing results to false when match is not at the end *****/
|
||||||
|
Match->Status.ShowUsrResults = false; // Force results to be hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue