Version19.192

This commit is contained in:
acanas 2020-04-22 03:15:04 +02:00
parent 78b655d1b9
commit c3ce51b798
38 changed files with 2122 additions and 1122 deletions

View File

@ -35,7 +35,8 @@ OBJS = swad_account.o swad_action.o swad_agenda.o swad_alert.o \
swad_course_config.o swad_cryptography.o \
swad_database.o swad_date.o swad_degree.o swad_degree_config.o \
swad_degree_type.o swad_department.o swad_duplicate.o \
swad_enrolment.o swad_exam_announcement.o \
swad_enrolment.o swad_exam.o swad_exam_announcement.o \
swad_exam_event.o swad_exam_result.o \
swad_figure.o swad_file.o swad_file_browser.o swad_file_extension.o \
swad_file_MIME.o swad_firewall.o swad_follow.o swad_form.o \
swad_forum.o \

View File

@ -0,0 +1 @@
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="file-contract" class="svg-inline--fa fa-file-contract fa-w-12" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="#404040" d="M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zM64 72c0-4.42 3.58-8 8-8h80c4.42 0 8 3.58 8 8v16c0 4.42-3.58 8-8 8H72c-4.42 0-8-3.58-8-8V72zm0 64c0-4.42 3.58-8 8-8h80c4.42 0 8 3.58 8 8v16c0 4.42-3.58 8-8 8H72c-4.42 0-8-3.58-8-8v-16zm192.81 248H304c8.84 0 16 7.16 16 16s-7.16 16-16 16h-47.19c-16.45 0-31.27-9.14-38.64-23.86-2.95-5.92-8.09-6.52-10.17-6.52s-7.22.59-10.02 6.19l-7.67 15.34a15.986 15.986 0 0 1-14.31 8.84c-.38 0-.75-.02-1.14-.05-6.45-.45-12-4.75-14.03-10.89L144 354.59l-10.61 31.88c-5.89 17.66-22.38 29.53-41 29.53H80c-8.84 0-16-7.16-16-16s7.16-16 16-16h12.39c4.83 0 9.11-3.08 10.64-7.66l18.19-54.64c3.3-9.81 12.44-16.41 22.78-16.41s19.48 6.59 22.77 16.41l13.88 41.64c19.77-16.19 54.05-9.7 66 14.16 2.02 4.06 5.96 6.5 10.16 6.5zM377 105L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128v-6.1c0-6.3-2.5-12.4-7-16.9z"></path></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1 @@
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="file-invoice" class="svg-inline--fa fa-file-invoice fa-w-12" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="#404040" d="M288 256H96v64h192v-64zm89-151L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128v-6.1c0-6.3-2.5-12.4-7-16.9zm-153 31V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zM64 72c0-4.42 3.58-8 8-8h80c4.42 0 8 3.58 8 8v16c0 4.42-3.58 8-8 8H72c-4.42 0-8-3.58-8-8V72zm0 64c0-4.42 3.58-8 8-8h80c4.42 0 8 3.58 8 8v16c0 4.42-3.58 8-8 8H72c-4.42 0-8-3.58-8-8v-16zm256 304c0 4.42-3.58 8-8 8h-80c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h80c4.42 0 8 3.58 8 8v16zm0-200v96c0 8.84-7.16 16-16 16H80c-8.84 0-16-7.16-16-16v-96c0-8.84 7.16-16 16-16h224c8.84 0 16 7.16 16 16z"></path></svg>

After

Width:  |  Height:  |  Size: 838 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -3960,7 +3960,7 @@ int swad__sendNotice (struct soap *soap,
/****************** Return test configuration in a course ********************/
/*****************************************************************************/
#define TstExa_MAX_BYTES_FEEDBACK_TYPE 32
#define TstRes_MAX_BYTES_FEEDBACK_TYPE 32
int swad__getTestConfig (struct soap *soap,
char *wsKey,int courseCode, // input
@ -4015,7 +4015,7 @@ int swad__getTestConfig (struct soap *soap,
getTestConfigOut->visibility = TstVis_MIN_VISIBILITY;
/* TODO: Remove these lines in 2021 */
getTestConfigOut->feedback = (char *) soap_malloc (soap,TstExa_MAX_BYTES_FEEDBACK_TYPE + 1);
getTestConfigOut->feedback = (char *) soap_malloc (soap,TstRes_MAX_BYTES_FEEDBACK_TYPE + 1);
getTestConfigOut->feedback[0] = '\0';
/***** Get test configuration *****/
@ -4033,23 +4033,23 @@ int swad__getTestConfig (struct soap *soap,
if (!TstVis_IsVisibleTotalScore (TstCfg_GetConfigVisibility ()))
Str_Copy (getTestConfigOut->feedback,
"nothing",
TstExa_MAX_BYTES_FEEDBACK_TYPE);
TstRes_MAX_BYTES_FEEDBACK_TYPE);
else if (!TstVis_IsVisibleEachQstScore (TstCfg_GetConfigVisibility ()))
Str_Copy (getTestConfigOut->feedback,
"totalResult",
TstExa_MAX_BYTES_FEEDBACK_TYPE);
TstRes_MAX_BYTES_FEEDBACK_TYPE);
else if (!TstVis_IsVisibleCorrectAns (TstCfg_GetConfigVisibility ()))
Str_Copy (getTestConfigOut->feedback,
"eachResult",
TstExa_MAX_BYTES_FEEDBACK_TYPE);
TstRes_MAX_BYTES_FEEDBACK_TYPE);
else if (!TstVis_IsVisibleFeedbackTxt (TstCfg_GetConfigVisibility ()))
Str_Copy (getTestConfigOut->feedback,
"eachGoodBad",
TstExa_MAX_BYTES_FEEDBACK_TYPE);
TstRes_MAX_BYTES_FEEDBACK_TYPE);
else
Str_Copy (getTestConfigOut->feedback,
"fullFeedback",
TstExa_MAX_BYTES_FEEDBACK_TYPE);
TstRes_MAX_BYTES_FEEDBACK_TYPE);
/***** Get number of tests *****/
if (TstCfg_GetConfigPluggable () == TstCfg_PLUGGABLE_YES &&

View File

@ -1081,7 +1081,7 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
UsrDat->FullName);
/***** Remove test results made by user in all courses *****/
TstExa_RemoveExamsMadeByUsrInAllCrss (UsrDat->UsrCod);
TstRes_RemoveExamsMadeByUsrInAllCrss (UsrDat->UsrCod);
/***** Remove user's notifications *****/
Ntf_RemoveUsrNtfs (UsrDat->UsrCod);

View File

@ -46,7 +46,10 @@
#include "swad_degree_type.h"
#include "swad_department.h"
#include "swad_duplicate.h"
#include "swad_exam.h"
#include "swad_exam_announcement.h"
#include "swad_exam_event.h"
#include "swad_exam_result.h"
#include "swad_enrolment.h"
#include "swad_figure.h"
#include "swad_follow.h"
@ -541,11 +544,12 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
// Actions in menu:
[ActSeeAss ] = { 15, 0,TabAss,ActSeeAss ,0x3F8,0x3C7, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Inf_ShowInfo ,"info" },
[ActSeeAsg ] = { 801, 1,TabAss,ActSeeAsg ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Asg_SeeAssignments ,"edit" },
[ActSeePrj ] = {1674, 2,TabAss,ActSeePrj ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prj_SeeProjects ,"file-alt" },
[ActSeePrj ] = {1674, 2,TabAss,ActSeePrj ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prj_SeeProjects ,"file-invoice" },
[ActReqTst ] = { 103, 3,TabAss,ActReqTst ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_RequestTest ,"check" },
[ActSeeAllExa ] = {1848, 4,TabAss,ActSeeAllExa ,0x200,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_SeeAllExams ,"file-contract" },
[ActSeeAllGam ] = {1649, 4,TabAss,ActSeeAllGam ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Gam_SeeAllGames ,"gamepad" },
[ActSeeAllSvy ] = { 966, 5,TabAss,ActSeeAllSvy ,0x3F8,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Svy_SeeAllSurveys ,"poll" },
[ActSeeAllExaAnn ] = { 85, 6,TabAss,ActSeeAllExaAnn ,0x3F8,0x3C7, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaAnn_ListExamAnnouncementsSee ,"bullhorn" },
[ActSeeAllExaAnn ] = { 85, 6,TabAss,ActSeeAllExaAnn ,0x3F8,0x3C7, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaAnn_ListExamAnnouncementsSee,"bullhorn" },
// Actions not in menu:
[ActEdiAss ] = { 69,-1,TabUnk,ActSeeAss ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Inf_FormsToSelSendInfo ,NULL},
@ -664,12 +668,62 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
[ActRenTag ] = { 143,-1,TabUnk,ActReqTst ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_RenameTag ,NULL},
[ActRcvCfgTst ] = { 454,-1,TabUnk,ActReqTst ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TstCfg_ReceiveConfigTst ,NULL},
[ActReqSeeMyTstRes ] = {1083,-1,TabUnk,ActReqTst ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,TstExa_SelDatesToSeeMyExams ,NULL},
[ActSeeMyTstRes ] = {1084,-1,TabUnk,ActReqTst ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TstExa_ShowMyExams ,NULL},
[ActSeeOneTstResMe ] = {1085,-1,TabUnk,ActReqTst ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TstExa_ShowOneExam ,NULL},
[ActReqSeeUsrTstRes ] = {1080,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,TstExa_SelUsrsToViewUsrsExams ,NULL},
[ActSeeUsrTstRes ] = {1081,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TstExa_GetUsrsAndShowExams ,NULL},
[ActSeeOneTstResOth ] = {1082,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TstExa_ShowOneExam ,NULL},
[ActReqSeeMyTstRes ] = {1083,-1,TabUnk,ActReqTst ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,TstRes_SelDatesToSeeMyExams ,NULL},
[ActSeeMyTstRes ] = {1084,-1,TabUnk,ActReqTst ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TstRes_ShowMyExams ,NULL},
[ActSeeOneTstResMe ] = {1085,-1,TabUnk,ActReqTst ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TstRes_ShowOneExam ,NULL},
[ActReqSeeUsrTstRes ] = {1080,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,TstRes_SelUsrsToViewUsrsExams ,NULL},
[ActSeeUsrTstRes ] = {1081,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TstRes_GetUsrsAndShowExams ,NULL},
[ActSeeOneTstResOth ] = {1082,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TstRes_ShowOneExam ,NULL},
[ActSeeExa ] = {1849,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_SeeOneExam ,NULL},
[ActReqRemExaEvt ] = {1850,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaEvt_RequestRemoveEvent ,NULL},
[ActRemExaEvt ] = {1851,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaEvt_RemoveEvent ,NULL},
[ActReqNewExaEvt ] = {1852,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_RequestNewEvent ,NULL},
[ActNewExaEvt ] = {1853,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,ExaEvt_CreateNewEventTch ,ExaEvt_ResumeEvent ,NULL},
[ActResExaEvt ] = {1854,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,ExaEvt_GetEventBeingPlayed ,ExaEvt_ResumeEvent ,NULL},
[ActBckExaEvt ] = {1855,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,ExaEvt_GetEventBeingPlayed ,ExaEvt_BackEvent ,NULL},
[ActPlyPauExaEvt ] = {1856,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,ExaEvt_GetEventBeingPlayed ,ExaEvt_PlayPauseEvent ,NULL},
[ActFwdExaEvt ] = {1857,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,ExaEvt_GetEventBeingPlayed ,ExaEvt_ForwardEvent ,NULL},
[ActChgNumColExaEvt ] = {1858,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,ExaEvt_GetEventBeingPlayed ,ExaEvt_ChangeNumColsEvt ,NULL},
[ActChgVisResExaEvtQst] = {1859,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,ExaEvt_GetEventBeingPlayed ,ExaEvt_ToggleVisibilResultsEvtQst,NULL},
[ActExaEvtCntDwn ] = {1860,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_AJAX_RFRESH,ExaEvt_GetEventBeingPlayed ,ExaEvt_StartCountdown ,NULL},
[ActRefExaEvtTch ] = {1861,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_AJAX_RFRESH,ExaEvt_GetEventBeingPlayed ,ExaEvt_RefreshEventTch ,NULL},
[ActJoiExaEvt ] = {1862,-1,TabUnk,ActSeeAllExa ,0x008, 0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,ExaEvt_GetEventBeingPlayed ,ExaEvt_JoinEventAsStd ,NULL},
[ActSeeExaEvtAnsQstStd] = {1863,-1,TabUnk,ActSeeAllExa ,0x008, 0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,ExaEvt_GetEventBeingPlayed ,ExaEvt_JoinEventAsStd ,NULL},
[ActRemExaEvtAnsQstStd] = {1864,-1,TabUnk,ActSeeAllExa ,0x008, 0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,ExaEvt_GetEventBeingPlayed ,ExaEvt_RemoveMyQuestionAnswer ,NULL},
[ActAnsExaEvtQstStd ] = {1865,-1,TabUnk,ActSeeAllExa ,0x008, 0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,ExaEvt_GetEventBeingPlayed ,ExaEvt_ReceiveQuestionAnswer ,NULL},
[ActRefExaEvtStd ] = {1866,-1,TabUnk,ActSeeAllExa ,0x008, 0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_AJAX_RFRESH,ExaEvt_GetEventBeingPlayed ,ExaEvt_RefreshEventStd ,NULL},
[ActSeeMyExaEvtResCrs] = {1867,-1,TabUnk,ActSeeAllExa ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaRes_ShowMyExaResultsInCrs ,NULL},
[ActSeeMyExaEvtResExa] = {1868,-1,TabUnk,ActSeeAllExa ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaRes_ShowMyExaResultsInExa ,NULL},
[ActSeeMyExaEvtResEvt] = {1869,-1,TabUnk,ActSeeAllExa ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaRes_ShowMyExaResultsInEvt ,NULL},
[ActSeeOneExaEvtResMe] = {1870,-1,TabUnk,ActSeeAllExa ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaRes_ShowOneExaResult ,NULL},
[ActReqSeeAllExaEvtRes] = {1871,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaRes_SelUsrsToViewExaResults ,NULL},
[ActSeeAllExaEvtResCrs] = {1872,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaRes_ShowAllExaResultsInCrs ,NULL},
[ActSeeAllExaEvtResExa] = {1873,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaRes_ShowAllExaResultsInExa ,NULL},
[ActSeeAllExaEvtResEvt] = {1874,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaRes_ShowAllExaResultsInEvt ,NULL},
[ActSeeOneExaEvtResOth] = {1875,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaRes_ShowOneExaResult ,NULL},
[ActChgVisResExaEvtUsr] = {1876,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaEvt_ToggleVisibilResultsEvtUsr ,NULL},
[ActFrmNewExa ] = {1877,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_RequestCreatOrEditExam ,NULL},
[ActEdiOneExa ] = {1878,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_RequestCreatOrEditExam ,NULL},
[ActNewExa ] = {1879,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_RecFormExam ,NULL},
[ActChgExa ] = {1880,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_RecFormExam ,NULL},
[ActReqRemExa ] = {1881,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_AskRemExam ,NULL},
[ActRemExa ] = {1882,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_RemoveExam ,NULL},
[ActHidExa ] = {1883,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_HideExam ,NULL},
[ActShoExa ] = {1884,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_UnhideExam ,NULL},
[ActAddOneExaQst ] = {1885,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,Exa_RequestNewQuestion ,NULL},
[ActExaLstTstQst ] = {1886,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_ListTstQuestionsToSelect ,NULL},
[ActAddTstQstToExa ] = {1887,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_AddTstQuestionsToExam ,NULL},
[ActReqRemExaQst ] = {1888,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_RequestRemoveQst ,NULL},
[ActRemExaQst ] = {1889,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_RemoveQst ,NULL},
[ActUp_ExaQst ] = {1890,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_MoveUpQst ,NULL},
[ActDwnExaQst ] = {1891,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_MoveDownQst ,NULL},
[ActSeeGam ] = {1650,-1,TabUnk,ActSeeAllGam ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Gam_SeeOneGame ,NULL},
@ -3596,6 +3650,50 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un
ActChgRooBld, // #1845
ActChgRooFlo, // #1846
ActChgRooTyp, // #1847
ActSeeAllExa, // #1848
ActSeeExa, // #1849
ActReqRemExaEvt, // #1850
ActRemExaEvt, // #1851
ActReqNewExaEvt, // #1852
ActNewExaEvt, // #1853
ActResExaEvt, // #1854
ActBckExaEvt, // #1855
ActPlyPauExaEvt, // #1856
ActFwdExaEvt, // #1857
ActChgNumColExaEvt, // #1858
ActChgVisResExaEvtQst, // #1859
ActExaEvtCntDwn, // #1860
ActRefExaEvtTch, // #1861
ActJoiExaEvt, // #1862
ActSeeExaEvtAnsQstStd, // #1863
ActRemExaEvtAnsQstStd, // #1864
ActAnsExaEvtQstStd, // #1865
ActRefExaEvtStd, // #1866
ActSeeMyExaEvtResCrs, // #1867
ActSeeMyExaEvtResExa, // #1868
ActSeeMyExaEvtResEvt, // #1869
ActSeeOneExaEvtResMe, // #1870
ActReqSeeAllExaEvtRes, // #1871
ActSeeAllExaEvtResCrs, // #1872
ActSeeAllExaEvtResExa, // #1873
ActSeeAllExaEvtResEvt, // #1874
ActSeeOneExaEvtResOth, // #1875
ActChgVisResExaEvtUsr, // #1876
ActFrmNewExa, // #1877
ActEdiOneExa, // #1878
ActNewExa, // #1879
ActChgExa, // #1880
ActReqRemExa, // #1881
ActRemExa, // #1882
ActHidExa, // #1883
ActShoExa, // #1884
ActAddOneExaQst, // #1885
ActExaLstTstQst, // #1886
ActAddTstQstToExa, // #1887
ActReqRemExaQst, // #1888
ActRemExaQst, // #1889
ActUp_ExaQst, // #1890
ActDwnExaQst, // #1891
};
/*****************************************************************************/

View File

