mirror of https://github.com/acanas/swad-core.git
Version19.8.2
This commit is contained in:
parent
138b24327c
commit
1f02939f6c
|
@ -468,10 +468,11 @@ 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.8.1 (2019-09-22)"
|
#define Log_PLATFORM_VERSION "SWAD 19.8.2 (2019-09-22)"
|
||||||
#define CSS_FILE "swad19.3.css"
|
#define CSS_FILE "swad19.3.css"
|
||||||
#define JS_FILE "swad18.130.2.js"
|
#define JS_FILE "swad18.130.2.js"
|
||||||
/*
|
/*
|
||||||
|
Version 19.8.2: Sep 22, 2019 View matches results. Not finished. (245429 lines)
|
||||||
Version 19.8.1: Sep 22, 2019 View matches results. Not finished. (245474 lines)
|
Version 19.8.1: Sep 22, 2019 View matches results. Not finished. (245474 lines)
|
||||||
Version 19.8: Sep 22, 2019 View matches results. Not finished.
|
Version 19.8: Sep 22, 2019 View matches results. Not finished.
|
||||||
Help links related to test and match results changed. (245412 lines)
|
Help links related to test and match results changed. (245412 lines)
|
||||||
|
|
20
swad_game.c
20
swad_game.c
|
@ -414,12 +414,12 @@ void Gam_ShowOneGame (long GamCod,
|
||||||
if (!ShowOnlyThisGame)
|
if (!ShowOnlyThisGame)
|
||||||
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
|
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
|
||||||
fprintf (Gbl.F.Out,"\">");
|
fprintf (Gbl.F.Out,"\">");
|
||||||
if (Game.TimeUTC[Gam_START_TIME])
|
if (Game.TimeUTC[Dat_START_TIME])
|
||||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
||||||
"writeLocalDateHMSFromUTC('gam_date_start_%u',%ld,"
|
"writeLocalDateHMSFromUTC('gam_date_start_%u',%ld,"
|
||||||
"%u,'<br />','%s',true,true,0x7);"
|
"%u,'<br />','%s',true,true,0x7);"
|
||||||
"</script>",
|
"</script>",
|
||||||
UniqueId,Game.TimeUTC[Gam_START_TIME],
|
UniqueId,Game.TimeUTC[Dat_START_TIME],
|
||||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
|
||||||
|
@ -431,12 +431,12 @@ void Gam_ShowOneGame (long GamCod,
|
||||||
if (!ShowOnlyThisGame)
|
if (!ShowOnlyThisGame)
|
||||||
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
|
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
|
||||||
fprintf (Gbl.F.Out,"\">");
|
fprintf (Gbl.F.Out,"\">");
|
||||||
if (Game.TimeUTC[Gam_END_TIME])
|
if (Game.TimeUTC[Dat_END_TIME])
|
||||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
||||||
"writeLocalDateHMSFromUTC('gam_date_end_%u',%ld,"
|
"writeLocalDateHMSFromUTC('gam_date_end_%u',%ld,"
|
||||||
"%u,'<br />','%s',false,true,0x7);"
|
"%u,'<br />','%s',false,true,0x7);"
|
||||||
"</script>",
|
"</script>",
|
||||||
UniqueId,Game.TimeUTC[Gam_END_TIME],
|
UniqueId,Game.TimeUTC[Dat_END_TIME],
|
||||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
|
||||||
|
@ -759,10 +759,10 @@ void Gam_GetDataOfGameByCod (struct Game *Game)
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get start date (row[0] holds the start UTC time) */
|
/* Get start date (row[0] holds the start UTC time) */
|
||||||
Game->TimeUTC[Gam_START_TIME] = Dat_GetUNIXTimeFromStr (row[0]);
|
Game->TimeUTC[Dat_START_TIME] = Dat_GetUNIXTimeFromStr (row[0]);
|
||||||
|
|
||||||
/* Get end date (row[1] holds the end UTC time) */
|
/* Get end date (row[1] holds the end UTC time) */
|
||||||
Game->TimeUTC[Gam_END_TIME ] = Dat_GetUNIXTimeFromStr (row[1]);
|
Game->TimeUTC[Dat_END_TIME ] = Dat_GetUNIXTimeFromStr (row[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free structure that stores the query result */
|
/* Free structure that stores the query result */
|
||||||
|
@ -770,8 +770,8 @@ void Gam_GetDataOfGameByCod (struct Game *Game)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Game->TimeUTC[Gam_START_TIME] =
|
Game->TimeUTC[Dat_START_TIME] =
|
||||||
Game->TimeUTC[Gam_END_TIME ] = (time_t) 0;
|
Game->TimeUTC[Dat_END_TIME ] = (time_t) 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1031,8 +1031,8 @@ void Gam_RequestCreatOrEditGame (void)
|
||||||
/* Initialize to empty game */
|
/* Initialize to empty game */
|
||||||
Game.GamCod = -1L;
|
Game.GamCod = -1L;
|
||||||
Game.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
|
Game.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
|
||||||
Game.TimeUTC[Gam_START_TIME] = (time_t) 0;
|
Game.TimeUTC[Dat_START_TIME] = (time_t) 0;
|
||||||
Game.TimeUTC[Gam_END_TIME ] = (time_t) 0;
|
Game.TimeUTC[Dat_END_TIME ] = (time_t) 0;
|
||||||
Game.Title[0] = '\0';
|
Game.Title[0] = '\0';
|
||||||
Game.NumQsts = 0;
|
Game.NumQsts = 0;
|
||||||
Game.Status.Visible = true;
|
Game.Status.Visible = true;
|
||||||
|
|
10
swad_game.h
10
swad_game.h
|
@ -27,6 +27,7 @@
|
||||||
/********************************* Headers ***********************************/
|
/********************************* Headers ***********************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include "swad_date.h"
|
||||||
#include "swad_scope.h"
|
#include "swad_scope.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -36,19 +37,12 @@
|
||||||
#define Gam_MAX_CHARS_TITLE (128 - 1) // 127
|
#define Gam_MAX_CHARS_TITLE (128 - 1) // 127
|
||||||
#define Gam_MAX_BYTES_TITLE ((Gam_MAX_CHARS_TITLE + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
|
#define Gam_MAX_BYTES_TITLE ((Gam_MAX_CHARS_TITLE + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
|
||||||
|
|
||||||
#define Gam_NUM_DATES 2
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
Gam_START_TIME = 0,
|
|
||||||
Gam_END_TIME = 1,
|
|
||||||
} Gam_StartOrEndTime_t;
|
|
||||||
|
|
||||||
struct Game
|
struct Game
|
||||||
{
|
{
|
||||||
long GamCod; // Game code
|
long GamCod; // Game code
|
||||||
long UsrCod; // Author code
|
long UsrCod; // Author code
|
||||||
char Title[Gam_MAX_BYTES_TITLE + 1];
|
char Title[Gam_MAX_BYTES_TITLE + 1];
|
||||||
time_t TimeUTC[Gam_NUM_DATES];
|
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
||||||
unsigned NumQsts; // Number of questions in the game
|
unsigned NumQsts; // Number of questions in the game
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
|
319
swad_match.c
319
swad_match.c
|
@ -84,7 +84,7 @@ struct Match
|
||||||
long MchCod;
|
long MchCod;
|
||||||
long GamCod;
|
long GamCod;
|
||||||
long UsrCod;
|
long UsrCod;
|
||||||
time_t TimeUTC[2];
|
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
||||||
char Title[Gam_MAX_BYTES_TITLE + 1];
|
char Title[Gam_MAX_BYTES_TITLE + 1];
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
@ -200,8 +200,7 @@ static void Mch_DrawBarNumUsrs (unsigned NumAnswerersAns,unsigned NumAnswerersQs
|
||||||
static void Mch_ShowHeaderMchResults (void);
|
static void Mch_ShowHeaderMchResults (void);
|
||||||
static void Mch_ShowMchResults (struct UsrData *UsrDat);
|
static void Mch_ShowMchResults (struct UsrData *UsrDat);
|
||||||
static void Mch_GetMatchResultDataByMchCod (long MchResCod,
|
static void Mch_GetMatchResultDataByMchCod (long MchResCod,
|
||||||
time_t *StartTimeUTC,
|
time_t TimeUTC[Dat_NUM_START_END_TIME],
|
||||||
time_t *EndTimeUTC,
|
|
||||||
unsigned *NumQsts,
|
unsigned *NumQsts,
|
||||||
unsigned *NumQstsNotBlank,
|
unsigned *NumQstsNotBlank,
|
||||||
double *Score);
|
double *Score);
|
||||||
|
@ -299,6 +298,7 @@ static void Mch_GetDataOfMatchByCod (struct Match *Match)
|
||||||
{
|
{
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
unsigned long NumRows;
|
unsigned long NumRows;
|
||||||
|
Dat_StartEndTime_t StartEndTime;
|
||||||
|
|
||||||
/***** Get data of match from database *****/
|
/***** Get data of match from database *****/
|
||||||
NumRows = (unsigned) DB_QuerySELECT (&mysql_res,"can not get matches",
|
NumRows = (unsigned) DB_QuerySELECT (&mysql_res,"can not get matches",
|
||||||
|
@ -328,8 +328,10 @@ static void Mch_GetDataOfMatchByCod (struct Match *Match)
|
||||||
Match->MchCod = -1L;
|
Match->MchCod = -1L;
|
||||||
Match->GamCod = -1L;
|
Match->GamCod = -1L;
|
||||||
Match->UsrCod = -1L;
|
Match->UsrCod = -1L;
|
||||||
Match->TimeUTC[Gam_START_TIME] =
|
for (StartEndTime = (Dat_StartEndTime_t) 0;
|
||||||
Match->TimeUTC[Gam_END_TIME ] = (time_t) 0;
|
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
|
||||||
|
StartEndTime++)
|
||||||
|
Match->TimeUTC[StartEndTime] = (time_t) 0;
|
||||||
Match->Title[0] = '\0';
|
Match->Title[0] = '\0';
|
||||||
Match->Status.QstInd = 0;
|
Match->Status.QstInd = 0;
|
||||||
Match->Status.QstCod = -1L;
|
Match->Status.QstCod = -1L;
|
||||||
|
@ -376,6 +378,7 @@ static void Mch_ListOneOrMoreMatches (struct Game *Game,
|
||||||
unsigned NumMatch;
|
unsigned NumMatch;
|
||||||
unsigned UniqueId;
|
unsigned UniqueId;
|
||||||
struct Match Match;
|
struct Match Match;
|
||||||
|
Dat_StartEndTime_t StartEndTime;
|
||||||
|
|
||||||
/***** Write the heading *****/
|
/***** Write the heading *****/
|
||||||
Tbl_StartTableWideMargin (2);
|
Tbl_StartTableWideMargin (2);
|
||||||
|
@ -443,36 +446,26 @@ static void Mch_ListOneOrMoreMatches (struct Game *Game,
|
||||||
Usr_WriteAuthor1Line (Match.UsrCod,false);
|
Usr_WriteAuthor1Line (Match.UsrCod,false);
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
|
||||||
/***** Start date/time *****/
|
/***** Start/end date/time *****/
|
||||||
fprintf (Gbl.F.Out,"<td id=\"mch_date_start_%u\""
|
for (StartEndTime = (Dat_StartEndTime_t) 0;
|
||||||
" class=\"%s LEFT_TOP COLOR%u\">",
|
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
|
||||||
UniqueId,
|
StartEndTime++)
|
||||||
Match.Status.QstInd >= Mch_AFTER_LAST_QUESTION ? "DATE_RED" :
|
{
|
||||||
"DATE_GREEN",
|
fprintf (Gbl.F.Out,"<td id=\"mch_time_%u_%u\""
|
||||||
Gbl.RowEvenOdd);
|
" class=\"%s LEFT_TOP COLOR%u\">",
|
||||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
(unsigned) StartEndTime,UniqueId,
|
||||||
"writeLocalDateHMSFromUTC('mch_date_start_%u',%ld,"
|
Match.Status.QstInd >= Mch_AFTER_LAST_QUESTION ? "DATE_RED" :
|
||||||
"%u,'<br />','%s',true,true,0x7);"
|
"DATE_GREEN",
|
||||||
"</script>"
|
Gbl.RowEvenOdd);
|
||||||
"</td>",
|
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
||||||
UniqueId,Match.TimeUTC[Gam_START_TIME],
|
"writeLocalDateHMSFromUTC('mch_time_%u_%u',"
|
||||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
"%ld,%u,'<br />','%s',true,true,0x7);"
|
||||||
|
"</script>"
|
||||||
/***** End date/time *****/
|
"</td>",
|
||||||
fprintf (Gbl.F.Out,"<td id=\"mch_date_end_%u\""
|
(unsigned) StartEndTime,UniqueId,
|
||||||
" class=\"%s LEFT_TOP COLOR%u\">",
|
Match.TimeUTC[StartEndTime],
|
||||||
UniqueId,
|
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||||
Match.Status.QstInd >= Mch_AFTER_LAST_QUESTION ? "DATE_RED" :
|
}
|
||||||
"DATE_GREEN",
|
|
||||||
Gbl.RowEvenOdd);
|
|
||||||
fprintf (Gbl.F.Out,"\">"
|
|
||||||
"<script type=\"text/javascript\">"
|
|
||||||
"writeLocalDateHMSFromUTC('mch_date_end_%u',%ld,"
|
|
||||||
"%u,'<br />','%s',false,true,0x7);"
|
|
||||||
"</script>"
|
|
||||||
"</td>",
|
|
||||||
UniqueId,Match.TimeUTC[Gam_END_TIME],
|
|
||||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
|
||||||
|
|
||||||
/***** Title and groups *****/
|
/***** Title and groups *****/
|
||||||
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP COLOR%u\">",Gbl.RowEvenOdd);
|
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP COLOR%u\">",Gbl.RowEvenOdd);
|
||||||
|
@ -611,6 +604,7 @@ static void Mch_GetMatchDataFromRow (MYSQL_RES *mysql_res,
|
||||||
struct Match *Match)
|
struct Match *Match)
|
||||||
{
|
{
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
|
Dat_StartEndTime_t StartEndTime;
|
||||||
|
|
||||||
/***** Get match data *****/
|
/***** Get match data *****/
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
@ -634,11 +628,11 @@ static void Mch_GetMatchDataFromRow (MYSQL_RES *mysql_res,
|
||||||
/* Get match teacher (row[2]) */
|
/* Get match teacher (row[2]) */
|
||||||
Match->UsrCod = Str_ConvertStrCodToLongCod (row[2]);
|
Match->UsrCod = Str_ConvertStrCodToLongCod (row[2]);
|
||||||
|
|
||||||
/* Get start date (row[3] holds the start UTC time) */
|
/* Get start/end times (row[3], row[4] hold start/end UTC times) */
|
||||||
Match->TimeUTC[Gam_START_TIME] = Dat_GetUNIXTimeFromStr (row[3]);
|
for (StartEndTime = (Dat_StartEndTime_t) 0;
|
||||||
|
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
|
||||||
/* Get end date (row[4] holds the end UTC time) */
|
StartEndTime++)
|
||||||
Match->TimeUTC[Gam_END_TIME ] = Dat_GetUNIXTimeFromStr (row[4]);
|
Match->TimeUTC[StartEndTime] = Dat_GetUNIXTimeFromStr (row[3 + StartEndTime]);
|
||||||
|
|
||||||
/* Get the title of the game (row[5]) */
|
/* Get the title of the game (row[5]) */
|
||||||
if (row[5])
|
if (row[5])
|
||||||
|
@ -2741,181 +2735,142 @@ static void Mch_ShowMchResults (struct UsrData *UsrDat)
|
||||||
extern const char *Txt_View_test;
|
extern const char *Txt_View_test;
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
unsigned NumExams;
|
unsigned NumResults;
|
||||||
unsigned NumTest;
|
unsigned NumResult;
|
||||||
static unsigned UniqueId = 0;
|
static unsigned UniqueId = 0;
|
||||||
long TstCod;
|
long MchResCod;
|
||||||
unsigned NumQstsInThisTest;
|
long MchCod;
|
||||||
unsigned NumQstsNotBlankInThisTest;
|
Dat_StartEndTime_t StartEndTime;
|
||||||
|
unsigned NumQstsInThisResult;
|
||||||
|
unsigned NumQstsNotBlankInThisResult;
|
||||||
unsigned NumTotalQsts = 0;
|
unsigned NumTotalQsts = 0;
|
||||||
unsigned NumTotalQstsNotBlank = 0;
|
unsigned NumTotalQstsNotBlank = 0;
|
||||||
double ScoreInThisTest;
|
double ScoreInThisResult;
|
||||||
double TotalScoreOfAllTests = 0.0;
|
double TotalScoreOfAllResults = 0.0;
|
||||||
unsigned NumExamsVisibleByTchs = 0;
|
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
||||||
bool ItsMe = Usr_ItsMe (UsrDat->UsrCod);
|
|
||||||
bool ICanViewTest;
|
|
||||||
bool ICanViewScore;
|
|
||||||
time_t TimeUTC;
|
|
||||||
char *ClassDat;
|
char *ClassDat;
|
||||||
|
|
||||||
/***** Make database query *****/
|
/***** Make database query *****/
|
||||||
NumExams =
|
NumResults =
|
||||||
(unsigned) DB_QuerySELECT (&mysql_res,"can not get test exams of a user",
|
(unsigned) DB_QuerySELECT (&mysql_res,"can not get matches results of a user",
|
||||||
"SELECT TstCod," // row[0]
|
"SELECT mch_results.MchResCod," // row[0]
|
||||||
"AllowTeachers," // row[1]
|
"mch_results.MchCod," // row[1]
|
||||||
"UNIX_TIMESTAMP(TstTime)," // row[2]
|
"UNIX_TIMESTAMP(mch_matches.StartTime)," // row[2]
|
||||||
"NumQsts," // row[3]
|
"UNIX_TIMESTAMP(mch_matches.EndTime)," // row[3]
|
||||||
"NumQstsNotBlank," // row[4]
|
"mch_results.NumQsts," // row[4]
|
||||||
"Score" // row[5]
|
"mch_results.NumQstsNotBlank," // row[5]
|
||||||
" FROM tst_exams"
|
"mch_results.Score" // row[6]
|
||||||
" WHERE CrsCod=%ld AND UsrCod=%ld"
|
" FROM mch_results,mch_matches,gam_games"
|
||||||
" AND TstTime>=FROM_UNIXTIME(%ld)"
|
" WHERE mch_results.UsrCod=%ld"
|
||||||
" AND TstTime<=FROM_UNIXTIME(%ld)"
|
" AND mch_results.MchCod=mch_matches.MchCod"
|
||||||
" ORDER BY TstCod",
|
" AND mch_matches.GamCod=gam_games.GamCod"
|
||||||
Gbl.Hierarchy.Crs.CrsCod,
|
" AND gam_games.CrsCod=%ld" // Extra check
|
||||||
|
" AND mch_matches.EndTime>=FROM_UNIXTIME(%ld)"
|
||||||
|
" AND mch_matches.StartTime<=FROM_UNIXTIME(%ld)"
|
||||||
|
" ORDER BY MchResCod",
|
||||||
UsrDat->UsrCod,
|
UsrDat->UsrCod,
|
||||||
(long) Gbl.DateRange.TimeUTC[0],
|
Gbl.Hierarchy.Crs.CrsCod,
|
||||||
(long) Gbl.DateRange.TimeUTC[1]);
|
(long) Gbl.DateRange.TimeUTC[Dat_START_TIME],
|
||||||
|
(long) Gbl.DateRange.TimeUTC[Dat_END_TIME]);
|
||||||
|
|
||||||
/***** Show user's data *****/
|
/***** Show user's data *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>");
|
fprintf (Gbl.F.Out,"<tr>");
|
||||||
// Tst_ShowDataUsr (UsrDat,NumExams); // TODO: Change to matches results
|
Usr_ShowTableCellWithUsrData (UsrDat,NumResults);
|
||||||
|
|
||||||
/***** Get and print test results *****/
|
/***** Get and print test results *****/
|
||||||
if (NumExams)
|
if (NumResults)
|
||||||
{
|
{
|
||||||
for (NumTest = 0;
|
for (NumResult = 0;
|
||||||
NumTest < NumExams;
|
NumResult < NumResults;
|
||||||
NumTest++)
|
NumResult++)
|
||||||
{
|
{
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get test code (row[0]) */
|
/* Get match result code (row[0]) */
|
||||||
if ((TstCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
if ((MchResCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of test result.");
|
Lay_ShowErrorAndExit ("Wrong code of result.");
|
||||||
|
|
||||||
/* Get if teachers are allowed to see this test result (row[1]) */
|
/* Get match code (row[1]) */
|
||||||
Gbl.Test.AllowTeachers = (row[1][0] == 'Y');
|
if ((MchCod = Str_ConvertStrCodToLongCod (row[1])) < 0)
|
||||||
ClassDat = Gbl.Test.AllowTeachers ? "DAT" :
|
Lay_ShowErrorAndExit ("Wrong code of match.");
|
||||||
"DAT_LIGHT";
|
|
||||||
|
|
||||||
switch (Gbl.Usrs.Me.Role.Logged)
|
if (NumResult)
|
||||||
{
|
|
||||||
case Rol_STD:
|
|
||||||
ICanViewTest = ItsMe;
|
|
||||||
ICanViewScore = ItsMe &&
|
|
||||||
Gbl.Test.Config.Feedback != Tst_FEEDBACK_NOTHING;
|
|
||||||
break;
|
|
||||||
case Rol_NET:
|
|
||||||
case Rol_TCH:
|
|
||||||
case Rol_DEG_ADM:
|
|
||||||
case Rol_CTR_ADM:
|
|
||||||
case Rol_INS_ADM:
|
|
||||||
ICanViewTest =
|
|
||||||
ICanViewScore = ItsMe ||
|
|
||||||
Gbl.Test.AllowTeachers;
|
|
||||||
break;
|
|
||||||
case Rol_SYS_ADM:
|
|
||||||
ICanViewTest =
|
|
||||||
ICanViewScore = true;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ICanViewTest =
|
|
||||||
ICanViewScore = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (NumTest)
|
|
||||||
fprintf (Gbl.F.Out,"<tr>");
|
fprintf (Gbl.F.Out,"<tr>");
|
||||||
|
|
||||||
/* Write date and time (row[2] holds UTC date-time) */
|
/* Write start/end times (row[2], row[3] hold UTC start/end times) */
|
||||||
TimeUTC = Dat_GetUNIXTimeFromStr (row[2]);
|
for (StartEndTime = (Dat_StartEndTime_t) 0;
|
||||||
UniqueId++;
|
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
|
||||||
fprintf (Gbl.F.Out,"<td id =\"tst_date_%u\" class=\"%s RIGHT_TOP COLOR%u\">"
|
StartEndTime++)
|
||||||
"<script type=\"text/javascript\">"
|
{
|
||||||
"writeLocalDateHMSFromUTC('tst_date_%u',%ld,"
|
TimeUTC[0] = Dat_GetUNIXTimeFromStr (row[2 + StartEndTime]);
|
||||||
"%u,', ','%s',true,false,0x7);"
|
UniqueId++;
|
||||||
"</script>"
|
fprintf (Gbl.F.Out,"<td id =\"mch_time_%u_%u\""
|
||||||
"</td>",
|
" class=\"%s RIGHT_TOP COLOR%u\">"
|
||||||
UniqueId,ClassDat,Gbl.RowEvenOdd,
|
"<script type=\"text/javascript\">"
|
||||||
UniqueId,(long) TimeUTC,
|
"writeLocalDateHMSFromUTC('mch_time_%u_%u',"
|
||||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
"%ld,%u,', ','%s',true,false,0x7);"
|
||||||
|
"</script>"
|
||||||
|
"</td>",
|
||||||
|
(unsigned) StartEndTime,UniqueId,
|
||||||
|
ClassDat,Gbl.RowEvenOdd,
|
||||||
|
(unsigned) StartEndTime,UniqueId,
|
||||||
|
(long) TimeUTC[StartEndTime],
|
||||||
|
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||||
|
}
|
||||||
|
|
||||||
/* Get number of questions (row[3]) */
|
/* Get number of questions (row[4]) */
|
||||||
if (sscanf (row[3],"%u",&NumQstsInThisTest) != 1)
|
if (sscanf (row[4],"%u",&NumQstsInThisResult) != 1)
|
||||||
NumQstsInThisTest = 0;
|
NumQstsInThisResult = 0;
|
||||||
if (Gbl.Test.AllowTeachers)
|
if (Gbl.Test.AllowTeachers)
|
||||||
NumTotalQsts += NumQstsInThisTest;
|
NumTotalQsts += NumQstsInThisResult;
|
||||||
|
|
||||||
/* Get number of questions not blank (row[4]) */
|
/* Get number of questions not blank (row[5]) */
|
||||||
if (sscanf (row[4],"%u",&NumQstsNotBlankInThisTest) != 1)
|
if (sscanf (row[5],"%u",&NumQstsNotBlankInThisResult) != 1)
|
||||||
NumQstsNotBlankInThisTest = 0;
|
NumQstsNotBlankInThisResult = 0;
|
||||||
if (Gbl.Test.AllowTeachers)
|
if (Gbl.Test.AllowTeachers)
|
||||||
NumTotalQstsNotBlank += NumQstsNotBlankInThisTest;
|
NumTotalQstsNotBlank += NumQstsNotBlankInThisResult;
|
||||||
|
|
||||||
/* Get score (row[5]) */
|
/* Get score (row[6]) */
|
||||||
Str_SetDecimalPointToUS (); // To get the decimal point as a dot
|
Str_SetDecimalPointToUS (); // To get the decimal point as a dot
|
||||||
if (sscanf (row[5],"%lf",&ScoreInThisTest) != 1)
|
if (sscanf (row[6],"%lf",&ScoreInThisResult) != 1)
|
||||||
ScoreInThisTest = 0.0;
|
ScoreInThisResult = 0.0;
|
||||||
Str_SetDecimalPointToLocal (); // Return to local system
|
Str_SetDecimalPointToLocal (); // Return to local system
|
||||||
if (Gbl.Test.AllowTeachers)
|
TotalScoreOfAllResults += ScoreInThisResult;
|
||||||
TotalScoreOfAllTests += ScoreInThisTest;
|
|
||||||
|
|
||||||
/* Write number of questions */
|
/* Write number of questions */
|
||||||
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP COLOR%u\">",
|
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP COLOR%u\">%u</td>",
|
||||||
ClassDat,Gbl.RowEvenOdd);
|
ClassDat,Gbl.RowEvenOdd,NumQstsInThisResult);
|
||||||
if (ICanViewTest)
|
|
||||||
fprintf (Gbl.F.Out,"%u",NumQstsInThisTest);
|
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
|
||||||
|
|
||||||
/* Write number of questions not blank */
|
/* Write number of questions not blank */
|
||||||
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP COLOR%u\">",
|
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP COLOR%u\">%u</td>",
|
||||||
ClassDat,Gbl.RowEvenOdd);
|
ClassDat,Gbl.RowEvenOdd,NumQstsNotBlankInThisResult);
|
||||||
if (ICanViewTest)
|
|
||||||
fprintf (Gbl.F.Out,"%u",NumQstsNotBlankInThisTest);
|
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
|
||||||
|
|
||||||
/* Write score */
|
/* Write score */
|
||||||
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP COLOR%u\">",
|
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP COLOR%u\">%.2lf</td>",
|
||||||
ClassDat,Gbl.RowEvenOdd);
|
ClassDat,Gbl.RowEvenOdd,ScoreInThisResult);
|
||||||
if (ICanViewScore)
|
|
||||||
fprintf (Gbl.F.Out,"%.2lf",ScoreInThisTest);
|
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
|
||||||
|
|
||||||
/* Write average score per question */
|
/* Write average score per question */
|
||||||
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP COLOR%u\">",
|
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP COLOR%u\">%.2lf</td>",
|
||||||
ClassDat,Gbl.RowEvenOdd);
|
ClassDat,Gbl.RowEvenOdd,
|
||||||
if (ICanViewScore)
|
NumQstsInThisResult ? ScoreInThisResult / (double) NumQstsInThisResult :
|
||||||
fprintf (Gbl.F.Out,"%.2lf",
|
0.0);
|
||||||
NumQstsInThisTest ? ScoreInThisTest / (double) NumQstsInThisTest :
|
|
||||||
0.0);
|
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
|
||||||
|
|
||||||
/* Write score over Tst_SCORE_MAX */
|
/* Write score over Tst_SCORE_MAX */
|
||||||
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP COLOR%u\">",
|
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP COLOR%u\">%.2lf</td>",
|
||||||
ClassDat,Gbl.RowEvenOdd);
|
ClassDat,Gbl.RowEvenOdd,
|
||||||
if (ICanViewScore)
|
NumQstsInThisResult ? ScoreInThisResult * Tst_SCORE_MAX / (double) NumQstsInThisResult :
|
||||||
fprintf (Gbl.F.Out,"%.2lf",
|
0.0);
|
||||||
NumQstsInThisTest ? ScoreInThisTest * Tst_SCORE_MAX / (double) NumQstsInThisTest :
|
|
||||||
0.0);
|
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
|
||||||
|
|
||||||
/* Link to show this result */
|
/* Link to show this result */
|
||||||
fprintf (Gbl.F.Out,"<td class=\"RIGHT_TOP COLOR%u\">",
|
fprintf (Gbl.F.Out,"<td class=\"RIGHT_TOP COLOR%u\">",
|
||||||
Gbl.RowEvenOdd);
|
Gbl.RowEvenOdd);
|
||||||
if (ICanViewTest)
|
Frm_StartForm (Gbl.Action.Act == ActSeeMyMchRes ? ActSeeOneMchResMe :
|
||||||
{
|
ActSeeOneMchResOth);
|
||||||
Frm_StartForm (Gbl.Action.Act == ActSeeMyTstRes ? ActSeeOneTstResMe :
|
// Tst_PutParamTstCod (TstCod); // TODO: Change to matches results
|
||||||
ActSeeOneTstResOth);
|
Ico_PutIconLink ("tasks.svg",Txt_View_test);
|
||||||
// Tst_PutParamTstCod (TstCod); // TODO: Change to matches results
|
Frm_EndForm ();
|
||||||
Ico_PutIconLink ("tasks.svg",Txt_View_test);
|
|
||||||
Frm_EndForm ();
|
|
||||||
}
|
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"</tr>");
|
"</tr>");
|
||||||
|
|
||||||
if (Gbl.Test.AllowTeachers)
|
|
||||||
NumExamsVisibleByTchs++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Write totals for this user *****/
|
/***** Write totals for this user *****/
|
||||||
|
@ -2962,8 +2917,7 @@ void Mch_ShowOneMchResult (void)
|
||||||
extern const char *Txt_Score;
|
extern const char *Txt_Score;
|
||||||
extern const char *Txt_out_of_PART_OF_A_SCORE;
|
extern const char *Txt_out_of_PART_OF_A_SCORE;
|
||||||
long MchResCod;
|
long MchResCod;
|
||||||
time_t StartTimeUTC = 0; // Match result UTC date-time, initialized to avoid warning
|
time_t TimeUTC[Dat_NUM_START_END_TIME]; // Match result UTC date-time
|
||||||
time_t EndTimeUTC = 0; // Match result UTC date-time, initialized to avoid warning
|
|
||||||
unsigned NumQstsNotBlank;
|
unsigned NumQstsNotBlank;
|
||||||
double TotalScore;
|
double TotalScore;
|
||||||
bool ShowPhoto;
|
bool ShowPhoto;
|
||||||
|
@ -2978,8 +2932,7 @@ void Mch_ShowOneMchResult (void)
|
||||||
|
|
||||||
/***** Get test result data *****/
|
/***** Get test result data *****/
|
||||||
Mch_GetMatchResultDataByMchCod (MchResCod,
|
Mch_GetMatchResultDataByMchCod (MchResCod,
|
||||||
&StartTimeUTC,
|
TimeUTC,
|
||||||
&EndTimeUTC,
|
|
||||||
&Gbl.Test.NumQsts,
|
&Gbl.Test.NumQsts,
|
||||||
&NumQstsNotBlank,
|
&NumQstsNotBlank,
|
||||||
&TotalScore);
|
&TotalScore);
|
||||||
|
@ -3096,8 +3049,8 @@ void Mch_ShowOneMchResult (void)
|
||||||
"</td>"
|
"</td>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Txt_Date,
|
Txt_Date,
|
||||||
StartTimeUTC,(unsigned) Gbl.Prefs.DateFormat,Txt_Today,
|
TimeUTC[Dat_START_TIME],(unsigned) Gbl.Prefs.DateFormat,Txt_Today,
|
||||||
EndTimeUTC ,(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
TimeUTC[Dat_END_TIME],(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||||
|
|
||||||
/* Number of questions */
|
/* Number of questions */
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
|
@ -3151,14 +3104,14 @@ void Mch_ShowOneMchResult (void)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Mch_GetMatchResultDataByMchCod (long MchResCod,
|
static void Mch_GetMatchResultDataByMchCod (long MchResCod,
|
||||||
time_t *StartTimeUTC,
|
time_t TimeUTC[Dat_NUM_START_END_TIME],
|
||||||
time_t *EndTimeUTC,
|
|
||||||
unsigned *NumQsts,
|
unsigned *NumQsts,
|
||||||
unsigned *NumQstsNotBlank,
|
unsigned *NumQstsNotBlank,
|
||||||
double *Score)
|
double *Score)
|
||||||
{
|
{
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
|
Dat_StartEndTime_t StartEndTime;
|
||||||
|
|
||||||
/***** Make database query *****/
|
/***** Make database query *****/
|
||||||
if (DB_QuerySELECT (&mysql_res,"can not get data"
|
if (DB_QuerySELECT (&mysql_res,"can not get data"
|
||||||
|
@ -3185,8 +3138,10 @@ static void Mch_GetMatchResultDataByMchCod (long MchResCod,
|
||||||
Gbl.Test.AllowTeachers = (row[1][0] == 'Y');
|
Gbl.Test.AllowTeachers = (row[1][0] == 'Y');
|
||||||
|
|
||||||
/* Get start time (row[1] and row[2] hold UTC date-times) */
|
/* Get start time (row[1] and row[2] hold UTC date-times) */
|
||||||
*StartTimeUTC = Dat_GetUNIXTimeFromStr (row[1]);
|
for (StartEndTime = (Dat_StartEndTime_t) 0;
|
||||||
*EndTimeUTC = Dat_GetUNIXTimeFromStr (row[2]);
|
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
|
||||||
|
StartEndTime++)
|
||||||
|
TimeUTC[StartEndTime] = Dat_GetUNIXTimeFromStr (row[1 + StartEndTime]);
|
||||||
|
|
||||||
/* Get number of questions (row[3]) */
|
/* Get number of questions (row[3]) */
|
||||||
if (sscanf (row[3],"%u",NumQsts) != 1)
|
if (sscanf (row[3],"%u",NumQsts) != 1)
|
||||||
|
|
64
swad_test.c
64
swad_test.c
|
@ -290,7 +290,6 @@ static void Tst_StoreScoreOfTestResultInDB (long TstCod,
|
||||||
unsigned NumQstsNotBlank,double Score);
|
unsigned NumQstsNotBlank,double Score);
|
||||||
static void Tst_ShowHeaderTestResults (void);
|
static void Tst_ShowHeaderTestResults (void);
|
||||||
static void Tst_ShowTstResults (struct UsrData *UsrDat);
|
static void Tst_ShowTstResults (struct UsrData *UsrDat);
|
||||||
static void Tst_ShowDataUsr (struct UsrData *UsrDat,unsigned NumExams);
|
|
||||||
static void Tst_PutParamTstCod (long TstCod);
|
static void Tst_PutParamTstCod (long TstCod);
|
||||||
static long Tst_GetParamTstCod (void);
|
static long Tst_GetParamTstCod (void);
|
||||||
static void Tst_ShowTestResultsSummaryRow (bool ItsMe,
|
static void Tst_ShowTestResultsSummaryRow (bool ItsMe,
|
||||||
|
@ -7654,7 +7653,7 @@ static void Tst_ShowTstResults (struct UsrData *UsrDat)
|
||||||
|
|
||||||
/***** Show user's data *****/
|
/***** Show user's data *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>");
|
fprintf (Gbl.F.Out,"<tr>");
|
||||||
Tst_ShowDataUsr (UsrDat,NumExams);
|
Usr_ShowTableCellWithUsrData (UsrDat,NumExams);
|
||||||
|
|
||||||
/***** Get and print test results *****/
|
/***** Get and print test results *****/
|
||||||
if (NumExams)
|
if (NumExams)
|
||||||
|
@ -7821,67 +7820,6 @@ static void Tst_ShowTstResults (struct UsrData *UsrDat)
|
||||||
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
|
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/******************** Show a row with the data of a user *********************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void Tst_ShowDataUsr (struct UsrData *UsrDat,unsigned NumExams)
|
|
||||||
{
|
|
||||||
bool ShowPhoto;
|
|
||||||
char PhotoURL[PATH_MAX + 1];
|
|
||||||
Act_Action_t NextAction;
|
|
||||||
|
|
||||||
/***** Show user's photo and name *****/
|
|
||||||
fprintf (Gbl.F.Out,"<td ");
|
|
||||||
if (NumExams)
|
|
||||||
fprintf (Gbl.F.Out,"rowspan=\"%u\"",NumExams + 1);
|
|
||||||
fprintf (Gbl.F.Out," class=\"LEFT_TOP COLOR%u\">",
|
|
||||||
Gbl.RowEvenOdd);
|
|
||||||
ShowPhoto = Pho_ShowingUsrPhotoIsAllowed (UsrDat,PhotoURL);
|
|
||||||
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
|
|
||||||
NULL,
|
|
||||||
"PHOTO45x60",Pho_ZOOM,false);
|
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
|
||||||
|
|
||||||
/***** Start form to go to user's record card *****/
|
|
||||||
fprintf (Gbl.F.Out,"<td ");
|
|
||||||
if (NumExams)
|
|
||||||
fprintf (Gbl.F.Out,"rowspan=\"%u\"",NumExams + 1);
|
|
||||||
fprintf (Gbl.F.Out," class=\"LEFT_TOP COLOR%u\">",
|
|
||||||
Gbl.RowEvenOdd);
|
|
||||||
switch (UsrDat->Roles.InCurrentCrs.Role)
|
|
||||||
{
|
|
||||||
case Rol_STD:
|
|
||||||
NextAction = ActSeeRecOneStd;
|
|
||||||
break;
|
|
||||||
case Rol_NET:
|
|
||||||
case Rol_TCH:
|
|
||||||
NextAction = ActSeeRecOneTch;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
NextAction = ActUnk;
|
|
||||||
Lay_ShowErrorAndExit ("Wrong role.");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
Frm_StartForm (NextAction);
|
|
||||||
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
|
|
||||||
Frm_LinkFormSubmit (UsrDat->FullName,"AUTHOR_TXT",NULL);
|
|
||||||
|
|
||||||
/***** Show user's ID *****/
|
|
||||||
ID_WriteUsrIDs (UsrDat,NULL);
|
|
||||||
|
|
||||||
/***** Show user's name *****/
|
|
||||||
fprintf (Gbl.F.Out,"<br />%s",UsrDat->Surname1);
|
|
||||||
if (UsrDat->Surname2[0])
|
|
||||||
fprintf (Gbl.F.Out," %s",UsrDat->Surname2);
|
|
||||||
if (UsrDat->FirstName[0])
|
|
||||||
fprintf (Gbl.F.Out,",<br />%s",UsrDat->FirstName);
|
|
||||||
|
|
||||||
/***** End form *****/
|
|
||||||
Frm_EndForm ();
|
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******************** Write parameter with code of test **********************/
|
/******************** Write parameter with code of test **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
62
swad_user.c
62
swad_user.c
|
@ -9728,3 +9728,65 @@ void Usr_WriteAuthor1Line (long UsrCod,bool Hidden)
|
||||||
/***** Free memory used for user's data *****/
|
/***** Free memory used for user's data *****/
|
||||||
Usr_UsrDataDestructor (&UsrDat);
|
Usr_UsrDataDestructor (&UsrDat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*************** Show a table cell with the data of a user *******************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Usr_ShowTableCellWithUsrData (struct UsrData *UsrDat,unsigned NumRows)
|
||||||
|
{
|
||||||
|
bool ShowPhoto;
|
||||||
|
char PhotoURL[PATH_MAX + 1];
|
||||||
|
Act_Action_t NextAction;
|
||||||
|
|
||||||
|
/***** Show user's photo and name *****/
|
||||||
|
fprintf (Gbl.F.Out,"<td ");
|
||||||
|
if (NumRows)
|
||||||
|
fprintf (Gbl.F.Out,"rowspan=\"%u\"",NumRows + 1);
|
||||||
|
fprintf (Gbl.F.Out," class=\"LEFT_TOP COLOR%u\">",
|
||||||
|
Gbl.RowEvenOdd);
|
||||||
|
ShowPhoto = Pho_ShowingUsrPhotoIsAllowed (UsrDat,PhotoURL);
|
||||||
|
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
|
||||||
|
NULL,
|
||||||
|
"PHOTO45x60",Pho_ZOOM,false);
|
||||||
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
|
||||||
|
/***** Start form to go to user's record card *****/
|
||||||
|
fprintf (Gbl.F.Out,"<td ");
|
||||||
|
if (NumRows)
|
||||||
|
fprintf (Gbl.F.Out,"rowspan=\"%u\"",NumRows + 1);
|
||||||
|
fprintf (Gbl.F.Out," class=\"LEFT_TOP COLOR%u\">",
|
||||||
|
Gbl.RowEvenOdd);
|
||||||
|
switch (UsrDat->Roles.InCurrentCrs.Role)
|
||||||
|
{
|
||||||
|
case Rol_STD:
|
||||||
|
NextAction = ActSeeRecOneStd;
|
||||||
|
break;
|
||||||
|
case Rol_NET:
|
||||||
|
case Rol_TCH:
|
||||||
|
NextAction = ActSeeRecOneTch;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
NextAction = ActUnk;
|
||||||
|
Lay_ShowErrorAndExit ("Wrong role.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Frm_StartForm (NextAction);
|
||||||
|
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
|
||||||
|
Frm_LinkFormSubmit (UsrDat->FullName,"AUTHOR_TXT",NULL);
|
||||||
|
|
||||||
|
/***** Show user's ID *****/
|
||||||
|
ID_WriteUsrIDs (UsrDat,NULL);
|
||||||
|
|
||||||
|
/***** Show user's name *****/
|
||||||
|
fprintf (Gbl.F.Out,"<br />%s",UsrDat->Surname1);
|
||||||
|
if (UsrDat->Surname2[0])
|
||||||
|
fprintf (Gbl.F.Out," %s",UsrDat->Surname2);
|
||||||
|
if (UsrDat->FirstName[0])
|
||||||
|
fprintf (Gbl.F.Out,",<br />%s",UsrDat->FirstName);
|
||||||
|
|
||||||
|
/***** End form *****/
|
||||||
|
Frm_EndForm ();
|
||||||
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -480,4 +480,6 @@ void Usr_PrintUsrQRCode (void);
|
||||||
|
|
||||||
void Usr_WriteAuthor1Line (long UsrCod,bool Hidden);
|
void Usr_WriteAuthor1Line (long UsrCod,bool Hidden);
|
||||||
|
|
||||||
|
void Usr_ShowTableCellWithUsrData (struct UsrData *UsrDat,unsigned NumRows);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue