mirror of
https://github.com/acanas/swad-core.git
synced 2024-05-28 20:43:27 +02:00
Version 16.70
This commit is contained in:
parent
d3dbccfe53
commit
2881fb5b37
|
@ -1374,7 +1374,7 @@ a:hover /* Default ==> underlined */
|
||||||
.FRAME_TITLE_BIG
|
.FRAME_TITLE_BIG
|
||||||
{
|
{
|
||||||
color:#606060;
|
color:#606060;
|
||||||
font-size:20pt;
|
font-size:22pt;
|
||||||
}
|
}
|
||||||
.FRAME_TITLE_SMALL
|
.FRAME_TITLE_SMALL
|
||||||
{
|
{
|
||||||
|
|
|
@ -172,13 +172,14 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 16.69.1 (2016-11-24)"
|
#define Log_PLATFORM_VERSION "SWAD 16.70 (2016-11-24)"
|
||||||
#define CSS_FILE "swad16.69.css"
|
#define CSS_FILE "swad16.69.css"
|
||||||
#define JS_FILE "swad16.46.1.js"
|
#define JS_FILE "swad16.46.1.js"
|
||||||
|
|
||||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
// 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
|
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1
|
||||||
/*
|
/*
|
||||||
|
Version 16.70: Nov 24, 2016 Changes in permissions to view test results. (207545 lines)
|
||||||
Version 16.69.1: Nov 24, 2016 Contextual help on messages. (207484 lines)
|
Version 16.69.1: Nov 24, 2016 Contextual help on messages. (207484 lines)
|
||||||
Version 16.69: Nov 23, 2016 Changes in layout of frame title. (207473 lines)
|
Version 16.69: Nov 23, 2016 Changes in layout of frame title. (207473 lines)
|
||||||
Version 16.68.10: Nov 23, 2016 Changes in layout of messages received / sent. (207459 lines)
|
Version 16.68.10: Nov 23, 2016 Changes in layout of messages received / sent. (207459 lines)
|
||||||
|
|
338
swad_test.c
338
swad_test.c
|
@ -7161,9 +7161,9 @@ static void Tst_ShowTestResults (struct UsrData *UsrDat)
|
||||||
double TotalScoreOfAllTests = 0.0;
|
double TotalScoreOfAllTests = 0.0;
|
||||||
unsigned NumTestResultsVisibleByTchs = 0;
|
unsigned NumTestResultsVisibleByTchs = 0;
|
||||||
bool ItsMe = (UsrDat->UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod);
|
bool ItsMe = (UsrDat->UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||||
bool IAmATeacher = (Gbl.Usrs.Me.LoggedRole >= Rol_TEACHER);
|
|
||||||
bool ICanViewTest;
|
bool ICanViewTest;
|
||||||
bool ICanViewScore;
|
bool ICanViewScore;
|
||||||
|
bool ICanViewTotalScore;
|
||||||
time_t TimeUTC;
|
time_t TimeUTC;
|
||||||
char *ClassDat;
|
char *ClassDat;
|
||||||
|
|
||||||
|
@ -7203,9 +7203,31 @@ static void Tst_ShowTestResults (struct UsrData *UsrDat)
|
||||||
Gbl.Test.AllowTeachers = (row[1][0] == 'Y');
|
Gbl.Test.AllowTeachers = (row[1][0] == 'Y');
|
||||||
ClassDat = Gbl.Test.AllowTeachers ? "DAT" :
|
ClassDat = Gbl.Test.AllowTeachers ? "DAT" :
|
||||||
"DAT_LIGHT";
|
"DAT_LIGHT";
|
||||||
ICanViewTest = ItsMe || Gbl.Test.AllowTeachers;
|
|
||||||
ICanViewScore = ICanViewTest && (IAmATeacher ||
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
Gbl.Test.Config.FeedbackType != Tst_FEEDBACK_NOTHING);
|
{
|
||||||
|
case Rol_STUDENT:
|
||||||
|
ICanViewTest = ItsMe;
|
||||||
|
ICanViewScore = ItsMe &&
|
||||||
|
Gbl.Test.Config.FeedbackType != Tst_FEEDBACK_NOTHING;
|
||||||
|
break;
|
||||||
|
case Rol_TEACHER:
|
||||||
|
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)
|
if (NumTest)
|
||||||
fprintf (Gbl.F.Out,"<tr>");
|
fprintf (Gbl.F.Out,"<tr>");
|
||||||
|
@ -7222,33 +7244,24 @@ static void Tst_ShowTestResults (struct UsrData *UsrDat)
|
||||||
UniqueId,(long) TimeUTC,Txt_Today);
|
UniqueId,(long) TimeUTC,Txt_Today);
|
||||||
|
|
||||||
/* Get number of questions (row[3]) */
|
/* Get number of questions (row[3]) */
|
||||||
if (sscanf (row[3],"%u",&NumQstsInThisTest) == 1)
|
if (sscanf (row[3],"%u",&NumQstsInThisTest) != 1)
|
||||||
{
|
|
||||||
if (Gbl.Test.AllowTeachers)
|
|
||||||
NumTotalQsts += NumQstsInThisTest;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
NumQstsInThisTest = 0;
|
NumQstsInThisTest = 0;
|
||||||
|
if (Gbl.Test.AllowTeachers)
|
||||||
|
NumTotalQsts += NumQstsInThisTest;
|
||||||
|
|
||||||
/* Get number of questions not blank (row[4]) */
|
/* Get number of questions not blank (row[4]) */
|
||||||
if (sscanf (row[4],"%u",&NumQstsNotBlankInThisTest) == 1)
|
if (sscanf (row[4],"%u",&NumQstsNotBlankInThisTest) != 1)
|
||||||
{
|
|
||||||
if (Gbl.Test.AllowTeachers)
|
|
||||||
NumTotalQstsNotBlank += NumQstsNotBlankInThisTest;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
NumQstsNotBlankInThisTest = 0;
|
NumQstsNotBlankInThisTest = 0;
|
||||||
|
if (Gbl.Test.AllowTeachers)
|
||||||
|
NumTotalQstsNotBlank += NumQstsNotBlankInThisTest;
|
||||||
|
|
||||||
/* Get score (row[5]) */
|
/* Get score (row[5]) */
|
||||||
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[5],"%lf",&ScoreInThisTest) != 1)
|
||||||
{
|
|
||||||
if (Gbl.Test.AllowTeachers)
|
|
||||||
TotalScoreOfAllTests += ScoreInThisTest;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ScoreInThisTest = 0.0;
|
ScoreInThisTest = 0.0;
|
||||||
Str_SetDecimalPointToLocal (); // Return to local system
|
Str_SetDecimalPointToLocal (); // Return to local system
|
||||||
|
if (Gbl.Test.AllowTeachers)
|
||||||
|
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\">",
|
||||||
|
@ -7313,8 +7326,26 @@ static void Tst_ShowTestResults (struct UsrData *UsrDat)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Write totals for this user *****/
|
/***** Write totals for this user *****/
|
||||||
ICanViewScore = NumTestResultsVisibleByTchs && (IAmATeacher ||
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
Gbl.Test.Config.FeedbackType != Tst_FEEDBACK_NOTHING);
|
{
|
||||||
|
case Rol_STUDENT:
|
||||||
|
ICanViewTotalScore = ItsMe &&
|
||||||
|
Gbl.Test.Config.FeedbackType != Tst_FEEDBACK_NOTHING;
|
||||||
|
break;
|
||||||
|
case Rol_TEACHER:
|
||||||
|
case Rol_DEG_ADM:
|
||||||
|
case Rol_CTR_ADM:
|
||||||
|
case Rol_INS_ADM:
|
||||||
|
ICanViewTotalScore = ItsMe ||
|
||||||
|
NumTestResultsVisibleByTchs;
|
||||||
|
break;
|
||||||
|
case Rol_SYS_ADM:
|
||||||
|
ICanViewTotalScore = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ICanViewTotalScore = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"DAT_N_LINE_TOP RIGHT_MIDDLE COLOR%u\">"
|
"<td class=\"DAT_N_LINE_TOP RIGHT_MIDDLE COLOR%u\">"
|
||||||
|
@ -7340,14 +7371,14 @@ static void Tst_ShowTestResults (struct UsrData *UsrDat)
|
||||||
/* Write total score */
|
/* Write total score */
|
||||||
fprintf (Gbl.F.Out,"<td class=\"DAT_N_LINE_TOP RIGHT_MIDDLE COLOR%u\">",
|
fprintf (Gbl.F.Out,"<td class=\"DAT_N_LINE_TOP RIGHT_MIDDLE COLOR%u\">",
|
||||||
Gbl.RowEvenOdd);
|
Gbl.RowEvenOdd);
|
||||||
if (ICanViewScore)
|
if (ICanViewTotalScore)
|
||||||
fprintf (Gbl.F.Out,"%.2lf",TotalScoreOfAllTests);
|
fprintf (Gbl.F.Out,"%.2lf",TotalScoreOfAllTests);
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
|
||||||
/* Write average score per question */
|
/* Write average score per question */
|
||||||
fprintf (Gbl.F.Out,"<td class=\"DAT_N_LINE_TOP RIGHT_MIDDLE COLOR%u\">",
|
fprintf (Gbl.F.Out,"<td class=\"DAT_N_LINE_TOP RIGHT_MIDDLE COLOR%u\">",
|
||||||
Gbl.RowEvenOdd);
|
Gbl.RowEvenOdd);
|
||||||
if (ICanViewScore)
|
if (ICanViewTotalScore)
|
||||||
fprintf (Gbl.F.Out,"%.2lf",
|
fprintf (Gbl.F.Out,"%.2lf",
|
||||||
NumTotalQsts ? TotalScoreOfAllTests / (double) NumTotalQsts :
|
NumTotalQsts ? TotalScoreOfAllTests / (double) NumTotalQsts :
|
||||||
0.0);
|
0.0);
|
||||||
|
@ -7356,7 +7387,7 @@ static void Tst_ShowTestResults (struct UsrData *UsrDat)
|
||||||
/* Write score over Tst_SCORE_MAX */
|
/* Write score over Tst_SCORE_MAX */
|
||||||
fprintf (Gbl.F.Out,"<td class=\"DAT_N_LINE_TOP RIGHT_MIDDLE COLOR%u\">",
|
fprintf (Gbl.F.Out,"<td class=\"DAT_N_LINE_TOP RIGHT_MIDDLE COLOR%u\">",
|
||||||
Gbl.RowEvenOdd);
|
Gbl.RowEvenOdd);
|
||||||
if (ICanViewScore)
|
if (ICanViewTotalScore)
|
||||||
fprintf (Gbl.F.Out,"%.2lf",
|
fprintf (Gbl.F.Out,"%.2lf",
|
||||||
NumTotalQsts ? TotalScoreOfAllTests * Tst_SCORE_MAX /
|
NumTotalQsts ? TotalScoreOfAllTests * Tst_SCORE_MAX /
|
||||||
(double) NumTotalQsts :
|
(double) NumTotalQsts :
|
||||||
|
@ -7482,145 +7513,176 @@ void Tst_ShowOneTestResult (void)
|
||||||
double TotalScore;
|
double TotalScore;
|
||||||
bool ShowPhoto;
|
bool ShowPhoto;
|
||||||
char PhotoURL[PATH_MAX+1];
|
char PhotoURL[PATH_MAX+1];
|
||||||
|
bool ItsMe;
|
||||||
|
bool ICanViewTest;
|
||||||
bool ICanViewScore;
|
bool ICanViewScore;
|
||||||
|
|
||||||
/***** Get the code of the test *****/
|
/***** Get the code of the test *****/
|
||||||
if ((TstCod = Tst_GetParamTstCod ()) == -1L)
|
if ((TstCod = Tst_GetParamTstCod ()) == -1L)
|
||||||
Lay_ShowErrorAndExit ("Code of test is missing.");
|
Lay_ShowErrorAndExit ("Code of test is missing.");
|
||||||
|
|
||||||
/***** Get test result data and check if I can view this test result) *****/
|
/***** Get test result data *****/
|
||||||
Tst_GetTestResultDataByTstCod (TstCod,&TstTimeUTC,&Gbl.Test.NumQsts,&NumQstsNotBlank,&TotalScore);
|
Tst_GetTestResultDataByTstCod (TstCod,&TstTimeUTC,&Gbl.Test.NumQsts,&NumQstsNotBlank,&TotalScore);
|
||||||
Gbl.Test.Config.FeedbackType = Tst_FEEDBACK_FULL_FEEDBACK; // Initialize feedback to maximum
|
Gbl.Test.Config.FeedbackType = Tst_FEEDBACK_FULL_FEEDBACK; // Initialize feedback to maximum
|
||||||
ICanViewScore = true;
|
|
||||||
switch (Gbl.Action.Act)
|
/***** Check if I can view this test result *****/
|
||||||
|
ItsMe = (Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||||
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case ActSeeOneTstResMe:
|
case Rol_STUDENT:
|
||||||
if (Gbl.Usrs.Other.UsrDat.UsrCod != Gbl.Usrs.Me.UsrDat.UsrCod) // The test result is not mine
|
ICanViewTest = ItsMe;
|
||||||
Lay_ShowErrorAndExit ("You can not view this test result.");
|
if (ItsMe)
|
||||||
if (Gbl.Usrs.Me.LoggedRole < Rol_TEACHER)
|
|
||||||
{
|
{
|
||||||
// Students only can view score if feedback type allows it
|
Tst_GetConfigTstFromDB (); // To get feedback type
|
||||||
Tst_GetConfigTstFromDB (); // To get feedback type
|
ICanViewScore = Gbl.Test.Config.FeedbackType != Tst_FEEDBACK_NOTHING;
|
||||||
ICanViewScore = (Gbl.Test.Config.FeedbackType != Tst_FEEDBACK_NOTHING);
|
}
|
||||||
|
else
|
||||||
|
ICanViewScore = false;
|
||||||
|
break;
|
||||||
|
case Rol_TEACHER:
|
||||||
|
case Rol_DEG_ADM:
|
||||||
|
case Rol_CTR_ADM:
|
||||||
|
case Rol_INS_ADM:
|
||||||
|
switch (Gbl.Action.Act)
|
||||||
|
{
|
||||||
|
case ActSeeOneTstResMe:
|
||||||
|
ICanViewTest =
|
||||||
|
ICanViewScore = ItsMe;
|
||||||
|
break;
|
||||||
|
case ActSeeOneTstResOth:
|
||||||
|
ICanViewTest =
|
||||||
|
ICanViewScore = ItsMe ||
|
||||||
|
Gbl.Test.AllowTeachers;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ICanViewTest =
|
||||||
|
ICanViewScore = false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ActSeeOneTstResOth:
|
case Rol_SYS_ADM:
|
||||||
if (Gbl.Usrs.Other.UsrDat.UsrCod != Gbl.Usrs.Me.UsrDat.UsrCod && // The test is not mine
|
ICanViewTest =
|
||||||
!Gbl.Test.AllowTeachers) // I am not allowed to view this test result
|
ICanViewScore = true;
|
||||||
Lay_ShowErrorAndExit ("You can not view this test result.");
|
break;
|
||||||
|
default:
|
||||||
|
ICanViewTest =
|
||||||
|
ICanViewScore = false;
|
||||||
break;
|
break;
|
||||||
default: // Not applicable here
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Get questions and user's answers of the test result from database *****/
|
if (ICanViewTest) // I am allowed to view this test result
|
||||||
Tst_GetTestResultQuestionsFromDB (TstCod);
|
{
|
||||||
|
/***** Get questions and user's answers of the test result from database *****/
|
||||||
|
Tst_GetTestResultQuestionsFromDB (TstCod);
|
||||||
|
|
||||||
/***** Start frame *****/
|
/***** Start frame *****/
|
||||||
Lay_StartRoundFrame (NULL,Txt_Test_result,NULL,Hlp_ASSESSMENT_Tests);
|
Lay_StartRoundFrame (NULL,Txt_Test_result,NULL,Hlp_ASSESSMENT_Tests);
|
||||||
Lay_WriteHeaderClassPhoto (false,false,
|
Lay_WriteHeaderClassPhoto (false,false,
|
||||||
Gbl.CurrentIns.Ins.InsCod,
|
Gbl.CurrentIns.Ins.InsCod,
|
||||||
Gbl.CurrentDeg.Deg.DegCod,
|
Gbl.CurrentDeg.Deg.DegCod,
|
||||||
Gbl.CurrentCrs.Crs.CrsCod);
|
Gbl.CurrentCrs.Crs.CrsCod);
|
||||||
|
|
||||||
/***** Start table *****/
|
/***** Start table *****/
|
||||||
fprintf (Gbl.F.Out,"<table class=\"FRAME_TBL CELLS_PAD_10\">");
|
fprintf (Gbl.F.Out,"<table class=\"FRAME_TBL CELLS_PAD_10\">");
|
||||||
|
|
||||||
/***** Header row *****/
|
/***** Header row *****/
|
||||||
/* Get data of the user who made the test */
|
/* Get data of the user who made the test */
|
||||||
if (!Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat))
|
if (!Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat))
|
||||||
Lay_ShowErrorAndExit ("User does not exists.");
|
Lay_ShowErrorAndExit ("User does not exists.");
|
||||||
|
|
||||||
/* User */
|
/* User */
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"DAT_N RIGHT_TOP\">"
|
"<td class=\"DAT_N RIGHT_TOP\">"
|
||||||
"%s:"
|
"%s:"
|
||||||
"</td>"
|
"</td>"
|
||||||
"<td class=\"DAT LEFT_TOP\">",
|
"<td class=\"DAT LEFT_TOP\">",
|
||||||
Txt_ROLES_SINGUL_Abc[Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB][Gbl.Usrs.Other.UsrDat.Sex]);
|
Txt_ROLES_SINGUL_Abc[Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB][Gbl.Usrs.Other.UsrDat.Sex]);
|
||||||
ID_WriteUsrIDs (&Gbl.Usrs.Other.UsrDat);
|
ID_WriteUsrIDs (&Gbl.Usrs.Other.UsrDat);
|
||||||
fprintf (Gbl.F.Out," %s",
|
|
||||||
Gbl.Usrs.Other.UsrDat.Surname1);
|
|
||||||
if (Gbl.Usrs.Other.UsrDat.Surname2[0])
|
|
||||||
fprintf (Gbl.F.Out," %s",
|
fprintf (Gbl.F.Out," %s",
|
||||||
Gbl.Usrs.Other.UsrDat.Surname2);
|
Gbl.Usrs.Other.UsrDat.Surname1);
|
||||||
if (Gbl.Usrs.Other.UsrDat.FirstName[0])
|
if (Gbl.Usrs.Other.UsrDat.Surname2[0])
|
||||||
fprintf (Gbl.F.Out,", %s",
|
fprintf (Gbl.F.Out," %s",
|
||||||
Gbl.Usrs.Other.UsrDat.FirstName);
|
Gbl.Usrs.Other.UsrDat.Surname2);
|
||||||
fprintf (Gbl.F.Out,"<br />");
|
if (Gbl.Usrs.Other.UsrDat.FirstName[0])
|
||||||
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&Gbl.Usrs.Other.UsrDat,PhotoURL);
|
fprintf (Gbl.F.Out,", %s",
|
||||||
Pho_ShowUsrPhoto (&Gbl.Usrs.Other.UsrDat,ShowPhoto ? PhotoURL :
|
Gbl.Usrs.Other.UsrDat.FirstName);
|
||||||
NULL,
|
fprintf (Gbl.F.Out,"<br />");
|
||||||
"PHOTO45x60",Pho_ZOOM,false);
|
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&Gbl.Usrs.Other.UsrDat,PhotoURL);
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
Pho_ShowUsrPhoto (&Gbl.Usrs.Other.UsrDat,ShowPhoto ? PhotoURL :
|
||||||
"</tr>");
|
NULL,
|
||||||
|
"PHOTO45x60",Pho_ZOOM,false);
|
||||||
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
|
"</tr>");
|
||||||
|
|
||||||
/* Test date */
|
/* Test date */
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"DAT_N RIGHT_TOP\">"
|
"<td class=\"DAT_N RIGHT_TOP\">"
|
||||||
"%s:"
|
"%s:"
|
||||||
"</td>"
|
"</td>"
|
||||||
"<td id=\"test\" class=\"DAT LEFT_TOP\">"
|
"<td id=\"test\" class=\"DAT LEFT_TOP\">"
|
||||||
"<script type=\"text/javascript\">"
|
"<script type=\"text/javascript\">"
|
||||||
"writeLocalDateHMSFromUTC('test',%ld,' ','%s');"
|
"writeLocalDateHMSFromUTC('test',%ld,' ','%s');"
|
||||||
"</script>"
|
"</script>"
|
||||||
"</td>"
|
"</td>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Txt_Date,TstTimeUTC,Txt_Today);
|
Txt_Date,TstTimeUTC,Txt_Today);
|
||||||
|
|
||||||
/* Number of questions */
|
/* Number of questions */
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"DAT_N RIGHT_TOP\">"
|
"<td class=\"DAT_N RIGHT_TOP\">"
|
||||||
"%s:"
|
"%s:"
|
||||||
"</td>"
|
"</td>"
|
||||||
"<td class=\"DAT LEFT_TOP\">"
|
"<td class=\"DAT LEFT_TOP\">"
|
||||||
"%u (%u %s)"
|
"%u (%u %s)"
|
||||||
"</td>"
|
"</td>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Txt_Questions,
|
Txt_Questions,
|
||||||
Gbl.Test.NumQsts,NumQstsNotBlank,Txt_non_blank_QUESTIONS);
|
Gbl.Test.NumQsts,NumQstsNotBlank,Txt_non_blank_QUESTIONS);
|
||||||
|
|
||||||
/* Score */
|
/* Score */
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"DAT_N RIGHT_TOP\">"
|
"<td class=\"DAT_N RIGHT_TOP\">"
|
||||||
"%s:"
|
"%s:"
|
||||||
"</td>"
|
"</td>"
|
||||||
"<td class=\"DAT LEFT_TOP\">",
|
"<td class=\"DAT LEFT_TOP\">",
|
||||||
Txt_Score);
|
Txt_Score);
|
||||||
if (ICanViewScore)
|
if (ICanViewScore)
|
||||||
fprintf (Gbl.F.Out,"%.2lf (%.2lf",
|
fprintf (Gbl.F.Out,"%.2lf (%.2lf",
|
||||||
TotalScore,
|
TotalScore,
|
||||||
Gbl.Test.NumQsts ? TotalScore * Tst_SCORE_MAX / (double) Gbl.Test.NumQsts :
|
Gbl.Test.NumQsts ? TotalScore * Tst_SCORE_MAX / (double) Gbl.Test.NumQsts :
|
||||||
0.0);
|
0.0);
|
||||||
else
|
else
|
||||||
fprintf (Gbl.F.Out,"? (?"); // No feedback
|
fprintf (Gbl.F.Out,"? (?"); // No feedback
|
||||||
fprintf (Gbl.F.Out," %s %u)</td>"
|
fprintf (Gbl.F.Out," %s %u)</td>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Txt_out_of_PART_OF_A_SCORE,Tst_SCORE_MAX);
|
Txt_out_of_PART_OF_A_SCORE,Tst_SCORE_MAX);
|
||||||
|
|
||||||
/* Tags present in this test */
|
/* Tags present in this test */
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"DAT_N RIGHT_TOP\">"
|
"<td class=\"DAT_N RIGHT_TOP\">"
|
||||||
"%s:"
|
"%s:"
|
||||||
"</td>"
|
"</td>"
|
||||||
"<td class=\"DAT LEFT_TOP\">",
|
"<td class=\"DAT LEFT_TOP\">",
|
||||||
Txt_Tags);
|
Txt_Tags);
|
||||||
Tst_ShowTstTagsPresentInATestResult (TstCod);
|
Tst_ShowTstTagsPresentInATestResult (TstCod);
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"</tr>");
|
"</tr>");
|
||||||
|
|
||||||
/***** Write answers and solutions *****/
|
/***** Write answers and solutions *****/
|
||||||
Tst_ShowTestResult (TstTimeUTC);
|
Tst_ShowTestResult (TstTimeUTC);
|
||||||
|
|
||||||
/***** Write total mark of test *****/
|
/***** Write total mark of test *****/
|
||||||
if (ICanViewScore)
|
if (ICanViewScore)
|
||||||
Tst_ShowTstTotalMark (TotalScore);
|
Tst_ShowTstTotalMark (TotalScore);
|
||||||
|
|
||||||
/***** End table *****/
|
/***** End table *****/
|
||||||
fprintf (Gbl.F.Out,"</table>");
|
fprintf (Gbl.F.Out,"</table>");
|
||||||
|
|
||||||
/***** End frame *****/
|
/***** End frame *****/
|
||||||
Lay_EndRoundFrame ();
|
Lay_EndRoundFrame ();
|
||||||
|
}
|
||||||
|
else // I am not allowed to view this test result
|
||||||
|
Lay_ShowErrorAndExit ("You can not view this test result.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user