@ -64,7 +64,7 @@ typedef enum
typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
#define Act_MAX_ACTION_COD 1847
#define Act_MAX_ACTION_COD 1891
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 13
@ -516,207 +516,256 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to
#define ActSeeAsg (ActChgCrsTT1stDay + 2)
#define ActSeePrj (ActChgCrsTT1stDay + 3)
#define ActReqTst (ActChgCrsTT1stDay + 4)
#define ActSeeAllGam (ActChgCrsTT1stDay + 5)
#define ActSeeAllSvy (ActChgCrsTT1stDay + 6)
#define ActSeeAllExaAnn (ActChgCrsTT1stDay + 7)
#define ActSeeAllExa (ActChgCrsTT1stDay + 5)
#define ActSeeAllGam (ActChgCrsTT1stDay + 6)
#define ActSeeAllSvy (ActChgCrsTT1stDay + 7)
#define ActSeeAllExaAnn (ActChgCrsTT1stDay + 8)
// Secondary actions
#define ActEdiAss (ActChgCrsTT1stDay + 8)
#define ActChgFrcReaAss (ActChgCrsTT1stDay + 9)
#define ActChgHavReaAss (ActChgCrsTT1stDay + 10)
#define ActSelInfSrcAss (ActChgCrsTT1stDay + 11)
#define ActRcvURLAss (ActChgCrsTT1stDay + 12)
#define ActRcvPagAss (ActChgCrsTT1stDay + 13)
#define ActEditorAss (ActChgCrsTT1stDay + 14)
#define ActPlaTxtEdiAss (ActChgCrsTT1stDay + 15)
#define ActRchTxtEdiAss (ActChgCrsTT1stDay + 16)
#define ActRcvPlaTxtAss (ActChgCrsTT1stDay + 17)
#define ActRcvRchTxtAss (ActChgCrsTT1stDay + 18)
#define ActEdiAss (ActChgCrsTT1stDay + 9)
#define ActChgFrcReaAss (ActChgCrsTT1stDay + 10)
#define ActChgHavReaAss (ActChgCrsTT1stDay + 11)
#define ActSelInfSrcAss (ActChgCrsTT1stDay + 12)
#define ActRcvURLAss (ActChgCrsTT1stDay + 13)
#define ActRcvPagAss (ActChgCrsTT1stDay + 14)
#define ActEditorAss (ActChgCrsTT1stDay + 15)
#define ActPlaTxtEdiAss (ActChgCrsTT1stDay + 16)
#define ActRchTxtEdiAss (ActChgCrsTT1stDay + 17)
#define ActRcvPlaTxtAss (ActChgCrsTT1stDay + 18)
#define ActRcvRchTxtAss (ActChgCrsTT1stDay + 19)
#define ActFrmNewAsg (ActChgCrsTT1stDay + 19)
#define ActEdiOneAsg (ActChgCrsTT1stDay + 20)
#define ActPrnOneAsg (ActChgCrsTT1stDay + 21)
#define ActNewAsg (ActChgCrsTT1stDay + 22)
#define ActChgAsg (ActChgCrsTT1stDay + 23)
#define ActReqRemAsg (ActChgCrsTT1stDay + 24)
#define ActRemAsg (ActChgCrsTT1stDay + 25)
#define ActHidAsg (ActChgCrsTT1stDay + 26)
#define ActShoAsg (ActChgCrsTT1stDay + 27)
#define ActFrmNewAsg (ActChgCrsTT1stDay + 20)
#define ActEdiOneAsg (ActChgCrsTT1stDay + 21)
#define ActPrnOneAsg (ActChgCrsTT1stDay + 22)
#define ActNewAsg (ActChgCrsTT1stDay + 23)
#define ActChgAsg (ActChgCrsTT1stDay + 24)
#define ActReqRemAsg (ActChgCrsTT1stDay + 25)
#define ActRemAsg (ActChgCrsTT1stDay + 26)
#define ActHidAsg (ActChgCrsTT1stDay + 27)
#define ActShoAsg (ActChgCrsTT1stDay + 28)
#define ActReqUsrPrj (ActChgCrsTT1stDay + 28)
#define ActSeeTblAllPrj (ActChgCrsTT1stDay + 29)
#define ActCfgPrj (ActChgCrsTT1stDay + 30)
#define ActRcvCfgPrj (ActChgCrsTT1stDay + 31)
#define ActReqLckAllPrj (ActChgCrsTT1stDay + 32)
#define ActReqUnlAllPrj (ActChgCrsTT1stDay + 33)
#define ActLckAllPrj (ActChgCrsTT1stDay + 34)
#define ActUnlAllPrj (ActChgCrsTT1stDay + 35)
#define ActFrmNewPrj (ActChgCrsTT1stDay + 36)
#define ActEdiOnePrj (ActChgCrsTT1stDay + 37)
#define ActPrnOnePrj (ActChgCrsTT1stDay + 38)
#define ActNewPrj (ActChgCrsTT1stDay + 39)
#define ActChgPrj (ActChgCrsTT1stDay + 40)
#define ActReqRemPrj (ActChgCrsTT1stDay + 41)
#define ActRemPrj (ActChgCrsTT1stDay + 42)
#define ActHidPrj (ActChgCrsTT1stDay + 43)
#define ActShoPrj (ActChgCrsTT1stDay + 44)
#define ActLckPrj (ActChgCrsTT1stDay + 45)
#define ActUnlPrj (ActChgCrsTT1stDay + 46)
#define ActReqAddStdPrj (ActChgCrsTT1stDay + 47)
#define ActReqAddTutPrj (ActChgCrsTT1stDay + 48)
#define ActReqAddEvlPrj (ActChgCrsTT1stDay + 49)
#define ActAddStdPrj (ActChgCrsTT1stDay + 50)
#define ActAddTutPrj (ActChgCrsTT1stDay + 51)
#define ActAddEvlPrj (ActChgCrsTT1stDay + 52)
#define ActReqRemStdPrj (ActChgCrsTT1stDay + 53)
#define ActReqRemTutPrj (ActChgCrsTT1stDay + 54)
#define ActReqRemEvlPrj (ActChgCrsTT1stDay + 55)
#define ActRemStdPrj (ActChgCrsTT1stDay + 56)
#define ActRemTutPrj (ActChgCrsTT1stDay + 57)
#define ActRemEvlPrj (ActChgCrsTT1stDay + 58)
#define ActReqUsrPrj (ActChgCrsTT1stDay + 29)
#define ActSeeTblAllPrj (ActChgCrsTT1stDay + 30)
#define ActCfgPrj (ActChgCrsTT1stDay + 31)
#define ActRcvCfgPrj (ActChgCrsTT1stDay + 32)
#define ActReqLckAllPrj (ActChgCrsTT1stDay + 33)
#define ActReqUnlAllPrj (ActChgCrsTT1stDay + 34)
#define ActLckAllPrj (ActChgCrsTT1stDay + 35)
#define ActUnlAllPrj (ActChgCrsTT1stDay + 36)
#define ActFrmNewPrj (ActChgCrsTT1stDay + 37)
#define ActEdiOnePrj (ActChgCrsTT1stDay + 38)
#define ActPrnOnePrj (ActChgCrsTT1stDay + 39)
#define ActNewPrj (ActChgCrsTT1stDay + 40)
#define ActChgPrj (ActChgCrsTT1stDay + 41)
#define ActReqRemPrj (ActChgCrsTT1stDay + 42)
#define ActRemPrj (ActChgCrsTT1stDay + 43)
#define ActHidPrj (ActChgCrsTT1stDay + 44)
#define ActShoPrj (ActChgCrsTT1stDay + 45)
#define ActLckPrj (ActChgCrsTT1stDay + 46)
#define ActUnlPrj (ActChgCrsTT1stDay + 47)
#define ActReqAddStdPrj (ActChgCrsTT1stDay + 48)
#define ActReqAddTutPrj (ActChgCrsTT1stDay + 49)
#define ActReqAddEvlPrj (ActChgCrsTT1stDay + 50)
#define ActAddStdPrj (ActChgCrsTT1stDay + 51)
#define ActAddTutPrj (ActChgCrsTT1stDay + 52)
#define ActAddEvlPrj (ActChgCrsTT1stDay + 53)
#define ActReqRemStdPrj (ActChgCrsTT1stDay + 54)
#define ActReqRemTutPrj (ActChgCrsTT1stDay + 55)
#define ActReqRemEvlPrj (ActChgCrsTT1stDay + 56)
#define ActRemStdPrj (ActChgCrsTT1stDay + 57)
#define ActRemTutPrj (ActChgCrsTT1stDay + 58)
#define ActRemEvlPrj (ActChgCrsTT1stDay + 59)
#define ActAdmDocPrj (ActChgCrsTT1stDay + 59)
#define ActReqRemFilDocPrj (ActChgCrsTT1stDay + 60)
#define ActRemFilDocPrj (ActChgCrsTT1stDay + 61)
#define ActRemFolDocPrj (ActChgCrsTT1stDay + 62)
#define ActCopDocPrj (ActChgCrsTT1stDay + 63)
#define ActPasDocPrj (ActChgCrsTT1stDay + 64)
#define ActRemTreDocPrj (ActChgCrsTT1stDay + 65)
#define ActFrmCreDocPrj (ActChgCrsTT1stDay + 66)
#define ActCreFolDocPrj (ActChgCrsTT1stDay + 67)
#define ActCreLnkDocPrj (ActChgCrsTT1stDay + 68)
#define ActRenFolDocPrj (ActChgCrsTT1stDay + 69)
#define ActRcvFilDocPrjDZ (ActChgCrsTT1stDay + 70)
#define ActRcvFilDocPrjCla (ActChgCrsTT1stDay + 71)
#define ActExpDocPrj (ActChgCrsTT1stDay + 72)
#define ActConDocPrj (ActChgCrsTT1stDay + 73)
#define ActZIPDocPrj (ActChgCrsTT1stDay + 74)
#define ActReqDatDocPrj (ActChgCrsTT1stDay + 75)
#define ActChgDatDocPrj (ActChgCrsTT1stDay + 76)
#define ActDowDocPrj (ActChgCrsTT1stDay + 77)
#define ActAdmDocPrj (ActChgCrsTT1stDay + 60)
#define ActReqRemFilDocPrj (ActChgCrsTT1stDay + 61)
#define ActRemFilDocPrj (ActChgCrsTT1stDay + 62)
#define ActRemFolDocPrj (ActChgCrsTT1stDay + 63)
#define ActCopDocPrj (ActChgCrsTT1stDay + 64)
#define ActPasDocPrj (ActChgCrsTT1stDay + 65)
#define ActRemTreDocPrj (ActChgCrsTT1stDay + 66)
#define ActFrmCreDocPrj (ActChgCrsTT1stDay + 67)
#define ActCreFolDocPrj (ActChgCrsTT1stDay + 68)
#define ActCreLnkDocPrj (ActChgCrsTT1stDay + 69)
#define ActRenFolDocPrj (ActChgCrsTT1stDay + 70)
#define ActRcvFilDocPrjDZ (ActChgCrsTT1stDay + 71)
#define ActRcvFilDocPrjCla (ActChgCrsTT1stDay + 72)
#define ActExpDocPrj (ActChgCrsTT1stDay + 73)
#define ActConDocPrj (ActChgCrsTT1stDay + 74)
#define ActZIPDocPrj (ActChgCrsTT1stDay + 75)
#define ActReqDatDocPrj (ActChgCrsTT1stDay + 76)
#define ActChgDatDocPrj (ActChgCrsTT1stDay + 77)
#define ActDowDocPrj (ActChgCrsTT1stDay + 78)
#define ActAdmAssPrj (ActChgCrsTT1stDay + 78)
#define ActReqRemFilAssPrj (ActChgCrsTT1stDay + 79)
#define ActRemFilAssPrj (ActChgCrsTT1stDay + 80)
#define ActRemFolAssPrj (ActChgCrsTT1stDay + 81)
#define ActCopAssPrj (ActChgCrsTT1stDay + 82)
#define ActPasAssPrj (ActChgCrsTT1stDay + 83)
#define ActRemTreAssPrj (ActChgCrsTT1stDay + 84)
#define ActFrmCreAssPrj (ActChgCrsTT1stDay + 85)
#define ActCreFolAssPrj (ActChgCrsTT1stDay + 86)
#define ActCreLnkAssPrj (ActChgCrsTT1stDay + 87)
#define ActRenFolAssPrj (ActChgCrsTT1stDay + 88)
#define ActRcvFilAssPrjDZ (ActChgCrsTT1stDay + 89)
#define ActRcvFilAssPrjCla (ActChgCrsTT1stDay + 90)
#define ActExpAssPrj (ActChgCrsTT1stDay + 91)
#define ActConAssPrj (ActChgCrsTT1stDay + 92)
#define ActZIPAssPrj (ActChgCrsTT1stDay + 93)
#define ActReqDatAssPrj (ActChgCrsTT1stDay + 94)
#define ActChgDatAssPrj (ActChgCrsTT1stDay + 95)
#define ActDowAssPrj (ActChgCrsTT1stDay + 96)
#define ActAdmAssPrj (ActChgCrsTT1stDay + 79)
#define ActReqRemFilAssPrj (ActChgCrsTT1stDay + 80)
#define ActRemFilAssPrj (ActChgCrsTT1stDay + 81)
#define ActRemFolAssPrj (ActChgCrsTT1stDay + 82)
#define ActCopAssPrj (ActChgCrsTT1stDay + 83)
#define ActPasAssPrj (ActChgCrsTT1stDay + 84)
#define ActRemTreAssPrj (ActChgCrsTT1stDay + 85)
#define ActFrmCreAssPrj (ActChgCrsTT1stDay + 86)
#define ActCreFolAssPrj (ActChgCrsTT1stDay + 87)
#define ActCreLnkAssPrj (ActChgCrsTT1stDay + 88)
#define ActRenFolAssPrj (ActChgCrsTT1stDay + 89)
#define ActRcvFilAssPrjDZ (ActChgCrsTT1stDay + 90)
#define ActRcvFilAssPrjCla (ActChgCrsTT1stDay + 91)
#define ActExpAssPrj (ActChgCrsTT1stDay + 92)
#define ActConAssPrj (ActChgCrsTT1stDay + 93)
#define ActZIPAssPrj (ActChgCrsTT1stDay + 94)
#define ActReqDatAssPrj (ActChgCrsTT1stDay + 95)
#define ActChgDatAssPrj (ActChgCrsTT1stDay + 96)
#define ActDowAssPrj (ActChgCrsTT1stDay + 97)
#define ActSeeTst (ActChgCrsTT1stDay + 97)
#define ActReqAssTst (ActChgCrsTT1stDay + 98)
#define ActAssTst (ActChgCrsTT1stDay + 99)
#define ActEdiTstQst (ActChgCrsTT1stDay + 100)
#define ActEdiOneTstQst (ActChgCrsTT1stDay + 101)
#define ActReqImpTstQst (ActChgCrsTT1stDay + 102)
#define ActImpTstQst (ActChgCrsTT1stDay + 103)
#define ActLstTstQst (ActChgCrsTT1stDay + 104)
#define ActRcvTstQst (ActChgCrsTT1stDay + 105)
#define ActReqRemSevTstQst (ActChgCrsTT1stDay + 106)
#define ActRemSevTstQst (ActChgCrsTT1stDay + 107)
#define ActReqRemOneTstQst (ActChgCrsTT1stDay + 108)
#define ActRemOneTstQst (ActChgCrsTT1stDay + 109)
#define ActChgShfTstQst (ActChgCrsTT1stDay + 110)
#define ActCfgTst (ActChgCrsTT1stDay + 111)
#define ActEnableTag (ActChgCrsTT1stDay + 112)
#define ActDisableTag (ActChgCrsTT1stDay + 113)
#define ActRenTag (ActChgCrsTT1stDay + 114)
#define ActRcvCfgTst (ActChgCrsTT1stDay + 115)
#define ActSeeTst (ActChgCrsTT1stDay + 98)
#define ActReqAssTst (ActChgCrsTT1stDay + 99)
#define ActAssTst (ActChgCrsTT1stDay + 100)
#define ActEdiTstQst (ActChgCrsTT1stDay + 101)
#define ActEdiOneTstQst (ActChgCrsTT1stDay + 102)
#define ActReqImpTstQst (ActChgCrsTT1stDay + 103)
#define ActImpTstQst (ActChgCrsTT1stDay + 104)
#define ActLstTstQst (ActChgCrsTT1stDay + 105)
#define ActRcvTstQst (ActChgCrsTT1stDay + 106)
#define ActReqRemSevTstQst (ActChgCrsTT1stDay + 107)
#define ActRemSevTstQst (ActChgCrsTT1stDay + 108)
#define ActReqRemOneTstQst (ActChgCrsTT1stDay + 109)
#define ActRemOneTstQst (ActChgCrsTT1stDay + 110)
#define ActChgShfTstQst (ActChgCrsTT1stDay + 111)
#define ActCfgTst (ActChgCrsTT1stDay + 112)
#define ActEnableTag (ActChgCrsTT1stDay + 113)
#define ActDisableTag (ActChgCrsTT1stDay + 114)
#define ActRenTag (ActChgCrsTT1stDay + 115)
#define ActRcvCfgTst (ActChgCrsTT1stDay + 116)
#define ActReqSeeMyTstRes (ActChgCrsTT1stDay + 116)
#define ActSeeMyTstRes (ActChgCrsTT1stDay + 117)
#define ActSeeOneTstResMe (ActChgCrsTT1stDay + 118)
#define ActReqSeeUsrTstRes (ActChgCrsTT1stDay + 119)
#define ActSeeUsrTstRes (ActChgCrsTT1stDay + 120)
#define ActSeeOneTstResOth (ActChgCrsTT1stDay + 121)
#define ActReqSeeMyTstRes (ActChgCrsTT1stDay + 117)
#define ActSeeMyTstRes (ActChgCrsTT1stDay + 118)
#define ActSeeOneTstResMe (ActChgCrsTT1stDay + 119)
#define ActReqSeeUsrTstRes (ActChgCrsTT1stDay + 120)
#define ActSeeUsrTstRes (ActChgCrsTT1stDay + 121)
#define ActSeeOneTstResOth (ActChgCrsTT1stDay + 122)
#define ActSeeGam (ActChgCrsTT1stDay + 122)
#define ActReqRemMch (ActChgCrsTT1stDay + 123)
#define ActRemMch (ActChgCrsTT1stDay + 124)
#define ActReqNewMch (ActChgCrsTT1stDay + 125)
#define ActNewMch (ActChgCrsTT1stDay + 126)
#define ActResMch (ActChgCrsTT1stDay + 127)
#define ActBckMch (ActChgCrsTT1stDay + 128)
#define ActPlyPauMch (ActChgCrsTT1stDay + 129)
#define ActFwdMch (ActChgCrsTT1stDay + 130)
#define ActChgNumColMch (ActChgCrsTT1stDay + 131)
#define ActChgVisResMchQst (ActChgCrsTT1stDay + 132)
#define ActMchCntDwn (ActChgCrsTT1stDay + 133)
#define ActRefMchTch (ActChgCrsTT1stDay + 134)
#define ActSeeExa (ActChgCrsTT1stDay + 123)
#define ActReqRemExaEvt (ActChgCrsTT1stDay + 124)
#define ActRemExaEvt (ActChgCrsTT1stDay + 125)
#define ActReqNewExaEvt (ActChgCrsTT1stDay + 126)
#define ActNewExaEvt (ActChgCrsTT1stDay + 127)
#define ActResExaEvt (ActChgCrsTT1stDay + 128)
#define ActBckExaEvt (ActChgCrsTT1stDay + 129)
#define ActPlyPauExaEvt (ActChgCrsTT1stDay + 130)
#define ActFwdExaEvt (ActChgCrsTT1stDay + 131)
#define ActChgNumColExaEvt (ActChgCrsTT1stDay + 132)
#define ActChgVisResExaEvtQst (ActChgCrsTT1stDay + 133)
#define ActExaEvtCntDwn (ActChgCrsTT1stDay + 134)
#define ActRefExaEvtTch (ActChgCrsTT1stDay + 135)
#define ActJoiExaEvt (ActChgCrsTT1stDay + 136)
#define ActSeeExaEvtAnsQstStd (ActChgCrsTT1stDay + 137)
#define ActRemExaEvtAnsQstStd (ActChgCrsTT1stDay + 138)
#define ActAnsExaEvtQstStd (ActChgCrsTT1stDay + 139)
#define ActRefExaEvtStd (ActChgCrsTT1stDay + 140)
#define ActJoiMch (ActChgCrsTT1stDay + 135)
#define ActSeeMchAnsQstStd (ActChgCrsTT1stDay + 136)
#define ActRemMchAnsQstStd (ActChgCrsTT1stDay + 137)
#define ActAnsMchQstStd (ActChgCrsTT1stDay + 138)
#define ActRefMchStd (ActChgCrsTT1stDay + 139)
#define ActSeeMyExaEvtResCrs (ActChgCrsTT1stDay + 141)
#define ActSeeMyExaEvtResExa (ActChgCrsTT1stDay + 142)
#define ActSeeMyExaEvtResEvt (ActChgCrsTT1stDay + 143)
#define ActSeeOneExaEvtResMe (ActChgCrsTT1stDay + 144)
#define ActSeeMyMchResCrs (ActChgCrsTT1stDay + 140)
#define ActSeeMyMchResGam (ActChgCrsTT1stDay + 141)
#define ActSeeMyMchResMch (ActChgCrsTT1stDay + 142)
#define ActSeeOneMchResMe (ActChgCrsTT1stDay + 143)
#define ActReqSeeAllExaEvtRes (ActChgCrsTT1stDay + 145)
#define ActSeeAllExaEvtResCrs (ActChgCrsTT1stDay + 146)
#define ActSeeAllExaEvtResExa (ActChgCrsTT1stDay + 147)
#define ActSeeAllExaEvtResEvt (ActChgCrsTT1stDay + 148)
#define ActSeeOneExaEvtResOth (ActChgCrsTT1stDay + 149)
#define ActReqSeeAllMchRes (ActChgCrsTT1stDay + 144)
#define ActSeeAllMchResCrs (ActChgCrsTT1stDay + 145)
#define ActSeeAllMchResGam (ActChgCrsTT1stDay + 146)
#define ActSeeAllMchResMch (ActChgCrsTT1stDay + 147)
#define ActSeeOneMchResOth (ActChgCrsTT1stDay + 148)
#define ActChgVisResExaEvtUsr (ActChgCrsTT1stDay + 150)
#define ActChgVisResMchUsr (ActChgCrsTT1stDay + 149)
#define ActFrmNewExa (ActChgCrsTT1stDay + 151)
#define ActEdiOneExa (ActChgCrsTT1stDay + 152)
#define ActNewExa (ActChgCrsTT1stDay + 153)
#define ActChgExa (ActChgCrsTT1stDay + 154)
#define ActReqRemExa (ActChgCrsTT1stDay + 155)
#define ActRemExa (ActChgCrsTT1stDay + 156)
#define ActHidExa (ActChgCrsTT1stDay + 157)
#define ActShoExa (ActChgCrsTT1stDay + 158)
#define ActAddOneExaQst (ActChgCrsTT1stDay + 159)
#define ActExaLstTstQst (ActChgCrsTT1stDay + 160)
#define ActAddTstQstToExa (ActChgCrsTT1stDay + 161)
#define ActReqRemExaQst (ActChgCrsTT1stDay + 162)
#define ActRemExaQst (ActChgCrsTT1stDay + 163)
#define ActUp_ExaQst (ActChgCrsTT1stDay + 164)
#define ActDwnExaQst (ActChgCrsTT1stDay + 165)
#define ActFrmNewGam (ActChgCrsTT1stDay + 150)
#define ActEdiOneGam (ActChgCrsTT1stDay + 151)
#define ActNewGam (ActChgCrsTT1stDay + 152)
#define ActChgGam (ActChgCrsTT1stDay + 153)
#define ActReqRemGam (ActChgCrsTT1stDay + 154)
#define ActRemGam (ActChgCrsTT1stDay + 155)
#define ActHidGam (ActChgCrsTT1stDay + 156)
#define ActShoGam (ActChgCrsTT1stDay + 157)
#define ActAddOneGamQst (ActChgCrsTT1stDay + 158)
#define ActGamLstTstQst (ActChgCrsTT1stDay + 159)
#define ActAddTstQstToGam (ActChgCrsTT1stDay + 160)
#define ActReqRemGamQst (ActChgCrsTT1stDay + 161)
#define ActRemGamQst (ActChgCrsTT1stDay + 162)
#define ActUp_GamQst (ActChgCrsTT1stDay + 163)
#define ActDwnGamQst (ActChgCrsTT1stDay + 164)
#define ActSeeGam (ActChgCrsTT1stDay + 166)
#define ActReqRemMch (ActChgCrsTT1stDay + 167)
#define ActRemMch (ActChgCrsTT1stDay + 168)
#define ActReqNewMch (ActChgCrsTT1stDay + 169)
#define ActNewMch (ActChgCrsTT1stDay + 170)
#define ActResMch (ActChgCrsTT1stDay + 171)
#define ActBckMch (ActChgCrsTT1stDay + 172)
#define ActPlyPauMch (ActChgCrsTT1stDay + 173)
#define ActFwdMch (ActChgCrsTT1stDay + 174)
#define ActChgNumColMch (ActChgCrsTT1stDay + 175)
#define ActChgVisResMchQst (ActChgCrsTT1stDay + 176)
#define ActMchCntDwn (ActChgCrsTT1stDay + 177)
#define ActRefMchTch (ActChgCrsTT1stDay + 178)
#define ActSeeSvy (ActChgCrsTT1stDay + 165)
#define ActAnsSvy (ActChgCrsTT1stDay + 166)
#define ActFrmNewSvy (ActChgCrsTT1stDay + 167)
#define ActEdiOneSvy (ActChgCrsTT1stDay + 168)
#define ActNewSvy (ActChgCrsTT1stDay + 169)
#define ActChgSvy (ActChgCrsTT1stDay + 170)
#define ActReqRemSvy (ActChgCrsTT1stDay + 171)
#define ActRemSvy (ActChgCrsTT1stDay + 172)
#define ActReqRstSvy (ActChgCrsTT1stDay + 173)
#define ActRstSvy (ActChgCrsTT1stDay + 174)
#define ActHidSvy (ActChgCrsTT1stDay + 175)
#define ActShoSvy (ActChgCrsTT1stDay + 176)
#define ActEdiOneSvyQst (ActChgCrsTT1stDay + 177)
#define ActRcvSvyQst (ActChgCrsTT1stDay + 178)
#define ActReqRemSvyQst (ActChgCrsTT1stDay + 179)
#define ActRemSvyQst (ActChgCrsTT1stDay + 180)
#define ActJoiMch (ActChgCrsTT1stDay + 179)
#define ActSeeMchAnsQstStd (ActChgCrsTT1stDay + 180)
#define ActRemMchAnsQstStd (ActChgCrsTT1stDay + 181)
#define ActAnsMchQstStd (ActChgCrsTT1stDay + 182)
#define ActRefMchStd (ActChgCrsTT1stDay + 183)
#define ActSeeOneExaAnn (ActChgCrsTT1stDay + 181)
#define ActSeeDatExaAnn (ActChgCrsTT1stDay + 182)
#define ActEdiExaAnn (ActChgCrsTT1stDay + 183)
#define ActRcvExaAnn (ActChgCrsTT1stDay + 184)
#define ActPrnExaAnn (ActChgCrsTT1stDay + 185)
#define ActReqRemExaAnn (ActChgCrsTT1stDay + 186)
#define ActRemExaAnn (ActChgCrsTT1stDay + 187)
#define ActHidExaAnn (ActChgCrsTT1stDay + 188)
#define ActShoExaAnn (ActChgCrsTT1stDay + 189)
#define ActSeeMyMchResCrs (ActChgCrsTT1stDay + 184)
#define ActSeeMyMchResGam (ActChgCrsTT1stDay + 185)
#define ActSeeMyMchResMch (ActChgCrsTT1stDay + 186)
#define ActSeeOneMchResMe (ActChgCrsTT1stDay + 187)
#define ActReqSeeAllMchRes (ActChgCrsTT1stDay + 188)
#define ActSeeAllMchResCrs (ActChgCrsTT1stDay + 189)
#define ActSeeAllMchResGam (ActChgCrsTT1stDay + 190)
#define ActSeeAllMchResMch (ActChgCrsTT1stDay + 191)
#define ActSeeOneMchResOth (ActChgCrsTT1stDay + 192)
#define ActChgVisResMchUsr (ActChgCrsTT1stDay + 193)
#define ActFrmNewGam (ActChgCrsTT1stDay + 194)
#define ActEdiOneGam (ActChgCrsTT1stDay + 195)
#define ActNewGam (ActChgCrsTT1stDay + 196)
#define ActChgGam (ActChgCrsTT1stDay + 197)
#define ActReqRemGam (ActChgCrsTT1stDay + 198)
#define ActRemGam (ActChgCrsTT1stDay + 199)
#define ActHidGam (ActChgCrsTT1stDay + 200)
#define ActShoGam (ActChgCrsTT1stDay + 201)
#define ActAddOneGamQst (ActChgCrsTT1stDay + 202)
#define ActGamLstTstQst (ActChgCrsTT1stDay + 203)
#define ActAddTstQstToGam (ActChgCrsTT1stDay + 204)
#define ActReqRemGamQst (ActChgCrsTT1stDay + 205)
#define ActRemGamQst (ActChgCrsTT1stDay + 206)
#define ActUp_GamQst (ActChgCrsTT1stDay + 207)
#define ActDwnGamQst (ActChgCrsTT1stDay + 208)
#define ActSeeSvy (ActChgCrsTT1stDay + 209)
#define ActAnsSvy (ActChgCrsTT1stDay + 210)
#define ActFrmNewSvy (ActChgCrsTT1stDay + 211)
#define ActEdiOneSvy (ActChgCrsTT1stDay + 212)
#define ActNewSvy (ActChgCrsTT1stDay + 213)
#define ActChgSvy (ActChgCrsTT1stDay + 214)
#define ActReqRemSvy (ActChgCrsTT1stDay + 215)
#define ActRemSvy (ActChgCrsTT1stDay + 216)
#define ActReqRstSvy (ActChgCrsTT1stDay + 217)
#define ActRstSvy (ActChgCrsTT1stDay + 218)
#define ActHidSvy (ActChgCrsTT1stDay + 219)
#define ActShoSvy (ActChgCrsTT1stDay + 220)
#define ActEdiOneSvyQst (ActChgCrsTT1stDay + 221)
#define ActRcvSvyQst (ActChgCrsTT1stDay + 222)
#define ActReqRemSvyQst (ActChgCrsTT1stDay + 223)
#define ActRemSvyQst (ActChgCrsTT1stDay + 224)
#define ActSeeOneExaAnn (ActChgCrsTT1stDay + 225)
#define ActSeeDatExaAnn (ActChgCrsTT1stDay + 226)
#define ActEdiExaAnn (ActChgCrsTT1stDay + 227)
#define ActRcvExaAnn (ActChgCrsTT1stDay + 228)
#define ActPrnExaAnn (ActChgCrsTT1stDay + 229)
#define ActReqRemExaAnn (ActChgCrsTT1stDay + 230)
#define ActRemExaAnn (ActChgCrsTT1stDay + 231)
#define ActHidExaAnn (ActChgCrsTT1stDay + 232)
#define ActShoExaAnn (ActChgCrsTT1stDay + 233)
/*****************************************************************************/
/******************************** Files tab **********************************/

View File

@ -497,7 +497,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 19.191 (2020-04-20)"
#define Log_PLATFORM_VERSION "SWAD 19.192 (2020-04-22)"
#define CSS_FILE "swad19.190.css"
#define JS_FILE "swad19.172.1.js"
/*
@ -552,6 +552,13 @@ Funci
// TODO: Cambiar icono notificaciones nuevas con "bell-on.svg"
// TODO: Ahmed El Moukhtari Koubaa: Cuando le damos a la opción de mostrar solo los mensajes no leídos, se muestran estos mensajes, pero cuando los intentamos leer, es decir, hacemos clic sobre ellos se recarga toda la página por así decirlo y vuelve a dar una lista con los mensajes, pero descartando aquel que clicamos porque, entiendo yo al menos, que ya lo ha marcado como leído.
Version 19.192: Apr 22, 2020 Changes in exams. (296803 lines)
Copy the following 4 icons to icon public directory:
sudo cp icon/iconset/awesome/file-contract.svg /var/www/html/swad/icon/iconset/awesome
sudo cp icon/iconset/awesome/file-invoice.svg /var/www/html/swad/icon/iconset/awesome
sudo cp icon/iconset/nuvola/file-contract.png /var/www/html/swad/icon/iconset/nuvola
sudo cp icon/iconset/nuvola/file-invoice.png /var/www/html/swad/icon/iconset/nuvola
Version 19.191: Apr 20, 2020 Module swad_exam for exam announcements is renamed as swad_exam_announcement.
New modules swad_exam, swad_exam_event and swad_exam_result to make exams. (295885 lines)
Version 19.190.5: Apr 19, 2020 Anchors in forms to edit buildings and rooms. (288527 lines)

View File

@ -28,9 +28,9 @@
/** Uncomment one of the following installations of SWAD or create your own **/
/*****************************************************************************/
//#define LOCALHOST_UBUNTU // Comment this line if not applicable
#define LOCALHOST_UBUNTU // Comment this line if not applicable
//#define OPENSWAD_ORG // Comment this line if not applicable
#define SWAD_UGR_ES // Comment this line if not applicable
//#define SWAD_UGR_ES // Comment this line if not applicable
//#define SWADBERRY_UGR_ES // Comment this line if not applicable
/*****************************************************************************/

View File

@ -1891,7 +1891,7 @@ static void Crs_EmptyCourseCompletely (long CrsCod)
Svy_RemoveSurveys (Hie_CRS,CrsCod);
/***** Remove all test exams made in the course *****/
TstExa_RemoveCrsExams (CrsCod);
TstRes_RemoveCrsExams (CrsCod);
/***** Remove all tests questions in the course *****/
Tst_RemoveCrsTests (CrsCod);

View File

@ -1463,7 +1463,7 @@ mysql> DESCRIBE mch_indexes;
DB_CreateTable ("CREATE TABLE IF NOT EXISTS mch_indexes ("
"MchCod INT NOT NULL,"
"QstInd INT NOT NULL,"
"Indexes TEXT NOT NULL," // TstExa_MAX_BYTES_INDEXES_ONE_QST
"Indexes TEXT NOT NULL," // TstRes_MAX_BYTES_INDEXES_ONE_QST
"UNIQUE INDEX(MchCod,QstInd))");
/***** Table mch_results *****/
@ -2886,8 +2886,8 @@ mysql> DESCRIBE tst_exam_questions;
"QstCod INT NOT NULL,"
"QstInd INT NOT NULL,"
"Score DOUBLE PRECISION NOT NULL DEFAULT 0,"
"Indexes TEXT NOT NULL," // TstExa_MAX_BYTES_INDEXES_ONE_QST
"Answers TEXT NOT NULL," // TstExa_MAX_BYTES_ANSWERS_ONE_QST
"Indexes TEXT NOT NULL," // TstRes_MAX_BYTES_INDEXES_ONE_QST
"Answers TEXT NOT NULL," // TstRes_MAX_BYTES_ANSWERS_ONE_QST
"UNIQUE INDEX(ExaCod,QstCod))");
/***** Table tst_exams *****/

View File

@ -4120,7 +4120,7 @@ static void Enr_EffectivelyRemUsrFromCrs (struct UsrData *UsrDat,
Brw_RemoveSomeInfoAboutCrsUsrFilesFromDB (UsrDat->UsrCod,Crs->CrsCod);
/***** Remove test results made by user in course *****/
TstExa_RemoveExamsMadeByUsrInCrs (UsrDat->UsrCod,Crs->CrsCod);
TstRes_RemoveExamsMadeByUsrInCrs (UsrDat->UsrCod,Crs->CrsCod);
/***** Set all the notifications for this user in this course as removed,
except notifications about new messages *****/

View File

@ -36,6 +36,8 @@
#include "swad_database.h"
#include "swad_exam.h"
#include "swad_exam_event.h"
#include "swad_exam_result.h"
#include "swad_figure.h"
#include "swad_form.h"
#include "swad_global.h"
@ -348,7 +350,7 @@ static void Exa_PutIconsListExams (void *Exams)
if (Exa_CheckIfICanEditExams ())
Exa_PutIconToCreateNewExam ((struct Exa_Exams *) Exams);
/***** Put icon to view matches results *****/
/***** Put icon to view events results *****/
switch (Gbl.Usrs.Me.Role.Logged)
{
case Rol_STD:
@ -469,7 +471,7 @@ void Exa_ShowOnlyOneExamBegin (struct Exa_Exams *Exams,
/***** Write questions of this exam *****/
Exa_ListExamQuestions (Exams,Exam);
else
/***** List matches *****/
/***** List events *****/
ExaEvt_ListEvents (Exams,Exam,PutFormNewMatch);
}
@ -526,7 +528,7 @@ static void Exa_ShowOneExam (struct Exa_Exams *Exams,
{
if (asprintf (&Id,"exa_date_%u_%u",(unsigned) StartEndTime,UniqueId) < 0)
Lay_NotEnoughMemoryExit ();
Color = Exam->NumUnfinishedEves ? (Exam->Hidden ? "DATE_GREEN_LIGHT":
Color = Exam->NumUnfinishedEvts ? (Exam->Hidden ? "DATE_GREEN_LIGHT":
"DATE_GREEN") :
(Exam->Hidden ? "DATE_RED_LIGHT":
"DATE_RED");
@ -577,7 +579,7 @@ static void Exa_ShowOneExam (struct Exa_Exams *Exams,
TstVis_ShowVisibilityIcons (Exam->Visibility,Exam->Hidden);
HTM_DIV_End ();
/***** Number of matches in exam *****/
/***** Number of events in exam *****/
if (ShowOnlyThisExam)
HTM_TD_Begin ("class=\"RT\"");
else
@ -592,7 +594,7 @@ static void Exa_ShowOneExam (struct Exa_Exams *Exams,
NULL);
if (ShowOnlyThisExam)
HTM_TxtColonNBSP (Txt_Matches);
HTM_Unsigned (Exam->NumEves);
HTM_Unsigned (Exam->NumEvts);
HTM_BUTTON_End ();
Frm_EndForm ();
@ -641,24 +643,24 @@ static void Exa_ShowOneExam (struct Exa_Exams *Exams,
}
/*****************************************************************************/
/************* Put icon to show results of matches in an exam *****************/
/************* Put icon to show results of events in an exam *****************/
/*****************************************************************************/
static void Exa_PutIconToShowResultsOfExam (void *Exams)
{
if (Exams)
{
/***** Put icon to view matches results *****/
/***** Put icon to view events results *****/
switch (Gbl.Usrs.Me.Role.Logged)
{
case Rol_STD:
Ico_PutContextualIconToShowResults (ActSeeMyEveResExa,ExaRes_RESULTS_BOX_ID,
Ico_PutContextualIconToShowResults (ActSeeMyExaEvtResExa,ExaRes_RESULTS_BOX_ID,
Exa_PutParams,Exams);
break;
case Rol_NET:
case Rol_TCH:
case Rol_SYS_ADM:
Ico_PutContextualIconToShowResults (ActSeeAllEveResExa,ExaRes_RESULTS_BOX_ID,
Ico_PutContextualIconToShowResults (ActSeeAllExaEvtResExa,ExaRes_RESULTS_BOX_ID,
Exa_PutParams,Exams);
break;
default:
@ -1007,11 +1009,11 @@ void Exa_GetDataOfExamByCod (struct Exa_Exam *Exam)
/* Get number of questions */
Exam->NumQsts = Exa_GetNumQstsExam (Exam->ExaCod);
/* Get number of matches */
Exam->NumEves = ExaEve_GetNumEvesInExam (Exam->ExaCod);
/* Get number of events */
Exam->NumEvts = ExaEvt_GetNumEventsInExam (Exam->ExaCod);
/* Get number of unfinished matches */
Exam->NumUnfinishedEves = ExaEvt_GetNumUnfinishedEvtsInExam (Exam->ExaCod);
/* Get number of unfinished events */
Exam->NumUnfinishedEvts = ExaEvt_GetNumUnfinishedEventsInExam (Exam->ExaCod);
}
else
/* Initialize to empty exam */
@ -1067,8 +1069,8 @@ static void Exa_ResetExam (struct Exa_Exam *Exam)
Exam->TimeUTC[Dat_END_TIME ] = (time_t) 0;
Exam->Title[0] = '\0';
Exam->NumQsts = 0;
Exam->NumEves = 0;
Exam->NumUnfinishedEves = 0;
Exam->NumEvts = 0;
Exam->NumUnfinishedEvts = 0;
Exam->Hidden = false;
}
@ -1195,7 +1197,7 @@ void Exa_RemoveExam (void)
static void Exa_RemoveExamFromAllTables (long ExaCod)
{
/***** Remove all matches in this exam *****/
/***** Remove all events in this exam *****/
ExaEvt_RemoveEventsInExamFromAllTables (ExaCod);
/***** Remove exam question *****/
@ -1215,7 +1217,7 @@ static void Exa_RemoveExamFromAllTables (long ExaCod)
void Exa_RemoveExamsCrs (long CrsCod)
{
/***** Remove all matches in this course *****/
/***** Remove all events in this course *****/
ExaEvt_RemoveEventInCourseFromAllTables (CrsCod);
/***** Remove the questions in exams *****/
@ -1659,7 +1661,7 @@ void Exa_RequestNewQuestion (void)
Lay_ShowErrorAndExit ("Code of exam is missing.");
Exa_GetDataOfExamByCod (&Exam);
/***** Check if exam has matches *****/
/***** Check if exam has events *****/
if (Exa_CheckIfEditable (&Exam))
{
/***** Show form to create a new question in this exam *****/
@ -1692,12 +1694,12 @@ void Exa_ListTstQuestionsToSelect (void)
Lay_ShowErrorAndExit ("Code of exam is missing.");
Exa_GetDataOfExamByCod (&Exam);
/***** Check if exam has matches *****/
/***** Check if exam has events *****/
if (Exa_CheckIfEditable (&Exam))
{
/***** List several test questions for selection *****/
Exams.ExaCod = Exam.ExaCod;
Tst_ListQuestionsToSelect (&Exams);
Tst_ListQuestionsToSelectForExam (&Exams);
}
else
Lay_NoPermissionExit ();
@ -1733,11 +1735,11 @@ unsigned Exa_GetParamQstInd (void)
static void Exa_RemAnswersOfAQuestion (long ExaCod,unsigned QstInd)
{
/***** Remove answers from all matches of this exam *****/
/***** Remove answers from all events of this exam *****/
DB_QueryDELETE ("can not remove the answers of a question",
"DELETE FROM exa_answers"
" USING exa_events,exa_answers"
" WHERE exa_events.ExaCod=%ld" // From all matches of this exam...
" WHERE exa_events.ExaCod=%ld" // From all events of this exam...
" AND exa_events.EvtCod=exa_answers.EvtCod"
" AND exa_answers.QstInd=%u", // ...remove only answers to this question
ExaCod,QstInd);
@ -2159,7 +2161,7 @@ void Exa_AddTstQuestionsToExam (void)
Lay_ShowErrorAndExit ("Code of exam is missing.");
Exa_GetDataOfExamByCod (&Exam);
/***** Check if exam has matches *****/
/***** Check if exam has events *****/
if (Exa_CheckIfEditable (&Exam))
{
/***** Get selected questions *****/
@ -2279,7 +2281,7 @@ void Exa_RequestRemoveQst (void)
Lay_ShowErrorAndExit ("Code of exam is missing.");
Exa_GetDataOfExamByCod (&Exam);
/***** Check if exam has matches *****/
/***** Check if exam has events *****/
if (Exa_CheckIfEditable (&Exam))
{
/***** Get question index *****/
@ -2322,7 +2324,7 @@ void Exa_RemoveQst (void)
Lay_ShowErrorAndExit ("Code of exam is missing.");
Exa_GetDataOfExamByCod (&Exam);
/***** Check if exam has matches *****/
/***** Check if exam has events *****/
if (Exa_CheckIfEditable (&Exam))
{
/***** Get question index *****/
@ -2386,7 +2388,7 @@ void Exa_MoveUpQst (void)
Lay_ShowErrorAndExit ("Code of exam is missing.");
Exa_GetDataOfExamByCod (&Exam);
/***** Check if exam has matches *****/
/***** Check if exam has events *****/
if (Exa_CheckIfEditable (&Exam))
{
/***** Get question index *****/
@ -2441,7 +2443,7 @@ void Exa_MoveDownQst (void)
Lay_ShowErrorAndExit ("Code of exam is missing.");
Exa_GetDataOfExamByCod (&Exam);
/***** Check if exam has matches *****/
/***** Check if exam has events *****/
if (Exa_CheckIfEditable (&Exam))
{
/***** Get question index *****/
@ -2533,15 +2535,15 @@ static void Exa_ExchangeQuestions (long ExaCod,
}
/*****************************************************************************/
/*********** Get number of matches and check is edition is possible **********/
/*********** Get number of events and check is edition is possible **********/
/*****************************************************************************/
// Before calling this function, number of matches must be calculated
// Before calling this function, number of events must be calculated
static bool Exa_CheckIfEditable (const struct Exa_Exam *Exam)
{
if (Exa_CheckIfICanEditExams ())
/***** Questions are editable only if exam has no matches *****/
return (bool) (Exam->NumEves == 0); // Exams with matches should not be edited
/***** Questions are editable only if exam has no events *****/
return (bool) (Exam->NumEvts == 0); // Exams with events should not be edited
else
return false; // Questions are not editable
}
@ -2562,10 +2564,10 @@ void Exa_PutButtonNewMatch (struct Exa_Exams *Exams,long ExaCod)
}
/*****************************************************************************/
/************* Request the creation of a new match as a teacher **************/
/************* Request the creation of a new event as a teacher **************/
/*****************************************************************************/
void Exa_RequestNewMatch (void)
void Exa_RequestNewEvent (void)
{
struct Exa_Exams Exams;
struct Exa_Exam Exam;

View File

@ -90,8 +90,8 @@ struct Exa_Exam
time_t TimeUTC[Dat_NUM_START_END_TIME];
bool Hidden; // Exam is hidden
unsigned NumQsts; // Number of questions in the exam
unsigned NumEves; // Number of events in the exam
unsigned NumUnfinishedEves; // Number of unfinished events in the exam
unsigned NumEvts; // Number of events in the exam
unsigned NumUnfinishedEvts; // Number of unfinished events in the exam
};
/*****************************************************************************/
@ -156,7 +156,7 @@ void Exa_MoveUpQst (void);
void Exa_MoveDownQst (void);
void Exa_PutButtonNewMatch (struct Exa_Exams *Exams,long ExaCod);
void Exa_RequestNewMatch (void);
void Exa_RequestNewEvent (void);
unsigned Exa_GetNumCoursesWithExams (Hie_Level_t Scope);
unsigned Exa_GetNumExams (Hie_Level_t Scope);

View File

@ -112,24 +112,24 @@ static void ExaEvt_ListOneOrMoreEvents (struct Exa_Exams *Exams,
MYSQL_RES *mysql_res);
static void ExaEvt_ListOneOrMoreEventsHeading (bool ICanEditEvents);
static bool ExaEvt_CheckIfICanEditEvents (void);
static bool ExaEvt_CheckIfICanEditThisEvent (const struct ExaEvt_Match *Event);
static bool ExaEvt_CheckIfICanEditThisEvent (const struct ExaEvt_Event *Event);
static void ExaEvt_ListOneOrMoreEventsIcons (struct Exa_Exams *Exams,
const struct ExaEvt_Match *Event);
static void ExaEvt_ListOneOrMoreEventsAuthor (const struct ExaEvt_Match *Event);
static void ExaEvt_ListOneOrMoreEventsTimes (const struct ExaEvt_Match *Event,unsigned UniqueId);
static void ExaEvt_ListOneOrMoreEventsTitleGrps (const struct ExaEvt_Match *Event);
static void ExaEvt_GetAndWriteNamesOfGrpsAssociatedToEvent (const struct ExaEvt_Match *Event);
static void ExaEvt_ListOneOrMoreEventsNumPlayers (const struct ExaEvt_Match *Event);
static void ExaEvt_ListOneOrMoreEventsStatus (struct ExaEvt_Match *Event,unsigned NumQsts);
const struct ExaEvt_Event *Event);
static void ExaEvt_ListOneOrMoreEventsAuthor (const struct ExaEvt_Event *Event);
static void ExaEvt_ListOneOrMoreEventsTimes (const struct ExaEvt_Event *Event,unsigned UniqueId);
static void ExaEvt_ListOneOrMoreEventsTitleGrps (const struct ExaEvt_Event *Event);
static void ExaEvt_GetAndWriteNamesOfGrpsAssociatedToEvent (const struct ExaEvt_Event *Event);
static void ExaEvt_ListOneOrMoreEventsNumPlayers (const struct ExaEvt_Event *Event);
static void ExaEvt_ListOneOrMoreEventsStatus (struct ExaEvt_Event *Event,unsigned NumQsts);
static void ExaEvt_ListOneOrMoreEventsResult (struct Exa_Exams *Exams,
const struct ExaEvt_Match *Event);
const struct ExaEvt_Event *Event);
static void ExaEvt_ListOneOrMoreEventsResultStd (struct Exa_Exams *Exams,
const struct ExaEvt_Match *Event);
const struct ExaEvt_Event *Event);
static void ExaEvt_ListOneOrMoreEventsResultTch (struct Exa_Exams *Exams,
const struct ExaEvt_Match *Event);
const struct ExaEvt_Event *Event);
static void ExaEvt_GetEventDataFromRow (MYSQL_RES *mysql_res,
struct ExaEvt_Match *Event);
struct ExaEvt_Event *Event);
static ExaEvt_Showing_t ExaEvt_GetShowingFromStr (const char *Str);
static void ExaEvt_RemoveEventFromAllTables (long EvtCod);
@ -149,63 +149,63 @@ static void ExaEvt_CreateIndexes (long ExaCod,long EvtCod);
static void ExaEvt_ReorderAnswer (long EvtCod,unsigned QstInd,
const struct Tst_Question *Question);
static void ExaEvt_CreateGrps (long EvtCod);
static void ExaEvt_UpdateEventStatusInDB (const struct ExaEvt_Match *Event);
static void ExaEvt_UpdateEventStatusInDB (const struct ExaEvt_Event *Event);
static void ExaEvt_UpdateElapsedTimeInQuestion (const struct ExaEvt_Match *Event);
static void ExaEvt_GetElapsedTimeInQuestion (const struct ExaEvt_Match *Event,
static void ExaEvt_UpdateElapsedTimeInQuestion (const struct ExaEvt_Event *Event);
static void ExaEvt_GetElapsedTimeInQuestion (const struct ExaEvt_Event *Event,
struct Time *Time);
static void ExaEvt_GetElapsedTimeInMatch (const struct ExaEvt_Match *Event,
static void ExaEvt_GetElapsedTimeInMatch (const struct ExaEvt_Event *Event,
struct Time *Time);
static void ExaEvt_GetElapsedTime (unsigned NumRows,MYSQL_RES *mysql_res,
struct Time *Time);
static void ExaEvt_SetMatchStatusToPrev (struct ExaEvt_Match *Event);
static void ExaEvt_SetMatchStatusToPrevQst (struct ExaEvt_Match *Event);
static void ExaEvt_SetMatchStatusToStart (struct ExaEvt_Match *Event);
static void ExaEvt_SetMatchStatusToPrev (struct ExaEvt_Event *Event);
static void ExaEvt_SetMatchStatusToPrevQst (struct ExaEvt_Event *Event);
static void ExaEvt_SetMatchStatusToStart (struct ExaEvt_Event *Event);
static void ExaEvt_SetMatchStatusToNext (struct ExaEvt_Match *Event);
static void ExaEvt_SetMatchStatusToNextQst (struct ExaEvt_Match *Event);
static void ExaEvt_SetMatchStatusToEnd (struct ExaEvt_Match *Event);
static void ExaEvt_SetMatchStatusToNext (struct ExaEvt_Event *Event);
static void ExaEvt_SetMatchStatusToNextQst (struct ExaEvt_Event *Event);
static void ExaEvt_SetMatchStatusToEnd (struct ExaEvt_Event *Event);
static void ExaEvt_ShowMatchStatusForTch (struct ExaEvt_Match *Event);
static void ExaEvt_ShowMatchStatusForStd (struct ExaEvt_Match *Event,ExaEvt_Update_t Update);
static void ExaEvt_ShowMatchStatusForTch (struct ExaEvt_Event *Event);
static void ExaEvt_ShowMatchStatusForStd (struct ExaEvt_Event *Event,ExaEvt_Update_t Update);
static void ExaEvt_ShowLeftColumnTch (struct ExaEvt_Match *Event);
static void ExaEvt_ShowRefreshablePartTch (struct ExaEvt_Match *Event);
static void ExaEvt_WriteElapsedTimeInEvt (struct ExaEvt_Match *Event);
static void ExaEvt_WriteElapsedTimeInQst (struct ExaEvt_Match *Event);
static void ExaEvt_WriteNumRespondersQst (struct ExaEvt_Match *Event);
static void ExaEvt_PutFormCountdown (struct ExaEvt_Match *Event,long Seconds,const char *Color);
static void ExaEvt_PutCountdownAndHourglassIcon (struct ExaEvt_Match *Event);
static void ExaEvt_PutFormsCountdown (struct ExaEvt_Match *Event);
static void ExaEvt_ShowLeftColumnTch (struct ExaEvt_Event *Event);
static void ExaEvt_ShowRefreshablePartTch (struct ExaEvt_Event *Event);
static void ExaEvt_WriteElapsedTimeInEvt (struct ExaEvt_Event *Event);
static void ExaEvt_WriteElapsedTimeInQst (struct ExaEvt_Event *Event);
static void ExaEvt_WriteNumRespondersQst (struct ExaEvt_Event *Event);
static void ExaEvt_PutFormCountdown (struct ExaEvt_Event *Event,long Seconds,const char *Color);
static void ExaEvt_PutCountdownAndHourglassIcon (struct ExaEvt_Event *Event);
static void ExaEvt_PutFormsCountdown (struct ExaEvt_Event *Event);
static void ExaEvt_ShowRightColumnTch (const struct ExaEvt_Match *Event);
static void ExaEvt_ShowLeftColumnStd (const struct ExaEvt_Match *Event,
static void ExaEvt_ShowRightColumnTch (const struct ExaEvt_Event *Event);
static void ExaEvt_ShowLeftColumnStd (const struct ExaEvt_Event *Event,
const struct ExaEvt_UsrAnswer *UsrAnswer);
static void ExaEvt_ShowRightColumnStd (struct ExaEvt_Match *Event,
static void ExaEvt_ShowRightColumnStd (struct ExaEvt_Event *Event,
const struct ExaEvt_UsrAnswer *UsrAnswer,
ExaEvt_Update_t Update);
static void ExaEvt_ShowNumQstInEvt (const struct ExaEvt_Match *Event);
static void ExaEvt_PutMatchControlButtons (const struct ExaEvt_Match *Event);
static void ExaEvt_ShowFormColumns (const struct ExaEvt_Match *Event);
static void ExaEvt_ShowNumQstInEvt (const struct ExaEvt_Event *Event);
static void ExaEvt_PutMatchControlButtons (const struct ExaEvt_Event *Event);
static void ExaEvt_ShowFormColumns (const struct ExaEvt_Event *Event);
static void ExaEvt_PutParamNumCols (unsigned NumCols);
static void ExaEvt_ShowEventTitleTch (const struct ExaEvt_Match *Event);
static void ExaEvt_ShowEventTitleStd (const struct ExaEvt_Match *Event);
static void ExaEvt_ShowEventTitleTch (const struct ExaEvt_Event *Event);
static void ExaEvt_ShowEventTitleStd (const struct ExaEvt_Event *Event);
static void ExaEvt_PutCheckboxResult (const struct ExaEvt_Match *Event);
static void ExaEvt_PutIfAnswered (const struct ExaEvt_Match *Event,bool Answered);
static void ExaEvt_PutIconToRemoveMyAnswer (const struct ExaEvt_Match *Event);
static void ExaEvt_ShowQuestionAndAnswersTch (const struct ExaEvt_Match *Event);
static void ExaEvt_WriteAnswersEventResult (const struct ExaEvt_Match *Event,
static void ExaEvt_PutCheckboxResult (const struct ExaEvt_Event *Event);
static void ExaEvt_PutIfAnswered (const struct ExaEvt_Event *Event,bool Answered);
static void ExaEvt_PutIconToRemoveMyAnswer (const struct ExaEvt_Event *Event);
static void ExaEvt_ShowQuestionAndAnswersTch (const struct ExaEvt_Event *Event);
static void ExaEvt_WriteAnswersEventResult (const struct ExaEvt_Event *Event,
const struct Tst_Question *Question,
const char *Class,bool ShowResult);
static bool ExaEvt_ShowQuestionAndAnswersStd (const struct ExaEvt_Match *Event,
static bool ExaEvt_ShowQuestionAndAnswersStd (const struct ExaEvt_Event *Event,
const struct ExaEvt_UsrAnswer *UsrAnswer,
ExaEvt_Update_t Update);
static void ExaEvt_ShowEventScore (const struct ExaEvt_Match *Event);
static void ExaEvt_ShowEventScore (const struct ExaEvt_Event *Event);
static void ExaEvt_DrawEmptyScoreRow (unsigned NumRow,double MinScore,double MaxScore);
static void ExaEvt_DrawScoreRow (double Score,double MinScore,double MaxScore,
unsigned NumRow,unsigned NumUsrs,unsigned MaxUsrs);
@ -225,11 +225,11 @@ static void ExaEvt_RemoveOldPlayers (void);
static void ExaEvt_UpdateEventAsBeingPlayed (long EvtCod);
static void ExaEvt_SetEventAsNotBeingPlayed (long EvtCod);
static bool ExaEvt_GetIfEventIsBeingPlayed (long EvtCod);
static void ExaEvt_GetNumPlayers (struct ExaEvt_Match *Event);
static void ExaEvt_GetNumPlayers (struct ExaEvt_Event *Event);
static void ExaEvt_RemoveMyAnswerToEventQuestion (const struct ExaEvt_Match *Event);
static void ExaEvt_RemoveMyAnswerToEventQuestion (const struct ExaEvt_Event *Event);
static void ExaEvt_ComputeScore (struct TstExa_Exam *Result);
static void ExaEvt_ComputeScore (struct TstRes_Result *Result);
static unsigned ExaEvt_GetNumUsrsWhoHaveAnswerEvt (long EvtCod);
@ -350,7 +350,7 @@ void ExaEvt_ListEvents (struct Exa_Exams *Exams,
/******************** Get exam event data using its code *********************/
/*****************************************************************************/
void ExaEvt_GetDataOfEventByCod (struct ExaEvt_Match *Event)
void ExaEvt_GetDataOfEventByCod (struct ExaEvt_Event *Event)
{
MYSQL_RES *mysql_res;
unsigned long NumRows;
@ -434,7 +434,7 @@ static void ExaEvt_PutIconToCreateNewEvent (struct Exa_Exams *Exams)
extern const char *Txt_New_match;
/***** Put form to create a new exam event *****/
Ico_PutContextualIconToAdd (ActReqNewExaEvt,ExaEvt_NEW_MATCH_SECTION_ID,
Ico_PutContextualIconToAdd (ActReqNewExaEvt,ExaEvt_NEW_EVENT_SECTION_ID,
Gam_PutParams,Exams,
Txt_New_match);
}
@ -450,7 +450,7 @@ static void ExaEvt_ListOneOrMoreEvents (struct Exa_Exams *Exams,
{
unsigned NumEvent;
unsigned UniqueId;
struct ExaEvt_Match Event;
struct ExaEvt_Event Event;
bool ICanEditEvents = ExaEvt_CheckIfICanEditEvents ();
/***** Write the heading *****/
@ -554,7 +554,7 @@ static bool ExaEvt_CheckIfICanEditEvents (void)
/************** Check if I can edit (remove/resume) an exam event ************/
/*****************************************************************************/
static bool ExaEvt_CheckIfICanEditThisEvent (const struct ExaEvt_Match *Event)
static bool ExaEvt_CheckIfICanEditThisEvent (const struct ExaEvt_Event *Event)
{
switch (Gbl.Usrs.Me.Role.Logged)
{
@ -573,7 +573,7 @@ static bool ExaEvt_CheckIfICanEditThisEvent (const struct ExaEvt_Match *Event)
/*****************************************************************************/
static void ExaEvt_ListOneOrMoreEventsIcons (struct Exa_Exams *Exams,
const struct ExaEvt_Match *Event)
const struct ExaEvt_Event *Event)
{
HTM_TD_Begin ("class=\"BT%u\"",Gbl.RowEvenOdd);
@ -597,7 +597,7 @@ static void ExaEvt_ListOneOrMoreEventsIcons (struct Exa_Exams *Exams,
/*********** Put a column for teacher who created the exam event *************/
/*****************************************************************************/
static void ExaEvt_ListOneOrMoreEventsAuthor (const struct ExaEvt_Match *Event)
static void ExaEvt_ListOneOrMoreEventsAuthor (const struct ExaEvt_Event *Event)
{
/***** Event author (teacher) *****/
HTM_TD_Begin ("class=\"LT COLOR%u\"",Gbl.RowEvenOdd);
@ -609,7 +609,7 @@ static void ExaEvt_ListOneOrMoreEventsAuthor (const struct ExaEvt_Match *Event)
/*************** Put a column for exam event start and end times *************/
/*****************************************************************************/
static void ExaEvt_ListOneOrMoreEventsTimes (const struct ExaEvt_Match *Event,unsigned UniqueId)
static void ExaEvt_ListOneOrMoreEventsTimes (const struct ExaEvt_Event *Event,unsigned UniqueId)
{
Dat_StartEndTime_t StartEndTime;
char *Id;
@ -637,7 +637,7 @@ static void ExaEvt_ListOneOrMoreEventsTimes (const struct ExaEvt_Match *Event,un
/*************** Put a column for exam event title and grous *****************/
/*****************************************************************************/
static void ExaEvt_ListOneOrMoreEventsTitleGrps (const struct ExaEvt_Match *Event)
static void ExaEvt_ListOneOrMoreEventsTitleGrps (const struct ExaEvt_Event *Event)
{
extern const char *Txt_Play;
extern const char *Txt_Resume;
@ -666,7 +666,7 @@ static void ExaEvt_ListOneOrMoreEventsTitleGrps (const struct ExaEvt_Match *Even
/********** Get and write the names of the groups of an exam event ***********/
/*****************************************************************************/
static void ExaEvt_GetAndWriteNamesOfGrpsAssociatedToEvent (const struct ExaEvt_Match *Event)
static void ExaEvt_GetAndWriteNamesOfGrpsAssociatedToEvent (const struct ExaEvt_Event *Event)
{
extern const char *Txt_Group;
extern const char *Txt_Groups;
@ -742,7 +742,7 @@ bool ExaEvt_CheckIfMatchIsAssociatedToGrp (long EvtCod,long GrpCod)
/******************* Put a column for number of players **********************/
/*****************************************************************************/
static void ExaEvt_ListOneOrMoreEventsNumPlayers (const struct ExaEvt_Match *Event)
static void ExaEvt_ListOneOrMoreEventsNumPlayers (const struct ExaEvt_Event *Event)
{
/***** Number of players who have answered any question in the exam event ******/
HTM_TD_Begin ("class=\"DAT RT COLOR%u\"",Gbl.RowEvenOdd);
@ -754,7 +754,7 @@ static void ExaEvt_ListOneOrMoreEventsNumPlayers (const struct ExaEvt_Match *Eve
/******************** Put a column for exam event status *********************/
/*****************************************************************************/
static void ExaEvt_ListOneOrMoreEventsStatus (struct ExaEvt_Match *Event,unsigned NumQsts)
static void ExaEvt_ListOneOrMoreEventsStatus (struct ExaEvt_Event *Event,unsigned NumQsts)
{
extern const char *Txt_Play;
extern const char *Txt_Resume;
@ -787,7 +787,7 @@ static void ExaEvt_ListOneOrMoreEventsStatus (struct ExaEvt_Match *Event,unsigne
/*****************************************************************************/
static void ExaEvt_ListOneOrMoreEventsResult (struct Exa_Exams *Exams,
const struct ExaEvt_Match *Event)
const struct ExaEvt_Event *Event)
{
HTM_TD_Begin ("class=\"DAT CT COLOR%u\"",Gbl.RowEvenOdd);
@ -810,7 +810,7 @@ static void ExaEvt_ListOneOrMoreEventsResult (struct Exa_Exams *Exams,
}
static void ExaEvt_ListOneOrMoreEventsResultStd (struct Exa_Exams *Exams,
const struct ExaEvt_Match *Event)
const struct ExaEvt_Event *Event)
{
extern const char *Txt_Results;
@ -831,7 +831,7 @@ static void ExaEvt_ListOneOrMoreEventsResultStd (struct Exa_Exams *Exams,
}
static void ExaEvt_ListOneOrMoreEventsResultTch (struct Exa_Exams *Exams,
const struct ExaEvt_Match *Event)
const struct ExaEvt_Event *Event)
{
extern const char *Txt_Visible_results;
extern const char *Txt_Hidden_results;
@ -873,7 +873,7 @@ void ExaEvt_ToggleVisibilResultsEvtUsr (void)
{
struct Exa_Exams Exams;
struct Exa_Exam Exam;
struct ExaEvt_Match Event;
struct ExaEvt_Event Event;
/***** Reset games *****/
Gam_ResetGames (&Exams);
@ -906,7 +906,7 @@ void ExaEvt_ToggleVisibilResultsEvtUsr (void)
/*****************************************************************************/
static void ExaEvt_GetEventDataFromRow (MYSQL_RES *mysql_res,
struct ExaEvt_Match *Event)
struct ExaEvt_Event *Event)
{
MYSQL_ROW row;
Dat_StartEndTime_t StartEndTime;
@ -1015,7 +1015,7 @@ void ExaEvt_RequestRemoveEvent (void)
extern const char *Txt_Remove_event;
struct Exa_Exams Exams;
struct Exa_Exam Exam;
struct ExaEvt_Match Event;
struct ExaEvt_Event Event;
/***** Reset games *****/
Gam_ResetGames (&Exams);
@ -1047,7 +1047,7 @@ void ExaEvt_RemoveEvent (void)
extern const char *Txt_Match_X_removed;
struct Exa_Exams Exams;
struct Exa_Exam Exam;
struct ExaEvt_Match Event;
struct ExaEvt_Event Event;
/***** Reset games *****/
Gam_ResetGames (&Exams);
@ -1249,7 +1249,7 @@ static void ExaEvt_PutParamEvtCod (long EvtCod)
void ExaEvt_GetAndCheckParameters (struct Exa_Exams *Exams,
struct Exa_Exam *Exam,
struct ExaEvt_Match *Event)
struct ExaEvt_Event *Event)
{
/***** Get parameters *****/
/* Get parameters of exam */
@ -1292,7 +1292,7 @@ static void ExaEvt_PutFormNewMatch (const struct Exa_Exam *Exam)
extern const char *Txt_Play;
/***** Start section for a new exam event *****/
HTM_SECTION_Begin (ExaEvt_NEW_MATCH_SECTION_ID);
HTM_SECTION_Begin (ExaEvt_NEW_EVENT_SECTION_ID);
/***** Begin form *****/
Frm_StartForm (ActNewExaEvt);
@ -1432,7 +1432,7 @@ void ExaEvt_CreateNewEventTch (void)
void ExaEvt_ResumeEvent (void)
{
struct ExaEvt_Match Event;
struct ExaEvt_Event Event;
/***** Remove old players.
This function must be called by a teacher
@ -1589,7 +1589,7 @@ static void ExaEvt_ReorderAnswer (long EvtCod,unsigned QstInd,
long LongNum;
unsigned AnsInd;
char StrOneAnswer[Cns_MAX_DECIMAL_DIGITS_UINT + 1];
char StrAnswersOneQst[TstExa_MAX_BYTES_ANSWERS_ONE_QST + 1];
char StrAnswersOneQst[TstRes_MAX_BYTES_ANSWERS_ONE_QST + 1];
/***** Initialize list of answers to empty string *****/
StrAnswersOneQst[0] = '\0';
@ -1622,9 +1622,9 @@ static void ExaEvt_ReorderAnswer (long EvtCod,unsigned QstInd,
/* Concatenate answer index to list of answers */
if (NumAns)
Str_Concat (StrAnswersOneQst,",",
TstExa_MAX_BYTES_ANSWERS_ONE_QST);
TstRes_MAX_BYTES_ANSWERS_ONE_QST);
Str_Concat (StrAnswersOneQst,StrOneAnswer,
TstExa_MAX_BYTES_ANSWERS_ONE_QST);
TstRes_MAX_BYTES_ANSWERS_ONE_QST);
}
/***** Free structure that stores the query result *****/
@ -1648,7 +1648,7 @@ void ExaEvt_GetIndexes (long EvtCod,unsigned QstInd,
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
char StrIndexesOneQst[TstExa_MAX_BYTES_INDEXES_ONE_QST + 1];
char StrIndexesOneQst[TstRes_MAX_BYTES_INDEXES_ONE_QST + 1];
/***** Get indexes for a question from database *****/
if (!DB_QuerySELECT (&mysql_res,"can not get data of a question",
@ -1661,14 +1661,14 @@ void ExaEvt_GetIndexes (long EvtCod,unsigned QstInd,
/* Get indexes (row[0]) */
Str_Copy (StrIndexesOneQst,row[0],
TstExa_MAX_BYTES_INDEXES_ONE_QST);
TstRes_MAX_BYTES_INDEXES_ONE_QST);
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
/***** Get indexes from string *****/
Par_ReplaceCommaBySeparatorMultiple (StrIndexesOneQst);
TstExa_GetIndexesFromStr (StrIndexesOneQst,Indexes);
TstRes_GetIndexesFromStr (StrIndexesOneQst,Indexes);
}
/*****************************************************************************/
@ -1725,7 +1725,7 @@ void ExaEvt_RemoveGroupsOfType (long GrpTypCod)
/************** Insert/update an exam exam event being played ****************/
/*****************************************************************************/
static void ExaEvt_UpdateEventStatusInDB (const struct ExaEvt_Match *Event)
static void ExaEvt_UpdateEventStatusInDB (const struct ExaEvt_Event *Event)
{
char *EvtSubQuery;
@ -1775,7 +1775,7 @@ static void ExaEvt_UpdateEventStatusInDB (const struct ExaEvt_Match *Event)
/********** Update elapsed time in current question (by a teacher) ***********/
/*****************************************************************************/
static void ExaEvt_UpdateElapsedTimeInQuestion (const struct ExaEvt_Match *Event)
static void ExaEvt_UpdateElapsedTimeInQuestion (const struct ExaEvt_Event *Event)
{
/***** Update elapsed time in current question in database *****/
if (Event->Status.Playing && // Event is being played
@ -1795,7 +1795,7 @@ static void ExaEvt_UpdateElapsedTimeInQuestion (const struct ExaEvt_Match *Event
/**************** Get elapsed time in an exam event question *****************/
/*****************************************************************************/
static void ExaEvt_GetElapsedTimeInQuestion (const struct ExaEvt_Match *Event,
static void ExaEvt_GetElapsedTimeInQuestion (const struct ExaEvt_Event *Event,
struct Time *Time)
{
MYSQL_RES *mysql_res;
@ -1819,7 +1819,7 @@ static void ExaEvt_GetElapsedTimeInQuestion (const struct ExaEvt_Match *Event,
/******************** Get elapsed time in an exam event **********************/
/*****************************************************************************/
static void ExaEvt_GetElapsedTimeInMatch (const struct ExaEvt_Match *Event,
static void ExaEvt_GetElapsedTimeInMatch (const struct ExaEvt_Event *Event,
struct Time *Time)
{
MYSQL_RES *mysql_res;
@ -1872,7 +1872,7 @@ static void ExaEvt_GetElapsedTime (unsigned NumRows,MYSQL_RES *mysql_res,
void ExaEvt_PlayPauseEvent (void)
{
struct ExaEvt_Match Event;
struct ExaEvt_Event Event;
/***** Remove old players.
This function must be called by a teacher
@ -1906,7 +1906,7 @@ void ExaEvt_PlayPauseEvent (void)
void ExaEvt_ChangeNumColsEvt (void)
{
struct ExaEvt_Match Event;
struct ExaEvt_Event Event;
/***** Remove old players.
This function must be called by a teacher
@ -1939,7 +1939,7 @@ void ExaEvt_ChangeNumColsEvt (void)
void ExaEvt_ToggleVisibilResultsEvtQst (void)
{
struct ExaEvt_Match Event;
struct ExaEvt_Event Event;
/***** Remove old players.
This function must be called by a teacher
@ -1971,7 +1971,7 @@ void ExaEvt_ToggleVisibilResultsEvtQst (void)
void ExaEvt_BackEvent (void)
{
struct ExaEvt_Match Event;
struct ExaEvt_Event Event;
/***** Remove old players.
This function must be called by a teacher
@ -2000,7 +2000,7 @@ void ExaEvt_BackEvent (void)
void ExaEvt_ForwardEvent (void)
{
struct ExaEvt_Match Event;
struct ExaEvt_Event Event;
/***** Remove old players.
This function must be called by a teacher
@ -2027,7 +2027,7 @@ void ExaEvt_ForwardEvent (void)
/************ Set exam event status to previous (backward) status ************/
/*****************************************************************************/
static void ExaEvt_SetMatchStatusToPrev (struct ExaEvt_Match *Event)
static void ExaEvt_SetMatchStatusToPrev (struct ExaEvt_Event *Event)
{
/***** What to show *****/
switch (Event->Status.Showing)
@ -2053,7 +2053,7 @@ static void ExaEvt_SetMatchStatusToPrev (struct ExaEvt_Match *Event)
/**************** Set exam event status to previous question *****************/
/*****************************************************************************/
static void ExaEvt_SetMatchStatusToPrevQst (struct ExaEvt_Match *Event)
static void ExaEvt_SetMatchStatusToPrevQst (struct ExaEvt_Event *Event)
{
/***** Get index of the previous question *****/
Event->Status.QstInd = Gam_GetPrevQuestionIndexInGame (Event->ExaCod,
@ -2073,7 +2073,7 @@ static void ExaEvt_SetMatchStatusToPrevQst (struct ExaEvt_Match *Event)
/********************** Set exam event status to start ***********************/
/*****************************************************************************/
static void ExaEvt_SetMatchStatusToStart (struct ExaEvt_Match *Event)
static void ExaEvt_SetMatchStatusToStart (struct ExaEvt_Event *Event)
{
Event->Status.QstInd = 0; // Before first question
Event->Status.QstCod = -1L;
@ -2085,7 +2085,7 @@ static void ExaEvt_SetMatchStatusToStart (struct ExaEvt_Match *Event)
/************** Set exam event status to next (forward) status ***************/
/*****************************************************************************/
static void ExaEvt_SetMatchStatusToNext (struct ExaEvt_Match *Event)
static void ExaEvt_SetMatchStatusToNext (struct ExaEvt_Event *Event)
{
/***** What to show *****/
switch (Event->Status.Showing)
@ -2116,7 +2116,7 @@ static void ExaEvt_SetMatchStatusToNext (struct ExaEvt_Match *Event)
/**************** Set exam event status to next question *********************/
/*****************************************************************************/
static void ExaEvt_SetMatchStatusToNextQst (struct ExaEvt_Match *Event)
static void ExaEvt_SetMatchStatusToNextQst (struct ExaEvt_Event *Event)
{
/***** Get index of the next question *****/
Event->Status.QstInd = Gam_GetNextQuestionIndexInGame (Event->ExaCod,
@ -2137,7 +2137,7 @@ static void ExaEvt_SetMatchStatusToNextQst (struct ExaEvt_Match *Event)
/********************** Set exam event status to end *************************/
/*****************************************************************************/
static void ExaEvt_SetMatchStatusToEnd (struct ExaEvt_Match *Event)
static void ExaEvt_SetMatchStatusToEnd (struct ExaEvt_Event *Event)
{
Event->Status.QstInd = ExaEvt_AFTER_LAST_QUESTION; // After last question
Event->Status.QstCod = -1L;
@ -2149,7 +2149,7 @@ static void ExaEvt_SetMatchStatusToEnd (struct ExaEvt_Match *Event)
/***** Show current exam event status (number, question, answers, button) ****/
/*****************************************************************************/
static void ExaEvt_ShowMatchStatusForTch (struct ExaEvt_Match *Event)
static void ExaEvt_ShowMatchStatusForTch (struct ExaEvt_Event *Event)
{
/***** Left column *****/
ExaEvt_ShowLeftColumnTch (Event);
@ -2162,7 +2162,7 @@ static void ExaEvt_ShowMatchStatusForTch (struct ExaEvt_Match *Event)
/************ Show current question being played for a student ***************/
/*****************************************************************************/
static void ExaEvt_ShowMatchStatusForStd (struct ExaEvt_Match *Event,ExaEvt_Update_t Update)
static void ExaEvt_ShowMatchStatusForStd (struct ExaEvt_Event *Event,ExaEvt_Update_t Update)
{
bool ICanPlayThisMatchBasedOnGrps;
struct ExaEvt_UsrAnswer UsrAnswer;
@ -2226,7 +2226,7 @@ unsigned ExaEvt_GetNumUnfinishedEventsInExam (long ExaCod)
/********* Check if I belong to any of the groups of an exam event ***********/
/*****************************************************************************/
bool ExaEvt_CheckIfICanPlayThisEventBasedOnGrps (const struct ExaEvt_Match *Event)
bool ExaEvt_CheckIfICanPlayThisEventBasedOnGrps (const struct ExaEvt_Event *Event)
{
switch (Gbl.Usrs.Me.Role.Logged)
{
@ -2262,7 +2262,7 @@ bool ExaEvt_CheckIfICanPlayThisEventBasedOnGrps (const struct ExaEvt_Match *Even
/******** Show left column when playing an exam event (as a teacher) *********/
/*****************************************************************************/
static void ExaEvt_ShowLeftColumnTch (struct ExaEvt_Match *Event)
static void ExaEvt_ShowLeftColumnTch (struct ExaEvt_Event *Event)
{
/***** Start left container *****/
HTM_DIV_Begin ("class=\"EXA_LEFT_TCH\"");
@ -2294,7 +2294,7 @@ static void ExaEvt_ShowLeftColumnTch (struct ExaEvt_Match *Event)
/***************** Show left refreshable part for teachers *******************/
/*****************************************************************************/
static void ExaEvt_ShowRefreshablePartTch (struct ExaEvt_Match *Event)
static void ExaEvt_ShowRefreshablePartTch (struct ExaEvt_Event *Event)
{
/***** Write elapsed time in exam event *****/
ExaEvt_WriteElapsedTimeInEvt (Event);
@ -2316,7 +2316,7 @@ static void ExaEvt_ShowRefreshablePartTch (struct ExaEvt_Match *Event)
/****************** Write elapsed time in current exam event *****************/
/*****************************************************************************/
static void ExaEvt_WriteElapsedTimeInEvt (struct ExaEvt_Match *Event)
static void ExaEvt_WriteElapsedTimeInEvt (struct ExaEvt_Event *Event)
{
struct Time Time;
@ -2335,7 +2335,7 @@ static void ExaEvt_WriteElapsedTimeInEvt (struct ExaEvt_Match *Event)
/****************** Write elapsed time in current question *******************/
/*****************************************************************************/
static void ExaEvt_WriteElapsedTimeInQst (struct ExaEvt_Match *Event)
static void ExaEvt_WriteElapsedTimeInQst (struct ExaEvt_Event *Event)
{
struct Time Time;
@ -2360,7 +2360,7 @@ static void ExaEvt_WriteElapsedTimeInQst (struct ExaEvt_Match *Event)
/************ Write number of responders to an exam event question ***********/
/*****************************************************************************/
static void ExaEvt_WriteNumRespondersQst (struct ExaEvt_Match *Event)
static void ExaEvt_WriteNumRespondersQst (struct ExaEvt_Event *Event)
{
extern const char *Txt_MATCH_respond;
@ -2402,7 +2402,7 @@ static void ExaEvt_WriteNumRespondersQst (struct ExaEvt_Match *Event)
/*************** Write current countdown and hourglass icon ******************/
/*****************************************************************************/
static void ExaEvt_PutCountdownAndHourglassIcon (struct ExaEvt_Match *Event)
static void ExaEvt_PutCountdownAndHourglassIcon (struct ExaEvt_Event *Event)
{
extern const char *Txt_Countdown;
const char *Class;
@ -2459,7 +2459,7 @@ static void ExaEvt_PutCountdownAndHourglassIcon (struct ExaEvt_Match *Event)
/******************** Put all forms to start countdowns **********************/
/*****************************************************************************/
static void ExaEvt_PutFormsCountdown (struct ExaEvt_Match *Event)
static void ExaEvt_PutFormsCountdown (struct ExaEvt_Event *Event)
{
/***** Start container *****/
HTM_DIV_Begin ("class=\"EXA_SHOW_HOURGLASS\"");
@ -2478,7 +2478,7 @@ static void ExaEvt_PutFormsCountdown (struct ExaEvt_Match *Event)
/****** Put a form to start a countdown with a given number of seconds *******/
/*****************************************************************************/
static void ExaEvt_PutFormCountdown (struct ExaEvt_Match *Event,long Seconds,const char *Color)
static void ExaEvt_PutFormCountdown (struct ExaEvt_Event *Event,long Seconds,const char *Color)
{
extern const char *Txt_Countdown;
char *OnSubmit;
@ -2536,7 +2536,7 @@ static void ExaEvt_PutFormCountdown (struct ExaEvt_Match *Event,long Seconds,con
/******* Show right column when playing an exam event (as a teacher) *********/
/*****************************************************************************/
static void ExaEvt_ShowRightColumnTch (const struct ExaEvt_Match *Event)
static void ExaEvt_ShowRightColumnTch (const struct ExaEvt_Event *Event)
{
/***** Start right container *****/
HTM_DIV_Begin ("class=\"EXA_RIGHT_TCH\"");
@ -2558,7 +2558,7 @@ static void ExaEvt_ShowRightColumnTch (const struct ExaEvt_Match *Event)
/******** Show left column when playing an exam event (as a student) *********/
/*****************************************************************************/
static void ExaEvt_ShowLeftColumnStd (const struct ExaEvt_Match *Event,
static void ExaEvt_ShowLeftColumnStd (const struct ExaEvt_Event *Event,
const struct ExaEvt_UsrAnswer *UsrAnswer)
{
bool Answered = UsrAnswer->NumOpt >= 0;
@ -2598,7 +2598,7 @@ static void ExaEvt_ShowLeftColumnStd (const struct ExaEvt_Match *Event,
/******* Show right column when playing an exam event (as a student) *********/
/*****************************************************************************/
static void ExaEvt_ShowRightColumnStd (struct ExaEvt_Match *Event,
static void ExaEvt_ShowRightColumnStd (struct ExaEvt_Event *Event,
const struct ExaEvt_UsrAnswer *UsrAnswer,
ExaEvt_Update_t Update)
{
@ -2644,7 +2644,7 @@ static void ExaEvt_ShowRightColumnStd (struct ExaEvt_Match *Event,
/********************* Show number of question in exam ***********************/
/*****************************************************************************/
static void ExaEvt_ShowNumQstInEvt (const struct ExaEvt_Match *Event)
static void ExaEvt_ShowNumQstInEvt (const struct ExaEvt_Event *Event)
{
extern const char *Txt_MATCH_Start;
extern const char *Txt_MATCH_End;
@ -2670,7 +2670,7 @@ static void ExaEvt_ShowNumQstInEvt (const struct ExaEvt_Match *Event)
/******************* Put buttons to control an exam event ********************/
/*****************************************************************************/
static void ExaEvt_PutMatchControlButtons (const struct ExaEvt_Match *Event)
static void ExaEvt_PutMatchControlButtons (const struct ExaEvt_Event *Event)
{
extern const char *Txt_Go_back;
extern const char *Txt_Go_forward;
@ -2743,7 +2743,7 @@ static void ExaEvt_PutMatchControlButtons (const struct ExaEvt_Match *Event)
/** Show form to choice whether to show answers in one column or two columns */
/*****************************************************************************/
static void ExaEvt_ShowFormColumns (const struct ExaEvt_Match *Event)
static void ExaEvt_ShowFormColumns (const struct ExaEvt_Event *Event)
{
extern const char *Txt_column;
extern const char *Txt_columns;
@ -2805,7 +2805,7 @@ static void ExaEvt_PutParamNumCols (unsigned NumCols) // Number of columns
/***************** Put checkbox to select if show results ********************/
/*****************************************************************************/
static void ExaEvt_PutCheckboxResult (const struct ExaEvt_Match *Event)
static void ExaEvt_PutCheckboxResult (const struct ExaEvt_Event *Event)
{
extern const char *Txt_View_results;
@ -2835,7 +2835,7 @@ static void ExaEvt_PutCheckboxResult (const struct ExaEvt_Match *Event)
/***************** Put checkbox to select if show results ********************/
/*****************************************************************************/
static void ExaEvt_PutIfAnswered (const struct ExaEvt_Match *Event,bool Answered)
static void ExaEvt_PutIfAnswered (const struct ExaEvt_Event *Event,bool Answered)
{
extern const char *Txt_View_my_answer;
extern const char *Txt_MATCH_QUESTION_Answered;
@ -2883,7 +2883,7 @@ static void ExaEvt_PutIfAnswered (const struct ExaEvt_Match *Event,bool Answered
/***************** Put checkbox to select if show results ********************/
/*****************************************************************************/
static void ExaEvt_PutIconToRemoveMyAnswer (const struct ExaEvt_Match *Event)
static void ExaEvt_PutIconToRemoveMyAnswer (const struct ExaEvt_Event *Event)
{
extern const char *Txt_Delete_my_answer;
@ -2913,7 +2913,7 @@ static void ExaEvt_PutIconToRemoveMyAnswer (const struct ExaEvt_Match *Event)
/***************************** Show exam event title ******************************/
/*****************************************************************************/
static void ExaEvt_ShowEventTitleTch (const struct ExaEvt_Match *Event)
static void ExaEvt_ShowEventTitleTch (const struct ExaEvt_Event *Event)
{
/***** Event title *****/
HTM_DIV_Begin ("class=\"EXA_TOP LT\"");
@ -2921,7 +2921,7 @@ static void ExaEvt_ShowEventTitleTch (const struct ExaEvt_Match *Event)
HTM_DIV_End ();
}
static void ExaEvt_ShowEventTitleStd (const struct ExaEvt_Match *Event)
static void ExaEvt_ShowEventTitleStd (const struct ExaEvt_Event *Event)
{
/***** Event title *****/
HTM_DIV_Begin ("class=\"EXA_TOP CT\"");
@ -2933,7 +2933,7 @@ static void ExaEvt_ShowEventTitleStd (const struct ExaEvt_Match *Event)
/***** Show question and its answers when playing an exam event (as a teacher) *****/
/*****************************************************************************/
static void ExaEvt_ShowQuestionAndAnswersTch (const struct ExaEvt_Match *Event)
static void ExaEvt_ShowQuestionAndAnswersTch (const struct ExaEvt_Event *Event)
{
extern const char *Txt_MATCH_Paused;
extern const char *Txt_Question_removed;
@ -3012,7 +3012,7 @@ static void ExaEvt_ShowQuestionAndAnswersTch (const struct ExaEvt_Match *Event)
/************* Write answers of a question when seeing an exam event ***************/
/*****************************************************************************/
static void ExaEvt_WriteAnswersEventResult (const struct ExaEvt_Match *Event,
static void ExaEvt_WriteAnswersEventResult (const struct ExaEvt_Event *Event,
const struct Tst_Question *Question,
const char *Class,bool ShowResult)
{
@ -3029,7 +3029,7 @@ static void ExaEvt_WriteAnswersEventResult (const struct ExaEvt_Match *Event,
/******** Write single or multiple choice answer when seeing an exam event *********/
/*****************************************************************************/
void ExaEvt_WriteChoiceAnsViewEvent (const struct ExaEvt_Match *Event,
void ExaEvt_WriteChoiceAnsViewEvent (const struct ExaEvt_Event *Event,
const struct Tst_Question *Question,
const char *Class,bool ShowResult)
{
@ -3121,7 +3121,7 @@ void ExaEvt_WriteChoiceAnsViewEvent (const struct ExaEvt_Match *Event,
/*****************************************************************************/
// Return true on valid question, false on invalid question
static bool ExaEvt_ShowQuestionAndAnswersStd (const struct ExaEvt_Match *Event,
static bool ExaEvt_ShowQuestionAndAnswersStd (const struct ExaEvt_Event *Event,
const struct ExaEvt_UsrAnswer *UsrAnswer,
ExaEvt_Update_t Update)
{
@ -3191,7 +3191,7 @@ static bool ExaEvt_ShowQuestionAndAnswersStd (const struct ExaEvt_Match *Event,
#define ExaEvt_NUM_ROWS_SCORE 50
static void ExaEvt_ShowEventScore (const struct ExaEvt_Match *Event)
static void ExaEvt_ShowEventScore (const struct ExaEvt_Event *Event)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -3568,7 +3568,7 @@ static bool ExaEvt_GetIfEventIsBeingPlayed (long EvtCod)
/*************************** Get number of players ***************************/
/*****************************************************************************/
static void ExaEvt_GetNumPlayers (struct ExaEvt_Match *Event)
static void ExaEvt_GetNumPlayers (struct ExaEvt_Event *Event)
{
/***** Get number of players who are playing an exam event *****/
Event->Status.NumPlayers =
@ -3583,7 +3583,7 @@ static void ExaEvt_GetNumPlayers (struct ExaEvt_Match *Event)
/*****************************************************************************/
// Return true on success
bool ExaEvt_RegisterMeAsPlayerInEvent (struct ExaEvt_Match *Event)
bool ExaEvt_RegisterMeAsPlayerInEvent (struct ExaEvt_Event *Event)
{
/***** Trivial check: exam event code must be > 0 *****/
if (Event->EvtCod <= 0)
@ -3629,7 +3629,7 @@ void ExaEvt_GetEventBeingPlayed (void)
void ExaEvt_JoinEventAsStd (void)
{
struct ExaEvt_Match Event;
struct ExaEvt_Event Event;
/***** Get data of the exam event from database *****/
Event.EvtCod = ExaEvt_GetEvtCodBeingPlayed ();
@ -3647,7 +3647,7 @@ void ExaEvt_JoinEventAsStd (void)
void ExaEvt_RemoveMyQuestionAnswer (void)
{
struct ExaEvt_Match Event;
struct ExaEvt_Event Event;
unsigned QstInd;
/***** Get data of the exam event from database *****/
@ -3677,7 +3677,7 @@ void ExaEvt_RemoveMyQuestionAnswer (void)
void ExaEvt_StartCountdown (void)
{
struct ExaEvt_Match Event;
struct ExaEvt_Event Event;
long NewCountdown;
/***** Get countdown parameter ****/
@ -3708,7 +3708,7 @@ void ExaEvt_StartCountdown (void)
void ExaEvt_RefreshEventTch (void)
{
struct ExaEvt_Match Event;
struct ExaEvt_Event Event;
enum {REFRESH_LEFT,REFRESH_ALL} WhatToRefresh;
if (!Gbl.Session.IsOpen) // If session has been closed, do not write anything
@ -3766,7 +3766,7 @@ void ExaEvt_RefreshEventTch (void)
void ExaEvt_RefreshEventStd (void)
{
struct ExaEvt_Match Event;
struct ExaEvt_Event Event;
if (!Gbl.Session.IsOpen) // If session has been closed, do not write anything
return;
@ -3826,12 +3826,12 @@ void ExaEvt_GetQstAnsFromDB (long EvtCod,long UsrCod,unsigned QstInd,
void ExaEvt_ReceiveQuestionAnswer (void)
{
struct ExaEvt_Match Event;
struct ExaEvt_Event Event;
unsigned QstInd;
unsigned Indexes[Tst_MAX_OPTIONS_PER_QUESTION];
struct ExaEvt_UsrAnswer PreviousUsrAnswer;
struct ExaEvt_UsrAnswer UsrAnswer;
struct TstExa_Exam Result;
struct TstRes_Result Result;
/***** Get data of the exam event from database *****/
Event.EvtCod = ExaEvt_GetEvtCodBeingPlayed ();
@ -3937,7 +3937,7 @@ void ExaEvt_ReceiveQuestionAnswer (void)
/********************* Remove answer to exam event question ***********************/
/*****************************************************************************/
static void ExaEvt_RemoveMyAnswerToEventQuestion (const struct ExaEvt_Match *Event)
static void ExaEvt_RemoveMyAnswerToEventQuestion (const struct ExaEvt_Event *Event)
{
DB_QueryDELETE ("can not remove your answer to the exam event question",
"DELETE FROM exa_answers"
@ -3949,7 +3949,7 @@ static void ExaEvt_RemoveMyAnswerToEventQuestion (const struct ExaEvt_Match *Eve
/******************** Compute exam event score for a student **********************/
/*****************************************************************************/
static void ExaEvt_ComputeScore (struct TstExa_Exam *Result)
static void ExaEvt_ComputeScore (struct TstRes_Result *Result)
{
unsigned NumQst;
struct Tst_Question Question;
@ -3964,7 +3964,7 @@ static void ExaEvt_ComputeScore (struct TstExa_Exam *Result)
Question.Answer.Type = Tst_ANS_UNIQUE_CHOICE;
/***** Compute score for this answer ******/
TstExa_ComputeChoiceAnsScore (Result,NumQst,&Question);
TstRes_ComputeChoiceAnsScore (Result,NumQst,&Question);
/***** Update total score *****/
Result->Score += Result->Questions[NumQst].Score;

View File

@ -34,7 +34,7 @@
/************************** Public types and constants ***********************/
/*****************************************************************************/
#define ExaEvt_NEW_MATCH_SECTION_ID "new_match"
#define ExaEvt_NEW_EVENT_SECTION_ID "new_event"
#define ExaEvt_AFTER_LAST_QUESTION ((unsigned)((1UL << 31) - 1)) // 2^31 - 1, don't change this number because it is used in database to indicate that a event is finished
@ -49,7 +49,7 @@ typedef enum
} ExaEvt_Showing_t;
#define ExaEvt_SHOWING_DEFAULT ExaEvt_START
struct ExaEvt_Match
struct ExaEvt_Event
{
long EvtCod;
long ExaCod;
@ -88,7 +88,7 @@ long ExaEvt_GetEvtCodBeingPlayed (void);
void ExaEvt_ListEvents (struct Exa_Exams *Exams,
struct Exa_Exam *Exam,
bool PutFormNewEvent);
void ExaEvt_GetDataOfEventByCod (struct ExaEvt_Match *Event);
void ExaEvt_GetDataOfEventByCod (struct ExaEvt_Event *Event);
void ExaEvt_ToggleVisibilResultsEvtUsr (void);
@ -102,7 +102,7 @@ void ExaEvt_RemoveUsrFromEventTablesInCrs (long UsrCod,long CrsCod);
void ExaEvt_PutParamsEdit (void *Exams);
void ExaEvt_GetAndCheckParameters (struct Exa_Exams *Exams,
struct Exa_Exam *Exam,
struct ExaEvt_Match *Event);
struct ExaEvt_Event *Event);
long ExaEvt_GetParamEvtCod (void);
void ExaEvt_CreateNewEventTch (void);
@ -122,13 +122,13 @@ void ExaEvt_ForwardEvent (void);
unsigned ExaEvt_GetNumEventsInExam (long ExaCod);
unsigned ExaEvt_GetNumUnfinishedEventsInExam (long ExaCod);
bool ExaEvt_CheckIfICanPlayThisEventBasedOnGrps (const struct ExaEvt_Match *Event);
bool ExaEvt_CheckIfICanPlayThisEventBasedOnGrps (const struct ExaEvt_Event *Event);
void ExaEvt_WriteChoiceAnsViewEvent (const struct ExaEvt_Match *Event,
void ExaEvt_WriteChoiceAnsViewEvent (const struct ExaEvt_Event *Event,
const struct Tst_Question *Question,
const char *Class,bool ShowResult);
bool ExaEvt_RegisterMeAsPlayerInEvent (struct ExaEvt_Match *Event);
bool ExaEvt_RegisterMeAsPlayerInEvent (struct ExaEvt_Event *Event);
void ExaEvt_GetEventBeingPlayed (void);
void ExaEvt_JoinEventAsStd (void);

View File

@ -36,6 +36,7 @@
#include "swad_database.h"
#include "swad_date.h"
#include "swad_exam.h"
#include "swad_exam_event.h"
#include "swad_exam_result.h"
#include "swad_form.h"
#include "swad_global.h"
@ -74,15 +75,15 @@ extern struct Globals Gbl;
static void ExaRes_PutFormToSelUsrsToViewEvtResults (void *Exams);
static void ExaRes_ListMyEvtResultsInCrs (struct Exa_Exams *Exams);
static void ExaRes_ListMyEvtResultsInGam (struct Exa_Exams *Exams,long ExaCod);
static void ExaRes_ListMyEvtResultsInMch (struct Exa_Exams *Exams,long EvtCod);
static void ExaRes_ListMyEvtResultsInExa (struct Exa_Exams *Exams,long ExaCod);
static void ExaRes_ListMyEvtResultsInEvt (struct Exa_Exams *Exams,long EvtCod);
static void ExaRes_ShowAllEvtResultsInSelectedExams (void *Exams);
static void ExaRes_ListAllEvtResultsInSelectedExams (struct Exa_Exams *Exams);
static void ExaRes_ListAllEvtResultsInExa (struct Exa_Exams *Exams,long ExaCod);
static void ExaRes_ListAllEvtResultsInEvt (struct Exa_Exams *Exams,long EvtCod);
static void ExaRes_ShowResultsBegin (struct Exa_Exams *Exams,
const char *Title,bool ListGamesToSelect);
const char *Title,bool ListExamsToSelect);
static void ExaRes_ShowResultsEnd (void);
static void ExaRes_ListExamsToSelect (struct Exa_Exams *Exams);
@ -101,7 +102,7 @@ static void ExaRes_ShowEvtResultsSummaryRow (unsigned NumResults,
double TotalScoreOfAllResults,
double TotalGrade);
static void ExaRes_GetEventResultDataByEvtCod (long EvtCod,long UsrCod,
struct TstExa_Exam *Exam);
struct TstRes_Result *Result);
static bool ExaRes_CheckIfICanSeeEventResult (struct ExaEvt_Event *Event,long UsrCod);
static bool ExaRes_CheckIfICanViewScore (bool ICanViewResult,unsigned Visibility);
@ -115,21 +116,21 @@ void ExaRes_ShowMyExaResultsInCrs (void)
extern const char *Txt_Results;
struct Exa_Exams Exams;
/***** Reset games *****/
Gam_ResetGames (&Exams);
/***** Reset exams *****/
Exa_ResetExams (&Exams);
/***** Get list of games *****/
Gam_GetListGames (&Exams,Gam_ORDER_BY_TITLE);
Gam_GetListSelectedGamCods (&Exams);
/***** Get list of exams *****/
Exa_GetListExams (&Exams,Exa_ORDER_BY_TITLE);
Exa_GetListSelectedExaCods (&Exams);
/***** List my events results in the current course *****/
ExaRes_ShowResultsBegin (&Exams,Txt_Results,true); // List games to select
ExaRes_ShowResultsBegin (&Exams,Txt_Results,true); // List exams to select
ExaRes_ListMyEvtResultsInCrs (&Exams);
ExaRes_ShowResultsEnd ();
/***** Free list of games *****/
free (Exams.GamCodsSelected);
Gam_FreeListGames (&Exams);
/***** Free list of exams *****/
free (Exams.ExaCodsSelected);
Exa_FreeListExams (&Exams);
}
static void ExaRes_ListMyEvtResultsInCrs (struct Exa_Exams *Exams)
@ -156,32 +157,32 @@ void ExaRes_ShowMyExaResultsInExa (void)
struct Exa_Exams Exams;
struct Exa_Exam Exam;
/***** Reset games *****/
Gam_ResetGames (&Exams);
/***** Reset exams *****/
Exa_ResetExams (&Exams);
/***** Get parameters *****/
if ((Exam.ExaCod = Gam_GetParams (&Exams)) <= 0)
if ((Exam.ExaCod = Exa_GetParams (&Exams)) <= 0)
Lay_ShowErrorAndExit ("Code of exam is missing.");
Gam_GetDataOfGameByCod (&Exam);
Exa_GetDataOfExamByCod (&Exam);
/***** Exam begin *****/
Gam_ShowOnlyOneGameBegin (&Exams,&Exam,
Exa_ShowOnlyOneExamBegin (&Exams,&Exam,
false, // Do not list exam questions
false); // Do not put form to start new event
/***** List my events results in exam *****/
ExaRes_ShowResultsBegin (&Exams,
Str_BuildStringStr (Txt_Results_of_game_X,Exam.Title),
false); // Do not list games to select
false); // Do not list exams to select
Str_FreeString ();
ExaRes_ListMyEvtResultsInGam (&Exams,Exam.ExaCod);
ExaRes_ListMyEvtResultsInExa (&Exams,Exam.ExaCod);
ExaRes_ShowResultsEnd ();
/***** Exam end *****/
Gam_ShowOnlyOneGameEnd ();
Exa_ShowOnlyOneExamEnd ();
}
static void ExaRes_ListMyEvtResultsInGam (struct Exa_Exams *Exams,long ExaCod)
static void ExaRes_ListMyEvtResultsInExa (struct Exa_Exams *Exams,long ExaCod)
{
/***** Table header *****/
ExaRes_ShowHeaderEvtResults (Usr_ME);
@ -195,41 +196,41 @@ static void ExaRes_ListMyEvtResultsInGam (struct Exa_Exams *Exams,long ExaCod)
/***************** Show my events results in a given event ******************/
/*****************************************************************************/
void ExaRes_ShowMyExaResultsInEve (void)
void ExaRes_ShowMyExaResultsInEvt (void)
{
extern const char *Txt_Results_of_match_X;
struct Exa_Exams Exams;
struct Exa_Exam Exam;
struct ExaEvt_Event Event;
/***** Reset games *****/
Gam_ResetGames (&Exams);
/***** Reset exams *****/
Exa_ResetExams (&Exams);
/***** Get parameters *****/
if ((Exam.ExaCod = Gam_GetParams (&Exams)) <= 0)
if ((Exam.ExaCod = Exa_GetParams (&Exams)) <= 0)
Lay_ShowErrorAndExit ("Code of exam is missing.");
if ((Event.EvtCod = Mch_GetParamEvtCod ()) <= 0)
if ((Event.EvtCod = ExaEvt_GetParamEvtCod ()) <= 0)
Lay_ShowErrorAndExit ("Code of event is missing.");
Gam_GetDataOfGameByCod (&Exam);
Exa_GetDataOfExamByCod (&Exam);
ExaEvt_GetDataOfEventByCod (&Event);
/***** Exam begin *****/
Gam_ShowOnlyOneGameBegin (&Exams,&Exam,
Exa_ShowOnlyOneExamBegin (&Exams,&Exam,
false, // Do not list exam questions
false); // Do not put form to start new event
/***** List my events results in event *****/
ExaRes_ShowResultsBegin (&Exams,Str_BuildStringStr (Txt_Results_of_match_X,Event.Title),
false); // Do not list games to select
false); // Do not list exams to select
Str_FreeString ();
ExaRes_ListMyEvtResultsInMch (&Exams,Event.EvtCod);
ExaRes_ListMyEvtResultsInEvt (&Exams,Event.EvtCod);
ExaRes_ShowResultsEnd ();
/***** Exam end *****/
Gam_ShowOnlyOneGameEnd ();
Exa_ShowOnlyOneExamEnd ();
}
static void ExaRes_ListMyEvtResultsInMch (struct Exa_Exams *Exams,long EvtCod)
static void ExaRes_ListMyEvtResultsInEvt (struct Exa_Exams *Exams,long EvtCod)
{
/***** Table header *****/
ExaRes_ShowHeaderEvtResults (Usr_ME);
@ -247,8 +248,8 @@ void ExaRes_ShowAllExaResultsInCrs (void)
{
struct Exa_Exams Exams;
/***** Reset games *****/
Gam_ResetGames (&Exams);
/***** Reset exams *****/
Exa_ResetExams (&Exams);
/***** Get users and show their events results *****/
Usr_GetSelectedUsrsAndGoToAct (&Gbl.Usrs.Selected,
@ -267,20 +268,20 @@ static void ExaRes_ShowAllEvtResultsInSelectedExams (void *Exams)
if (!Exams)
return;
/***** Get list of games *****/
Gam_GetListGames ((struct Exa_Exams *) Exams,Gam_ORDER_BY_TITLE);
Gam_GetListSelectedGamCods ((struct Exa_Exams *) Exams);
/***** Get list of exams *****/
Exa_GetListExams ((struct Exa_Exams *) Exams,Exa_ORDER_BY_TITLE);
Exa_GetListSelectedExaCods ((struct Exa_Exams *) Exams);
/***** List the events results of the selected users *****/
ExaRes_ShowResultsBegin ((struct Exa_Exams *) Exams,
Txt_Results,
true); // List games to select
true); // List exams to select
ExaRes_ListAllEvtResultsInSelectedExams ((struct Exa_Exams *) Exams);
ExaRes_ShowResultsEnd ();
/***** Free list of games *****/
free (((struct Exa_Exams *) Exams)->GamCodsSelected);
Gam_FreeListGames ((struct Exa_Exams *) Exams);
/***** Free list of exams *****/
free (((struct Exa_Exams *) Exams)->ExaCodsSelected);
Exa_FreeListExams ((struct Exa_Exams *) Exams);
}
static void ExaRes_ListAllEvtResultsInSelectedExams (struct Exa_Exams *Exams)
@ -300,7 +301,7 @@ static void ExaRes_ListAllEvtResultsInSelectedExams (struct Exa_Exams *Exams)
Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64);
Usr_GetUsrCodFromEncryptedUsrCod (&Gbl.Usrs.Other.UsrDat);
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Usr_DONT_GET_PREFS))
if (Usr_CheckIfICanViewMch (&Gbl.Usrs.Other.UsrDat))
if (Usr_CheckIfICanViewTstExaMchResult (&Gbl.Usrs.Other.UsrDat))
{
/***** Show events results *****/
Gbl.Usrs.Other.UsrDat.Accepted = Usr_CheckIfUsrHasAcceptedInCurrentCrs (&Gbl.Usrs.Other.UsrDat);
@ -318,8 +319,8 @@ void ExaRes_SelUsrsToViewExaResults (void)
{
struct Exa_Exams Exams;
/***** Reset games *****/
Gam_ResetGames (&Exams);
/***** Reset exams *****/
Exa_ResetExams (&Exams);
/***** Put form to select users *****/
ExaRes_PutFormToSelUsrsToViewEvtResults (&Exams);
@ -327,16 +328,16 @@ void ExaRes_SelUsrsToViewExaResults (void)
static void ExaRes_PutFormToSelUsrsToViewEvtResults (void *Exams)
{
extern const char *Hlp_ASSESSMENT_Games_results;
extern const char *Hlp_ASSESSMENT_Exams_results;
extern const char *Txt_Results;
extern const char *Txt_View_matches_results;
if (Exams) // Not used
Usr_PutFormToSelectUsrsToGoToAct (&Gbl.Usrs.Selected,
ActSeeAllMchResCrs,
ActSeeAllExaEvtResCrs,
NULL,NULL,
Txt_Results,
Hlp_ASSESSMENT_Games_results,
Hlp_ASSESSMENT_Exams_results,
Txt_View_matches_results,
false); // Do not put form with date range
}
@ -351,29 +352,29 @@ void ExaRes_ShowAllExaResultsInExa (void)
struct Exa_Exams Exams;
struct Exa_Exam Exam;
/***** Reset games *****/
Gam_ResetGames (&Exams);
/***** Reset exams *****/
Exa_ResetExams (&Exams);
/***** Get parameters *****/
if ((Exam.ExaCod = Gam_GetParams (&Exams)) <= 0)
if ((Exam.ExaCod = Exa_GetParams (&Exams)) <= 0)
Lay_ShowErrorAndExit ("Code of exam is missing.");
Gam_GetDataOfGameByCod (&Exam);
Exa_GetDataOfExamByCod (&Exam);
/***** Exam begin *****/
Gam_ShowOnlyOneGameBegin (&Exams,&Exam,
Exa_ShowOnlyOneExamBegin (&Exams,&Exam,
false, // Do not list exam questions
false); // Do not put form to start new event
/***** List events results in exam *****/
ExaRes_ShowResultsBegin (&Exams,
Str_BuildStringStr (Txt_Results_of_game_X,Exam.Title),
false); // Do not list games to select
false); // Do not list exams to select
Str_FreeString ();
ExaRes_ListAllEvtResultsInExa (&Exams,Exam.ExaCod);
ExaRes_ShowResultsEnd ();
/***** Exam end *****/
Gam_ShowOnlyOneGameEnd ();
Exa_ShowOnlyOneExamEnd ();
}
static void ExaRes_ListAllEvtResultsInExa (struct Exa_Exams *Exams,long ExaCod)
@ -414,7 +415,7 @@ static void ExaRes_ListAllEvtResultsInExa (struct Exa_Exams *Exams,long ExaCod)
/* Get event code (row[0]) */
if ((Gbl.Usrs.Other.UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[0])) > 0)
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Usr_DONT_GET_PREFS))
if (Usr_CheckIfICanViewMch (&Gbl.Usrs.Other.UsrDat))
if (Usr_CheckIfICanViewTstExaMchResult (&Gbl.Usrs.Other.UsrDat))
{
/***** Show events results *****/
Gbl.Usrs.Other.UsrDat.Accepted = Usr_CheckIfUsrHasAcceptedInCurrentCrs (&Gbl.Usrs.Other.UsrDat);
@ -431,39 +432,39 @@ static void ExaRes_ListAllEvtResultsInExa (struct Exa_Exams *Exams,long ExaCod)
/** Show events results of a event for the users who answered in that event */
/*****************************************************************************/
void ExaRes_ShowAllExaResultsInEve (void)
void ExaRes_ShowAllExaResultsInEvt (void)
{
extern const char *Txt_Results_of_match_X;
struct Exa_Exams Exams;
struct Exa_Exam Exam;
struct ExaEvt_Event Event;
/***** Reset games *****/
Gam_ResetGames (&Exams);
/***** Reset exams *****/
Exa_ResetExams (&Exams);
/***** Get parameters *****/
if ((Exam.ExaCod = Gam_GetParams (&Exams)) <= 0)
if ((Exam.ExaCod = Exa_GetParams (&Exams)) <= 0)
Lay_ShowErrorAndExit ("Code of exam is missing.");
if ((Event.EvtCod = Mch_GetParamEvtCod ()) <= 0)
if ((Event.EvtCod = ExaEvt_GetParamEvtCod ()) <= 0)
Lay_ShowErrorAndExit ("Code of event is missing.");
Gam_GetDataOfGameByCod (&Exam);
Exa_GetDataOfExamByCod (&Exam);
ExaEvt_GetDataOfEventByCod (&Event);
/***** Exam begin *****/
Gam_ShowOnlyOneGameBegin (&Exams,&Exam,
Exa_ShowOnlyOneExamBegin (&Exams,&Exam,
false, // Do not list exam questions
false); // Do not put form to start new event
/***** List events results in event *****/
ExaRes_ShowResultsBegin (&Exams,
Str_BuildStringStr (Txt_Results_of_match_X,Event.Title),
false); // Do not list games to select
false); // Do not list exams to select
Str_FreeString ();
ExaRes_ListAllEvtResultsInEvt (&Exams,Event.EvtCod);
ExaRes_ShowResultsEnd ();
/***** Exam end *****/
Gam_ShowOnlyOneGameEnd ();
Exa_ShowOnlyOneExamEnd ();
}
static void ExaRes_ListAllEvtResultsInEvt (struct Exa_Exams *Exams,long EvtCod)
@ -504,7 +505,7 @@ static void ExaRes_ListAllEvtResultsInEvt (struct Exa_Exams *Exams,long EvtCod)
/* Get event code (row[0]) */
if ((Gbl.Usrs.Other.UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[0])) > 0)
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Usr_DONT_GET_PREFS))
if (Usr_CheckIfICanViewMch (&Gbl.Usrs.Other.UsrDat))
if (Usr_CheckIfICanViewTstExaMchResult (&Gbl.Usrs.Other.UsrDat))
{
/***** Show events results *****/
Gbl.Usrs.Other.UsrDat.Accepted = Usr_CheckIfUsrHasAcceptedInCurrentCrs (&Gbl.Usrs.Other.UsrDat);
@ -522,18 +523,18 @@ static void ExaRes_ListAllEvtResultsInEvt (struct Exa_Exams *Exams,long EvtCod)
/*****************************************************************************/
static void ExaRes_ShowResultsBegin (struct Exa_Exams *Exams,
const char *Title,bool ListGamesToSelect)
const char *Title,bool ListExamsToSelect)
{
extern const char *Hlp_ASSESSMENT_Games_results;
extern const char *Hlp_ASSESSMENT_Exams_results;
/***** Begin box *****/
HTM_SECTION_Begin (ExaRes_RESULTS_BOX_ID);
Box_BoxBegin ("100%",Title,
NULL,NULL,
Hlp_ASSESSMENT_Games_results,Box_NOT_CLOSABLE);
Hlp_ASSESSMENT_Exams_results,Box_NOT_CLOSABLE);
/***** List games to select *****/
if (ListGamesToSelect)
/***** List exams to select *****/
if (ListExamsToSelect)
ExaRes_ListExamsToSelect (Exams);
/***** Begin event results table *****/
@ -558,22 +559,22 @@ static void ExaRes_ShowResultsEnd (void)
static void ExaRes_ListExamsToSelect (struct Exa_Exams *Exams)
{
extern const char *Hlp_ASSESSMENT_Games_results;
extern const char *Hlp_ASSESSMENT_Exams_results;
extern const char *The_ClassFormLinkInBoxBold[The_NUM_THEMES];
extern const char *Txt_Games;
extern const char *Txt_Game;
extern const char *Txt_Exams;
extern const char *Txt_Exam;
extern const char *Txt_Update_results;
unsigned UniqueId;
unsigned NumExam;
struct Exa_Exam Exam;
/***** Begin box *****/
Box_BoxBegin (NULL,Txt_Games,
Box_BoxBegin (NULL,Txt_Exams,
NULL,NULL,
Hlp_ASSESSMENT_Games_results,Box_CLOSABLE);
Hlp_ASSESSMENT_Exams_results,Box_CLOSABLE);
/***** Begin form to update the results
depending on the games selected *****/
depending on the exams selected *****/
Frm_StartFormAnchor (Gbl.Action.Act,ExaRes_RESULTS_TABLE_ID);
Grp_PutParamsCodGrps ();
Usr_PutHiddenParSelectedUsrsCods (&Gbl.Usrs.Selected);
@ -585,7 +586,7 @@ static void ExaRes_ListExamsToSelect (struct Exa_Exams *Exams)
HTM_TR_Begin (NULL);
HTM_TH (1,2,NULL,NULL);
HTM_TH (1,1,"LM",Txt_Game);
HTM_TH (1,1,"LM",Txt_Exam);
HTM_TR_End ();
@ -596,7 +597,7 @@ static void ExaRes_ListExamsToSelect (struct Exa_Exams *Exams)
{
/* Get data of this exam */
Exam.ExaCod = Exams->Lst[NumExam].ExaCod;
Gam_GetDataOfGameByCod (&Exam);
Exa_GetDataOfExamByCod (&Exam);
/* Write a row for this event */
HTM_TR_Begin (NULL);
@ -678,8 +679,8 @@ static void ExaRes_ShowHeaderEvtResults (Usr_MeOrOther_t MeOrOther)
}
/*****************************************************************************/
/******* Build string with list of selected games separated by commas ********/
/******* from list of selected games ********/
/******* Build string with list of selected exams separated by commas ********/
/******* from list of selected exams ********/
/*****************************************************************************/
static void ExaRes_BuildExamsSelectedCommas (struct Exa_Exams *Exams,
@ -689,12 +690,12 @@ static void ExaRes_BuildExamsSelectedCommas (struct Exa_Exams *Exams,
unsigned NumExam;
char LongStr[Cns_MAX_DECIMAL_DIGITS_LONG + 1];
/***** Allocate memory for subquery of games selected *****/
/***** Allocate memory for subquery of exams selected *****/
MaxLength = (size_t) Exams->NumSelected * (Cns_MAX_DECIMAL_DIGITS_LONG + 1);
if ((*ExamsSelectedCommas = (char *) malloc (MaxLength + 1)) == NULL)
Lay_NotEnoughMemoryExit ();
/***** Build subquery with list of selected games *****/
/***** Build subquery with list of selected exams *****/
(*ExamsSelectedCommas)[0] = '\0';
for (NumExam = 0;
NumExam < Exams->Num;
@ -760,7 +761,7 @@ static void ExaRes_ShowEvtResults (struct Exa_Exams *Exams,
Lay_NotEnoughMemoryExit ();
}
/***** Build games subquery *****/
/***** Build exams subquery *****/
if (ExaCod > 0)
{
if (asprintf (&ExaSubQuery," AND exa_events.ExaCod=%ld",ExaCod) < 0)
@ -927,8 +928,8 @@ static void ExaRes_ShowEvtResults (struct Exa_Exams *Exams,
HTM_TD_Begin ("class=\"DAT RT COLOR%u\"",Gbl.RowEvenOdd);
if (ICanViewScore)
{
Grade = TstExa_ComputeGrade (NumQstsInThisResult,ScoreInThisResult,MaxGrade);
TstExa_ShowGrade (Grade,MaxGrade);
Grade = TstRes_ComputeGrade (NumQstsInThisResult,ScoreInThisResult,MaxGrade);
TstRes_ShowGrade (Grade,MaxGrade);
TotalGrade += Grade;
}
else
@ -944,12 +945,12 @@ static void ExaRes_ShowEvtResults (struct Exa_Exams *Exams,
switch (MeOrOther)
{
case Usr_ME:
Frm_StartForm (ActSeeOneMchResMe);
Mch_PutParamsEdit (Exams);
Frm_StartForm (ActSeeOneExaEvtResMe);
ExaEvt_PutParamsEdit (Exams);
break;
case Usr_OTHER:
Frm_StartForm (ActSeeOneMchResOth);
Mch_PutParamsEdit (Exams);
ExaEvt_PutParamsEdit (Exams);
Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EncryptedUsrCod);
break;
}
@ -965,9 +966,9 @@ static void ExaRes_ShowEvtResults (struct Exa_Exams *Exams,
/***** Write totals for this user *****/
ExaRes_ShowEvtResultsSummaryRow (NumResults,
NumTotalQsts,NumTotalQstsNotBlank,
TotalScoreOfAllResults,
TotalGrade);
NumTotalQsts,NumTotalQstsNotBlank,
TotalScoreOfAllResults,
TotalGrade);
}
else
{
@ -1045,7 +1046,7 @@ static void ExaRes_ShowEvtResultsSummaryRow (unsigned NumResults,
void ExaRes_ShowOneExaResult (void)
{
extern const char *Hlp_ASSESSMENT_Games_results;
extern const char *Hlp_ASSESSMENT_Exams_results;
extern const char *Txt_The_user_does_not_exist;
extern const char *Txt_ROLES_SINGUL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
extern const char *Txt_START_END_TIME[Dat_NUM_START_END_TIME];
@ -1061,17 +1062,17 @@ void ExaRes_ShowOneExaResult (void)
struct UsrData *UsrDat;
Dat_StartEndTime_t StartEndTime;
char *Id;
struct TstExa_Exam Exam;
struct TstRes_Result Result;
bool ShowPhoto;
char PhotoURL[PATH_MAX + 1];
bool ICanViewResult;
bool ICanViewScore;
/***** Reset games *****/
Gam_ResetGames (&Exams);
/***** Reset exams *****/
Exa_ResetExams (&Exams);
/***** Get and check parameters *****/
Mch_GetAndCheckParameters (&Exams,&Exam,&Event);
ExaEvt_GetAndCheckParameters (&Exams,&Exam,&Event);
/***** Pointer to user's data *****/
MeOrOther = (Gbl.Action.Act == ActSeeOneMchResMe) ? Usr_ME :
@ -1089,8 +1090,8 @@ void ExaRes_ShowOneExaResult (void)
}
/***** Get event result data *****/
TstExa_ResetExam (&Exam);
ExaRes_GetEventResultDataByEvtCod (Event.EvtCod,UsrDat->UsrCod,&Exam);
TstRes_ResetResult (&Result);
ExaRes_GetEventResultDataByEvtCod (Event.EvtCod,UsrDat->UsrCod,&Result);
/***** Check if I can view this event result *****/
switch (Gbl.Usrs.Me.Role.Logged)
@ -1121,12 +1122,12 @@ void ExaRes_ShowOneExaResult (void)
{
/***** Get questions and user's answers of the event result from database *****/
ExaRes_GetExamResultQuestionsFromDB (Event.EvtCod,UsrDat->UsrCod,
&Exam);
&Exam);
/***** Begin box *****/
Box_BoxBegin (NULL,Event.Title,
NULL,NULL,
Hlp_ASSESSMENT_Games_results,Box_NOT_CLOSABLE);
Hlp_ASSESSMENT_Exams_results,Box_NOT_CLOSABLE);
Lay_WriteHeaderClassPhoto (false,false,
Gbl.Hierarchy.Ins.InsCod,
Gbl.Hierarchy.Deg.DegCod,
@ -1139,7 +1140,7 @@ void ExaRes_ShowOneExaResult (void)
/* Get data of the user who answer the event */
if (!Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (UsrDat,Usr_DONT_GET_PREFS))
Lay_ShowErrorAndExit (Txt_The_user_does_not_exist);
if (!Usr_CheckIfICanViewTst (UsrDat))
if (!Usr_CheckIfICanViewTstExaMchResult (UsrDat))
Lay_NoPermissionExit ();
/* User */
@ -1197,8 +1198,8 @@ void ExaRes_ShowOneExaResult (void)
HTM_TD_Begin ("class=\"DAT LT\"");
HTM_TxtF ("%u (%u %s)",
Exam.NumQsts,
Exam.NumQstsNotBlank,Txt_non_blank_QUESTIONS);
Result.NumQsts,
Result.NumQstsNotBlank,Txt_non_blank_QUESTIONS);
HTM_TD_End ();
HTM_TR_End ();
@ -1212,7 +1213,7 @@ void ExaRes_ShowOneExaResult (void)
HTM_TD_Begin ("class=\"DAT LT\"");
if (ICanViewScore)
HTM_Double2Decimals (Exam.Score);
HTM_Double2Decimals (Result.Score);
else
Ico_PutIconNotVisible ();
HTM_TD_End ();
@ -1228,9 +1229,8 @@ void ExaRes_ShowOneExaResult (void)
HTM_TD_Begin ("class=\"DAT LT\"");
if (ICanViewScore)
TstExa_ComputeAndShowGrade (Exam.NumQsts,
Exam.Score,
Exam.MaxGrade);
TstRes_ComputeAndShowGrade (Result.NumQsts,Result.Score,
Exam.MaxGrade);
else
Ico_PutIconNotVisible ();
HTM_TD_End ();
@ -1245,13 +1245,13 @@ void ExaRes_ShowOneExaResult (void)
HTM_TD_End ();
HTM_TD_Begin ("class=\"DAT LT\"");
Gam_ShowTstTagsPresentInAGame (Event.ExaCod);
Exa_ShowTstTagsPresentInAnExam (Event.ExaCod);
HTM_TD_End ();
HTM_TR_End ();
/***** Write answers and solutions *****/
TstExa_ShowExamAnswers (UsrDat,&Exam,Exam.Visibility);
TstRes_ShowExamAnswers (UsrDat,&Result,Exam.Visibility);
/***** End table *****/
HTM_TABLE_End ();
@ -1261,10 +1261,11 @@ void ExaRes_ShowOneExaResult (void)
{
HTM_DIV_Begin ("class=\"DAT_N_BOLD CM\"");
HTM_TxtColonNBSP (Txt_Score);
HTM_Double2Decimals (Exam.Score);
HTM_Double2Decimals (Result.Score);
HTM_BR ();
HTM_TxtColonNBSP (Txt_Grade);
TstExa_ComputeAndShowGrade (Exam.NumQsts,Exam.Score,Exam.MaxGrade);
TstRes_ComputeAndShowGrade (Result.NumQsts,Result.Score,
Exam.MaxGrade);
HTM_DIV_End ();
}
@ -1280,37 +1281,37 @@ void ExaRes_ShowOneExaResult (void)
/*****************************************************************************/
void ExaRes_GetExamResultQuestionsFromDB (long EvtCod,long UsrCod,
struct TstExa_Exam *Exam)
struct TstRes_Result *Result)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
unsigned NumQst;
long LongNum;
unsigned QstInd;
struct Mch_UsrAnswer UsrAnswer;
struct ExaEvt_UsrAnswer UsrAnswer;
/***** Get questions and answers of a event result *****/
Exam->NumQsts = (unsigned)
DB_QuerySELECT (&mysql_res,"can not get questions and answers"
" of a event result",
"SELECT gam_questions.QstCod," // row[0]
"gam_questions.QstInd," // row[1]
"mch_indexes.Indexes" // row[2]
" FROM exa_events,gam_questions,mch_indexes"
" WHERE exa_events.EvtCod=%ld"
" AND exa_events.ExaCod=gam_questions.ExaCod"
" AND exa_events.EvtCod=mch_indexes.EvtCod"
" AND gam_questions.QstInd=mch_indexes.QstInd"
" ORDER BY gam_questions.QstInd",
EvtCod);
for (NumQst = 0, Exam->NumQstsNotBlank = 0;
NumQst < Exam->NumQsts;
Result->NumQsts = (unsigned)
DB_QuerySELECT (&mysql_res,"can not get questions and answers"
" of a event result",
"SELECT exa_questions.QstCod," // row[0]
"exa_questions.QstInd," // row[1]
"exa_indexes.Indexes" // row[2]
" FROM exa_events,exa_questions,exa_indexes"
" WHERE exa_events.EvtCod=%ld"
" AND exa_events.ExaCod=exa_questions.ExaCod"
" AND exa_events.EvtCod=exa_indexes.EvtCod"
" AND exa_questions.QstInd=exa_indexes.QstInd"
" ORDER BY exa_questions.QstInd",
EvtCod);
for (NumQst = 0, Result->NumQstsNotBlank = 0;
NumQst < Result->NumQsts;
NumQst++)
{
row = mysql_fetch_row (mysql_res);
/* Get question code (row[0]) */
if ((Exam->Questions[NumQst].QstCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
if ((Result->Questions[NumQst].QstCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
Lay_ShowErrorAndExit ("Wrong code of question.");
/* Get question index (row[1]) */
@ -1319,24 +1320,24 @@ void ExaRes_GetExamResultQuestionsFromDB (long EvtCod,long UsrCod,
QstInd = (unsigned) LongNum;
/* Get indexes for this question (row[2]) */
Str_Copy (Exam->Questions[NumQst].StrIndexes,row[2],
TstExa_MAX_BYTES_INDEXES_ONE_QST);
Str_Copy (Result->Questions[NumQst].StrIndexes,row[2],
TstRes_MAX_BYTES_INDEXES_ONE_QST);
/* Get answers selected by user for this question */
Mch_GetQstAnsFromDB (EvtCod,UsrCod,QstInd,&UsrAnswer);
ExaEvt_GetQstAnsFromDB (EvtCod,UsrCod,QstInd,&UsrAnswer);
if (UsrAnswer.AnsInd >= 0) // UsrAnswer.AnsInd >= 0 ==> answer selected
{
snprintf (Exam->Questions[NumQst].StrAnswers,TstExa_MAX_BYTES_ANSWERS_ONE_QST + 1,
snprintf (Result->Questions[NumQst].StrAnswers,TstRes_MAX_BYTES_ANSWERS_ONE_QST + 1,
"%d",UsrAnswer.AnsInd);
Exam->NumQstsNotBlank++;
Result->NumQstsNotBlank++;
}
else // UsrAnswer.AnsInd < 0 ==> no answer selected
Exam->Questions[NumQst].StrAnswers[0] = '\0'; // Empty answer
Result->Questions[NumQst].StrAnswers[0] = '\0'; // Empty answer
/* Replace each comma by a separator of multiple parameters */
/* In database commas are used as separators instead of special chars */
Par_ReplaceCommaBySeparatorMultiple (Exam->Questions[NumQst].StrIndexes);
Par_ReplaceCommaBySeparatorMultiple (Exam->Questions[NumQst].StrAnswers);
Par_ReplaceCommaBySeparatorMultiple (Result->Questions[NumQst].StrIndexes);
Par_ReplaceCommaBySeparatorMultiple (Result->Questions[NumQst].StrAnswers);
}
/***** Free structure that stores the query result *****/
@ -1348,7 +1349,7 @@ void ExaRes_GetExamResultQuestionsFromDB (long EvtCod,long UsrCod,
/*****************************************************************************/
static void ExaRes_GetEventResultDataByEvtCod (long EvtCod,long UsrCod,
struct TstExa_Exam *Exam)
struct TstRes_Result *Result)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -1357,11 +1358,11 @@ static void ExaRes_GetEventResultDataByEvtCod (long EvtCod,long UsrCod,
/***** Make database query *****/
if (DB_QuerySELECT (&mysql_res,"can not get data"
" of a event result of a user",
"SELECT UNIX_TIMESTAMP(exa_results.StartTime)," // row[1]
"UNIX_TIMESTAMP(exa_results.EndTime)," // row[2]
"exa_results.NumQsts," // row[3]
"exa_results.NumQstsNotBlank," // row[4]
"exa_results.Score" // row[5]
"SELECT UNIX_TIMESTAMP(exa_results.StartTime)," // row[1]
"UNIX_TIMESTAMP(exa_results.EndTime)," // row[2]
"exa_results.NumQsts," // row[3]
"exa_results.NumQstsNotBlank," // row[4]
"exa_results.Score" // row[5]
" FROM exa_results,exa_events,exa_exams"
" WHERE exa_results.EvtCod=%ld"
" AND exa_results.UsrCod=%ld"
@ -1377,27 +1378,27 @@ static void ExaRes_GetEventResultDataByEvtCod (long EvtCod,long UsrCod,
for (StartEndTime = (Dat_StartEndTime_t) 0;
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
StartEndTime++)
Exam->TimeUTC[StartEndTime] = Dat_GetUNIXTimeFromStr (row[StartEndTime]);
Result->TimeUTC[StartEndTime] = Dat_GetUNIXTimeFromStr (row[StartEndTime]);
/* Get number of questions (row[2]) */
if (sscanf (row[2],"%u",&Exam->NumQsts) != 1)
Exam->NumQsts = 0;
if (sscanf (row[2],"%u",&Result->NumQsts) != 1)
Result->NumQsts = 0;
/* Get number of questions not blank (row[3]) */
if (sscanf (row[3],"%u",&Exam->NumQstsNotBlank) != 1)
Exam->NumQstsNotBlank = 0;
if (sscanf (row[3],"%u",&Result->NumQstsNotBlank) != 1)
Result->NumQstsNotBlank = 0;
/* Get score (row[4]) */
Str_SetDecimalPointToUS (); // To get the decimal point as a dot
if (sscanf (row[4],"%lf",&Exam->Score) != 1)
Exam->Score = 0.0;
if (sscanf (row[4],"%lf",&Result->Score) != 1)
Result->Score = 0.0;
Str_SetDecimalPointToLocal (); // Return to local system
}
else
{
Exam->NumQsts = 0;
Exam->NumQstsNotBlank = 0;
Exam->Score = 0.0;
Result->NumQsts = 0;
Result->NumQstsNotBlank = 0;
Result->Score = 0.0;
}
/***** Free structure that stores the query result *****/
@ -1417,7 +1418,7 @@ static bool ExaRes_CheckIfICanSeeEventResult (struct ExaEvt_Event *Event,long Us
case Rol_STD:
ItsMe = Usr_ItsMe (UsrCod);
if (ItsMe && Event->Status.ShowUsrResults)
return Mch_CheckIfICanPlayThisMatchBasedOnGrps (Event);
return ExaEvt_CheckIfICanPlayThisEventBasedOnGrps (Event);
return false;
case Rol_NET:
case Rol_TCH:

View File

@ -42,15 +42,15 @@
void ExaRes_ShowMyExaResultsInCrs (void);
void ExaRes_ShowMyExaResultsInExa (void);
void ExaRes_ShowMyExaResultsInEve (void);
void ExaRes_ShowMyExaResultsInEvt (void);
void ExaRes_ShowAllExaResultsInCrs (void);
void ExaRes_SelUsrsToViewExaResults (void);
void ExaRes_ShowAllExaResultsInExa (void);
void ExaRes_ShowAllExaResultsInEve (void);
void ExaRes_ShowAllExaResultsInEvt (void);
void ExaRes_ShowOneExaResult (void);
void ExaRes_GetExamResultQuestionsFromDB (long EvtCod,long UsrCod,
struct TstExa_Exam *Exam);
struct TstRes_Result *Result);
#endif

View File

@ -161,6 +161,7 @@ static void Fig_GetAndShowCourseProgramStats (void); // TODO: Change function fr
static void Fig_GetAndShowAssignmentsStats (void);
static void Fig_GetAndShowProjectsStats (void);
static void Fig_GetAndShowTestsStats (void);
static void Fig_GetAndShowExamsStats (void);
static void Fig_GetAndShowGamesStats (void);
static void Fig_GetAndShowTimelineActivityStats (void);
@ -335,6 +336,7 @@ void Fig_ShowFigures (void)
[Fig_ASSIGNMENTS ] = Fig_GetAndShowAssignmentsStats,
[Fig_PROJECTS ] = Fig_GetAndShowProjectsStats,
[Fig_TESTS ] = Fig_GetAndShowTestsStats,
[Fig_EXAMS ] = Fig_GetAndShowExamsStats,
[Fig_GAMES ] = Fig_GetAndShowGamesStats,
[Fig_SURVEYS ] = Fig_GetAndShowSurveysStats,
[Fig_TIMELINE ] = Fig_GetAndShowTimelineActivityStats,
@ -3289,6 +3291,61 @@ static void Fig_GetAndShowTestsStats (void)
Box_BoxTableEnd ();
}
/*****************************************************************************/
/*************************** Show stats about exams **************************/
/*****************************************************************************/
static void Fig_GetAndShowExamsStats (void)
{
extern const char *Hlp_ANALYTICS_Figures_games;
extern const char *Txt_FIGURE_TYPES[Fig_NUM_FIGURES];
extern const char *Txt_Number_of_BR_games;
extern const char *Txt_Number_of_BR_courses_with_BR_games;
extern const char *Txt_Average_number_BR_of_games_BR_per_course;
unsigned NumGames;
unsigned NumCoursesWithGames = 0;
double NumGamesPerCourse = 0.0;
/***** Get the number of games from this location *****/
if ((NumGames = Gam_GetNumGames (Gbl.Scope.Current)))
if ((NumCoursesWithGames = Gam_GetNumCoursesWithGames (Gbl.Scope.Current)) != 0)
NumGamesPerCourse = (double) NumGames / (double) NumCoursesWithGames;
/***** Begin box and table *****/
Box_BoxTableBegin (NULL,Txt_FIGURE_TYPES[Fig_GAMES],
NULL,NULL,
Hlp_ANALYTICS_Figures_games,Box_NOT_CLOSABLE,2);
/***** Write table heading *****/
HTM_TR_Begin (NULL);
HTM_TH (1,1,"RM",Txt_Number_of_BR_games);
HTM_TH (1,1,"RM",Txt_Number_of_BR_courses_with_BR_games);
HTM_TH (1,1,"RM",Txt_Average_number_BR_of_games_BR_per_course);
HTM_TR_End ();
/***** Write number of games *****/
HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"DAT RM\"");
HTM_Unsigned (NumGames);
HTM_TD_End ();
HTM_TD_Begin ("class=\"DAT RM\"");
HTM_Unsigned (NumCoursesWithGames);
HTM_TD_End ();
HTM_TD_Begin ("class=\"DAT RM\"");
HTM_Double2Decimals (NumGamesPerCourse);
HTM_TD_End ();
HTM_TR_End ();
/***** End table and box *****/
Box_BoxTableEnd ();
}
/*****************************************************************************/
/*************************** Show stats about games **************************/
/*****************************************************************************/

View File

@ -33,7 +33,7 @@
/************************** Public types and constants ***********************/
/*****************************************************************************/
#define Fig_NUM_FIGURES 29
#define Fig_NUM_FIGURES 30
typedef enum
{
Fig_USERS, // Number of users
@ -47,6 +47,7 @@ typedef enum
Fig_ASSIGNMENTS, // Number of assignments
Fig_PROJECTS, // Number of projects
Fig_TESTS, // Number of test questions
Fig_EXAMS, // Number of exams
Fig_GAMES, // Number of games
Fig_SURVEYS, // Number of surveys
Fig_TIMELINE, // Number of timeline notes

View File

@ -1696,7 +1696,7 @@ void Gam_ListTstQuestionsToSelect (void)
{
/***** List several test questions for selection *****/
Games.GamCod = Game.GamCod;
Tst_ListQuestionsToSelect (&Games);
Tst_ListQuestionsToSelectForGame (&Games);
}
else
Lay_NoPermissionExit ();

View File

@ -1390,6 +1390,132 @@ const char *Hlp_ASSESSMENT_Tests_results =
"ASSESSMENT.Tests.en#results";
#endif
const char *Hlp_ASSESSMENT_Exams =
#if L==1
"ASSESSMENT.Exams.es";
#elif L==2
"ASSESSMENT.Exams.en";
#elif L==3
"ASSESSMENT.Exams.en";
#elif L==4
"ASSESSMENT.Exams.es";
#elif L==5
"ASSESSMENT.Exams.en";
#elif L==6
"ASSESSMENT.Exams.es";
#elif L==7
"ASSESSMENT.Exams.en";
#elif L==8
"ASSESSMENT.Exams.en";
#elif L==9
"ASSESSMENT.Exams.en";
#endif
const char *Hlp_ASSESSMENT_Exams_edit_exam =
#if L==1
"ASSESSMENT.Exams.es#editar-examen";
#elif L==2
"ASSESSMENT.Exams.en#edit-exam";
#elif L==3
"ASSESSMENT.Exams.en#edit-exam";
#elif L==4
"ASSESSMENT.Exams.es#editar-examen";
#elif L==5
"ASSESSMENT.Exams.en#edit-exam";
#elif L==6
"ASSESSMENT.Exams.es#editar-examen";
#elif L==7
"ASSESSMENT.Exams.en#edit-exam";
#elif L==8
"ASSESSMENT.Exams.en#edit-exam";
#elif L==9
"ASSESSMENT.Exams.en#edit-exam";
#endif
const char *Hlp_ASSESSMENT_Exams_events =
#if L==1
"ASSESSMENT.Exams.es#eventos";
#elif L==2
"ASSESSMENT.Exams.en#events";
#elif L==3
"ASSESSMENT.Exams.en#events";
#elif L==4
"ASSESSMENT.Exams.es#eventos";
#elif L==5
"ASSESSMENT.Exams.en#events";
#elif L==6
"ASSESSMENT.Exams.es#eventos";
#elif L==7
"ASSESSMENT.Exams.en#events";
#elif L==8
"ASSESSMENT.Exams.en#events";
#elif L==9
"ASSESSMENT.Exams.en#events";
#endif
const char *Hlp_ASSESSMENT_Exams_new_exam =
#if L==1
"ASSESSMENT.Exams.es#nuevo-examen";
#elif L==2
"ASSESSMENT.Exams.en#new-exam";
#elif L==3
"ASSESSMENT.Exams.en#new-exam";
#elif L==4
"ASSESSMENT.Exams.es#nuevo-examen";
#elif L==5
"ASSESSMENT.Exams.en#new-exam";
#elif L==6
"ASSESSMENT.Exams.es#nuevo-examen";
#elif L==7
"ASSESSMENT.Exams.en#new-exam";
#elif L==8
"ASSESSMENT.Exams.en#new-exam";
#elif L==9
"ASSESSMENT.Exams.en#new-exam";
#endif
const char *Hlp_ASSESSMENT_Exams_questions =
#if L==1
"ASSESSMENT.Exams.es#preguntas";
#elif L==2
"ASSESSMENT.Exams.en#questions";
#elif L==3
"ASSESSMENT.Exams.en#questions";
#elif L==4
"ASSESSMENT.Exams.es#preguntas";
#elif L==5
"ASSESSMENT.Exams.en#questions";
#elif L==6
"ASSESSMENT.Exams.es#preguntas";
#elif L==7
"ASSESSMENT.Exams.en#questions";
#elif L==8
"ASSESSMENT.Exams.en#questions";
#elif L==9
"ASSESSMENT.Exams.en#questions";
#endif
const char *Hlp_ASSESSMENT_Exams_results =
#if L==1
"ASSESSMENT.Exams.es#resultados";
#elif L==2
"ASSESSMENT.Exams.en#results";
#elif L==3
"ASSESSMENT.Exams.en#results";
#elif L==4
"ASSESSMENT.Exams.es#resultados";
#elif L==5
"ASSESSMENT.Exams.en#results";
#elif L==6
"ASSESSMENT.Exams.es#resultados";
#elif L==7
"ASSESSMENT.Exams.en#results";
#elif L==8
"ASSESSMENT.Exams.en#results";
#elif L==9
"ASSESSMENT.Exams.en#results";
#endif
const char *Hlp_ASSESSMENT_Games =
#if L==1
"ASSESSMENT.Games.es";

View File

@ -229,7 +229,7 @@ static void Mch_GetNumPlayers (struct Mch_Match *Match);
static void Mch_RemoveMyAnswerToMatchQuestion (const struct Mch_Match *Match);
static void Mch_ComputeScore (struct TstExa_Exam *Result);
static void Mch_ComputeScore (struct TstRes_Result *Result);
static unsigned Mch_GetNumUsrsWhoHaveAnswerMch (long MchCod);
@ -1589,7 +1589,7 @@ static void Mch_ReorderAnswer (long MchCod,unsigned QstInd,
long LongNum;
unsigned AnsInd;
char StrOneAnswer[Cns_MAX_DECIMAL_DIGITS_UINT + 1];
char StrAnswersOneQst[TstExa_MAX_BYTES_ANSWERS_ONE_QST + 1];
char StrAnswersOneQst[TstRes_MAX_BYTES_ANSWERS_ONE_QST + 1];
/***** Initialize list of answers to empty string *****/
StrAnswersOneQst[0] = '\0';
@ -1622,9 +1622,9 @@ static void Mch_ReorderAnswer (long MchCod,unsigned QstInd,
/* Concatenate answer index to list of answers */
if (NumAns)
Str_Concat (StrAnswersOneQst,",",
TstExa_MAX_BYTES_ANSWERS_ONE_QST);
TstRes_MAX_BYTES_ANSWERS_ONE_QST);
Str_Concat (StrAnswersOneQst,StrOneAnswer,
TstExa_MAX_BYTES_ANSWERS_ONE_QST);
TstRes_MAX_BYTES_ANSWERS_ONE_QST);
}
/***** Free structure that stores the query result *****/
@ -1648,7 +1648,7 @@ void Mch_GetIndexes (long MchCod,unsigned QstInd,
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
char StrIndexesOneQst[TstExa_MAX_BYTES_INDEXES_ONE_QST + 1];
char StrIndexesOneQst[TstRes_MAX_BYTES_INDEXES_ONE_QST + 1];
/***** Get indexes for a question from database *****/
if (!DB_QuerySELECT (&mysql_res,"can not get data of a question",
@ -1661,14 +1661,14 @@ void Mch_GetIndexes (long MchCod,unsigned QstInd,
/* Get indexes (row[0]) */
Str_Copy (StrIndexesOneQst,row[0],
TstExa_MAX_BYTES_INDEXES_ONE_QST);
TstRes_MAX_BYTES_INDEXES_ONE_QST);
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
/***** Get indexes from string *****/
Par_ReplaceCommaBySeparatorMultiple (StrIndexesOneQst);
TstExa_GetIndexesFromStr (StrIndexesOneQst,Indexes);
TstRes_GetIndexesFromStr (StrIndexesOneQst,Indexes);
}
/*****************************************************************************/
@ -3828,7 +3828,7 @@ void Mch_ReceiveQuestionAnswer (void)
unsigned Indexes[Tst_MAX_OPTIONS_PER_QUESTION];
struct Mch_UsrAnswer PreviousUsrAnswer;
struct Mch_UsrAnswer UsrAnswer;
struct TstExa_Exam Result;
struct TstRes_Result Result;
/***** Get data of the match from database *****/
Match.MchCod = Mch_GetMchCodBeingPlayed ();
@ -3946,7 +3946,7 @@ static void Mch_RemoveMyAnswerToMatchQuestion (const struct Mch_Match *Match)
/******************** Compute match score for a student **********************/
/*****************************************************************************/
static void Mch_ComputeScore (struct TstExa_Exam *Result)
static void Mch_ComputeScore (struct TstRes_Result *Result)
{
unsigned NumQst;
struct Tst_Question Question;
@ -3961,7 +3961,7 @@ static void Mch_ComputeScore (struct TstExa_Exam *Result)
Question.Answer.Type = Tst_ANS_UNIQUE_CHOICE;
/***** Compute score for this answer ******/
TstExa_ComputeChoiceAnsScore (Result,NumQst,&Question);
TstRes_ComputeChoiceAnsScore (Result,NumQst,&Question);
/***** Update total score *****/
Result->Score += Result->Questions[NumQst].Score;

View File

@ -101,7 +101,7 @@ static void MchRes_ShowMchResultsSummaryRow (unsigned NumResults,
double TotalScoreOfAllResults,
double TotalGrade);
static void MchRes_GetMatchResultDataByMchCod (long MchCod,long UsrCod,
struct TstExa_Exam *Exam);
struct TstRes_Result *Result);
static bool MchRes_CheckIfICanSeeMatchResult (struct Mch_Match *Match,long UsrCod);
static bool MchRes_CheckIfICanViewScore (bool ICanViewResult,unsigned Visibility);
@ -300,7 +300,7 @@ static void MchRes_ListAllMchResultsInSelectedGames (struct Gam_Games *Games)
Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64);
Usr_GetUsrCodFromEncryptedUsrCod (&Gbl.Usrs.Other.UsrDat);
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Usr_DONT_GET_PREFS))
if (Usr_CheckIfICanViewMch (&Gbl.Usrs.Other.UsrDat))
if (Usr_CheckIfICanViewTstExaMchResult (&Gbl.Usrs.Other.UsrDat))
{
/***** Show matches results *****/
Gbl.Usrs.Other.UsrDat.Accepted = Usr_CheckIfUsrHasAcceptedInCurrentCrs (&Gbl.Usrs.Other.UsrDat);
@ -414,7 +414,7 @@ static void MchRes_ListAllMchResultsInGam (struct Gam_Games *Games,long GamCod)
/* Get match code (row[0]) */
if ((Gbl.Usrs.Other.UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[0])) > 0)
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Usr_DONT_GET_PREFS))
if (Usr_CheckIfICanViewMch (&Gbl.Usrs.Other.UsrDat))
if (Usr_CheckIfICanViewTstExaMchResult (&Gbl.Usrs.Other.UsrDat))
{
/***** Show matches results *****/
Gbl.Usrs.Other.UsrDat.Accepted = Usr_CheckIfUsrHasAcceptedInCurrentCrs (&Gbl.Usrs.Other.UsrDat);
@ -504,7 +504,7 @@ static void MchRes_ListAllMchResultsInMch (struct Gam_Games *Games,long MchCod)
/* Get match code (row[0]) */
if ((Gbl.Usrs.Other.UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[0])) > 0)
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Usr_DONT_GET_PREFS))
if (Usr_CheckIfICanViewMch (&Gbl.Usrs.Other.UsrDat))
if (Usr_CheckIfICanViewTstExaMchResult (&Gbl.Usrs.Other.UsrDat))
{
/***** Show matches results *****/
Gbl.Usrs.Other.UsrDat.Accepted = Usr_CheckIfUsrHasAcceptedInCurrentCrs (&Gbl.Usrs.Other.UsrDat);
@ -927,8 +927,8 @@ static void MchRes_ShowMchResults (struct Gam_Games *Games,
HTM_TD_Begin ("class=\"DAT RT COLOR%u\"",Gbl.RowEvenOdd);
if (ICanViewScore)
{
Grade = TstExa_ComputeGrade (NumQstsInThisResult,ScoreInThisResult,MaxGrade);
TstExa_ShowGrade (Grade,MaxGrade);
Grade = TstRes_ComputeGrade (NumQstsInThisResult,ScoreInThisResult,MaxGrade);
TstRes_ShowGrade (Grade,MaxGrade);
TotalGrade += Grade;
}
else
@ -1061,7 +1061,7 @@ void MchRes_ShowOneMchResult (void)
struct UsrData *UsrDat;
Dat_StartEndTime_t StartEndTime;
char *Id;
struct TstExa_Exam Exam;
struct TstRes_Result Result;
bool ShowPhoto;
char PhotoURL[PATH_MAX + 1];
bool ICanViewResult;
@ -1089,8 +1089,8 @@ void MchRes_ShowOneMchResult (void)
}
/***** Get match result data *****/
TstExa_ResetExam (&Exam);
MchRes_GetMatchResultDataByMchCod (Match.MchCod,UsrDat->UsrCod,&Exam);
TstRes_ResetResult (&Result);
MchRes_GetMatchResultDataByMchCod (Match.MchCod,UsrDat->UsrCod,&Result);
/***** Check if I can view this match result *****/
switch (Gbl.Usrs.Me.Role.Logged)
@ -1121,7 +1121,7 @@ void MchRes_ShowOneMchResult (void)
{
/***** Get questions and user's answers of the match result from database *****/
MchRes_GetMatchResultQuestionsFromDB (Match.MchCod,UsrDat->UsrCod,
&Exam);
&Result);
/***** Begin box *****/
Box_BoxBegin (NULL,Match.Title,
@ -1139,7 +1139,7 @@ void MchRes_ShowOneMchResult (void)
/* Get data of the user who answer the match */
if (!Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (UsrDat,Usr_DONT_GET_PREFS))
Lay_ShowErrorAndExit (Txt_The_user_does_not_exist);
if (!Usr_CheckIfICanViewTst (UsrDat))
if (!Usr_CheckIfICanViewTstExaMchResult (UsrDat))
Lay_NoPermissionExit ();
/* User */
@ -1179,7 +1179,7 @@ void MchRes_ShowOneMchResult (void)
if (asprintf (&Id,"match_%u",(unsigned) StartEndTime) < 0)
Lay_NotEnoughMemoryExit ();
HTM_TD_Begin ("id=\"%s\" class=\"DAT LT\"",Id);
Dat_WriteLocalDateHMSFromUTC (Id,Exam.TimeUTC[StartEndTime],
Dat_WriteLocalDateHMSFromUTC (Id,Result.TimeUTC[StartEndTime],
Gbl.Prefs.DateFormat,Dat_SEPARATOR_COMMA,
true,true,true,0x7);
HTM_TD_End ();
@ -1197,8 +1197,8 @@ void MchRes_ShowOneMchResult (void)
HTM_TD_Begin ("class=\"DAT LT\"");
HTM_TxtF ("%u (%u %s)",
Exam.NumQsts,
Exam.NumQstsNotBlank,Txt_non_blank_QUESTIONS);
Result.NumQsts,
Result.NumQstsNotBlank,Txt_non_blank_QUESTIONS);
HTM_TD_End ();
HTM_TR_End ();
@ -1212,7 +1212,7 @@ void MchRes_ShowOneMchResult (void)
HTM_TD_Begin ("class=\"DAT LT\"");
if (ICanViewScore)
HTM_Double2Decimals (Exam.Score);
HTM_Double2Decimals (Result.Score);
else
Ico_PutIconNotVisible ();
HTM_TD_End ();
@ -1228,9 +1228,8 @@ void MchRes_ShowOneMchResult (void)
HTM_TD_Begin ("class=\"DAT LT\"");
if (ICanViewScore)
TstExa_ComputeAndShowGrade (Exam.NumQsts,
Exam.Score,
Game.MaxGrade);
TstRes_ComputeAndShowGrade (Result.NumQsts,Result.Score,
Game.MaxGrade);
else
Ico_PutIconNotVisible ();
HTM_TD_End ();
@ -1251,7 +1250,7 @@ void MchRes_ShowOneMchResult (void)
HTM_TR_End ();
/***** Write answers and solutions *****/
TstExa_ShowExamAnswers (UsrDat,&Exam,Game.Visibility);
TstRes_ShowExamAnswers (UsrDat,&Result,Game.Visibility);
/***** End table *****/
HTM_TABLE_End ();
@ -1261,10 +1260,11 @@ void MchRes_ShowOneMchResult (void)
{
HTM_DIV_Begin ("class=\"DAT_N_BOLD CM\"");
HTM_TxtColonNBSP (Txt_Score);
HTM_Double2Decimals (Exam.Score);
HTM_Double2Decimals (Result.Score);
HTM_BR ();
HTM_TxtColonNBSP (Txt_Grade);
TstExa_ComputeAndShowGrade (Exam.NumQsts,Exam.Score,Game.MaxGrade);
TstRes_ComputeAndShowGrade (Result.NumQsts,Result.Score,
Game.MaxGrade);
HTM_DIV_End ();
}
@ -1280,7 +1280,7 @@ void MchRes_ShowOneMchResult (void)
/*****************************************************************************/
void MchRes_GetMatchResultQuestionsFromDB (long MchCod,long UsrCod,
struct TstExa_Exam *Exam)
struct TstRes_Result *Result)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -1290,27 +1290,27 @@ void MchRes_GetMatchResultQuestionsFromDB (long MchCod,long UsrCod,
struct Mch_UsrAnswer UsrAnswer;
/***** Get questions and answers of a match result *****/
Exam->NumQsts = (unsigned)
DB_QuerySELECT (&mysql_res,"can not get questions and answers"
" of a match result",
"SELECT gam_questions.QstCod," // row[0]
"gam_questions.QstInd," // row[1]
"mch_indexes.Indexes" // row[2]
" FROM mch_matches,gam_questions,mch_indexes"
" WHERE mch_matches.MchCod=%ld"
" AND mch_matches.GamCod=gam_questions.GamCod"
" AND mch_matches.MchCod=mch_indexes.MchCod"
" AND gam_questions.QstInd=mch_indexes.QstInd"
" ORDER BY gam_questions.QstInd",
MchCod);
for (NumQst = 0, Exam->NumQstsNotBlank = 0;
NumQst < Exam->NumQsts;
Result->NumQsts = (unsigned)
DB_QuerySELECT (&mysql_res,"can not get questions and answers"
" of a match result",
"SELECT gam_questions.QstCod," // row[0]
"gam_questions.QstInd," // row[1]
"mch_indexes.Indexes" // row[2]
" FROM mch_matches,gam_questions,mch_indexes"
" WHERE mch_matches.MchCod=%ld"
" AND mch_matches.GamCod=gam_questions.GamCod"
" AND mch_matches.MchCod=mch_indexes.MchCod"
" AND gam_questions.QstInd=mch_indexes.QstInd"
" ORDER BY gam_questions.QstInd",
MchCod);
for (NumQst = 0, Result->NumQstsNotBlank = 0;
NumQst < Result->NumQsts;
NumQst++)
{
row = mysql_fetch_row (mysql_res);
/* Get question code (row[0]) */
if ((Exam->Questions[NumQst].QstCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
if ((Result->Questions[NumQst].QstCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
Lay_ShowErrorAndExit ("Wrong code of question.");
/* Get question index (row[1]) */
@ -1319,24 +1319,24 @@ void MchRes_GetMatchResultQuestionsFromDB (long MchCod,long UsrCod,
QstInd = (unsigned) LongNum;
/* Get indexes for this question (row[2]) */
Str_Copy (Exam->Questions[NumQst].StrIndexes,row[2],
TstExa_MAX_BYTES_INDEXES_ONE_QST);
Str_Copy (Result->Questions[NumQst].StrIndexes,row[2],
TstRes_MAX_BYTES_INDEXES_ONE_QST);
/* Get answers selected by user for this question */
Mch_GetQstAnsFromDB (MchCod,UsrCod,QstInd,&UsrAnswer);
if (UsrAnswer.AnsInd >= 0) // UsrAnswer.AnsInd >= 0 ==> answer selected
{
snprintf (Exam->Questions[NumQst].StrAnswers,TstExa_MAX_BYTES_ANSWERS_ONE_QST + 1,
snprintf (Result->Questions[NumQst].StrAnswers,TstRes_MAX_BYTES_ANSWERS_ONE_QST + 1,
"%d",UsrAnswer.AnsInd);
Exam->NumQstsNotBlank++;
Result->NumQstsNotBlank++;
}
else // UsrAnswer.AnsInd < 0 ==> no answer selected
Exam->Questions[NumQst].StrAnswers[0] = '\0'; // Empty answer
Result->Questions[NumQst].StrAnswers[0] = '\0'; // Empty answer
/* Replace each comma by a separator of multiple parameters */
/* In database commas are used as separators instead of special chars */
Par_ReplaceCommaBySeparatorMultiple (Exam->Questions[NumQst].StrIndexes);
Par_ReplaceCommaBySeparatorMultiple (Exam->Questions[NumQst].StrAnswers);
Par_ReplaceCommaBySeparatorMultiple (Result->Questions[NumQst].StrIndexes);
Par_ReplaceCommaBySeparatorMultiple (Result->Questions[NumQst].StrAnswers);
}
/***** Free structure that stores the query result *****/
@ -1348,7 +1348,7 @@ void MchRes_GetMatchResultQuestionsFromDB (long MchCod,long UsrCod,
/*****************************************************************************/
static void MchRes_GetMatchResultDataByMchCod (long MchCod,long UsrCod,
struct TstExa_Exam *Exam)
struct TstRes_Result *Result)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -1377,27 +1377,27 @@ static void MchRes_GetMatchResultDataByMchCod (long MchCod,long UsrCod,
for (StartEndTime = (Dat_StartEndTime_t) 0;
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
StartEndTime++)
Exam->TimeUTC[StartEndTime] = Dat_GetUNIXTimeFromStr (row[StartEndTime]);
Result->TimeUTC[StartEndTime] = Dat_GetUNIXTimeFromStr (row[StartEndTime]);
/* Get number of questions (row[2]) */
if (sscanf (row[2],"%u",&Exam->NumQsts) != 1)
Exam->NumQsts = 0;
if (sscanf (row[2],"%u",&Result->NumQsts) != 1)
Result->NumQsts = 0;
/* Get number of questions not blank (row[3]) */
if (sscanf (row[3],"%u",&Exam->NumQstsNotBlank) != 1)
Exam->NumQstsNotBlank = 0;
if (sscanf (row[3],"%u",&Result->NumQstsNotBlank) != 1)
Result->NumQstsNotBlank = 0;
/* Get score (row[4]) */
Str_SetDecimalPointToUS (); // To get the decimal point as a dot
if (sscanf (row[4],"%lf",&Exam->Score) != 1)
Exam->Score = 0.0;
if (sscanf (row[4],"%lf",&Result->Score) != 1)
Result->Score = 0.0;
Str_SetDecimalPointToLocal (); // Return to local system
}
else
{
Exam->NumQsts = 0;
Exam->NumQstsNotBlank = 0;
Exam->Score = 0.0;
Result->NumQsts = 0;
Result->NumQstsNotBlank = 0;
Result->Score = 0.0;
}
/***** Free structure that stores the query result *****/

View File

@ -51,6 +51,6 @@ void MchRes_ShowAllMchResultsInMch (void);
void MchRes_ShowOneMchResult (void);
void MchRes_GetMatchResultQuestionsFromDB (long MchCod,long UsrCod,
struct TstExa_Exam *Exam);
struct TstRes_Result *Result);
#endif

View File

@ -116,9 +116,10 @@ static const Act_Action_t Mnu_MenuActions[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_
[ 1] = ActSeeAsg,
[ 2] = ActSeePrj,
[ 3] = ActReqTst,
[ 4] = ActSeeAllGam,
[ 5] = ActSeeAllSvy,
[ 6] = ActSeeAllExaAnn,
[ 4] = ActSeeAllExa,
[ 5] = ActSeeAllGam,
[ 6] = ActSeeAllSvy,
[ 7] = ActSeeAllExaAnn,
},
[TabFil] = {
[ 0] = ActSeeAdmDocIns,

View File

@ -34,6 +34,7 @@
#include "swad_agenda.h"
#include "swad_attendance.h"
#include "swad_database.h"
#include "swad_exam.h"
#include "swad_form.h"
#include "swad_forum.h"
#include "swad_game.h"
@ -62,6 +63,7 @@ static const char *Pag_ParamNumPag[Pag_NUM_WHAT_PAGINATE] =
{
[Pag_ASSIGNMENTS ] = "NumPagAsg",
[Pag_PROJECTS ] = "NumPagPrj",
[Pag_EXAMS ] = "NumPagExa",
[Pag_GAMES ] = "NumPagGam",
[Pag_SURVEYS ] = "NumPagSvy",
[Pag_ATT_EVENTS ] = "NumPagAtt",
@ -187,6 +189,13 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
1,
Cod);
break;
case Pag_EXAMS:
Frm_StartFormAnchor (ActSeeAllExa,Pagination->Anchor);
Pag_PutHiddenParamPagNum (WhatPaginate,1);
Dat_PutHiddenParamOrder (((struct Exa_Exams *) Context)->SelectedOrder);
WhichGroups = Grp_GetParamWhichGroups ();
Grp_PutParamWhichGroups (&WhichGroups);
break;
case Pag_GAMES:
Frm_StartFormAnchor (ActSeeAllGam,Pagination->Anchor);
Pag_PutHiddenParamPagNum (WhatPaginate,1);
@ -305,6 +314,13 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
1,
Cod);
break;
case Pag_EXAMS:
Frm_StartFormAnchor (ActSeeAllExa,Pagination->Anchor);
Pag_PutHiddenParamPagNum (WhatPaginate,1);
Dat_PutHiddenParamOrder (((struct Exa_Exams *) Context)->SelectedOrder);
WhichGroups = Grp_GetParamWhichGroups ();
Grp_PutParamWhichGroups (&WhichGroups);
break;
case Pag_GAMES:
Frm_StartFormAnchor (ActSeeAllGam,Pagination->Anchor);
Pag_PutHiddenParamPagNum (WhatPaginate,1);
@ -409,6 +425,13 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
Pagination->LeftPage,
Cod);
break;
case Pag_EXAMS:
Frm_StartFormAnchor (ActSeeAllExa,Pagination->Anchor);
Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->LeftPage);
Dat_PutHiddenParamOrder (((struct Exa_Exams *) Context)->SelectedOrder);
WhichGroups = Grp_GetParamWhichGroups ();
Grp_PutParamWhichGroups (&WhichGroups);
break;
case Pag_GAMES:
Frm_StartFormAnchor (ActSeeAllGam,Pagination->Anchor);
Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->LeftPage);
@ -525,6 +548,13 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
NumPage,
Cod);
break;
case Pag_EXAMS:
Frm_StartFormAnchor (ActSeeAllExa,Pagination->Anchor);
Pag_PutHiddenParamPagNum (WhatPaginate,NumPage);
Dat_PutHiddenParamOrder (((struct Exa_Exams *) Context)->SelectedOrder);
WhichGroups = Grp_GetParamWhichGroups ();
Grp_PutParamWhichGroups (&WhichGroups);
break;
case Pag_GAMES:
Frm_StartFormAnchor (ActSeeAllGam,Pagination->Anchor);
Pag_PutHiddenParamPagNum (WhatPaginate,NumPage);
@ -628,6 +658,13 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
Pagination->RightPage,
Cod);
break;
case Pag_EXAMS:
Frm_StartFormAnchor (ActSeeAllExa,Pagination->Anchor);
Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->RightPage);
Dat_PutHiddenParamOrder (((struct Exa_Exams *) Context)->SelectedOrder);
WhichGroups = Grp_GetParamWhichGroups ();
Grp_PutParamWhichGroups (&WhichGroups);
break;
case Pag_GAMES:
Frm_StartFormAnchor (ActSeeAllGam,Pagination->Anchor);
Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->RightPage);
@ -732,6 +769,13 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
Pagination->NumPags,
Cod);
break;
case Pag_EXAMS:
Frm_StartFormAnchor (ActSeeAllExa,Pagination->Anchor);
Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->NumPags);
Dat_PutHiddenParamOrder (((struct Exa_Exams *) Context)->SelectedOrder);
WhichGroups = Grp_GetParamWhichGroups ();
Grp_PutParamWhichGroups (&WhichGroups);
break;
case Pag_GAMES:
Frm_StartFormAnchor (ActSeeAllGam,Pagination->Anchor);
Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->NumPags);

View File

@ -39,20 +39,21 @@
/******************************** Public types *******************************/
/*****************************************************************************/
#define Pag_NUM_WHAT_PAGINATE 11
#define Pag_NUM_WHAT_PAGINATE 12
typedef enum
{
Pag_ASSIGNMENTS = 0,
Pag_PROJECTS = 1,
Pag_GAMES = 2,
Pag_SURVEYS = 3,
Pag_ATT_EVENTS = 4,
Pag_THREADS_FORUM = 5,
Pag_POSTS_FORUM = 6,
Pag_MESSAGES_RECEIVED = 7,
Pag_MESSAGES_SENT = 8,
Pag_MY_AGENDA = 9,
Pag_ANOTHER_AGENDA = 10,
Pag_EXAMS = 2,
Pag_GAMES = 3,
Pag_SURVEYS = 4,
Pag_ATT_EVENTS = 5,
Pag_THREADS_FORUM = 6,
Pag_POSTS_FORUM = 7,
Pag_MESSAGES_RECEIVED = 8,
Pag_MESSAGES_SENT = 9,
Pag_MY_AGENDA = 10,
Pag_ANOTHER_AGENDA = 11,
} Pag_WhatPaginate_t;
struct Pagination // Used for threads and messages pagination

View File

@ -2528,7 +2528,7 @@ static void Rec_PutIconsCommands (__attribute__((unused)) void *Args)
if (Gbl.Record.UsrDat->Roles.InCurrentCrs.Role == Rol_STD) // He/she is a student in current course
{
/***** Button to view student's test exams *****/
if (Usr_CheckIfICanViewTst (Gbl.Record.UsrDat))
if (Usr_CheckIfICanViewTstExaMchResult (Gbl.Record.UsrDat))
{
if (ItsMe)
Lay_PutContextualLinkOnlyIcon (ActSeeMyTstRes,NULL,

View File

@ -132,15 +132,15 @@ static void Tst_ShowFormRequestTest (struct Tst_Test *Test);
static void Tst_PutCheckBoxAllowTeachers (bool AllowTeachers);
static void Tst_GetAnswersFromForm (struct TstExa_Exam *Exam);
static void Tst_GetAnswersFromForm (struct TstRes_Result *Result);
static bool Tst_CheckIfNextTstAllowed (void);
static unsigned Tst_GetNumExamsGeneratedByMe (void);
static void Tst_ShowTestExamToFillIt (struct TstExa_Exam *Exam,
static void Tst_ShowTestExamToFillIt (struct TstRes_Result *Result,
unsigned NumExamsGeneratedByMe,
Tst_RequestOrConfirm_t RequestOrConfirm);
static void Tst_WriteQstAndAnsSeeing (const struct TstExa_Exam *Exam,
static void Tst_WriteQstAndAnsSeeing (const struct TstRes_Result *Result,
unsigned NumQst,
const struct Tst_Question *Question);
@ -150,6 +150,8 @@ static void Tst_IncreaseMyNumAccessTst (void);
static void Tst_UpdateLastAccTst (unsigned NumQsts);
static void Tst_ShowFormRequestEditTests (struct Tst_Test *Test);
static void Tst_ShowFormRequestSelectTestsForExam (struct Exa_Exams *Exams,
struct Tst_Test *Test);
static void Tst_ShowFormRequestSelectTestsForGame (struct Gam_Games *Games,
struct Tst_Test *Test);
static bool Tst_CheckIfICanEditTests (void);
@ -174,8 +176,8 @@ static void Tst_PutInputFieldNumQst (const char *Field,const char *Label,
static void Tst_ShowFormAnswerTypes (const struct Tst_AnswerTypes *AnswerTypes);
static void Tst_GetQuestions (struct Tst_Test *Test,MYSQL_RES **mysql_res);
static void Tst_GetQuestionsForNewTestFromDB (struct Tst_Test *Test,
struct TstExa_Exam *Exam);
static void Tst_GenerateChoiceIndexesDependingOnShuffle (struct TstExa_Exam *Exam,
struct TstRes_Result *Result);
static void Tst_GenerateChoiceIndexesDependingOnShuffle (struct TstRes_Result *Result,
unsigned NumQst,
bool Shuffle);
@ -184,34 +186,37 @@ static void Tst_ListOneOrMoreQuestionsForEdition (struct Tst_Test *Test,
MYSQL_RES *mysql_res);
static void Tst_WriteHeadingRowQuestionsForEdition (const struct Tst_Test *Test);
static void Tst_WriteQuestionListing (struct Tst_Test *Test,unsigned NumQst);
static void Tst_ListOneOrMoreQuestionsForSelection (struct Gam_Games *Games,
static void Tst_ListOneOrMoreQuestionsForSelectionForExam (struct Exa_Exams *Exams,
unsigned NumQsts,
MYSQL_RES *mysql_res);
static void Tst_ListOneOrMoreQuestionsForSelectionForGame (struct Gam_Games *Games,
unsigned NumQsts,
MYSQL_RES *mysql_res);
static void Tst_WriteQuestionRowForSelection (unsigned NumQst,
struct Tst_Question *Question);
static void Tst_WriteAnswersSeeing (const struct TstExa_Exam *Exam,
static void Tst_WriteAnswersSeeing (const struct TstRes_Result *Result,
unsigned NumQst,
const struct Tst_Question *Question);
static void Tst_WriteIntAnsListing (const struct Tst_Question *Question);
static void Tst_WriteIntAnsSeeing (const struct TstExa_Exam *Exam,
static void Tst_WriteIntAnsSeeing (const struct TstRes_Result *Result,
unsigned NumQst);
static void Tst_WriteFloatAnsEdit (const struct Tst_Question *Question);
static void Tst_WriteFloatAnsSeeing (const struct TstExa_Exam *Exam,
static void Tst_WriteFloatAnsSeeing (const struct TstRes_Result *Result,
unsigned NumQst);
static void Tst_WriteTFAnsListing (const struct Tst_Question *Question);
static void Tst_WriteTFAnsSeeing (const struct TstExa_Exam *Exam,
static void Tst_WriteTFAnsSeeing (const struct TstRes_Result *Result,
unsigned NumQst);
static void Tst_WriteChoiceAnsListing (const struct Tst_Question *Question);
static void Tst_WriteChoiceAnsSeeing (const struct TstExa_Exam *Exam,
static void Tst_WriteChoiceAnsSeeing (const struct TstRes_Result *Result,
unsigned NumQst,
const struct Tst_Question *Question);
static void Tst_WriteTextAnsSeeing (const struct TstExa_Exam *Exam,
static void Tst_WriteTextAnsSeeing (const struct TstRes_Result *Result,
unsigned NumQst);
static void Tst_WriteParamQstCod (unsigned NumQst,long QstCod);
@ -441,7 +446,7 @@ void Tst_ShowNewTest (void)
{
extern const char *Txt_No_questions_found_matching_your_search_criteria;
struct Tst_Test Test;
struct TstExa_Exam Exam;
struct TstRes_Result Exam;
unsigned NumExamsGeneratedByMe;
/***** Create test *****/
@ -456,7 +461,7 @@ void Tst_ShowNewTest (void)
if (Tst_GetParamsTst (&Test,Tst_SHOW_TEST_TO_ANSWER)) // Get parameters from form
{
/***** Get questions *****/
TstExa_ResetExam (&Exam);
TstRes_ResetResult (&Exam);
Tst_GetQuestionsForNewTestFromDB (&Test,&Exam);
if (Exam.NumQsts)
{
@ -465,8 +470,8 @@ void Tst_ShowNewTest (void)
NumExamsGeneratedByMe = Tst_GetNumExamsGeneratedByMe ();
/***** Create new test exam in database *****/
TstExa_CreateExamInDB (&Exam);
TstExa_ComputeScoresAndStoreExamQuestions (&Exam,
TstRes_CreateExamInDB (&Exam);
TstRes_ComputeScoresAndStoreExamQuestions (&Exam,
false); // Don't update question score
/***** Show test exam to be answered *****/
@ -519,46 +524,46 @@ void Tst_ReceiveTestDraft (void)
{
extern const char *Txt_The_test_X_has_already_been_assessed_previously;
unsigned NumTst;
struct TstExa_Exam Exam;
struct TstRes_Result Result;
/***** Read test configuration from database *****/
TstCfg_GetConfigFromDB ();
/***** Get basic parameters of the exam *****/
/* Get test exam code from form */
TstExa_ResetExam (&Exam);
if ((Exam.ExaCod = TstExa_GetParamExaCod ()) <= 0)
TstRes_ResetResult (&Result);
if ((Result.ResCod = TstRes_GetParamExaCod ()) <= 0)
Lay_ShowErrorAndExit ("Wrong test exam.");
/* Get number of this test from form */
NumTst = Tst_GetParamNumTst ();
/***** Get test exam from database *****/
TstExa_GetExamDataByExaCod (&Exam);
TstRes_GetExamDataByExaCod (&Result);
/****** Get test status in database for this session-course-num.test *****/
if (Exam.Sent)
if (Result.Sent)
Ale_ShowAlert (Ale_WARNING,Txt_The_test_X_has_already_been_assessed_previously,
NumTst);
else // Exam not yet sent
{
/***** Get test exam questions from database *****/
TstExa_GetExamQuestionsFromDB (&Exam);
TstRes_GetExamQuestionsFromDB (&Result);
/***** Get answers from form to assess a test *****/
Tst_GetAnswersFromForm (&Exam);
Tst_GetAnswersFromForm (&Result);
/***** Update test exam in database *****/
TstExa_ComputeScoresAndStoreExamQuestions (&Exam,
TstRes_ComputeScoresAndStoreExamQuestions (&Result,
false); // Don't update question score
TstExa_UpdateExamInDB (&Exam);
TstRes_UpdateExamInDB (&Result);
/***** Show question and button to send the test *****/
/* Start alert */
Ale_ShowAlert (Ale_WARNING,"Por favor, revise sus respuestas antes de enviar el examen:"); // TODO: Need translation!!!
/* Show the same test exam to be answered */
Tst_ShowTestExamToFillIt (&Exam,NumTst,Tst_CONFIRM);
Tst_ShowTestExamToFillIt (&Result,NumTst,Tst_CONFIRM);
}
}
@ -575,43 +580,43 @@ void Tst_AssessTest (void)
extern const char *Txt_Grade;
extern const char *Txt_The_test_X_has_already_been_assessed_previously;
unsigned NumTst;
struct TstExa_Exam Exam;
struct TstRes_Result Result;
/***** Read test configuration from database *****/
TstCfg_GetConfigFromDB ();
/***** Get basic parameters of the exam *****/
/* Get test exam code from form */
TstExa_ResetExam (&Exam);
if ((Exam.ExaCod = TstExa_GetParamExaCod ()) <= 0)
TstRes_ResetResult (&Result);
if ((Result.ResCod = TstRes_GetParamExaCod ()) <= 0)
Lay_ShowErrorAndExit ("Wrong test exam.");
/* Get number of this test from form */
NumTst = Tst_GetParamNumTst ();
/***** Get test exam from database *****/
TstExa_GetExamDataByExaCod (&Exam);
TstRes_GetExamDataByExaCod (&Result);
/****** Get test status in database for this session-course-num.test *****/
if (Exam.Sent)
if (Result.Sent)
Ale_ShowAlert (Ale_WARNING,Txt_The_test_X_has_already_been_assessed_previously,
NumTst);
else // Exam not yet sent
{
/***** Get test exam questions from database *****/
TstExa_GetExamQuestionsFromDB (&Exam);
TstRes_GetExamQuestionsFromDB (&Result);
/***** Get answers from form to assess a test *****/
Tst_GetAnswersFromForm (&Exam);
Tst_GetAnswersFromForm (&Result);
/***** Get if test exam will be visible by teachers *****/
Exam.Sent = true; // The exam has been finished and sent by student
Exam.AllowTeachers = Par_GetParToBool ("AllowTchs");
Result.Sent = true; // The exam has been finished and sent by student
Result.AllowTeachers = Par_GetParToBool ("AllowTchs");
/***** Update test exam in database *****/
TstExa_ComputeScoresAndStoreExamQuestions (&Exam,
TstRes_ComputeScoresAndStoreExamQuestions (&Result,
Gbl.Usrs.Me.Role.Logged == Rol_STD); // Update question score?
TstExa_UpdateExamInDB (&Exam);
TstRes_UpdateExamInDB (&Result);
/***** Begin box *****/
Box_BoxBegin (NULL,Txt_Test_result,
@ -631,19 +636,19 @@ void Tst_AssessTest (void)
}
/***** Write answers and solutions *****/
TstExa_ShowExamAfterAssess (&Exam);
TstRes_ShowExamAfterAssess (&Result);
/***** Write total score and grade *****/
if (TstVis_IsVisibleTotalScore (TstCfg_GetConfigVisibility ()))
{
HTM_DIV_Begin ("class=\"DAT_N_BOLD CM\"");
HTM_TxtColonNBSP (Txt_Score);
HTM_Double2Decimals (Exam.Score);
HTM_Double2Decimals (Result.Score);
HTM_BR ();
HTM_TxtColonNBSP (Txt_Grade);
TstExa_ComputeAndShowGrade (Exam.NumQsts,
Exam.Score,
TstExa_SCORE_MAX);
TstRes_ComputeAndShowGrade (Result.NumQsts,
Result.Score,
TstRes_SCORE_MAX);
HTM_DIV_End ();
}
@ -656,22 +661,22 @@ void Tst_AssessTest (void)
/*********** Get questions and answers from form to assess a test ************/
/*****************************************************************************/
static void Tst_GetAnswersFromForm (struct TstExa_Exam *Exam)
static void Tst_GetAnswersFromForm (struct TstRes_Result *Result)
{
unsigned NumQst;
char StrAns[3 + Cns_MAX_DECIMAL_DIGITS_UINT + 1]; // "Ansxx...x"
/***** Loop for every question getting user's answers *****/
for (NumQst = 0;
NumQst < Exam->NumQsts;
NumQst < Result->NumQsts;
NumQst++)
{
/* Get answers selected by user for this question */
snprintf (StrAns,sizeof (StrAns),
"Ans%010u",
NumQst);
Par_GetParMultiToText (StrAns,Exam->Questions[NumQst].StrAnswers,
TstExa_MAX_BYTES_ANSWERS_ONE_QST); /* If answer type == T/F ==> " ", "T", "F"; if choice ==> "0", "2",... */
Par_GetParMultiToText (StrAns,Result->Questions[NumQst].StrAnswers,
TstRes_MAX_BYTES_ANSWERS_ONE_QST); /* If answer type == T/F ==> " ", "T", "F"; if choice ==> "0", "2",... */
}
}
@ -783,7 +788,7 @@ static unsigned Tst_GetNumExamsGeneratedByMe (void)
/************************ Show a test exam to be answered ********************/
/*****************************************************************************/
static void Tst_ShowTestExamToFillIt (struct TstExa_Exam *Exam,
static void Tst_ShowTestExamToFillIt (struct TstRes_Result *Result,
unsigned NumExamsGeneratedByMe,
Tst_RequestOrConfirm_t RequestOrConfirm)
{
@ -806,11 +811,11 @@ static void Tst_ShowTestExamToFillIt (struct TstExa_Exam *Exam,
Gbl.Hierarchy.Deg.DegCod,
Gbl.Hierarchy.Crs.CrsCod);
if (Exam->NumQsts)
if (Result->NumQsts)
{
/***** Begin form *****/
Frm_StartForm (Action[RequestOrConfirm]);
TstExa_PutParamExaCod (Exam->ExaCod);
TstRes_PutParamExaCod (Result->ResCod);
Par_PutHiddenParamUnsigned (NULL,"NumTst",NumExamsGeneratedByMe);
/***** Begin table *****/
@ -818,21 +823,21 @@ static void Tst_ShowTestExamToFillIt (struct TstExa_Exam *Exam,
/***** Write one row for each question *****/
for (NumQst = 0;
NumQst < Exam->NumQsts;
NumQst < Result->NumQsts;
NumQst++)
{
Gbl.RowEvenOdd = NumQst % 2;
/* Create test question */
Tst_QstConstructor (&Question);
Question.QstCod = Exam->Questions[NumQst].QstCod;
Question.QstCod = Result->Questions[NumQst].QstCod;
/* Show question */
if (!Tst_GetQstDataFromDB (&Question)) // Question exists
Lay_ShowErrorAndExit ("Wrong question.");
/* Write question and answers */
Tst_WriteQstAndAnsSeeing (Exam,NumQst,&Question);
Tst_WriteQstAndAnsSeeing (Result,NumQst,&Question);
/* Destroy test question */
Tst_QstDestructor (&Question);
@ -846,7 +851,7 @@ static void Tst_ShowTestExamToFillIt (struct TstExa_Exam *Exam,
{
case Tst_REQUEST:
/* Send button */
Btn_PutConfirmButton ("He terminado"); // TODO: Need translation!!!
Btn_PutConfirmButton ("Continuar"); // TODO: Need translation!!!
break;
case Tst_CONFIRM:
/* Will the test exam be visible by teachers? */
@ -896,7 +901,7 @@ void Tst_ShowTagList (unsigned NumTags,MYSQL_RES *mysql_res)
/********** Write a row of a test, with one question and its answer **********/
/*****************************************************************************/
static void Tst_WriteQstAndAnsSeeing (const struct TstExa_Exam *Exam,
static void Tst_WriteQstAndAnsSeeing (const struct TstRes_Result *Result,
unsigned NumQst,
const struct Tst_Question *Question)
{
@ -924,7 +929,7 @@ static void Tst_WriteQstAndAnsSeeing (const struct TstExa_Exam *Exam,
"TEST_MED_SHOW");
/* Answers */
Tst_WriteAnswersSeeing (Exam,NumQst,Question);
Tst_WriteAnswersSeeing (Result,NumQst,Question);
HTM_TD_End ();
@ -1213,6 +1218,24 @@ static void Tst_ShowFormRequestEditTests (struct Tst_Test *Test)
/******************* Select test questions for a game ************************/
/*****************************************************************************/
void Tst_RequestSelectTestsForExam (struct Exa_Exams *Exams)
{
struct Tst_Test Test;
/***** Create test *****/
Tst_TstConstructor (&Test);
/***** Show form to select test for exam *****/
Tst_ShowFormRequestSelectTestsForExam (Exams,&Test); // No tags selected
/***** Destroy test *****/
Tst_TstDestructor (&Test);
}
/*****************************************************************************/
/******************* Select test questions for a game ************************/
/*****************************************************************************/
void Tst_RequestSelectTestsForGame (struct Gam_Games *Games)
{
struct Tst_Test Test;
@ -1227,6 +1250,65 @@ void Tst_RequestSelectTestsForGame (struct Gam_Games *Games)
Tst_TstDestructor (&Test);
}
/*****************************************************************************/
/************** Show form to select test questions for a exam ****************/
/*****************************************************************************/
static void Tst_ShowFormRequestSelectTestsForExam (struct Exa_Exams *Exams,
struct Tst_Test *Test)
{
extern const char *Hlp_ASSESSMENT_Exams_questions;
extern const char *Txt_No_test_questions;
extern const char *Txt_Select_questions;
extern const char *Txt_Show_questions;
MYSQL_RES *mysql_res;
static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] =
{
[Dat_START_TIME] = Dat_HMS_DO_NOT_SET,
[Dat_END_TIME ] = Dat_HMS_DO_NOT_SET
};
/***** Begin box *****/
Box_BoxBegin (NULL,Txt_Select_questions,
NULL,NULL,
Hlp_ASSESSMENT_Exams_questions,Box_NOT_CLOSABLE);
/***** Get tags already present in the table of questions *****/
if ((Test->Tags.Num = Tst_GetAllTagsFromCurrentCrs (&mysql_res)))
{
Frm_StartForm (ActExaLstTstQst);
Exa_PutParams (Exams);
HTM_TABLE_BeginPadding (2);
/***** Selection of tags *****/
Tst_ShowFormSelTags (&Test->Tags,mysql_res,false);
/***** Starting and ending dates in the search *****/
Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (SetHMS);
HTM_TABLE_End ();
/***** Send button *****/
Btn_PutConfirmButton (Txt_Show_questions);
Frm_EndForm ();
}
else // No test questions
{
/***** Warning message *****/
Ale_ShowAlert (Ale_INFO,Txt_No_test_questions);
/***** Button to create a new question *****/
Tst_PutButtonToAddQuestion ();
}
/***** End box *****/
Box_BoxEnd ();
/* Free structure that stores the query result */
DB_FreeMySQLResult (&mysql_res);
}
/*****************************************************************************/
/************** Show form to select test questions for a game ****************/
/*****************************************************************************/
@ -2141,10 +2223,10 @@ void Tst_ListQuestionsToEdit (void)
}
/*****************************************************************************/
/**************** List several test questions for selection ******************/
/************ List several test questions for selection for exam *************/
/*****************************************************************************/
void Tst_ListQuestionsToSelect (struct Gam_Games *Games)
void Tst_ListQuestionsToSelectForExam (struct Exa_Exams *Exams)
{
struct Tst_Test Test;
MYSQL_RES *mysql_res;
@ -2158,7 +2240,38 @@ void Tst_ListQuestionsToSelect (struct Gam_Games *Games)
Tst_GetQuestions (&Test,&mysql_res); // Query database
if (Test.NumQsts)
/* Show the table with the questions */
Tst_ListOneOrMoreQuestionsForSelection (Games,Test.NumQsts,mysql_res);
Tst_ListOneOrMoreQuestionsForSelectionForExam (Exams,Test.NumQsts,mysql_res);
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
}
else
/* Show the form again */
Tst_ShowFormRequestSelectTestsForExam (Exams,&Test);
/***** Destroy test *****/
Tst_TstDestructor (&Test);
}
/*****************************************************************************/
/************ List several test questions for selection for game *************/
/*****************************************************************************/
void Tst_ListQuestionsToSelectForGame (struct Gam_Games *Games)
{
struct Tst_Test Test;
MYSQL_RES *mysql_res;
/***** Create test *****/
Tst_TstConstructor (&Test);
/***** Get parameters, query the database and list the questions *****/
if (Tst_GetParamsTst (&Test,Tst_SELECT_QUESTIONS_FOR_GAME)) // Get parameters from the form
{
Tst_GetQuestions (&Test,&mysql_res); // Query database
if (Test.NumQsts)
/* Show the table with the questions */
Tst_ListOneOrMoreQuestionsForSelectionForGame (Games,Test.NumQsts,mysql_res);
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
@ -2335,7 +2448,7 @@ static void Tst_GetQuestions (struct Tst_Test *Test,MYSQL_RES **mysql_res)
/*****************************************************************************/
static void Tst_GetQuestionsForNewTestFromDB (struct Tst_Test *Test,
struct TstExa_Exam *Exam)
struct TstRes_Result *Result)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -2448,14 +2561,14 @@ static void Tst_GetQuestionsForNewTestFromDB (struct Tst_Test *Test,
Lay_ShowAlert (Lay_INFO,Query);
*/
/* Make the query */
Exam->NumQsts =
Result->NumQsts =
Test->NumQsts = (unsigned) DB_QuerySELECT (&mysql_res,"can not get questions",
"%s",
Query);
/***** Get questions and answers from database *****/
for (NumQst = 0;
NumQst < Exam->NumQsts;
NumQst < Result->NumQsts;
NumQst++)
{
/* Get question row */
@ -2467,7 +2580,7 @@ static void Tst_GetQuestionsForNewTestFromDB (struct Tst_Test *Test,
*/
/* Get question code (row[0]) */
if ((Exam->Questions[NumQst].QstCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
if ((Result->Questions[NumQst].QstCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
Lay_ShowErrorAndExit ("Wrong code of question.");
/* Get answer type (row[1]) */
@ -2483,13 +2596,13 @@ static void Tst_GetQuestionsForNewTestFromDB (struct Tst_Test *Test,
case Tst_ANS_FLOAT:
case Tst_ANS_TRUE_FALSE:
case Tst_ANS_TEXT:
Exam->Questions[NumQst].StrIndexes[0] = '\0';
Result->Questions[NumQst].StrIndexes[0] = '\0';
break;
case Tst_ANS_UNIQUE_CHOICE:
case Tst_ANS_MULTIPLE_CHOICE:
/* If answer type is unique or multiple option,
generate indexes of answers depending on shuffle */
Tst_GenerateChoiceIndexesDependingOnShuffle (Exam,NumQst,Shuffle);
Tst_GenerateChoiceIndexesDependingOnShuffle (Result,NumQst,Shuffle);
break;
default:
break;
@ -2499,18 +2612,18 @@ static void Tst_GetQuestionsForNewTestFromDB (struct Tst_Test *Test,
Initially user has not answered the question ==> initially all the answers will be blank.
If the user does not confirm the submission of their exam ==>
==> the exam may be half filled ==> the answers displayed will be those selected by the user. */
Exam->Questions[NumQst].StrAnswers[0] = '\0';
Result->Questions[NumQst].StrAnswers[0] = '\0';
}
/***** Get if test exam will be visible by teachers *****/
Exam->AllowTeachers = Par_GetParToBool ("AllowTchs");
Result->AllowTeachers = Par_GetParToBool ("AllowTchs");
}
/*****************************************************************************/
/********* Get single or multiple choice answer when seeing a test ***********/
/*****************************************************************************/
static void Tst_GenerateChoiceIndexesDependingOnShuffle (struct TstExa_Exam *Exam,
static void Tst_GenerateChoiceIndexesDependingOnShuffle (struct TstRes_Result *Result,
unsigned NumQst,
bool Shuffle)
{
@ -2525,7 +2638,7 @@ static void Tst_GenerateChoiceIndexesDependingOnShuffle (struct TstExa_Exam *Exa
/***** Create test question *****/
Tst_QstConstructor (&Question);
Question.QstCod = Exam->Questions[NumQst].QstCod;
Question.QstCod = Result->Questions[NumQst].QstCod;
/***** Get answers of question from database *****/
Tst_GetAnswersQst (&Question,&mysql_res,Shuffle);
@ -2562,8 +2675,8 @@ static void Tst_GenerateChoiceIndexesDependingOnShuffle (struct TstExa_Exam *Exa
snprintf (StrInd,sizeof (StrInd),"%u",Index);
else
snprintf (StrInd,sizeof (StrInd),"%s%u",Par_SEPARATOR_PARAM_MULTIPLE,Index);
Str_Concat (Exam->Questions[NumQst].StrIndexes,StrInd,
TstExa_MAX_BYTES_INDEXES_ONE_QST);
Str_Concat (Result->Questions[NumQst].StrIndexes,StrInd,
TstRes_MAX_BYTES_INDEXES_ONE_QST);
}
/***** Free structure that stores the query result *****/
@ -2851,13 +2964,96 @@ static void Tst_WriteQuestionListing (struct Tst_Test *Test,unsigned NumQst)
}
}
/*****************************************************************************/
/*************** List for selection one or more test questions ***************/
/*****************************************************************************/
static void Tst_ListOneOrMoreQuestionsForSelection (struct Gam_Games *Games,
unsigned NumQsts,
MYSQL_RES *mysql_res)
static void Tst_ListOneOrMoreQuestionsForSelectionForExam (struct Exa_Exams *Exams,
unsigned NumQsts,
MYSQL_RES *mysql_res)
{
extern const char *Hlp_ASSESSMENT_Exams_questions;
extern const char *Txt_Questions;
extern const char *Txt_No_INDEX;
extern const char *Txt_Code;
extern const char *Txt_Date;
extern const char *Txt_Tags;
extern const char *Txt_Type;
extern const char *Txt_Shuffle;
extern const char *Txt_Question;
extern const char *Txt_Add_questions;
unsigned NumQst;
struct Tst_Question Question;
MYSQL_ROW row;
/***** Begin box *****/
Box_BoxBegin (NULL,Txt_Questions,
NULL,NULL,
Hlp_ASSESSMENT_Exams_questions,Box_NOT_CLOSABLE);
/***** Begin form *****/
Frm_StartForm (ActAddTstQstToExa);
Exa_PutParams (Exams);
/***** Write the heading *****/
HTM_TABLE_BeginWideMarginPadding (2);
HTM_TR_Begin (NULL);
HTM_TH_Empty (1);
HTM_TH (1,1,"CT",Txt_No_INDEX);
HTM_TH (1,1,"CT",Txt_Code);
HTM_TH (1,1,"CT",Txt_Date);
HTM_TH (1,1,"LT",Txt_Tags);
HTM_TH (1,1,"CT",Txt_Type);
HTM_TH (1,1,"CT",Txt_Shuffle);
HTM_TH (1,1,"CT",Txt_Question);
HTM_TR_End ();
/***** Write rows *****/
for (NumQst = 0;
NumQst < NumQsts;
NumQst++)
{
Gbl.RowEvenOdd = NumQst % 2;
/* Create test question */
Tst_QstConstructor (&Question);
/* Get question code (row[0]) */
row = mysql_fetch_row (mysql_res);
if ((Question.QstCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
Lay_ShowErrorAndExit ("Wrong code of question.");
/* Write question row */
Tst_WriteQuestionRowForSelection (NumQst,&Question);
/* Destroy test question */
Tst_QstDestructor (&Question);
}
/***** End table *****/
HTM_TABLE_End ();
/***** Button to add questions *****/
Btn_PutConfirmButton (Txt_Add_questions);
/***** End form *****/
Frm_EndForm ();
/***** End box *****/
Box_BoxEnd ();
}
/*****************************************************************************/
/*************** List for selection one or more test questions ***************/
/*****************************************************************************/
static void Tst_ListOneOrMoreQuestionsForSelectionForGame (struct Gam_Games *Games,
unsigned NumQsts,
MYSQL_RES *mysql_res)
{
extern const char *Hlp_ASSESSMENT_Games_questions;
extern const char *Txt_Questions;
@ -3100,7 +3296,7 @@ void Tst_WriteAnswersListing (const struct Tst_Question *Question)
/************** Write answers of a question when seeing a test ***************/
/*****************************************************************************/
static void Tst_WriteAnswersSeeing (const struct TstExa_Exam *Exam,
static void Tst_WriteAnswersSeeing (const struct TstRes_Result *Result,
unsigned NumQst,
const struct Tst_Question *Question)
{
@ -3108,20 +3304,20 @@ static void Tst_WriteAnswersSeeing (const struct TstExa_Exam *Exam,
switch (Question->Answer.Type)
{
case Tst_ANS_INT:
Tst_WriteIntAnsSeeing (Exam,NumQst);
Tst_WriteIntAnsSeeing (Result,NumQst);
break;
case Tst_ANS_FLOAT:
Tst_WriteFloatAnsSeeing (Exam,NumQst);
Tst_WriteFloatAnsSeeing (Result,NumQst);
break;
case Tst_ANS_TRUE_FALSE:
Tst_WriteTFAnsSeeing (Exam,NumQst);
Tst_WriteTFAnsSeeing (Result,NumQst);
break;
case Tst_ANS_UNIQUE_CHOICE:
case Tst_ANS_MULTIPLE_CHOICE:
Tst_WriteChoiceAnsSeeing (Exam,NumQst,Question);
Tst_WriteChoiceAnsSeeing (Result,NumQst,Question);
break;
case Tst_ANS_TEXT:
Tst_WriteTextAnsSeeing (Exam,NumQst);
Tst_WriteTextAnsSeeing (Result,NumQst);
break;
default:
break;
@ -3157,7 +3353,7 @@ static void Tst_WriteIntAnsListing (const struct Tst_Question *Question)
/****************** Write integer answer when seeing a test ******************/
/*****************************************************************************/
static void Tst_WriteIntAnsSeeing (const struct TstExa_Exam *Exam,
static void Tst_WriteIntAnsSeeing (const struct TstRes_Result *Exam,
unsigned NumQst)
{
char StrAns[3 + Cns_MAX_DECIMAL_DIGITS_UINT + 1]; // "Ansxx...x"
@ -3189,7 +3385,7 @@ static void Tst_WriteFloatAnsEdit (const struct Tst_Question *Question)
/****************** Write float answer when seeing a test ********************/
/*****************************************************************************/
static void Tst_WriteFloatAnsSeeing (const struct TstExa_Exam *Exam,
static void Tst_WriteFloatAnsSeeing (const struct TstRes_Result *Exam,
unsigned NumQst)
{
char StrAns[3 + Cns_MAX_DECIMAL_DIGITS_UINT + 1]; // "Ansxx...x"
@ -3220,7 +3416,7 @@ static void Tst_WriteTFAnsListing (const struct Tst_Question *Question)
/************** Write false / true answer when seeing a test ****************/
/*****************************************************************************/
static void Tst_WriteTFAnsSeeing (const struct TstExa_Exam *Exam,
static void Tst_WriteTFAnsSeeing (const struct TstRes_Result *Exam,
unsigned NumQst)
{
extern const char *Txt_TF_QST[2];
@ -3353,7 +3549,7 @@ static void Tst_WriteChoiceAnsListing (const struct Tst_Question *Question)
/******** Write single or multiple choice answer when seeing a test **********/
/*****************************************************************************/
static void Tst_WriteChoiceAnsSeeing (const struct TstExa_Exam *Exam,
static void Tst_WriteChoiceAnsSeeing (const struct TstRes_Result *Exam,
unsigned NumQst,
const struct Tst_Question *Question)
{
@ -3363,10 +3559,10 @@ static void Tst_WriteChoiceAnsSeeing (const struct TstExa_Exam *Exam,
char StrAns[3 + Cns_MAX_DECIMAL_DIGITS_UINT + 1]; // "Ansxx...x"
/***** Get indexes for this question from string *****/
TstExa_GetIndexesFromStr (Exam->Questions[NumQst].StrIndexes,Indexes);
TstRes_GetIndexesFromStr (Exam->Questions[NumQst].StrIndexes,Indexes);
/***** Get the user's answers for this question from string *****/
TstExa_GetAnswersFromStr (Exam->Questions[NumQst].StrAnswers,UsrAnswers);
TstRes_GetAnswersFromStr (Exam->Questions[NumQst].StrAnswers,UsrAnswers);
/***** Begin table *****/
HTM_TABLE_BeginPadding (2);
@ -3494,7 +3690,7 @@ void Tst_GetChoiceAns (struct Tst_Question *Question,MYSQL_RES *mysql_res)
/******************** Write text answer when seeing a test *******************/
/*****************************************************************************/
static void Tst_WriteTextAnsSeeing (const struct TstExa_Exam *Exam,
static void Tst_WriteTextAnsSeeing (const struct TstRes_Result *Result,
unsigned NumQst)
{
char StrAns[3 + Cns_MAX_DECIMAL_DIGITS_UINT + 1]; // "Ansxx...x"
@ -3503,7 +3699,7 @@ static void Tst_WriteTextAnsSeeing (const struct TstExa_Exam *Exam,
snprintf (StrAns,sizeof (StrAns),
"Ans%010u",
NumQst);
HTM_INPUT_TEXT (StrAns,TstExa_MAX_CHARS_ANSWERS_ONE_QST,Exam->Questions[NumQst].StrAnswers,false,
HTM_INPUT_TEXT (StrAns,TstRes_MAX_CHARS_ANSWERS_ONE_QST,Result->Questions[NumQst].StrAnswers,false,
"size=\"40\"");
}
@ -4761,7 +4957,7 @@ static void Tst_GetQstFromForm (struct Tst_Question *Question)
char TagStr[6 + Cns_MAX_DECIMAL_DIGITS_UINT + 1];
char AnsStr[6 + Cns_MAX_DECIMAL_DIGITS_UINT + 1];
char FbStr[5 + Cns_MAX_DECIMAL_DIGITS_UINT + 1];
char StrMultiAns[TstExa_MAX_BYTES_ANSWERS_ONE_QST + 1];
char StrMultiAns[TstRes_MAX_BYTES_ANSWERS_ONE_QST + 1];
char TF[1 + 1]; // (T)rue or (F)alse
const char *Ptr;
unsigned NumCorrectAns;
@ -4913,7 +5109,7 @@ static void Tst_GetQstFromForm (struct Tst_Question *Question)
}
else if (Question->Answer.Type == Tst_ANS_MULTIPLE_CHOICE)
{
Par_GetParMultiToText ("AnsMulti",StrMultiAns,TstExa_MAX_BYTES_ANSWERS_ONE_QST);
Par_GetParMultiToText ("AnsMulti",StrMultiAns,TstRes_MAX_BYTES_ANSWERS_ONE_QST);
Ptr = StrMultiAns;
while (*Ptr)
{

View File

@ -27,10 +27,10 @@
/********************************* Headers ***********************************/
/*****************************************************************************/
#include "swad_exam.h"
#include "swad_game.h"
#include "swad_media.h"
#include "swad_test_config.h"
// #include "swad_test_exam.h"
/*****************************************************************************/
/***************************** Public constants ******************************/
@ -166,10 +166,12 @@ void Tst_WriteQstStem (const char *Stem,const char *ClassStem,bool Visible);
void Tst_WriteQstFeedback (const char *Feedback,const char *ClassFeedback);
void Tst_RequestEditTests (void);
void Tst_RequestSelectTestsForExam (struct Exa_Exams *Exams);
void Tst_RequestSelectTestsForGame (struct Gam_Games *Games);
void Tst_ListQuestionsToEdit (void);
void Tst_ListQuestionsToSelect (struct Gam_Games *Games);
void Tst_ListQuestionsToSelectForExam (struct Exa_Exams *Exams);
void Tst_ListQuestionsToSelectForGame (struct Gam_Games *Games);
void Tst_WriteParamEditQst (const struct Tst_Test *Test);
unsigned Tst_GetNumAnswersQst (long QstCod);

File diff suppressed because it is too large Load Diff

View File

@ -34,32 +34,32 @@
/***************************** Public constants ******************************/
/*****************************************************************************/
#define TstExa_MAX_BYTES_INDEXES_ONE_QST (Tst_MAX_OPTIONS_PER_QUESTION * (3 + 1))
#define TstRes_MAX_BYTES_INDEXES_ONE_QST (Tst_MAX_OPTIONS_PER_QUESTION * (3 + 1))
#define TstExa_MAX_CHARS_ANSWERS_ONE_QST (128 - 1) // 127
#define TstExa_MAX_BYTES_ANSWERS_ONE_QST ((TstExa_MAX_CHARS_ANSWERS_ONE_QST + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
#define TstRes_MAX_CHARS_ANSWERS_ONE_QST (128 - 1) // 127
#define TstRes_MAX_BYTES_ANSWERS_ONE_QST ((TstRes_MAX_CHARS_ANSWERS_ONE_QST + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
#define TstExa_SCORE_MAX 10 // Maximum score of a test (10 in Spain). Must be unsigned! // TODO: Make this configurable by teachers
#define TstRes_SCORE_MAX 10 // Maximum score of a test (10 in Spain). Must be unsigned! // TODO: Make this configurable by teachers
/*****************************************************************************/
/******************************* Public types ********************************/
/*****************************************************************************/
struct TstExa_Exam
struct TstRes_Result
{
long ExaCod; // Test exam code
long ResCod; // Test result code
time_t TimeUTC[Dat_NUM_START_END_TIME];
unsigned NumQsts; // Number of questions
unsigned NumQstsNotBlank; // Number of questions not blank
bool Sent; // This test exam has been sent or not?
bool Sent; // This test result has been sent or not?
// "Sent" means that user has clicked "Send" button after finishing
bool AllowTeachers; // Are teachers allowed to see this test exam?
double Score; // Total score of the test exam
bool AllowTeachers; // Are teachers allowed to see this test result?
double Score; // Total score of the test result
struct
{
long QstCod; // Question code
char StrIndexes[TstExa_MAX_BYTES_INDEXES_ONE_QST + 1]; // 0 1 2 3, 3 0 2 1, etc.
char StrAnswers[TstExa_MAX_BYTES_ANSWERS_ONE_QST + 1]; // Answers selected by user
char StrIndexes[TstRes_MAX_BYTES_INDEXES_ONE_QST + 1]; // 0 1 2 3, 3 0 2 1, etc.
char StrAnswers[TstRes_MAX_BYTES_ANSWERS_ONE_QST + 1]; // Answers selected by user
double Score; // Question score
bool AnswerIsNotBlank; // Answer not blank?
} Questions[TstCfg_MAX_QUESTIONS_PER_TEST];
@ -69,43 +69,43 @@ struct TstExa_Exam
/***************************** Public prototypes *****************************/
/*****************************************************************************/
void TstExa_ResetExam (struct TstExa_Exam *Exam);
void TstExa_CreateExamInDB (struct TstExa_Exam *Exam);
void TstExa_UpdateExamInDB (const struct TstExa_Exam *Exam);
void TstRes_ResetResult (struct TstRes_Result *Result);
void TstRes_CreateExamInDB (struct TstRes_Result *Exam);
void TstRes_UpdateExamInDB (const struct TstRes_Result *Exam);
void TstExa_ShowExamAfterAssess (struct TstExa_Exam *Exam);
void TstRes_ShowExamAfterAssess (struct TstRes_Result *Exam);
void TstExa_ComputeScoresAndStoreExamQuestions (struct TstExa_Exam *Exam,
void TstRes_ComputeScoresAndStoreExamQuestions (struct TstRes_Result *Exam,
bool UpdateQstScore);
void TstExa_ComputeChoiceAnsScore (struct TstExa_Exam *Result,
void TstRes_ComputeChoiceAnsScore (struct TstRes_Result *Result,
unsigned NumQst,
struct Tst_Question *Question);
void TstExa_GetIndexesFromStr (const char StrIndexesOneQst[TstExa_MAX_BYTES_INDEXES_ONE_QST + 1], // 0 1 2 3, 3 0 2 1, etc.
void TstRes_GetIndexesFromStr (const char StrIndexesOneQst[TstRes_MAX_BYTES_INDEXES_ONE_QST + 1], // 0 1 2 3, 3 0 2 1, etc.
unsigned Indexes[Tst_MAX_OPTIONS_PER_QUESTION]);
void TstExa_GetAnswersFromStr (const char StrAnswersOneQst[TstExa_MAX_BYTES_ANSWERS_ONE_QST + 1],
void TstRes_GetAnswersFromStr (const char StrAnswersOneQst[TstRes_MAX_BYTES_ANSWERS_ONE_QST + 1],
bool UsrAnswers[Tst_MAX_OPTIONS_PER_QUESTION]);
void TstExa_ComputeAndShowGrade (unsigned NumQsts,double Score,double MaxGrade);
double TstExa_ComputeGrade (unsigned NumQsts,double Score,double MaxGrade);
void TstExa_ShowGrade (double Grade,double MaxGrade);
void TstRes_ComputeAndShowGrade (unsigned NumQsts,double Score,double MaxGrade);
double TstRes_ComputeGrade (unsigned NumQsts,double Score,double MaxGrade);
void TstRes_ShowGrade (double Grade,double MaxGrade);
void TstExa_SelUsrsToViewUsrsExams (void);
void TstExa_SelDatesToSeeMyExams (void);
void TstExa_ShowMyExams (void);
void TstExa_GetUsrsAndShowExams (void);
void TstRes_SelUsrsToViewUsrsExams (void);
void TstRes_SelDatesToSeeMyExams (void);
void TstRes_ShowMyExams (void);
void TstRes_GetUsrsAndShowExams (void);
void TstExa_PutParamExaCod (long ExaCod);
long TstExa_GetParamExaCod (void);
void TstRes_PutParamExaCod (long ExaCod);
long TstRes_GetParamExaCod (void);
void TstExa_ShowOneExam (void);
void TstExa_ShowExamAnswers (struct UsrData *UsrDat,
struct TstExa_Exam *Exam,
void TstRes_ShowOneExam (void);
void TstRes_ShowExamAnswers (struct UsrData *UsrDat,
struct TstRes_Result *Result,
unsigned Visibility);
void TstExa_GetExamDataByExaCod (struct TstExa_Exam *Exam);
void TstRes_GetExamDataByExaCod (struct TstRes_Result *Result);
void TstExa_GetExamQuestionsFromDB (struct TstExa_Exam *Exam);
void TstExa_RemoveExamsMadeByUsrInAllCrss (long UsrCod);
void TstExa_RemoveExamsMadeByUsrInCrs (long UsrCod,long CrsCod);
void TstExa_RemoveCrsExams (long CrsCod);
void TstRes_GetExamQuestionsFromDB (struct TstRes_Result *Result);
void TstRes_RemoveExamsMadeByUsrInAllCrss (long UsrCod);
void TstRes_RemoveExamsMadeByUsrInCrs (long UsrCod,long CrsCod);
void TstRes_RemoveCrsExams (long CrsCod);
#endif

View File

@ -1507,6 +1507,27 @@ const char *Txt_Already_existed_an_event_with_the_title_X = // Warning: it is ve
"J&aacute; existe um evento com o t&iacute;tulo <strong>%s</strong>.";
#endif
const char *Txt_Already_existed_an_exam_with_the_title_X = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca
"Ja existia un examen amb el t&iacute;tol <strong>%s</strong>.";
#elif L==2 // de
"Es gibt bereits einen Pr&uuml;fung mit dem Namen <strong>%s</strong>.";
#elif L==3 // en
"Already existed an exam with the title <strong>%s</strong>.";
#elif L==4 // es
"Ya exist&iacute;a un examen con el t&iacute;tulo <strong>%s</strong>.";
#elif L==5 // fr
"Il existe d&eacute;j&agrave; un examen du titre <strong>%s</strong>.";
#elif L==6 // gn
"Ya exist&iacute;a un examen con el t&iacute;tulo <strong>%s</strong>."; // Okoteve traducción
#elif L==7 // it
"Esiste gi&agrave; un esame con il titolo <strong>%s</strong>.";
#elif L==8 // pl
"Istniala juz egzamin z tytulu <strong>%s</strong>.";
#elif L==9 // pt
"J&aacute; existe um exame com o t&iacute;tulo <strong>%s</strong>.";
#endif
const char *Txt_Altitude =
#if L==1 // ca
"Altitud";
@ -5858,6 +5879,27 @@ const char *Txt_Create_event =
"Criar evento";
#endif
const char *Txt_Create_exam =
#if L==1 // ca
"Crear examen";
#elif L==2 // de
"Pr&uuml;fung erstellen";
#elif L==3 // en
"Create exam";
#elif L==4 // es
"Crear examen";
#elif L==5 // fr
"Cr&eacute;er exam";
#elif L==6 // gn
"Crear examen"; // Okoteve traducción
#elif L==7 // it
"Crea esame";
#elif L==8 // pl
"Utw&oacute;rz egzamin";
#elif L==9 // pt
"Criar exame";
#endif
const char *Txt_Create_folder =
#if L==1 // ca
"Crear carpeta"; // Necessita traduccio
@ -6490,7 +6532,7 @@ const char *Txt_Created_new_email_domain_X = // Warning: it is very important to
const char *Txt_Created_new_event_X = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca
"Creado nuevo evento <strong>%s</strong>."; // Necessita traduccio
"reat nou esdeveniment <strong>%s</strong>.";
#elif L==2 // de
"Neues Ereignis <strong>%s</strong> eingegeben.";
#elif L==3 // en
@ -6509,6 +6551,27 @@ const char *Txt_Created_new_event_X = // Warning: it is very important to includ
"Criado novo evento <strong>%s</strong>.";
#endif
const char *Txt_Created_new_exam_X = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca
"reat nou examen <strong>%s</strong>.";
#elif L==2 // de
"Neues Pr&uuml;fung <strong>%s</strong> eingegeben.";
#elif L==3 // en
"Created new exam <strong>%s</strong>.";
#elif L==4 // es
"Creado nuevo examen <strong>%s</strong>.";
#elif L==5 // fr
"Cr&eacute;&eacute; nouveau examen <strong>%s</strong>.";
#elif L==6 // gn
"Creado nuevo examen <strong>%s</strong>."; // Okoteve traducción
#elif L==7 // it
"Creato nuovo esame <strong>%s</strong>.";
#elif L==8 // pl
"Utworzono nowe egzaminu <strong>%s</strong>.";
#elif L==9 // pt
"Criado novo exame <strong>%s</strong>.";
#endif
const char *Txt_Created_new_game_X = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca
"Creada novo joc <strong>%s</strong>.";
@ -8799,6 +8862,27 @@ const char *Txt_Do_you_really_want_to_remove_the_event_X = // Warning: it is ver
"Voc&ecirc; realmente deseja remover o evento <strong>%s</strong>?";
#endif
const char *Txt_Do_you_really_want_to_remove_the_exam_X = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca
"De veres voleu eliminar l'examen <strong>%s</strong>?";
#elif L==2 // de
"Wollen Sie der Pr&uuml;fung <strong>%s</strong> wirklich entfernen?";
#elif L==3 // en
"Do you really want to remove the exam <strong>%s</strong>?";
#elif L==4 // es
"&iquest;Realmente desea eliminar el examen <strong>%s</strong>?";
#elif L==5 // fr
"Voulez-vous vraiment supprimer l'examen <strong>%s</strong>?";
#elif L==6 // gn
"&iquest;Realmente desea eliminar el examen <strong>%s</strong>?"; // Okoteve traducción
#elif L==7 // it
"Vuoi realmente rimuovere l'esame <strong>%s</strong>?";
#elif L==8 // pl
"Czy na pewno chcesz usunac egzaminu <strong>%s</strong>?";
#elif L==9 // pt
"Voc&ecirc; realmente deseja remover o exame <strong>%s</strong>?";
#endif
const char *Txt_Do_you_really_want_to_remove_the_field_X_from_the_records_of_Y_Z_ = // Warning: it is very important to include two %s and one %u in the following sentences
#if L==1 // ca
"&iquest;Realmente desea eliminar el campo <strong>%s</strong>"
@ -9981,6 +10065,27 @@ const char *Txt_Edit_event =
"Editar evento";
#endif
const char *Txt_Edit_exam =
#if L==1 // ca
"Editar exam";
#elif L==2 // de
"Editar exam";
#elif L==3 // en
"Editar exam";
#elif L==4 // es
"Editar examen";
#elif L==5 // fr
"Editar exam";
#elif L==6 // gn
"Editar examen"; // Okoteve traducción
#elif L==7 // it
"Editar exam";
#elif L==8 // pl
"Editar exam";
#elif L==9 // pt
"Editar exam";
#endif
const char *Txt_Edit_game =
#if L==1 // ca
"Editar joc";
@ -11248,7 +11353,7 @@ const char *Txt_Events =
const char *Txt_Exam =
#if L==1 // ca
"ex&agrave;men";
"Ex&agrave;men";
#elif L==2 // de
"Pr&uuml;fung";
#elif L==3 // en
@ -11582,6 +11687,180 @@ const char *Txt_Exam_of_X = // Warning: it is very important to include %s in th
"Exame de %s";
#endif
const char *Txt_Exam_X_removed = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca
"Examen <strong>%s</strong> eliminat.";
#elif L==2 // de
"Pr&uuml;fung <strong>%s</strong> entfernt.";
#elif L==3 // en
"Exam <strong>%s</strong> removed.";
#elif L==4 // es
"Examen <strong>%s</strong> eliminado.";
#elif L==5 // fr
"Examen <strong>%s</strong> supprim&eacute;.";
#elif L==6 // gn
"Examen <strong>%s</strong> eliminado."; // Okoteve traducción
#elif L==7 // it
"Esame <strong>%s</strong> rimosso.";
#elif L==8 // pl
"Egzamin <strong>%s</strong> usuniete.";
#elif L==9 // pt
"Exame <strong>%s</strong> removido.";
#endif
const char *Txt_Exams =
#if L==1 // ca
"Ex&agrave;mens";
#elif L==2 // de
"Pr&uuml;fungen";
#elif L==3 // en
"Exams";
#elif L==4 // es
"Ex&aacute;menes";
#elif L==5 // fr
"Examens";
#elif L==6 // gn
"Ex&aacute;menes"; // Okoteve traducción
#elif L==7 // it
"Esami";
#elif L==8 // pl
"Egzaminy";
#elif L==9 // pt
"Exames";
#endif
const char *Txt_EXAMS_ORDER[Exa_NUM_ORDERS] =
{
[Exa_ORDER_BY_START_DATE] =
#if L==1 // ca
"Inici"
#elif L==2 // de
"Start"
#elif L==3 // en
"Start"
#elif L==4 // es
"Inicio"
#elif L==5 // fr
"D&eacute;but"
#elif L==6 // gn
"&Ntilde;epyr&utilde;"
#elif L==7 // it
"Inizio"
#elif L==8 // pl
"Pocz&aogon;tek"
#elif L==9 // pt
"In&iacute;cio"
#endif
,
[Exa_ORDER_BY_END_DATE] =
#if L==1 // ca
"Final"
#elif L==2 // de
"Ende"
#elif L==3 // en
"End"
#elif L==4 // es
"Final"
#elif L==5 // fr
"Fin"
#elif L==6 // gn
"Paha"
#elif L==7 // it
"Fine"
#elif L==8 // pl
"Koniec"
#elif L==9 // pt
"Fim"
#endif
,
[Exa_ORDER_BY_TITLE] =
#if L==1 // ca
"Ex&agrave;men"
#elif L==2 // de
"Pr&uuml;fung"
#elif L==3 // en
"Exam"
#elif L==4 // es
"Examen"
#elif L==5 // fr
"Examen"
#elif L==6 // gn
"Kuaara'&atilde;"
#elif L==7 // it
"Esame"
#elif L==8 // pl
"Egzamin"
#elif L==9 // pt
"Exame"
#endif
};
const char *Txt_EXAMS_ORDER_HELP[Gam_NUM_ORDERS] =
{
[Exa_ORDER_BY_START_DATE] =
#if L==1 // ca
"Ordenar per data de comen&ccedil;ament"
#elif L==2 // de
"Sortieren nach Startdatum"
#elif L==3 // en
"Sort by start date"
#elif L==4 // es
"Ordenar por fecha de comienzo"
#elif L==5 // fr
"Trier par date de d&eacute;but"
#elif L==6 // gn
"Ordenar por fecha de comienzo" // Okoteve traducción
#elif L==7 // it
"Ordina per data di inizio"
#elif L==8 // pl
"Sortuj wedlug daty rozpoczecia"
#elif L==9 // pt
"Classificar por data de in&iacute;cio"
#endif
,
[Exa_ORDER_BY_END_DATE] =
#if L==1 // ca
"Ordenar per data de finalitzaci&oacute;"
#elif L==2 // de
"Sortieren nach Enddatum"
#elif L==3 // en
"Sort by end date"
#elif L==4 // es
"Ordenar por fecha de finalizaci&oacute;n"
#elif L==5 // fr
"Trier par date de fin"
#elif L==6 // gn
"Ordenar por fecha de finalizaci&oacute;n" // Okoteve traducción
#elif L==7 // it
"Ordina per data di fine"
#elif L==8 // pl
"Sortuj wedlug daty zakonczenia"
#elif L==9 // pt
"Classificar por data de t&eacute;rmino"
#endif
,
[Exa_ORDER_BY_TITLE] =
#if L==1 // ca
"Ordenar per t&iacute;tol del ex&agrave;men"
#elif L==2 // de
"Sortieren nach Pr&uuml;fungtitel"
#elif L==3 // en
"Sort by exam title"
#elif L==4 // es
"Ordenar por t&iacute;tulo del examen"
#elif L==5 // fr
"Trier par titre de l'examen"
#elif L==6 // gn
"Ordenar por t&iacute;tulo del examen" // Okoteve traducción
#elif L==7 // it
"Ordina per titolo del gioco"
#elif L==8 // pl
"Sortuj wed&lstrok;ug tytu&lstrok;u egzamin"
#elif L==9 // pt
"Classificar por t&iacute;tulo do exame"
#endif
};
const char *Txt_Existing_question =
#if L==1 // ca
"Pregunta ja existent";
@ -19672,7 +19951,28 @@ const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB] =
"Testes"
#endif
,
// 4: ActSeeAllGam
// 4: ActSeeAllExa
#if L==1 // ca
"Ex&agrave;mens"
#elif L==2 // de
"Pr&uuml;fungen"
#elif L==3 // en
"Exams"
#elif L==4 // es
"Ex&aacute;menes"
#elif L==5 // fr
"Examens"
#elif L==6 // gn
"Ex&aacute;menes" // Okoteve traducción
#elif L==7 // it
"Esami"
#elif L==8 // pl
"Egzaminy"
#elif L==9 // pt
"Exames"
#endif
,
// 5: ActSeeAllGam
#if L==1 // ca
"Jocs"
#elif L==2 // de
@ -19693,7 +19993,7 @@ const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB] =
"Jogos"
#endif
,
// 5: ActSeeAllSvy
// 6: ActSeeAllSvy
#if L==1 // ca
"Enquestes"
#elif L==2 // de
@ -19714,7 +20014,7 @@ const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB] =
"Inqu&eacute;ritos"
#endif
,
// 6: ActSeeAllExaAnn
// 7: ActSeeAllExaAnn
#if L==1 // ca
"Convocat&ograve;ries"
#elif L==2 // de
@ -19735,7 +20035,6 @@ const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB] =
"Chamadas"
#endif
,
NULL, // 7
NULL, // 8
NULL, // 9
NULL, // 10
@ -24588,6 +24887,27 @@ const char *Txt_New_event =
"Novo evento";
#endif
const char *Txt_New_exam =
#if L==1 // ca
"Nou examen";
#elif L==2 // de
"Neue Pr&uuml;fung";
#elif L==3 // en
"New exam";
#elif L==4 // es
"Nuevo examen";
#elif L==5 // fr
"Nouveau examen";
#elif L==6 // gn
"Nuevo examen"; // Okoteve traducción
#elif L==7 // it
"Nuovo esame";
#elif L==8 // pl
"Nowe egzamin";
#elif L==9 // pt
"Novo exame";
#endif
const char *Txt_New_FILE_OR_FOLDER =
#if L==1 // ca
"Nou";
@ -25596,6 +25916,27 @@ const char *Txt_No_events =
"N&atilde;o h&aacute; eventos.";
#endif
const char *Txt_No_exams =
#if L==1 // ca
"No hi ha ex&agrave;mens.";
#elif L==2 // de
"Keine Pr&uuml;fung.";
#elif L==3 // en
"No exams.";
#elif L==4 // es
"No hay ex&aacute;menes.";
#elif L==5 // fr
"Il n'y a pas d'examens.";
#elif L==6 // gn
"No hay ex&aacute;menes."; // Okoteve traducción
#elif L==7 // it
"Non ci sono esame.";
#elif L==8 // pl
"Brak egzamin&oacute;w.";
#elif L==9 // pt
"N&atilde;o h&aacute; exames.";
#endif
const char *Txt_No_file_index_html_index_htm_found_within_the_ZIP_file =
#if L==1 // ca
"No se ha encontrado un archivo <em>index.html</em> / <em>index.htm</em>"
@ -33089,6 +33430,27 @@ const char *Txt_Remove_event =
"Remover evento";
#endif
const char *Txt_Remove_exam =
#if L==1 // ca
"Eliminar examen";
#elif L==2 // de
"Ereignis Pr&uuml;fung";
#elif L==3 // en
"Remove exam";
#elif L==4 // es
"Eliminar examen";
#elif L==5 // fr
"Supprimer examen";
#elif L==6 // gn
"Eliminar examen"; // Okoteve traducción
#elif L==7 // it
"Rimuovere esame";
#elif L==8 // pl
"Usu&nacute; egzamin";
#elif L==9 // pt
"Remover exame";
#endif
const char *Txt_Remove_file =
#if L==1 // ca
"Eliminar fitxer";
@ -43012,6 +43374,27 @@ const char *Txt_FIGURE_TYPES[Fig_NUM_FIGURES] =
"Testy"
#elif L==9 // pt
"Testes"
#endif
,
[Fig_EXAMS] =
#if L==1 // ca
"Ex&agrave;mens"
#elif L==2 // de
"Pr&uuml;fungen"
#elif L==3 // en
"Exams"
#elif L==4 // es
"Ex&aacute;menes"
#elif L==5 // fr
"Examens"
#elif L==6 // gn
"Ex&aacute;menes" // Okoteve traducción
#elif L==7 // it
"Esami"
#elif L==8 // pl
"Egzaminy"
#elif L==9 // pt
"Exames"
#endif
,
[Fig_GAMES] =
@ -46361,6 +46744,27 @@ const char *Txt_The_event_has_been_modified =
"O evento foi modificado.";
#endif
const char *Txt_The_exam_has_been_modified =
#if L==1 // ca
"El examen ha sido modificado."; // Necessita traduccio
#elif L==2 // de
"Der Ereignis wurde ge&auml;ndert.";
#elif L==3 // en
"The exam has been modified.";
#elif L==4 // es
"El examen ha sido modificado.";
#elif L==5 // fr
"L'examen a &eacute;t&eacute; modifi&eacute;.";
#elif L==6 // gn
"El examen ha sido modificado."; // Okoteve traducción
#elif L==7 // it
"L'esame &egrave; stata modificato.";
#elif L==8 // pl
"Egzamin zosta&lstrok; zmodyfikowany.";
#elif L==9 // pt
"O exame foi modificado.";
#endif
const char *Txt_The_file_could_not_be_processed_successfully =
#if L==1 // ca
"El fitxer no s'ha pogut processar correctament.";
@ -50918,6 +51322,27 @@ const char *Txt_There_was_a_problem_sending_an_email_automatically =
"Ocorreu um problema ao enviar um email automaticamente.";
#endif
const char *Txt_This_exam_has_no_questions =
#if L==1 // ca
"Aquest examen no t&eacute; preguntes.";
#elif L==2 // de
"Dieses Pr&uuml;fung hat keine Fragen.";
#elif L==3 // en
"This exam has no questions.";
#elif L==4 // es
"Este examen no tiene preguntas.";
#elif L==5 // fr
"Cet examen n'a pas de questions.";
#elif L==6 // gn
"Este examen no tiene preguntas."; // Okoteve traducción
#elif L==7 // it
"Questo esame non ha domande.";
#elif L==8 // pl
"Ten egzamin nie ma pytania.";
#elif L==9 // pt
"Este exame n&atilde;o tem perguntas.";
#endif
const char *Txt_This_game_has_no_questions =
#if L==1 // ca
"Aquest joc no t&eacute; preguntes.";
@ -54919,6 +55344,27 @@ const char *Txt_View_event =
"Ver evento";
#endif
const char *Txt_View_exam =
#if L==1 // ca
"Veure examen";
#elif L==2 // de
"Anzeigen Pr&uuml;fung";
#elif L==3 // en
"View exam";
#elif L==4 // es
"Ver examen";
#elif L==5 // fr
"Voir examen";
#elif L==6 // gn
"Ver examen"; // Okoteve traducción
#elif L==7 // it
"Vedi esame";
#elif L==8 // pl
"Zobacz egzaminu";
#elif L==9 // pt
"Ver exame";
#endif
const char *Txt_View_game =
#if L==1 // ca
"Veure joc";
@ -58259,13 +58705,34 @@ const char *Txt_You_must_specify_the_title_of_the_event =
#elif L==6 // gn
"Debe especificar el t&iacute;tulo del evento."; // Okoteve traducción
#elif L==7 // it
"&Egrave; necessario specificare il titolo del evento.";
"&Egrave; necessario specificare il titolo dell'evento.";
#elif L==8 // pl
"Musisz poda&cacute; tytu&lstrok; wydarzenia.";
#elif L==9 // pt
"Voc&ecirc; deve especificar o t&iacute;tulo do evento.";
#endif
const char *Txt_You_must_specify_the_title_of_the_exam =
#if L==1 // ca
"Cal especificar el t&iacute;tol de l'examen.";
#elif L==2 // de
"Der Pr&uuml;fung muss angegeben werden.";
#elif L==3 // en
"You must specify the title of the exam.";
#elif L==4 // es
"Debe especificar el t&iacute;tulo del examen.";
#elif L==5 // fr
"Vous devez sp&eacute;cifier le titre de l'examen.";
#elif L==6 // gn
"Debe especificar el t&iacute;tulo del examen."; // Okoteve traducción
#elif L==7 // it
"&Egrave; necessario specificare il titolo dell'esame.";
#elif L==8 // pl
"Musisz poda&cacute; tytu&lstrok; egzaminu.";
#elif L==9 // pt
"Voc&ecirc; deve especificar o t&iacute;tulo do exame.";
#endif
const char *Txt_You_must_specify_the_title_of_the_game =
#if L==1 // ca
"Cal especificar el t&iacute;tol del joc.";

View File

@ -1277,59 +1277,10 @@ bool Usr_CheckIfICanViewRecordTch (struct UsrData *UsrDat)
}
/*****************************************************************************/
/************ Check if I can view test results of another user ***************/
/********* Check if I can view test/exam/match result of another user ********/
/*****************************************************************************/
bool Usr_CheckIfICanViewTst (const struct UsrData *UsrDat)
{
bool ItsMe;
/***** 1. Fast check: Am I logged? *****/
if (!Gbl.Usrs.Me.Logged)
return false;
/***** 2. Fast check: Is it a valid user code? *****/
if (UsrDat->UsrCod <= 0)
return false;
/***** 3. Fast check: Is it a course selected? *****/
if (Gbl.Hierarchy.Crs.CrsCod <= 0)
return false;
/***** 4. Fast check: Am I a system admin? *****/
if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
return true;
/***** 5. Fast check: Do I belong to the current course? *****/
if (!Gbl.Usrs.Me.IBelongToCurrentCrs)
return false;
/***** 6. Fast check: It's me? *****/
ItsMe = Usr_ItsMe (UsrDat->UsrCod);
if (ItsMe)
return true;
/***** 7. Fast check: Does he/she belong to the current course? *****/
if (!Usr_CheckIfUsrBelongsToCurrentCrs (UsrDat))
return false;
/***** 8. Fast / slow check depending on roles *****/
switch (Gbl.Usrs.Me.Role.Logged)
{
case Rol_NET:
return Grp_CheckIfUsrSharesAnyOfMyGrpsInCurrentCrs (UsrDat);
case Rol_TCH:
return true;
default:
return false;
}
}
/*****************************************************************************/
/*********** Check if I can view matches results of another user *************/
/*****************************************************************************/
bool Usr_CheckIfICanViewMch (const struct UsrData *UsrDat)
bool Usr_CheckIfICanViewTstExaMchResult (const struct UsrData *UsrDat)
{
bool ItsMe;

View File

@ -324,8 +324,7 @@ bool Usr_CheckIfUsrHasAcceptedInCurrentCrs (const struct UsrData *UsrDat);
bool Usr_CheckIfICanViewRecordStd (const struct UsrData *UsrDat);
bool Usr_CheckIfICanViewRecordTch (struct UsrData *UsrDat);
bool Usr_CheckIfICanViewTst (const struct UsrData *UsrDat);
bool Usr_CheckIfICanViewMch (const struct UsrData *UsrDat);
bool Usr_CheckIfICanViewTstExaMchResult (const struct UsrData *UsrDat);
bool Usr_CheckIfICanViewAsgWrk (const struct UsrData *UsrDat);
bool Usr_CheckIfICanViewAtt (const struct UsrData *UsrDat);
bool Usr_CheckIfICanViewUsrAgenda (struct UsrData *UsrDat);