mirror of https://github.com/acanas/swad-core.git
Version19.233
This commit is contained in:
parent
ab1fd57d9f
commit
3941c8e791
3
Makefile
3
Makefile
|
@ -36,7 +36,8 @@ OBJS = swad_account.o swad_action.o swad_agenda.o swad_alert.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.o swad_exam_announcement.o \
|
||||
swad_exam_event.o swad_exam_print.o swad_exam_result.o swad_exam_set.o \
|
||||
swad_exam_print.o swad_exam_result.o swad_exam_session.o \
|
||||
swad_exam_set.o \
|
||||
swad_figure.o swad_figure_cache.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 \
|
||||
|
|
16
sql/swad.sql
16
sql/swad.sql
|
@ -453,21 +453,21 @@ CREATE TABLE IF NOT EXISTS departments (
|
|||
-- Table exa_groups: stores the groups associated to each event in an exam
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS exa_groups (
|
||||
EvtCod INT NOT NULL,
|
||||
SesCod INT NOT NULL,
|
||||
GrpCod INT NOT NULL,
|
||||
UNIQUE INDEX(EvtCod,GrpCod));
|
||||
UNIQUE INDEX(SesCod,GrpCod));
|
||||
--
|
||||
-- Table exa_events: stores the events (exams instances) that have already taken place
|
||||
-- Table exa_sessions: stores the exam sessions that have already taken place
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS exa_events (
|
||||
EvtCod INT NOT NULL AUTO_INCREMENT,
|
||||
CREATE TABLE IF NOT EXISTS exa_sessions (
|
||||
SesCod INT NOT NULL AUTO_INCREMENT,
|
||||
ExaCod INT NOT NULL,
|
||||
Hidden ENUM('N','Y') NOT NULL DEFAULT 'N',
|
||||
UsrCod INT NOT NULL,
|
||||
StartTime DATETIME NOT NULL,
|
||||
EndTime DATETIME NOT NULL,
|
||||
Title VARCHAR(2047) NOT NULL,
|
||||
UNIQUE INDEX(EvtCod),
|
||||
UNIQUE INDEX(SesCod),
|
||||
INDEX(ExaCod));
|
||||
--
|
||||
-- Table exa_exams: stores the exams
|
||||
|
@ -500,7 +500,7 @@ CREATE TABLE IF NOT EXISTS exa_print_questions (
|
|||
--
|
||||
CREATE TABLE IF NOT EXISTS exa_prints (
|
||||
PrnCod INT NOT NULL AUTO_INCREMENT,
|
||||
EvtCod INT NOT NULL,
|
||||
SesCod INT NOT NULL,
|
||||
UsrCod INT NOT NULL,
|
||||
StartTime DATETIME NOT NULL,
|
||||
EndTime DATETIME NOT NULL,
|
||||
|
@ -509,7 +509,7 @@ CREATE TABLE IF NOT EXISTS exa_prints (
|
|||
Sent ENUM('N','Y') NOT NULL DEFAULT 'N',
|
||||
Score DOUBLE PRECISION NOT NULL DEFAULT 0,
|
||||
UNIQUE INDEX(PrnCod),
|
||||
UNIQUE INDEX(EvtCod,UsrCod));
|
||||
UNIQUE INDEX(SesCod,UsrCod));
|
||||
--
|
||||
-- Table exa_set_answers: stores the answers of questions in exam sets
|
||||
--
|
||||
|
|
|
@ -48,9 +48,9 @@
|
|||
#include "swad_duplicate.h"
|
||||
#include "swad_exam.h"
|
||||
#include "swad_exam_announcement.h"
|
||||
#include "swad_exam_event.h"
|
||||
#include "swad_exam_print.h"
|
||||
#include "swad_exam_result.h"
|
||||
#include "swad_exam_session.h"
|
||||
#include "swad_exam_set.h"
|
||||
#include "swad_enrolment.h"
|
||||
#include "swad_figure.h"
|
||||
|
@ -679,14 +679,14 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
|||
|
||||
[ActSeeExa ] = {1849,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_SeeOneExam ,NULL},
|
||||
|
||||
[ActReqNewExaEvt ] = {1852,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaEvt_RequestCreatOrEditEvent ,NULL},
|
||||
[ActEdiOneExaEvt ] = {1902,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaEvt_RequestCreatOrEditEvent ,NULL},
|
||||
[ActNewExaEvt ] = {1853,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaEvt_ReceiveFormEvent ,NULL},
|
||||
[ActChgExaEvt ] = {1903,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaEvt_ReceiveFormEvent ,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},
|
||||
[ActHidExaEvt ] = {1900,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaEvt_HideEvent ,NULL},
|
||||
[ActShoExaEvt ] = {1901,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaEvt_UnhideEvent ,NULL},
|
||||
[ActReqNewExaEvt ] = {1852,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSes_RequestCreatOrEditSession ,NULL},
|
||||
[ActEdiOneExaEvt ] = {1902,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSes_RequestCreatOrEditSession ,NULL},
|
||||
[ActNewExaEvt ] = {1853,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSes_ReceiveFormSession ,NULL},
|
||||
[ActChgExaEvt ] = {1903,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSes_ReceiveFormSession ,NULL},
|
||||
[ActReqRemExaEvt ] = {1850,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSes_RequestRemoveSession ,NULL},
|
||||
[ActRemExaEvt ] = {1851,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSes_RemoveSession ,NULL},
|
||||
[ActHidExaEvt ] = {1900,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSes_HideSession ,NULL},
|
||||
[ActShoExaEvt ] = {1901,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSes_UnhideSession ,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},
|
||||
|
@ -699,7 +699,7 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
|||
[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_ToggleVisResultsEvtUsr ,NULL},
|
||||
[ActChgVisResExaEvtUsr] = {1876,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSes_ToggleVisResultsSesUsr ,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},
|
||||
|
|
|
@ -472,6 +472,15 @@ contiene una de las que yo imparto. As
|
|||
// TODO: ¿Añadir dos columnas a resultados de juegos entre "Preguntas contestadas" y "Puntuación total": Preguntas "Correctas" y Preguntas "Erróneas"?
|
||||
// Problema: sólo es aplicable a tipo test
|
||||
|
||||
// TODO: En los avisos amarillos aparecen enlaces, pero en las copias de ellos en el timeline
|
||||
// no se insertan los hipervínculos de los avisos.
|
||||
// No los añadí en su momento porque se copian los primeros caracteres del mensaje,
|
||||
// pudiendo cortarse en mitad de un enlace.
|
||||
// Es decir, porque es complicadillo de hacer.
|
||||
// Lo mejor sería limitar la longitud máximoa de los avisos a N caracteres,
|
||||
// igual que los posts del timeline, y así ponerlos completos siempre, con enlaces y todo.
|
||||
// De camino evitaría los avisos kilométricos.
|
||||
|
||||
// TODO: Si hay accesos a un centro y el centro se elimina, al clicar en el acceso sale un mensaje de "Usted no tiene permiso para realizar esta acción." en lugar de "No existe el centro"
|
||||
|
||||
// TODO: Poner en swad.cfg varias líneas de swad_config.h para que sea más configurable
|
||||
|
@ -548,14 +557,29 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
|
|||
En OpenSWAD:
|
||||
ps2pdf source.ps destination.pdf
|
||||
*/
|
||||
#define Log_PLATFORM_VERSION "SWAD 19.232.1 (2020-05-16)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 19.233 (2020-05-17)"
|
||||
#define CSS_FILE "swad19.230.1.css"
|
||||
#define JS_FILE "swad19.230.3.js"
|
||||
/*
|
||||
TODO: Comprobar si el directorio público que devuelve Ses_GetPublicDirFromCache sigue existiendo.
|
||||
// Si no existe, hay que crear un nuevo directorio y meterlo en cache
|
||||
|
||||
Version 19.232.1: May 16, 2020 Changes in contextual icons in bank of questions and test. (301004 lines)
|
||||
Version 19.233: May 17, 2020 Exam event is renamed as exam session. (301028 lines)
|
||||
7 changes necessary in database:
|
||||
RENAME TABLE exa_events TO exa_sessions;
|
||||
ALTER TABLE exa_groups CHANGE COLUMN EvtCod SesCod INT NOT NULL;
|
||||
ALTER TABLE exa_prints CHANGE COLUMN EvtCod SesCod INT NOT NULL;
|
||||
ALTER TABLE exa_sessions CHANGE COLUMN EvtCod SesCod INT NOT NULL AUTO_INCREMENT;
|
||||
ALTER TABLE exa_groups DROP INDEX EvtCod,ADD UNIQUE INDEX(SesCod,GrpCod);
|
||||
ALTER TABLE exa_prints DROP INDEX EvtCod,ADD UNIQUE INDEX(SesCod,UsrCod);
|
||||
ALTER TABLE exa_sessions DROP INDEX EvtCod,ADD UNIQUE INDEX(SesCod);
|
||||
|
||||
Version 19.232.2: May 16, 2020 When a new tag is created, it is marked as hidden. (301007 lines)
|
||||
Version 19.232.1: May 16, 2020 Changes in contextual icons in bank of questions and test. (301006 lines)
|
||||
Copy the following 2 icons to icon public directory:
|
||||
sudo cp icon/iconset/nuvola/house-user.svg /var/www/html/swad/icon/iconset/nuvola/
|
||||
sudo cp icon/iconset/nuvola/tasks.png /var/www/html/swad/icon/iconset/nuvola/
|
||||
|
||||
Version 19.232: May 16, 2020 New option to edit questions separated from tests. (301000 lines)
|
||||
Version 19.231: May 16, 2020 Fixed bugs and code refactoring in exam results. (300956 lines)
|
||||
Version 19.230.3: May 15, 2020 Update maths in exam prints when user answers. (301037 lines)
|
||||
|
@ -728,7 +752,7 @@ ALTER TABLE crs_usr DROP COLUMN LastDowGrpCod, DROP COLUMN LastComGrpCod, DROP C
|
|||
ALTER TABLE crs_usr_last ENGINE=MyISAM;
|
||||
OPTIMIZE TABLE crs_usr_last;
|
||||
OPTIMIZE TABLE crs_usr;
|
||||
--------------
|
||||
|
||||
Version 19.206.3: Apr 30, 2020 Added indexes on database table. (300244 lines)
|
||||
10 changes necessary in database:
|
||||
RENAME TABLE crs_usr TO crs_usr_old;
|
||||
|
|
|
@ -1005,44 +1005,15 @@ mysql> DESCRIBE exa_groups;
|
|||
+--------+---------+------+-----+---------+-------+
|
||||
| Field | Type | Null | Key | Default | Extra |
|
||||
+--------+---------+------+-----+---------+-------+
|
||||
| EvtCod | int(11) | NO | PRI | NULL | |
|
||||
| SesCod | int(11) | NO | PRI | NULL | |
|
||||
| GrpCod | int(11) | NO | PRI | NULL | |
|
||||
+--------+---------+------+-----+---------+-------+
|
||||
2 rows in set (0.01 sec)
|
||||
2 rows in set (0.00 sec)
|
||||
*/
|
||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS exa_groups ("
|
||||
"EvtCod INT NOT NULL,"
|
||||
"SesCod INT NOT NULL,"
|
||||
"GrpCod INT NOT NULL,"
|
||||
"UNIQUE INDEX(EvtCod,GrpCod))");
|
||||
|
||||
/***** Table exa_events *****/
|
||||
/*
|
||||
mysql> DESCRIBE exa_events;
|
||||
+----------------+---------------+------+-----+---------+----------------+
|
||||
| Field | Type | Null | Key | Default | Extra |
|
||||
+----------------+---------------+------+-----+---------+----------------+
|
||||
| EvtCod | int(11) | NO | PRI | NULL | auto_increment |
|
||||
| ExaCod | int(11) | NO | MUL | NULL | |
|
||||
| Hidden | enum('N','Y') | NO | | N | |
|
||||
| UsrCod | int(11) | NO | | NULL | |
|
||||
| StartTime | datetime | NO | | NULL | |
|
||||
| EndTime | datetime | NO | | NULL | |
|
||||
| Title | varchar(2047) | NO | | NULL | |
|
||||
| ShowUsrResults | enum('N','Y') | NO | | N | |
|
||||
+----------------+---------------+------+-----+---------+----------------+
|
||||
8 rows in set (0.00 sec)
|
||||
*/
|
||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS exa_events ("
|
||||
"EvtCod INT NOT NULL AUTO_INCREMENT,"
|
||||
"ExaCod INT NOT NULL,"
|
||||
"Hidden ENUM('N','Y') NOT NULL DEFAULT 'N',"
|
||||
"UsrCod INT NOT NULL,"
|
||||
"StartTime DATETIME NOT NULL,"
|
||||
"EndTime DATETIME NOT NULL,"
|
||||
"Title VARCHAR(2047) NOT NULL," // ExaEvt_MAX_BYTES_TITLE
|
||||
"ShowUsrResults ENUM('N','Y') NOT NULL DEFAULT 'N',"
|
||||
"UNIQUE INDEX(EvtCod),"
|
||||
"INDEX(ExaCod))");
|
||||
"UNIQUE INDEX(SesCod,GrpCod))");
|
||||
|
||||
/***** Table exa_exams *****/
|
||||
/*
|
||||
|
@ -1106,7 +1077,7 @@ mysql> DESCRIBE exa_prints;
|
|||
| Field | Type | Null | Key | Default | Extra |
|
||||
+-----------------+---------------+------+-----+---------+----------------+
|
||||
| PrnCod | int(11) | NO | PRI | NULL | auto_increment |
|
||||
| EvtCod | int(11) | NO | MUL | NULL | |
|
||||
| SesCod | int(11) | NO | MUL | NULL | |
|
||||
| UsrCod | int(11) | NO | | NULL | |
|
||||
| StartTime | datetime | NO | | NULL | |
|
||||
| EndTime | datetime | NO | | NULL | |
|
||||
|
@ -1119,7 +1090,7 @@ mysql> DESCRIBE exa_prints;
|
|||
*/
|
||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS exa_prints ("
|
||||
"PrnCod INT NOT NULL AUTO_INCREMENT,"
|
||||
"EvtCod INT NOT NULL,"
|
||||
"SesCod INT NOT NULL,"
|
||||
"UsrCod INT NOT NULL,"
|
||||
"StartTime DATETIME NOT NULL,"
|
||||
"EndTime DATETIME NOT NULL,"
|
||||
|
@ -1128,7 +1099,36 @@ mysql> DESCRIBE exa_prints;
|
|||
"Sent ENUM('N','Y') NOT NULL DEFAULT 'N',"
|
||||
"Score DOUBLE PRECISION NOT NULL DEFAULT 0,"
|
||||
"UNIQUE INDEX(PrnCod),"
|
||||
"UNIQUE INDEX(EvtCod,UsrCod))");
|
||||
"UNIQUE INDEX(SesCod,UsrCod))");
|
||||
|
||||
/***** Table exa_sessions *****/
|
||||
/*
|
||||
mysql> DESCRIBE exa_sessions;
|
||||
+----------------+---------------+------+-----+---------+----------------+
|
||||
| Field | Type | Null | Key | Default | Extra |
|
||||
+----------------+---------------+------+-----+---------+----------------+
|
||||
| SesCod | int(11) | NO | PRI | NULL | auto_increment |
|
||||
| ExaCod | int(11) | NO | MUL | NULL | |
|
||||
| Hidden | enum('N','Y') | NO | | N | |
|
||||
| UsrCod | int(11) | NO | | NULL | |
|
||||
| StartTime | datetime | NO | | NULL | |
|
||||
| EndTime | datetime | NO | | NULL | |
|
||||
| Title | varchar(2047) | NO | | NULL | |
|
||||
| ShowUsrResults | enum('N','Y') | NO | | N | |
|
||||
+----------------+---------------+------+-----+---------+----------------+
|
||||
8 rows in set (0.00 sec)
|
||||
*/
|
||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS exa_sessions ("
|
||||
"SesCod INT NOT NULL AUTO_INCREMENT,"
|
||||
"ExaCod INT NOT NULL,"
|
||||
"Hidden ENUM('N','Y') NOT NULL DEFAULT 'N',"
|
||||
"UsrCod INT NOT NULL,"
|
||||
"StartTime DATETIME NOT NULL,"
|
||||
"EndTime DATETIME NOT NULL,"
|
||||
"Title VARCHAR(2047) NOT NULL," // ExaSes_MAX_BYTES_TITLE
|
||||
"ShowUsrResults ENUM('N','Y') NOT NULL DEFAULT 'N',"
|
||||
"UNIQUE INDEX(SesCod),"
|
||||
"INDEX(ExaCod))");
|
||||
|
||||
/***** Table exa_set_answers *****/
|
||||
/*
|
||||
|
|
94
swad_exam.c
94
swad_exam.c
|
@ -36,8 +36,8 @@
|
|||
|
||||
#include "swad_database.h"
|
||||
#include "swad_exam.h"
|
||||
#include "swad_exam_event.h"
|
||||
#include "swad_exam_result.h"
|
||||
#include "swad_exam_session.h"
|
||||
#include "swad_exam_set.h"
|
||||
#include "swad_exam_type.h"
|
||||
#include "swad_figure.h"
|
||||
|
@ -157,7 +157,7 @@ void Exa_ResetExams (struct Exa_Exams *Exams)
|
|||
Exams->ListQuestions = NULL;
|
||||
Exams->ExaCodsSelected = NULL; // String with selected exam codes separated by separator multiple
|
||||
Exams->ExaCod = -1L; // Selected/current exam code
|
||||
Exams->EvtCod = -1L; // Selected/current event code
|
||||
Exams->SesCod = -1L; // Selected/current session code
|
||||
Exams->SetInd = 0; // Current set index
|
||||
Exams->QstCod = -1L; // Current question code
|
||||
}
|
||||
|
@ -180,8 +180,8 @@ void Exa_ResetExam (struct Exa_Exam *Exam)
|
|||
Exam->Hidden = false;
|
||||
Exam->NumSets = 0;
|
||||
Exam->NumQsts = 0;
|
||||
Exam->NumEvts = 0;
|
||||
Exam->NumOpenEvts = 0;
|
||||
Exam->NumSess = 0;
|
||||
Exam->NumOpenSess = 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -212,7 +212,7 @@ static void Exa_ListAllExams (struct Exa_Exams *Exams)
|
|||
extern const char *Txt_Exams;
|
||||
extern const char *Txt_EXAMS_ORDER_HELP[Exa_NUM_ORDERS];
|
||||
extern const char *Txt_EXAMS_ORDER[Exa_NUM_ORDERS];
|
||||
extern const char *Txt_Events;
|
||||
extern const char *Txt_Sessions;
|
||||
extern const char *Txt_No_exams;
|
||||
Exa_Order_t Order;
|
||||
struct Pagination Pagination;
|
||||
|
@ -271,7 +271,7 @@ static void Exa_ListAllExams (struct Exa_Exams *Exams)
|
|||
HTM_TH_End ();
|
||||
}
|
||||
|
||||
HTM_TH (1,1,"RM",Txt_Events);
|
||||
HTM_TH (1,1,"RM",Txt_Sessions);
|
||||
|
||||
HTM_TR_End ();
|
||||
|
||||
|
@ -341,7 +341,7 @@ static void Exa_PutIconsListExams (void *Exams)
|
|||
if (Exa_CheckIfICanEditExams ())
|
||||
Exa_PutIconToCreateNewExam ((struct Exa_Exams *) Exams);
|
||||
|
||||
/***** Put icon to view events results *****/
|
||||
/***** Put icon to view sessions results *****/
|
||||
switch (Gbl.Usrs.Me.Role.Logged)
|
||||
{
|
||||
case Rol_STD:
|
||||
|
@ -411,12 +411,12 @@ void Exa_SeeOneExam (void)
|
|||
{
|
||||
struct Exa_Exams Exams;
|
||||
struct Exa_Exam Exam;
|
||||
struct ExaEvt_Event Event;
|
||||
struct ExaSes_Session Session;
|
||||
|
||||
/***** Reset exams context *****/
|
||||
Exa_ResetExams (&Exams);
|
||||
Exa_ResetExam (&Exam);
|
||||
ExaEvt_ResetEvent (&Event);
|
||||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (&Exams);
|
||||
|
@ -429,8 +429,8 @@ void Exa_SeeOneExam (void)
|
|||
Exams.ExaCod = Exam.ExaCod;
|
||||
|
||||
/***** Show exam *****/
|
||||
Exa_ShowOnlyOneExam (&Exams,&Exam,&Event,
|
||||
false); // Do not put form for event
|
||||
Exa_ShowOnlyOneExam (&Exams,&Exam,&Session,
|
||||
false); // Do not put form for session
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -439,17 +439,17 @@ void Exa_SeeOneExam (void)
|
|||
|
||||
void Exa_ShowOnlyOneExam (struct Exa_Exams *Exams,
|
||||
struct Exa_Exam *Exam,
|
||||
struct ExaEvt_Event *Event,
|
||||
bool PutFormEvent)
|
||||
struct ExaSes_Session *Session,
|
||||
bool PutFormSession)
|
||||
{
|
||||
Exa_ShowOnlyOneExamBegin (Exams,Exam,Event,PutFormEvent);
|
||||
Exa_ShowOnlyOneExamBegin (Exams,Exam,Session,PutFormSession);
|
||||
Exa_ShowOnlyOneExamEnd ();
|
||||
}
|
||||
|
||||
void Exa_ShowOnlyOneExamBegin (struct Exa_Exams *Exams,
|
||||
struct Exa_Exam *Exam,
|
||||
struct ExaEvt_Event *Event,
|
||||
bool PutFormEvent)
|
||||
struct ExaSes_Session *Session,
|
||||
bool PutFormSession)
|
||||
{
|
||||
extern const char *Hlp_ASSESSMENT_Exams;
|
||||
extern const char *Txt_Exam;
|
||||
|
@ -465,8 +465,8 @@ void Exa_ShowOnlyOneExamBegin (struct Exa_Exams *Exams,
|
|||
Exam,
|
||||
true); // Show only this exam
|
||||
|
||||
/***** List events *****/
|
||||
ExaEvt_ListEvents (Exams,Exam,Event,PutFormEvent);
|
||||
/***** List sessions *****/
|
||||
ExaSes_ListSessions (Exams,Exam,Session,PutFormSession);
|
||||
}
|
||||
|
||||
void Exa_ShowOnlyOneExamEnd (void)
|
||||
|
@ -482,7 +482,7 @@ static void Exa_ShowOneExam (struct Exa_Exams *Exams,
|
|||
extern const char *Txt_Sets_of_questions;
|
||||
extern const char *Txt_Maximum_grade;
|
||||
extern const char *Txt_Result_visibility;
|
||||
extern const char *Txt_Events;
|
||||
extern const char *Txt_Sessions;
|
||||
char *Anchor;
|
||||
static unsigned UniqueId = 0;
|
||||
char *Id;
|
||||
|
@ -522,7 +522,7 @@ static void Exa_ShowOneExam (struct Exa_Exams *Exams,
|
|||
{
|
||||
if (asprintf (&Id,"exa_date_%u_%u",(unsigned) StartEndTime,UniqueId) < 0)
|
||||
Lay_NotEnoughMemoryExit ();
|
||||
Color = Exam->NumOpenEvts ? (Exam->Hidden ? "DATE_GREEN_LIGHT":
|
||||
Color = Exam->NumOpenSess ? (Exam->Hidden ? "DATE_GREEN_LIGHT":
|
||||
"DATE_GREEN") :
|
||||
(Exam->Hidden ? "DATE_RED_LIGHT":
|
||||
"DATE_RED");
|
||||
|
@ -573,7 +573,7 @@ static void Exa_ShowOneExam (struct Exa_Exams *Exams,
|
|||
TstVis_ShowVisibilityIcons (Exam->Visibility,Exam->Hidden);
|
||||
HTM_DIV_End ();
|
||||
|
||||
/***** Number of events in exam *****/
|
||||
/***** Number of sessions in exam *****/
|
||||
if (ShowOnlyThisExam)
|
||||
HTM_TD_Begin ("class=\"RT\"");
|
||||
else
|
||||
|
@ -582,13 +582,13 @@ static void Exa_ShowOneExam (struct Exa_Exams *Exams,
|
|||
Exams->ExaCod = Exam->ExaCod;
|
||||
Frm_StartForm (ActSeeExa);
|
||||
Exa_PutParams (Exams);
|
||||
HTM_BUTTON_SUBMIT_Begin (Txt_Events,
|
||||
HTM_BUTTON_SUBMIT_Begin (Txt_Sessions,
|
||||
Exam->Hidden ? "BT_LINK LT ASG_TITLE_LIGHT" :
|
||||
"BT_LINK LT ASG_TITLE",
|
||||
NULL);
|
||||
if (ShowOnlyThisExam)
|
||||
HTM_TxtColonNBSP (Txt_Events);
|
||||
HTM_Unsigned (Exam->NumEvts);
|
||||
HTM_TxtColonNBSP (Txt_Sessions);
|
||||
HTM_Unsigned (Exam->NumSess);
|
||||
HTM_BUTTON_End ();
|
||||
Frm_EndForm ();
|
||||
|
||||
|
@ -637,14 +637,14 @@ static void Exa_ShowOneExam (struct Exa_Exams *Exams,
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************* Put icon to show results of events in an exam *****************/
|
||||
/************ Put icon to show results of sessions in an exam ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Exa_PutIconToShowResultsOfExam (void *Exams)
|
||||
{
|
||||
if (Exams)
|
||||
{
|
||||
/***** Put icon to view events results *****/
|
||||
/***** Put icon to view sessions results *****/
|
||||
switch (Gbl.Usrs.Me.Role.Logged)
|
||||
{
|
||||
case Rol_STD:
|
||||
|
@ -828,11 +828,11 @@ void Exa_GetListExams (struct Exa_Exams *Exams,Exa_Order_t SelectedOrder)
|
|||
/***** Get list of exams from database *****/
|
||||
NumRows = DB_QuerySELECT (&mysql_res,"can not get exams",
|
||||
"SELECT exa_exams.ExaCod," // row[0]
|
||||
"MIN(exa_events.StartTime) AS StartTime," // row[1]
|
||||
"MAX(exa_events.EndTime) AS EndTime" // row[2]
|
||||
"MIN(exa_sessions.StartTime) AS StartTime," // row[1]
|
||||
"MAX(exa_sessions.EndTime) AS EndTime" // row[2]
|
||||
" FROM exa_exams"
|
||||
" LEFT JOIN exa_events"
|
||||
" ON exa_exams.ExaCod=exa_events.ExaCod"
|
||||
" LEFT JOIN exa_sessions"
|
||||
" ON exa_exams.ExaCod=exa_sessions.ExaCod"
|
||||
" WHERE exa_exams.CrsCod=%ld"
|
||||
"%s"
|
||||
" GROUP BY exa_exams.ExaCod"
|
||||
|
@ -873,7 +873,7 @@ void Exa_GetListExams (struct Exa_Exams *Exams,Exa_Order_t SelectedOrder)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************* Get list of exam events selected **********************/
|
||||
/******************** Get list of exam sessions selected *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_GetListSelectedExaCods (struct Exa_Exams *Exams)
|
||||
|
@ -962,8 +962,8 @@ void Exa_GetDataOfExamByCod (struct Exa_Exam *Exam)
|
|||
"exa_exams.Visibility," // row[5]
|
||||
"exa_exams.Title" // row[6]
|
||||
" FROM exa_exams"
|
||||
" LEFT JOIN exa_events"
|
||||
" ON exa_exams.ExaCod=exa_events.ExaCod"
|
||||
" LEFT JOIN exa_sessions"
|
||||
" ON exa_exams.ExaCod=exa_sessions.ExaCod"
|
||||
" WHERE exa_exams.ExaCod=%ld",
|
||||
Exam->ExaCod);
|
||||
if (NumRows) // Exam found...
|
||||
|
@ -1001,11 +1001,11 @@ void Exa_GetDataOfExamByCod (struct Exa_Exam *Exam)
|
|||
/* Get number of questions */
|
||||
Exam->NumQsts = ExaSet_GetNumQstsExam (Exam->ExaCod);
|
||||
|
||||
/* Get number of events */
|
||||
Exam->NumEvts = ExaEvt_GetNumEventsInExam (Exam->ExaCod);
|
||||
/* Get number of sessions */
|
||||
Exam->NumSess = ExaSes_GetNumSessionsInExam (Exam->ExaCod);
|
||||
|
||||
/* Get number of open events */
|
||||
Exam->NumOpenEvts = ExaEvt_GetNumOpenEventsInExam (Exam->ExaCod);
|
||||
/* Get number of open sessions */
|
||||
Exam->NumOpenSess = ExaSes_GetNumOpenSessionsInExam (Exam->ExaCod);
|
||||
}
|
||||
else
|
||||
/* Initialize to empty exam */
|
||||
|
@ -1020,7 +1020,7 @@ void Exa_GetDataOfExamByCod (struct Exa_Exam *Exam)
|
|||
NumRows = DB_QuerySELECT (&mysql_res,"can not get exam data",
|
||||
"SELECT UNIX_TIMESTAMP(MIN(StartTime))," // row[0]
|
||||
"UNIX_TIMESTAMP(MAX(EndTime))" // row[1]
|
||||
" FROM exa_events"
|
||||
" FROM exa_sessions"
|
||||
" WHERE ExaCod=%ld",
|
||||
Exam->ExaCod);
|
||||
if (NumRows)
|
||||
|
@ -1178,8 +1178,8 @@ void Exa_RemoveExam (void)
|
|||
|
||||
static void Exa_RemoveExamFromAllTables (long ExaCod)
|
||||
{
|
||||
/***** Remove all events in this exam *****/
|
||||
ExaEvt_RemoveEventsInExamFromAllTables (ExaCod);
|
||||
/***** Remove all sessions in this exam *****/
|
||||
ExaSes_RemoveSessionsInExamFromAllTables (ExaCod);
|
||||
|
||||
/***** Remove exam questions *****/
|
||||
DB_QueryDELETE ("can not remove exam questions",
|
||||
|
@ -1207,8 +1207,8 @@ static void Exa_RemoveExamFromAllTables (long ExaCod)
|
|||
|
||||
void Exa_RemoveExamsCrs (long CrsCod)
|
||||
{
|
||||
/***** Remove all events in this course *****/
|
||||
ExaEvt_RemoveEventInCourseFromAllTables (CrsCod);
|
||||
/***** Remove all sessions in this course *****/
|
||||
ExaSes_RemoveSessionInCourseFromAllTables (CrsCod);
|
||||
|
||||
/***** Remove the questions in exams *****/
|
||||
DB_QueryDELETE ("can not remove questions in course exams",
|
||||
|
@ -1756,7 +1756,7 @@ unsigned Exa_GetNextQuestionIndexInExam (long ExaCod,unsigned QstInd)
|
|||
{
|
||||
MYSQL_RES *mysql_res;
|
||||
MYSQL_ROW row;
|
||||
unsigned NextQstInd = ExaEvt_AFTER_LAST_QUESTION; // End of questions has been reached
|
||||
unsigned NextQstInd = ExaSes_AFTER_LAST_QUESTION; // End of questions has been reached
|
||||
|
||||
/***** Get next question index in an exam from database *****/
|
||||
// Although indexes are always continuous...
|
||||
|
@ -1793,15 +1793,15 @@ static void Exa_PutParamSetCod (void *SetCod) // Should be a pointer to long
|
|||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
/*********** Get number of events and check is edition is possible **********/
|
||||
/********** Get number of sessions and check is edition is possible **********/
|
||||
/*****************************************************************************/
|
||||
// Before calling this function, number of events must be calculated
|
||||
// Before calling this function, number of sessions must be calculated
|
||||
|
||||
bool Exa_CheckIfEditable (const struct Exa_Exam *Exam)
|
||||
{
|
||||
if (Exa_CheckIfICanEditExams ())
|
||||
/***** Questions are editable only if exam has no events *****/
|
||||
return (bool) (Exam->NumEvts == 0); // Exams with events should not be edited
|
||||
/***** Questions are editable only if exam has no sessions *****/
|
||||
return (bool) (Exam->NumSess == 0); // Exams with sessions should not be edited
|
||||
else
|
||||
return false; // Questions are not editable
|
||||
}
|
||||
|
|
11
swad_exam.h
11
swad_exam.h
|
@ -28,10 +28,7 @@
|
|||
/********************************* Headers ***********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
// #include "swad_date.h"
|
||||
// #include "swad_exam_event.h"
|
||||
#include "swad_exam_type.h"
|
||||
// #include "swad_scope.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/************************** Public types and constants ***********************/
|
||||
|
@ -51,12 +48,12 @@ bool Exa_CheckIfICanEditExams (void);
|
|||
void Exa_SeeOneExam (void);
|
||||
void Exa_ShowOnlyOneExam (struct Exa_Exams *Exams,
|
||||
struct Exa_Exam *Exam,
|
||||
struct ExaEvt_Event *Event,
|
||||
bool PutFormEvent);
|
||||
struct ExaSes_Session *Session,
|
||||
bool PutFormSession);
|
||||
void Exa_ShowOnlyOneExamBegin (struct Exa_Exams *Exams,
|
||||
struct Exa_Exam *Exam,
|
||||
struct ExaEvt_Event *Event,
|
||||
bool PutFormEvent);
|
||||
struct ExaSes_Session *Session,
|
||||
bool PutFormSession);
|
||||
void Exa_ShowOnlyOneExamEnd (void);
|
||||
|
||||
void Exa_SetCurrentExaCod (long ExaCod);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// swad_exam_print.c: exam prints (each copy of an exam in an event for a student)
|
||||
// swad_exam_print.c: exam prints (each copy of an exam in a session for a student)
|
||||
|
||||
/*
|
||||
SWAD (Shared Workspace At a Distance),
|
||||
|
@ -35,9 +35,9 @@
|
|||
#include "swad_box.h"
|
||||
#include "swad_database.h"
|
||||
#include "swad_exam.h"
|
||||
#include "swad_exam_event.h"
|
||||
#include "swad_exam_print.h"
|
||||
#include "swad_exam_result.h"
|
||||
#include "swad_exam_session.h"
|
||||
#include "swad_exam_set.h"
|
||||
#include "swad_exam_type.h"
|
||||
#include "swad_form.h"
|
||||
|
@ -140,7 +140,7 @@ static void ExaPrn_UpdatePrintInDB (const struct ExaPrn_Print *Print);
|
|||
|
||||
void ExaPrn_ResetPrint (struct ExaPrn_Print *Print)
|
||||
{
|
||||
Print->EvtCod = -1L;
|
||||
Print->SesCod = -1L;
|
||||
Print->UsrCod = -1L;
|
||||
ExaPrn_ResetPrintExceptEvtCodAndUsrCod (Print);
|
||||
}
|
||||
|
@ -148,7 +148,6 @@ void ExaPrn_ResetPrint (struct ExaPrn_Print *Print)
|
|||
static void ExaPrn_ResetPrintExceptEvtCodAndUsrCod (struct ExaPrn_Print *Print)
|
||||
{
|
||||
Print->PrnCod = -1L;
|
||||
// Print->ExaCod = -1L;
|
||||
Print->TimeUTC[Dat_START_TIME] =
|
||||
Print->TimeUTC[Dat_END_TIME ] = (time_t) 0;
|
||||
Print->NumQsts =
|
||||
|
@ -158,32 +157,32 @@ static void ExaPrn_ResetPrintExceptEvtCodAndUsrCod (struct ExaPrn_Print *Print)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************** Show print of an exam in an event ********************/
|
||||
/********************** Show print of an exam in a session *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void ExaPrn_ShowExamPrint (void)
|
||||
{
|
||||
struct Exa_Exams Exams;
|
||||
struct Exa_Exam Exam;
|
||||
struct ExaEvt_Event Event;
|
||||
struct ExaSes_Session Session;
|
||||
struct ExaPrn_Print Print;
|
||||
|
||||
/***** Reset exams context *****/
|
||||
Exa_ResetExams (&Exams);
|
||||
Exa_ResetExam (&Exam);
|
||||
ExaEvt_ResetEvent (&Event);
|
||||
ExaSes_ResetSession (&Session);
|
||||
ExaPrn_ResetPrint (&Print);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaEvt_GetAndCheckParameters (&Exams,&Exam,&Event);
|
||||
ExaSes_GetAndCheckParameters (&Exams,&Exam,&Session);
|
||||
|
||||
/***** Check if I can access to this event *****/
|
||||
if (ExaEvt_CheckIfICanAnswerThisEvent (&Event))
|
||||
/***** Check if I can access to this session *****/
|
||||
if (ExaSes_CheckIfICanAnswerThisSession (&Session))
|
||||
{
|
||||
/***** Get print data from database *****/
|
||||
Print.EvtCod = Event.EvtCod;
|
||||
Print.SesCod = Session.SesCod;
|
||||
Print.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
|
||||
ExaPrn_GetPrintDataByEvtCodAndUsrCod (&Print);
|
||||
ExaPrn_GetPrintDataBySesCodAndUsrCod (&Print);
|
||||
|
||||
if (Print.PrnCod > 0) // Print exists and I can access to it
|
||||
/***** Get questions and user's answers of exam print from database *****/
|
||||
|
@ -209,10 +208,10 @@ void ExaPrn_ShowExamPrint (void)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********* Get data of an exam print using event code and user code **********/
|
||||
/******** Get data of an exam print using session code and user code *********/
|
||||
/*****************************************************************************/
|
||||
|
||||
void ExaPrn_GetPrintDataByEvtCodAndUsrCod (struct ExaPrn_Print *Print)
|
||||
void ExaPrn_GetPrintDataBySesCodAndUsrCod (struct ExaPrn_Print *Print)
|
||||
{
|
||||
MYSQL_RES *mysql_res;
|
||||
MYSQL_ROW row;
|
||||
|
@ -227,9 +226,9 @@ void ExaPrn_GetPrintDataByEvtCodAndUsrCod (struct ExaPrn_Print *Print)
|
|||
"Sent," // row[5]
|
||||
"Score" // row[6]
|
||||
" FROM exa_prints"
|
||||
" WHERE EvtCod=%ld"
|
||||
" WHERE SesCod=%ld"
|
||||
" AND UsrCod=%ld",
|
||||
Print->EvtCod,
|
||||
Print->SesCod,
|
||||
Print->UsrCod) == 1)
|
||||
{
|
||||
row = mysql_fetch_row (mysql_res);
|
||||
|
@ -490,10 +489,10 @@ static void ExaPrn_CreatePrintInDB (struct ExaPrn_Print *Print)
|
|||
Print->PrnCod =
|
||||
DB_QueryINSERTandReturnCode ("can not create new exam print",
|
||||
"INSERT INTO exa_prints"
|
||||
" (EvtCod,UsrCod,StartTime,EndTime,NumQsts,NumQstsNotBlank,Sent,Score)"
|
||||
" (SesCod,UsrCod,StartTime,EndTime,NumQsts,NumQstsNotBlank,Sent,Score)"
|
||||
" VALUES"
|
||||
" (%ld,%ld,NOW(),NOW(),%u,0,'N',0)",
|
||||
Print->EvtCod,
|
||||
Print->SesCod,
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||
Print->NumQsts);
|
||||
}
|
||||
|
@ -588,8 +587,8 @@ static void ExaPrn_ShowExamPrintToFillIt (const char *Title,
|
|||
|
||||
/***** Form to end/close this exam print *****/
|
||||
Frm_StartForm (ActEndExaPrn);
|
||||
// ExaEvt_PutParamEvtCod (Print->EvtCod);
|
||||
Btn_PutCreateButton ("He terminado"); // TODO: Translate!!!
|
||||
// ExaSes_PutParamSesCod (Print->SesCod);
|
||||
Btn_PutCreateButton ("He terminado"); // TODO: Need translations!!!
|
||||
Frm_EndForm ();
|
||||
}
|
||||
|
||||
|
@ -744,10 +743,10 @@ static void ExaPrn_WriteIntAnsToFill (const struct ExaPrn_Print *Print,
|
|||
Id,
|
||||
Print->PrintedQuestions[NumQst].StrAnswers);
|
||||
HTM_TxtF (" onchange=\"updateExamPrint('examprint','%s','Ans',"
|
||||
"'act=%ld&ses=%s&EvtCod=%ld&NumQst=%u');"
|
||||
"'act=%ld&ses=%s&SesCod=%ld&NumQst=%u');"
|
||||
" return false;\" />", // return false is necessary to not submit form
|
||||
Id,
|
||||
Act_GetActCod (ActAnsExaPrn),Gbl.Session.Id,Print->EvtCod,NumQst);
|
||||
Act_GetActCod (ActAnsExaPrn),Gbl.Session.Id,Print->SesCod,NumQst);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -768,10 +767,10 @@ static void ExaPrn_WriteFloatAnsToFill (const struct ExaPrn_Print *Print,
|
|||
Id,Tst_MAX_BYTES_FLOAT_ANSWER,
|
||||
Print->PrintedQuestions[NumQst].StrAnswers);
|
||||
HTM_TxtF (" onchange=\"updateExamPrint('examprint','%s','Ans',"
|
||||
"'act=%ld&ses=%s&EvtCod=%ld&NumQst=%u');"
|
||||
"'act=%ld&ses=%s&SesCod=%ld&NumQst=%u');"
|
||||
" return false;\" />", // return false is necessary to not submit form
|
||||
Id,
|
||||
Act_GetActCod (ActAnsExaPrn),Gbl.Session.Id,Print->EvtCod,NumQst);
|
||||
Act_GetActCod (ActAnsExaPrn),Gbl.Session.Id,Print->SesCod,NumQst);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -793,11 +792,11 @@ static void ExaPrn_WriteTFAnsToFill (const struct ExaPrn_Print *Print,
|
|||
NumQst);
|
||||
HTM_TxtF ("<select id=\"%s\" name=\"Ans\"",Id);
|
||||
HTM_TxtF (" onchange=\"updateExamPrint('examprint','%s','Ans',"
|
||||
"'act=%ld&ses=%s&EvtCod=%ld&NumQst=%u');"
|
||||
"'act=%ld&ses=%s&SesCod=%ld&NumQst=%u');"
|
||||
" return false;\" />", // return false is necessary to not submit form
|
||||
Id,
|
||||
Act_GetActCod (ActAnsExaPrn),
|
||||
Gbl.Session.Id,Print->EvtCod,NumQst);
|
||||
Gbl.Session.Id,Print->SesCod,NumQst);
|
||||
HTM_OPTION (HTM_Type_STRING,"" ,Print->PrintedQuestions[NumQst].StrAnswers[0] == '\0',false," ");
|
||||
HTM_OPTION (HTM_Type_STRING,"T",Print->PrintedQuestions[NumQst].StrAnswers[0] == 'T' ,false,"%s",Txt_TF_QST[0]);
|
||||
HTM_OPTION (HTM_Type_STRING,"F",Print->PrintedQuestions[NumQst].StrAnswers[0] == 'F' ,false,"%s",Txt_TF_QST[1]);
|
||||
|
@ -850,10 +849,10 @@ static void ExaPrn_WriteChoiceAnsToFill (struct ExaPrn_Print *Print,
|
|||
UsrAnswers[Indexes[NumOpt]] ? " checked=\"checked\"" :
|
||||
"");
|
||||
HTM_TxtF (" onclick=\"updateExamPrint('examprint','%s_%u','Ans',"
|
||||
"'act=%ld&ses=%s&EvtCod=%ld&NumQst=%u');"
|
||||
"'act=%ld&ses=%s&SesCod=%ld&NumQst=%u');"
|
||||
" return false;\" />", // return false is necessary to not submit form
|
||||
Id,NumOpt,
|
||||
Act_GetActCod (ActAnsExaPrn),Gbl.Session.Id,Print->EvtCod,NumQst);
|
||||
Act_GetActCod (ActAnsExaPrn),Gbl.Session.Id,Print->SesCod,NumQst);
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
|
@ -897,10 +896,10 @@ static void ExaPrn_WriteTextAnsToFill (const struct ExaPrn_Print *Print,
|
|||
Id,Tst_MAX_CHARS_ANSWERS_ONE_QST,
|
||||
Print->PrintedQuestions[NumQst].StrAnswers);
|
||||
HTM_TxtF (" onchange=\"updateExamPrint('examprint','%s','Ans',"
|
||||
"'act=%ld&ses=%s&EvtCod=%ld&NumQst=%u');"
|
||||
"'act=%ld&ses=%s&SesCod=%ld&NumQst=%u');"
|
||||
" return false;\" />", // return false is necessary to not submit form
|
||||
Id,
|
||||
Act_GetActCod (ActAnsExaPrn),Gbl.Session.Id,Print->EvtCod,NumQst);
|
||||
Act_GetActCod (ActAnsExaPrn),Gbl.Session.Id,Print->SesCod,NumQst);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -915,15 +914,15 @@ void ExaPrn_ReceivePrintAnswer (void)
|
|||
/***** Reset print *****/
|
||||
ExaPrn_ResetPrint (&Print);
|
||||
|
||||
/***** Get event code *****/
|
||||
Print.EvtCod = ExaEvt_GetParamEvtCod ();
|
||||
/***** Get session code *****/
|
||||
Print.SesCod = ExaSes_GetParamSesCod ();
|
||||
|
||||
/***** Check if event if visible and open *****/
|
||||
if (ExaEvt_CheckIfEventIsVisibleAndOpen (Print.EvtCod))
|
||||
/***** Check if session if visible and open *****/
|
||||
if (ExaSes_CheckIfSessionIsVisibleAndOpen (Print.SesCod))
|
||||
{
|
||||
/***** Get print data *****/
|
||||
Print.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
|
||||
ExaPrn_GetPrintDataByEvtCodAndUsrCod (&Print);
|
||||
ExaPrn_GetPrintDataBySesCodAndUsrCod (&Print);
|
||||
if (Print.PrnCod <= 0)
|
||||
Lay_WrongExamExit ();
|
||||
|
||||
|
@ -1388,13 +1387,13 @@ static void ExaPrn_UpdatePrintInDB (const struct ExaPrn_Print *Print)
|
|||
"Sent='%c',"
|
||||
"Score='%.15lg'"
|
||||
" WHERE PrnCod=%ld"
|
||||
" AND EvtCod=%ld AND UsrCod=%ld", // Extra checks
|
||||
" AND SesCod=%ld AND UsrCod=%ld", // Extra checks
|
||||
Print->NumQstsNotBlank,
|
||||
Print->Sent ? 'Y' :
|
||||
'N',
|
||||
Print->Score,
|
||||
Print->PrnCod,
|
||||
Print->EvtCod,Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
Print->SesCod,Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
Str_SetDecimalPointToLocal (); // Return to local system
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// swad_exam_print.h: exam prints (each copy of an exam in an event for a student)
|
||||
// swad_exam_print.h: exam prints (each copy of an exam in a session for a student)
|
||||
|
||||
#ifndef _SWAD_EXA_PRN
|
||||
#define _SWAD_EXA_PRN
|
||||
|
@ -27,6 +27,8 @@
|
|||
/********************************** Headers **********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include "swad_test_print.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/************************* Public types and constants ************************/
|
||||
/*****************************************************************************/
|
||||
|
@ -36,7 +38,7 @@
|
|||
struct ExaPrn_Print
|
||||
{
|
||||
long PrnCod; // Exam print code
|
||||
long EvtCod; // Event code associated to this print
|
||||
long SesCod; // Session code associated to this print
|
||||
long UsrCod; // User who answered the exam print
|
||||
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
||||
unsigned NumQsts; // Number of questions
|
||||
|
@ -55,7 +57,7 @@ void ExaPrn_ResetPrint (struct ExaPrn_Print *Print);
|
|||
|
||||
void ExaPrn_ShowExamPrint (void);
|
||||
|
||||
void ExaPrn_GetPrintDataByEvtCodAndUsrCod (struct ExaPrn_Print *Print);
|
||||
void ExaPrn_GetPrintDataBySesCodAndUsrCod (struct ExaPrn_Print *Print);
|
||||
|
||||
void ExaPrn_GetPrintQuestionsFromDB (struct ExaPrn_Print *Print);
|
||||
|
||||
|
|
|
@ -36,9 +36,9 @@
|
|||
#include "swad_database.h"
|
||||
#include "swad_date.h"
|
||||
#include "swad_exam.h"
|
||||
#include "swad_exam_event.h"
|
||||
#include "swad_exam_print.h"
|
||||
#include "swad_exam_result.h"
|
||||
#include "swad_exam_session.h"
|
||||
#include "swad_exam_set.h"
|
||||
#include "swad_exam_type.h"
|
||||
#include "swad_form.h"
|
||||
|
@ -78,13 +78,13 @@ extern struct Globals Gbl;
|
|||
|
||||
static void ExaRes_PutFormToSelUsrsToViewEvtResults (void *Exams);
|
||||
|
||||
static void ExaRes_ListMyEvtResultsInCrs (struct Exa_Exams *Exams);
|
||||
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_ListMySesResultsInCrs (struct Exa_Exams *Exams);
|
||||
static void ExaRes_ListMySesResultsInExa (struct Exa_Exams *Exams,long ExaCod);
|
||||
static void ExaRes_ListMySesResultsInSes (struct Exa_Exams *Exams,long SesCod);
|
||||
static void ExaRes_ShowAllSesResultsInSelectedExams (void *Exams);
|
||||
static void ExaRes_ListAllSesResultsInSelectedExams (struct Exa_Exams *Exams);
|
||||
static void ExaRes_ListAllSesResultsInExa (struct Exa_Exams *Exams,long ExaCod);
|
||||
static void ExaRes_ListAllSesResultsInSes (struct Exa_Exams *Exams,long SesCod);
|
||||
|
||||
static void ExaRes_ShowResultsBegin (struct Exa_Exams *Exams,
|
||||
const char *Title,bool ListExamsToSelect);
|
||||
|
@ -95,9 +95,9 @@ static void ExaRes_ShowHeaderEvtResults (Usr_MeOrOther_t MeOrOther);
|
|||
|
||||
static void ExaRes_BuildExamsSelectedCommas (struct Exa_Exams *Exams,
|
||||
char **ExamsSelectedCommas);
|
||||
static void ExaRes_ShowEvtResults (struct Exa_Exams *Exams,
|
||||
static void ExaRes_ShowSesResults (struct Exa_Exams *Exams,
|
||||
Usr_MeOrOther_t MeOrOther,
|
||||
long EvtCod, // <= 0 ==> any
|
||||
long SesCod, // <= 0 ==> any
|
||||
long ExaCod, // <= 0 ==> any
|
||||
const char *ExamsSelectedCommas);
|
||||
static void ExaRes_ShowEvtResultsSummaryRow (unsigned NumResults,
|
||||
|
@ -106,7 +106,7 @@ static void ExaRes_ShowEvtResultsSummaryRow (unsigned NumResults,
|
|||
double TotalScoreOfAllResults,
|
||||
double TotalGrade);
|
||||
|
||||
static bool ExaRes_CheckIfICanSeePrintResult (struct ExaEvt_Event *Event,long UsrCod);
|
||||
static bool ExaRes_CheckIfICanSeePrintResult (struct ExaSes_Session *Session,long UsrCod);
|
||||
static bool ExaRes_CheckIfICanViewScore (bool ICanViewResult,unsigned Visibility);
|
||||
|
||||
static void ExaRes_ShowExamAnswers (struct UsrData *UsrDat,
|
||||
|
@ -119,7 +119,7 @@ static void ExaRes_WriteQstAndAnsExam (struct UsrData *UsrDat,
|
|||
unsigned Visibility);
|
||||
|
||||
/*****************************************************************************/
|
||||
/*************************** Show my events results **************************/
|
||||
/*************************** Show my sessions results **************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void ExaRes_ShowMyExaResultsInCrs (void)
|
||||
|
@ -134,9 +134,9 @@ void ExaRes_ShowMyExaResultsInCrs (void)
|
|||
Exa_GetListExams (&Exams,Exa_ORDER_BY_TITLE);
|
||||
Exa_GetListSelectedExaCods (&Exams);
|
||||
|
||||
/***** List my events results in the current course *****/
|
||||
/***** List my sessions results in the current course *****/
|
||||
ExaRes_ShowResultsBegin (&Exams,Txt_Results,true); // List exams to select
|
||||
ExaRes_ListMyEvtResultsInCrs (&Exams);
|
||||
ExaRes_ListMySesResultsInCrs (&Exams);
|
||||
ExaRes_ShowResultsEnd ();
|
||||
|
||||
/***** Free list of exams *****/
|
||||
|
@ -144,22 +144,22 @@ void ExaRes_ShowMyExaResultsInCrs (void)
|
|||
Exa_FreeListExams (&Exams);
|
||||
}
|
||||
|
||||
static void ExaRes_ListMyEvtResultsInCrs (struct Exa_Exams *Exams)
|
||||
static void ExaRes_ListMySesResultsInCrs (struct Exa_Exams *Exams)
|
||||
{
|
||||
char *ExamsSelectedCommas = NULL; // Initialized to avoid warning
|
||||
|
||||
/***** Table header *****/
|
||||
ExaRes_ShowHeaderEvtResults (Usr_ME);
|
||||
|
||||
/***** List my events results in the current course *****/
|
||||
/***** List my sessions results in the current course *****/
|
||||
TstCfg_GetConfigFromDB (); // Get feedback type
|
||||
ExaRes_BuildExamsSelectedCommas (Exams,&ExamsSelectedCommas);
|
||||
ExaRes_ShowEvtResults (Exams,Usr_ME,-1L,-1L,ExamsSelectedCommas);
|
||||
ExaRes_ShowSesResults (Exams,Usr_ME,-1L,-1L,ExamsSelectedCommas);
|
||||
free (ExamsSelectedCommas);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************** Show my events results in a given exam *******************/
|
||||
/***************** Show my sessions results in a given exam *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void ExaRes_ShowMyExaResultsInExa (void)
|
||||
|
@ -167,12 +167,12 @@ void ExaRes_ShowMyExaResultsInExa (void)
|
|||
extern const char *Txt_Results_of_exam_X;
|
||||
struct Exa_Exams Exams;
|
||||
struct Exa_Exam Exam;
|
||||
struct ExaEvt_Event Event;
|
||||
struct ExaSes_Session Session;
|
||||
|
||||
/***** Reset exams context *****/
|
||||
Exa_ResetExams (&Exams);
|
||||
Exa_ResetExam (&Exam);
|
||||
ExaEvt_ResetEvent (&Event);
|
||||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (&Exams);
|
||||
|
@ -185,85 +185,85 @@ void ExaRes_ShowMyExaResultsInExa (void)
|
|||
Exams.ExaCod = Exam.ExaCod;
|
||||
|
||||
/***** Exam begin *****/
|
||||
Exa_ShowOnlyOneExamBegin (&Exams,&Exam,&Event,
|
||||
false); // Do not put form to start new event
|
||||
Exa_ShowOnlyOneExamBegin (&Exams,&Exam,&Session,
|
||||
false); // Do not put form to start new session
|
||||
|
||||
/***** List my events results in exam *****/
|
||||
/***** List my sessions results in exam *****/
|
||||
ExaRes_ShowResultsBegin (&Exams,
|
||||
Str_BuildStringStr (Txt_Results_of_exam_X,Exam.Title),
|
||||
false); // Do not list exams to select
|
||||
Str_FreeString ();
|
||||
ExaRes_ListMyEvtResultsInExa (&Exams,Exam.ExaCod);
|
||||
ExaRes_ListMySesResultsInExa (&Exams,Exam.ExaCod);
|
||||
ExaRes_ShowResultsEnd ();
|
||||
|
||||
/***** Exam end *****/
|
||||
Exa_ShowOnlyOneExamEnd ();
|
||||
}
|
||||
|
||||
static void ExaRes_ListMyEvtResultsInExa (struct Exa_Exams *Exams,long ExaCod)
|
||||
static void ExaRes_ListMySesResultsInExa (struct Exa_Exams *Exams,long ExaCod)
|
||||
{
|
||||
/***** Table header *****/
|
||||
ExaRes_ShowHeaderEvtResults (Usr_ME);
|
||||
|
||||
/***** List my events results in exam *****/
|
||||
/***** List my sessions results in exam *****/
|
||||
TstCfg_GetConfigFromDB (); // Get feedback type
|
||||
ExaRes_ShowEvtResults (Exams,Usr_ME,-1L,ExaCod,NULL);
|
||||
ExaRes_ShowSesResults (Exams,Usr_ME,-1L,ExaCod,NULL);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************** Show my events results in a given event ******************/
|
||||
/***************** Show my sessions results in a given session ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void ExaRes_ShowMyExaResultsInEvt (void)
|
||||
{
|
||||
extern const char *Txt_Results_of_event_X;
|
||||
extern const char *Txt_Results_of_session_X;
|
||||
struct Exa_Exams Exams;
|
||||
struct Exa_Exam Exam;
|
||||
struct ExaEvt_Event Event;
|
||||
struct ExaSes_Session Session;
|
||||
|
||||
/***** Reset exams context *****/
|
||||
Exa_ResetExams (&Exams);
|
||||
Exa_ResetExam (&Exam);
|
||||
ExaEvt_ResetEvent (&Event);
|
||||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (&Exams);
|
||||
if (Exams.ExaCod <= 0)
|
||||
Lay_WrongExamExit ();
|
||||
Exam.ExaCod = Exams.ExaCod;
|
||||
if ((Event.EvtCod = ExaEvt_GetParamEvtCod ()) <= 0)
|
||||
Lay_WrongEventExit ();
|
||||
if ((Session.SesCod = ExaSes_GetParamSesCod ()) <= 0)
|
||||
Lay_WrongExamSessionExit ();
|
||||
Exa_GetDataOfExamByCod (&Exam);
|
||||
Exams.ExaCod = Exam.ExaCod;
|
||||
ExaEvt_GetDataOfEventByCod (&Event);
|
||||
ExaSes_GetDataOfSessionByCod (&Session);
|
||||
|
||||
/***** Exam begin *****/
|
||||
Exa_ShowOnlyOneExamBegin (&Exams,&Exam,&Event,
|
||||
false); // Do not put form to start new event
|
||||
Exa_ShowOnlyOneExamBegin (&Exams,&Exam,&Session,
|
||||
false); // Do not put form to start new session
|
||||
|
||||
/***** List my events results in event *****/
|
||||
ExaRes_ShowResultsBegin (&Exams,Str_BuildStringStr (Txt_Results_of_event_X,Event.Title),
|
||||
/***** List my sessions results in session *****/
|
||||
ExaRes_ShowResultsBegin (&Exams,Str_BuildStringStr (Txt_Results_of_session_X,Session.Title),
|
||||
false); // Do not list exams to select
|
||||
Str_FreeString ();
|
||||
ExaRes_ListMyEvtResultsInEvt (&Exams,Event.EvtCod);
|
||||
ExaRes_ListMySesResultsInSes (&Exams,Session.SesCod);
|
||||
ExaRes_ShowResultsEnd ();
|
||||
|
||||
/***** Exam end *****/
|
||||
Exa_ShowOnlyOneExamEnd ();
|
||||
}
|
||||
|
||||
static void ExaRes_ListMyEvtResultsInEvt (struct Exa_Exams *Exams,long EvtCod)
|
||||
static void ExaRes_ListMySesResultsInSes (struct Exa_Exams *Exams,long SesCod)
|
||||
{
|
||||
/***** Table header *****/
|
||||
ExaRes_ShowHeaderEvtResults (Usr_ME);
|
||||
|
||||
/***** List my events results in exam *****/
|
||||
/***** List my sessions results in exam *****/
|
||||
TstCfg_GetConfigFromDB (); // Get feedback type
|
||||
ExaRes_ShowEvtResults (Exams,Usr_ME,EvtCod,-1L,NULL);
|
||||
ExaRes_ShowSesResults (Exams,Usr_ME,SesCod,-1L,NULL);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************** Get users and show their events results *****************/
|
||||
/****************** Get users and show their sessions results *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void ExaRes_ShowAllExaResultsInCrs (void)
|
||||
|
@ -273,17 +273,17 @@ void ExaRes_ShowAllExaResultsInCrs (void)
|
|||
/***** Reset exams context *****/
|
||||
Exa_ResetExams (&Exams);
|
||||
|
||||
/***** Get users and show their events results *****/
|
||||
/***** Get users and show their sessions results *****/
|
||||
Usr_GetSelectedUsrsAndGoToAct (&Gbl.Usrs.Selected,
|
||||
ExaRes_ShowAllEvtResultsInSelectedExams,&Exams,
|
||||
ExaRes_ShowAllSesResultsInSelectedExams,&Exams,
|
||||
ExaRes_PutFormToSelUsrsToViewEvtResults,&Exams);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************** Show events results for several users *******************/
|
||||
/****************** Show sessions results for several users *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void ExaRes_ShowAllEvtResultsInSelectedExams (void *Exams)
|
||||
static void ExaRes_ShowAllSesResultsInSelectedExams (void *Exams)
|
||||
{
|
||||
extern const char *Txt_Results;
|
||||
|
||||
|
@ -294,11 +294,11 @@ static void ExaRes_ShowAllEvtResultsInSelectedExams (void *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 *****/
|
||||
/***** List the sessions results of the selected users *****/
|
||||
ExaRes_ShowResultsBegin ((struct Exa_Exams *) Exams,
|
||||
Txt_Results,
|
||||
true); // List exams to select
|
||||
ExaRes_ListAllEvtResultsInSelectedExams ((struct Exa_Exams *) Exams);
|
||||
ExaRes_ListAllSesResultsInSelectedExams ((struct Exa_Exams *) Exams);
|
||||
ExaRes_ShowResultsEnd ();
|
||||
|
||||
/***** Free list of exams *****/
|
||||
|
@ -306,7 +306,7 @@ static void ExaRes_ShowAllEvtResultsInSelectedExams (void *Exams)
|
|||
Exa_FreeListExams ((struct Exa_Exams *) Exams);
|
||||
}
|
||||
|
||||
static void ExaRes_ListAllEvtResultsInSelectedExams (struct Exa_Exams *Exams)
|
||||
static void ExaRes_ListAllSesResultsInSelectedExams (struct Exa_Exams *Exams)
|
||||
{
|
||||
char *ExamsSelectedCommas = NULL; // Initialized to avoid warning
|
||||
const char *Ptr;
|
||||
|
@ -314,7 +314,7 @@ static void ExaRes_ListAllEvtResultsInSelectedExams (struct Exa_Exams *Exams)
|
|||
/***** Table head *****/
|
||||
ExaRes_ShowHeaderEvtResults (Usr_OTHER);
|
||||
|
||||
/***** List the events results of the selected users *****/
|
||||
/***** List the sessions results of the selected users *****/
|
||||
ExaRes_BuildExamsSelectedCommas (Exams,&ExamsSelectedCommas);
|
||||
Ptr = Gbl.Usrs.Selected.List[Rol_UNK];
|
||||
while (*Ptr)
|
||||
|
@ -325,16 +325,16 @@ static void ExaRes_ListAllEvtResultsInSelectedExams (struct Exa_Exams *Exams)
|
|||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Usr_DONT_GET_PREFS))
|
||||
if (Usr_CheckIfICanViewTstExaMchResult (&Gbl.Usrs.Other.UsrDat))
|
||||
{
|
||||
/***** Show events results *****/
|
||||
/***** Show sessions results *****/
|
||||
Gbl.Usrs.Other.UsrDat.Accepted = Usr_CheckIfUsrHasAcceptedInCurrentCrs (&Gbl.Usrs.Other.UsrDat);
|
||||
ExaRes_ShowEvtResults (Exams,Usr_OTHER,-1L,-1L,ExamsSelectedCommas);
|
||||
ExaRes_ShowSesResults (Exams,Usr_OTHER,-1L,-1L,ExamsSelectedCommas);
|
||||
}
|
||||
}
|
||||
free (ExamsSelectedCommas);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**************** Select users to show their events results *****************/
|
||||
/**************** Select users to show their sessions results *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void ExaRes_SelUsrsToViewExaResults (void)
|
||||
|
@ -365,7 +365,7 @@ static void ExaRes_PutFormToSelUsrsToViewEvtResults (void *Exams)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*** Show events results of a exam for the users who answered in that exam **/
|
||||
/*** Show sessions results of a exam for the users who answered in that exam **/
|
||||
/*****************************************************************************/
|
||||
|
||||
void ExaRes_ShowAllExaResultsInExa (void)
|
||||
|
@ -373,12 +373,12 @@ void ExaRes_ShowAllExaResultsInExa (void)
|
|||
extern const char *Txt_Results_of_exam_X;
|
||||
struct Exa_Exams Exams;
|
||||
struct Exa_Exam Exam;
|
||||
struct ExaEvt_Event Event;
|
||||
struct ExaSes_Session Session;
|
||||
|
||||
/***** Reset exams context *****/
|
||||
Exa_ResetExams (&Exams);
|
||||
Exa_ResetExam (&Exam);
|
||||
ExaEvt_ResetEvent (&Event);
|
||||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (&Exams);
|
||||
|
@ -389,22 +389,22 @@ void ExaRes_ShowAllExaResultsInExa (void)
|
|||
Exams.ExaCod = Exam.ExaCod;
|
||||
|
||||
/***** Exam begin *****/
|
||||
Exa_ShowOnlyOneExamBegin (&Exams,&Exam,&Event,
|
||||
false); // Do not put form to start new event
|
||||
Exa_ShowOnlyOneExamBegin (&Exams,&Exam,&Session,
|
||||
false); // Do not put form to start new session
|
||||
|
||||
/***** List events results in exam *****/
|
||||
/***** List sessions results in exam *****/
|
||||
ExaRes_ShowResultsBegin (&Exams,
|
||||
Str_BuildStringStr (Txt_Results_of_exam_X,Exam.Title),
|
||||
false); // Do not list exams to select
|
||||
Str_FreeString ();
|
||||
ExaRes_ListAllEvtResultsInExa (&Exams,Exam.ExaCod);
|
||||
ExaRes_ListAllSesResultsInExa (&Exams,Exam.ExaCod);
|
||||
ExaRes_ShowResultsEnd ();
|
||||
|
||||
/***** Exam end *****/
|
||||
Exa_ShowOnlyOneExamEnd ();
|
||||
}
|
||||
|
||||
static void ExaRes_ListAllEvtResultsInExa (struct Exa_Exams *Exams,long ExaCod)
|
||||
static void ExaRes_ListAllSesResultsInExa (struct Exa_Exams *Exams,long ExaCod)
|
||||
{
|
||||
MYSQL_RES *mysql_res;
|
||||
MYSQL_ROW row;
|
||||
|
@ -414,14 +414,14 @@ static void ExaRes_ListAllEvtResultsInExa (struct Exa_Exams *Exams,long ExaCod)
|
|||
/***** Table head *****/
|
||||
ExaRes_ShowHeaderEvtResults (Usr_OTHER);
|
||||
|
||||
/***** Get all users who have answered any event question in this exam *****/
|
||||
/***** Get all users who have answered any session question in this exam *****/
|
||||
NumUsrs = DB_QuerySELECT (&mysql_res,"can not get users in exam",
|
||||
"SELECT users.UsrCod FROM"
|
||||
" (SELECT DISTINCT exa_prints.UsrCod AS UsrCod" // row[0]
|
||||
" FROM exa_prints,exa_events,exa_exams"
|
||||
" WHERE exa_events.ExaCod=%ld"
|
||||
" AND exa_events.EvtCod=exa_prints.EvtCod"
|
||||
" AND exa_events.ExaCod=exa_exams.ExaCod"
|
||||
" FROM exa_prints,exa_sessions,exa_exams"
|
||||
" WHERE exa_sessions.ExaCod=%ld"
|
||||
" AND exa_sessions.SesCod=exa_prints.SesCod"
|
||||
" AND exa_sessions.ExaCod=exa_exams.ExaCod"
|
||||
" AND exa_exams.CrsCod=%ld)" // Extra check
|
||||
" AS users,usr_data"
|
||||
" WHERE users.UsrCod=usr_data.UsrCod"
|
||||
|
@ -432,21 +432,21 @@ static void ExaRes_ListAllEvtResultsInExa (struct Exa_Exams *Exams,long ExaCod)
|
|||
Gbl.Hierarchy.Crs.CrsCod);
|
||||
if (NumUsrs)
|
||||
{
|
||||
/***** List events results for each user *****/
|
||||
/***** List sessions results for each user *****/
|
||||
for (NumUsr = 0;
|
||||
NumUsr < NumUsrs;
|
||||
NumUsr++)
|
||||
{
|
||||
row = mysql_fetch_row (mysql_res);
|
||||
|
||||
/* Get event code (row[0]) */
|
||||
/* Get session 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_CheckIfICanViewTstExaMchResult (&Gbl.Usrs.Other.UsrDat))
|
||||
{
|
||||
/***** Show events results *****/
|
||||
/***** Show sessions results *****/
|
||||
Gbl.Usrs.Other.UsrDat.Accepted = Usr_CheckIfUsrHasAcceptedInCurrentCrs (&Gbl.Usrs.Other.UsrDat);
|
||||
ExaRes_ShowEvtResults (Exams,Usr_OTHER,-1L,ExaCod,NULL);
|
||||
ExaRes_ShowSesResults (Exams,Usr_OTHER,-1L,ExaCod,NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -456,51 +456,51 @@ static void ExaRes_ListAllEvtResultsInExa (struct Exa_Exams *Exams,long ExaCod)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/** Show events results of a event for the users who answered in that event */
|
||||
/** Show sessions results of a session for the users who answered in that session */
|
||||
/*****************************************************************************/
|
||||
|
||||
void ExaRes_ShowAllExaResultsInEvt (void)
|
||||
{
|
||||
extern const char *Txt_Results_of_event_X;
|
||||
extern const char *Txt_Results_of_session_X;
|
||||
struct Exa_Exams Exams;
|
||||
struct Exa_Exam Exam;
|
||||
struct ExaEvt_Event Event;
|
||||
struct ExaSes_Session Session;
|
||||
|
||||
/***** Reset exams context *****/
|
||||
Exa_ResetExams (&Exams);
|
||||
Exa_ResetExam (&Exam);
|
||||
ExaEvt_ResetEvent (&Event);
|
||||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (&Exams);
|
||||
if (Exams.ExaCod <= 0)
|
||||
Lay_WrongExamExit ();
|
||||
Exam.ExaCod = Exams.ExaCod;
|
||||
if ((Event.EvtCod = ExaEvt_GetParamEvtCod ()) <= 0)
|
||||
Lay_WrongEventExit ();
|
||||
if ((Session.SesCod = ExaSes_GetParamSesCod ()) <= 0)
|
||||
Lay_WrongExamSessionExit ();
|
||||
|
||||
/***** Get exam data and event *****/
|
||||
/***** Get exam data and session *****/
|
||||
Exa_GetDataOfExamByCod (&Exam);
|
||||
Exams.ExaCod = Exam.ExaCod;
|
||||
ExaEvt_GetDataOfEventByCod (&Event);
|
||||
ExaSes_GetDataOfSessionByCod (&Session);
|
||||
|
||||
/***** Exam begin *****/
|
||||
Exa_ShowOnlyOneExamBegin (&Exams,&Exam,&Event,
|
||||
false); // Do not put form to start new event
|
||||
Exa_ShowOnlyOneExamBegin (&Exams,&Exam,&Session,
|
||||
false); // Do not put form to start new session
|
||||
|
||||
/***** List events results in event *****/
|
||||
/***** List sessions results in session *****/
|
||||
ExaRes_ShowResultsBegin (&Exams,
|
||||
Str_BuildStringStr (Txt_Results_of_event_X,Event.Title),
|
||||
Str_BuildStringStr (Txt_Results_of_session_X,Session.Title),
|
||||
false); // Do not list exams to select
|
||||
Str_FreeString ();
|
||||
ExaRes_ListAllEvtResultsInEvt (&Exams,Event.EvtCod);
|
||||
ExaRes_ListAllSesResultsInSes (&Exams,Session.SesCod);
|
||||
ExaRes_ShowResultsEnd ();
|
||||
|
||||
/***** Exam end *****/
|
||||
Exa_ShowOnlyOneExamEnd ();
|
||||
}
|
||||
|
||||
static void ExaRes_ListAllEvtResultsInEvt (struct Exa_Exams *Exams,long EvtCod)
|
||||
static void ExaRes_ListAllSesResultsInSes (struct Exa_Exams *Exams,long SesCod)
|
||||
{
|
||||
MYSQL_RES *mysql_res;
|
||||
MYSQL_ROW row;
|
||||
|
@ -510,39 +510,39 @@ static void ExaRes_ListAllEvtResultsInEvt (struct Exa_Exams *Exams,long EvtCod)
|
|||
/***** Table head *****/
|
||||
ExaRes_ShowHeaderEvtResults (Usr_OTHER);
|
||||
|
||||
/***** Get all users who have answered any event question in this exam *****/
|
||||
NumUsrs = DB_QuerySELECT (&mysql_res,"can not get users in event",
|
||||
/***** Get all users who have answered any session question in this exam *****/
|
||||
NumUsrs = DB_QuerySELECT (&mysql_res,"can not get users in session",
|
||||
"SELECT users.UsrCod FROM"
|
||||
" (SELECT exa_prints.UsrCod AS UsrCod" // row[0]
|
||||
" FROM exa_prints,exa_events,exa_exams"
|
||||
" WHERE exa_prints.EvtCod=%ld"
|
||||
" AND exa_prints.EvtCod=exa_events.EvtCod"
|
||||
" AND exa_events.ExaCod=exa_exams.ExaCod"
|
||||
" FROM exa_prints,exa_sessions,exa_exams"
|
||||
" WHERE exa_prints.SesCod=%ld"
|
||||
" AND exa_prints.SesCod=exa_sessions.SesCod"
|
||||
" AND exa_sessions.ExaCod=exa_exams.ExaCod"
|
||||
" AND exa_exams.CrsCod=%ld)" // Extra check
|
||||
" AS users,usr_data"
|
||||
" WHERE users.UsrCod=usr_data.UsrCod"
|
||||
" ORDER BY usr_data.Surname1,"
|
||||
"usr_data.Surname2,"
|
||||
"usr_data.FirstName",
|
||||
EvtCod,
|
||||
SesCod,
|
||||
Gbl.Hierarchy.Crs.CrsCod);
|
||||
if (NumUsrs)
|
||||
{
|
||||
/***** List events results for each user *****/
|
||||
/***** List sessions results for each user *****/
|
||||
for (NumUsr = 0;
|
||||
NumUsr < NumUsrs;
|
||||
NumUsr++)
|
||||
{
|
||||
row = mysql_fetch_row (mysql_res);
|
||||
|
||||
/* Get event code (row[0]) */
|
||||
/* Get session 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_CheckIfICanViewTstExaMchResult (&Gbl.Usrs.Other.UsrDat))
|
||||
{
|
||||
/***** Show events results *****/
|
||||
/***** Show sessions results *****/
|
||||
Gbl.Usrs.Other.UsrDat.Accepted = Usr_CheckIfUsrHasAcceptedInCurrentCrs (&Gbl.Usrs.Other.UsrDat);
|
||||
ExaRes_ShowEvtResults (Exams,Usr_OTHER,EvtCod,-1L,NULL);
|
||||
ExaRes_ShowSesResults (Exams,Usr_OTHER,SesCod,-1L,NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -570,14 +570,14 @@ static void ExaRes_ShowResultsBegin (struct Exa_Exams *Exams,
|
|||
if (ListExamsToSelect)
|
||||
ExaRes_ListExamsToSelect (Exams);
|
||||
|
||||
/***** Begin event results table *****/
|
||||
/***** Begin session results table *****/
|
||||
HTM_SECTION_Begin (ExaRes_RESULTS_TABLE_ID);
|
||||
HTM_TABLE_BeginWidePadding (2);
|
||||
}
|
||||
|
||||
static void ExaRes_ShowResultsEnd (void)
|
||||
{
|
||||
/***** End event results table *****/
|
||||
/***** End session results table *****/
|
||||
HTM_TABLE_End ();
|
||||
HTM_SECTION_End ();
|
||||
|
||||
|
@ -587,7 +587,7 @@ static void ExaRes_ShowResultsEnd (void)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********** Write list of those attendance events that have students *********/
|
||||
/********** Write list of those attendance sessions that have students *********/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void ExaRes_ListExamsToSelect (struct Exa_Exams *Exams)
|
||||
|
@ -626,7 +626,7 @@ static void ExaRes_ListExamsToSelect (struct Exa_Exams *Exams)
|
|||
|
||||
HTM_TR_End ();
|
||||
|
||||
/***** List the events *****/
|
||||
/***** List the sessions *****/
|
||||
for (NumExam = 0, UniqueId = 1, Gbl.RowEvenOdd = 0;
|
||||
NumExam < Exams->Num;
|
||||
NumExam++, UniqueId++, Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd)
|
||||
|
@ -636,7 +636,7 @@ static void ExaRes_ListExamsToSelect (struct Exa_Exams *Exams)
|
|||
Exa_GetDataOfExamByCod (&Exam);
|
||||
Exams->ExaCod = Exam.ExaCod;
|
||||
|
||||
/* Write a row for this event */
|
||||
/* Write a row for this session */
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
HTM_TD_Begin ("class=\"DAT CT COLOR%u\"",Gbl.RowEvenOdd);
|
||||
|
@ -684,13 +684,13 @@ static void ExaRes_ListExamsToSelect (struct Exa_Exams *Exams)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************* Show header of my events results *********************/
|
||||
/********************* Show header of my sessions results *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void ExaRes_ShowHeaderEvtResults (Usr_MeOrOther_t MeOrOther)
|
||||
{
|
||||
extern const char *Txt_User[Usr_NUM_SEXS];
|
||||
extern const char *Txt_Event;
|
||||
extern const char *Txt_Session;
|
||||
extern const char *Txt_START_END_TIME[Dat_NUM_START_END_TIME];
|
||||
extern const char *Txt_Questions;
|
||||
extern const char *Txt_Non_blank_BR_questions;
|
||||
|
@ -704,7 +704,7 @@ static void ExaRes_ShowHeaderEvtResults (Usr_MeOrOther_t MeOrOther)
|
|||
Usr_SEX_UNKNOWN]);
|
||||
HTM_TH (1,1,"LT",Txt_START_END_TIME[Dat_START_TIME]);
|
||||
HTM_TH (1,1,"LT",Txt_START_END_TIME[Dat_END_TIME ]);
|
||||
HTM_TH (1,1,"LT",Txt_Event);
|
||||
HTM_TH (1,1,"LT",Txt_Session);
|
||||
HTM_TH (1,1,"RT",Txt_Questions);
|
||||
HTM_TH (1,1,"RT",Txt_Non_blank_BR_questions);
|
||||
HTM_TH (1,1,"RT",Txt_Score);
|
||||
|
@ -747,16 +747,16 @@ static void ExaRes_BuildExamsSelectedCommas (struct Exa_Exams *Exams,
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********* Show the events results of a user in the current course **********/
|
||||
/********* Show the sessions results of a user in the current course *********/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void ExaRes_ShowEvtResults (struct Exa_Exams *Exams,
|
||||
static void ExaRes_ShowSesResults (struct Exa_Exams *Exams,
|
||||
Usr_MeOrOther_t MeOrOther,
|
||||
long EvtCod, // <= 0 ==> any
|
||||
long SesCod, // <= 0 ==> any
|
||||
long ExaCod, // <= 0 ==> any
|
||||
const char *ExamsSelectedCommas)
|
||||
{
|
||||
extern const char *Txt_Event_result;
|
||||
extern const char *Txt_Result;
|
||||
char *EvtSubQuery;
|
||||
char *ExaSubQuery;
|
||||
MYSQL_RES *mysql_res;
|
||||
|
@ -768,7 +768,7 @@ static void ExaRes_ShowEvtResults (struct Exa_Exams *Exams,
|
|||
unsigned NumResult;
|
||||
static unsigned UniqueId = 0;
|
||||
char *Id;
|
||||
struct ExaEvt_Event Event;
|
||||
struct ExaSes_Session Session;
|
||||
Dat_StartEndTime_t StartEndTime;
|
||||
unsigned NumQstsInThisResult;
|
||||
unsigned NumQstsNotBlankInThisResult;
|
||||
|
@ -782,17 +782,17 @@ static void ExaRes_ShowEvtResults (struct Exa_Exams *Exams,
|
|||
unsigned Visibility;
|
||||
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
||||
|
||||
/***** Reset event *****/
|
||||
ExaEvt_ResetEvent (&Event);
|
||||
/***** Reset session *****/
|
||||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Set user *****/
|
||||
UsrDat = (MeOrOther == Usr_ME) ? &Gbl.Usrs.Me.UsrDat :
|
||||
&Gbl.Usrs.Other.UsrDat;
|
||||
|
||||
/***** Build events subquery *****/
|
||||
if (EvtCod > 0)
|
||||
/***** Build sessions subquery *****/
|
||||
if (SesCod > 0)
|
||||
{
|
||||
if (asprintf (&EvtSubQuery," AND exa_prints.EvtCod=%ld",EvtCod) < 0)
|
||||
if (asprintf (&EvtSubQuery," AND exa_prints.SesCod=%ld",SesCod) < 0)
|
||||
Lay_NotEnoughMemoryExit ();
|
||||
}
|
||||
else
|
||||
|
@ -804,14 +804,14 @@ static void ExaRes_ShowEvtResults (struct Exa_Exams *Exams,
|
|||
/***** Build exams subquery *****/
|
||||
if (ExaCod > 0)
|
||||
{
|
||||
if (asprintf (&ExaSubQuery," AND exa_events.ExaCod=%ld",ExaCod) < 0)
|
||||
if (asprintf (&ExaSubQuery," AND exa_sessions.ExaCod=%ld",ExaCod) < 0)
|
||||
Lay_NotEnoughMemoryExit ();
|
||||
}
|
||||
else if (ExamsSelectedCommas)
|
||||
{
|
||||
if (ExamsSelectedCommas[0])
|
||||
{
|
||||
if (asprintf (&ExaSubQuery," AND exa_events.ExaCod IN (%s)",
|
||||
if (asprintf (&ExaSubQuery," AND exa_sessions.ExaCod IN (%s)",
|
||||
ExamsSelectedCommas) < 0)
|
||||
Lay_NotEnoughMemoryExit ();
|
||||
}
|
||||
|
@ -829,8 +829,8 @@ static void ExaRes_ShowEvtResults (struct Exa_Exams *Exams,
|
|||
|
||||
/***** Make database query *****/
|
||||
NumResults =
|
||||
(unsigned) DB_QuerySELECT (&mysql_res,"can not get events results",
|
||||
"SELECT exa_prints.EvtCod," // row[0]
|
||||
(unsigned) DB_QuerySELECT (&mysql_res,"can not get sessions results",
|
||||
"SELECT exa_prints.SesCod," // row[0]
|
||||
"UNIX_TIMESTAMP(exa_prints.StartTime)," // row[1]
|
||||
"UNIX_TIMESTAMP(exa_prints.EndTime)," // row[2]
|
||||
"exa_prints.NumQsts," // row[3]
|
||||
|
@ -838,14 +838,14 @@ static void ExaRes_ShowEvtResults (struct Exa_Exams *Exams,
|
|||
"exa_prints.Score," // row[5]
|
||||
"exa_exams.MaxGrade," // row[6]
|
||||
"exa_exams.Visibility" // row[7]
|
||||
" FROM exa_prints,exa_events,exa_exams"
|
||||
" FROM exa_prints,exa_sessions,exa_exams"
|
||||
" WHERE exa_prints.UsrCod=%ld"
|
||||
"%s" // Event subquery
|
||||
" AND exa_prints.EvtCod=exa_events.EvtCod"
|
||||
"%s" // Session subquery
|
||||
" AND exa_prints.SesCod=exa_sessions.SesCod"
|
||||
"%s" // Exams subquery
|
||||
" AND exa_events.ExaCod=exa_exams.ExaCod"
|
||||
" AND exa_sessions.ExaCod=exa_exams.ExaCod"
|
||||
" AND exa_exams.CrsCod=%ld" // Extra check
|
||||
" ORDER BY exa_events.Title",
|
||||
" ORDER BY exa_sessions.Title",
|
||||
UsrDat->UsrCod,
|
||||
EvtSubQuery,
|
||||
ExaSubQuery,
|
||||
|
@ -857,7 +857,7 @@ static void ExaRes_ShowEvtResults (struct Exa_Exams *Exams,
|
|||
HTM_TR_Begin (NULL);
|
||||
Usr_ShowTableCellWithUsrData (UsrDat,NumResults);
|
||||
|
||||
/***** Get and print events results *****/
|
||||
/***** Get and print sessions results *****/
|
||||
if (NumResults)
|
||||
{
|
||||
for (NumResult = 0;
|
||||
|
@ -866,16 +866,16 @@ static void ExaRes_ShowEvtResults (struct Exa_Exams *Exams,
|
|||
{
|
||||
row = mysql_fetch_row (mysql_res);
|
||||
|
||||
/* Get event code (row[0]) */
|
||||
if ((Event.EvtCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
||||
Lay_ShowErrorAndExit ("Wrong code of event.");
|
||||
ExaEvt_GetDataOfEventByCod (&Event);
|
||||
/* Get session code (row[0]) */
|
||||
if ((Session.SesCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
||||
Lay_ShowErrorAndExit ("Wrong code of session.");
|
||||
ExaSes_GetDataOfSessionByCod (&Session);
|
||||
|
||||
/* Get visibility (row[7]) */
|
||||
Visibility = TstVis_GetVisibilityFromStr (row[7]);
|
||||
|
||||
/* Show event result? */
|
||||
ICanViewResult = ExaRes_CheckIfICanSeePrintResult (&Event,UsrDat->UsrCod);
|
||||
/* Show session result? */
|
||||
ICanViewResult = ExaRes_CheckIfICanSeePrintResult (&Session,UsrDat->UsrCod);
|
||||
ICanViewScore = ExaRes_CheckIfICanViewScore (ICanViewResult,Visibility);
|
||||
|
||||
if (NumResult)
|
||||
|
@ -899,9 +899,9 @@ static void ExaRes_ShowEvtResults (struct Exa_Exams *Exams,
|
|||
free (Id);
|
||||
}
|
||||
|
||||
/* Write event title */
|
||||
/* Write session title */
|
||||
HTM_TD_Begin ("class=\"DAT LT COLOR%u\"",Gbl.RowEvenOdd);
|
||||
HTM_Txt (Event.Title);
|
||||
HTM_Txt (Session.Title);
|
||||
HTM_TD_End ();
|
||||
|
||||
if (ICanViewScore)
|
||||
|
@ -980,21 +980,21 @@ static void ExaRes_ShowEvtResults (struct Exa_Exams *Exams,
|
|||
HTM_TD_Begin ("class=\"RT COLOR%u\"",Gbl.RowEvenOdd);
|
||||
if (ICanViewResult)
|
||||
{
|
||||
Exams->ExaCod = Event.ExaCod;
|
||||
Exams->EvtCod = Event.EvtCod;
|
||||
Exams->ExaCod = Session.ExaCod;
|
||||
Exams->SesCod = Session.SesCod;
|
||||
switch (MeOrOther)
|
||||
{
|
||||
case Usr_ME:
|
||||
Frm_StartForm (ActSeeOneExaEvtResMe);
|
||||
ExaEvt_PutParamsEdit (Exams);
|
||||
ExaSes_PutParamsEdit (Exams);
|
||||
break;
|
||||
case Usr_OTHER:
|
||||
Frm_StartForm (ActSeeOneExaEvtResOth);
|
||||
ExaEvt_PutParamsEdit (Exams);
|
||||
ExaSes_PutParamsEdit (Exams);
|
||||
Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EncryptedUsrCod);
|
||||
break;
|
||||
}
|
||||
Ico_PutIconLink ("tasks.svg",Txt_Event_result);
|
||||
Ico_PutIconLink ("tasks.svg",Txt_Result);
|
||||
Frm_EndForm ();
|
||||
}
|
||||
else
|
||||
|
@ -1023,7 +1023,7 @@ static void ExaRes_ShowEvtResults (struct Exa_Exams *Exams,
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************** Show row with summary of user's events results **************/
|
||||
/************** Show row with summary of user's sessions results **************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void ExaRes_ShowEvtResultsSummaryRow (unsigned NumResults,
|
||||
|
@ -1032,14 +1032,14 @@ static void ExaRes_ShowEvtResultsSummaryRow (unsigned NumResults,
|
|||
double TotalScoreOfAllResults,
|
||||
double TotalGrade)
|
||||
{
|
||||
extern const char *Txt_Events;
|
||||
extern const char *Txt_Sessions;
|
||||
|
||||
/***** Start row *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
/***** Row title *****/
|
||||
HTM_TD_Begin ("colspan=\"3\" class=\"DAT_N_LINE_TOP RM COLOR%u\"",Gbl.RowEvenOdd);
|
||||
HTM_TxtColonNBSP (Txt_Events);
|
||||
HTM_TxtColonNBSP (Txt_Sessions);
|
||||
HTM_Unsigned (NumResults);
|
||||
HTM_TD_End ();
|
||||
|
||||
|
@ -1081,7 +1081,7 @@ static void ExaRes_ShowEvtResultsSummaryRow (unsigned NumResults,
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************* Show one event result of another user *******************/
|
||||
/******************* Show one session result of another user *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void ExaRes_ShowOneExaResult (void)
|
||||
|
@ -1096,7 +1096,7 @@ void ExaRes_ShowOneExaResult (void)
|
|||
extern const char *Txt_Grade;
|
||||
struct Exa_Exams Exams;
|
||||
struct Exa_Exam Exam;
|
||||
struct ExaEvt_Event Event;
|
||||
struct ExaSes_Session Session;
|
||||
Usr_MeOrOther_t MeOrOther;
|
||||
struct UsrData *UsrDat;
|
||||
Dat_StartEndTime_t StartEndTime;
|
||||
|
@ -1110,10 +1110,10 @@ void ExaRes_ShowOneExaResult (void)
|
|||
/***** Reset exams context *****/
|
||||
Exa_ResetExams (&Exams);
|
||||
Exa_ResetExam (&Exam);
|
||||
ExaEvt_ResetEvent (&Event);
|
||||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaEvt_GetAndCheckParameters (&Exams,&Exam,&Event);
|
||||
ExaSes_GetAndCheckParameters (&Exams,&Exam,&Session);
|
||||
|
||||
/***** Pointer to user's data *****/
|
||||
MeOrOther = (Gbl.Action.Act == ActSeeOneExaEvtResMe) ? Usr_ME :
|
||||
|
@ -1130,17 +1130,17 @@ void ExaRes_ShowOneExaResult (void)
|
|||
break;
|
||||
}
|
||||
|
||||
/***** Get event result data *****/
|
||||
/***** Get session result data *****/
|
||||
ExaPrn_ResetPrint (&Print);
|
||||
Print.EvtCod = Event.EvtCod;
|
||||
Print.SesCod = Session.SesCod;
|
||||
Print.UsrCod = UsrDat->UsrCod;
|
||||
ExaPrn_GetPrintDataByEvtCodAndUsrCod (&Print);
|
||||
ExaPrn_GetPrintDataBySesCodAndUsrCod (&Print);
|
||||
|
||||
/***** Check if I can view this print result *****/
|
||||
switch (Gbl.Usrs.Me.Role.Logged)
|
||||
{
|
||||
case Rol_STD:
|
||||
ICanViewResult = ExaRes_CheckIfICanSeePrintResult (&Event,UsrDat->UsrCod);
|
||||
ICanViewResult = ExaRes_CheckIfICanSeePrintResult (&Session,UsrDat->UsrCod);
|
||||
if (ICanViewResult)
|
||||
ICanViewScore = TstVis_IsVisibleTotalScore (Exam.Visibility);
|
||||
else
|
||||
|
@ -1161,13 +1161,13 @@ void ExaRes_ShowOneExaResult (void)
|
|||
break;
|
||||
}
|
||||
|
||||
if (ICanViewResult) // I am allowed to view this event result
|
||||
if (ICanViewResult) // I am allowed to view this session result
|
||||
{
|
||||
/***** Get questions and user's answers of exam print from database *****/
|
||||
ExaPrn_GetPrintQuestionsFromDB (&Print);
|
||||
|
||||
/***** Begin box *****/
|
||||
Box_BoxBegin (NULL,Event.Title,
|
||||
Box_BoxBegin (NULL,Session.Title,
|
||||
NULL,NULL,
|
||||
Hlp_ASSESSMENT_Exams_results,Box_NOT_CLOSABLE);
|
||||
Lay_WriteHeaderClassPhoto (false,false,
|
||||
|
@ -1179,7 +1179,7 @@ void ExaRes_ShowOneExaResult (void)
|
|||
HTM_TABLE_BeginWideMarginPadding (5);
|
||||
|
||||
/***** Header row *****/
|
||||
/* Get data of the user who answer the event */
|
||||
/* Get data of the user who answer the session */
|
||||
if (!Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (UsrDat,Usr_DONT_GET_PREFS))
|
||||
Lay_ShowErrorAndExit (Txt_The_user_does_not_exist);
|
||||
if (!Usr_CheckIfICanViewTstExaMchResult (UsrDat))
|
||||
|
@ -1208,7 +1208,7 @@ void ExaRes_ShowOneExaResult (void)
|
|||
|
||||
HTM_TR_End ();
|
||||
|
||||
/* Start/end time (for user in this event) */
|
||||
/* Start/end time (for user in this session) */
|
||||
for (StartEndTime = (Dat_StartEndTime_t) 0;
|
||||
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
|
||||
StartEndTime++)
|
||||
|
@ -1285,7 +1285,7 @@ void ExaRes_ShowOneExaResult (void)
|
|||
/***** End table *****/
|
||||
HTM_TABLE_End ();
|
||||
|
||||
/***** Write total mark of event result *****/
|
||||
/***** Write total mark of session result *****/
|
||||
if (ICanViewScore)
|
||||
{
|
||||
HTM_DIV_Begin ("class=\"DAT_N_BOLD CM\"");
|
||||
|
@ -1301,15 +1301,15 @@ void ExaRes_ShowOneExaResult (void)
|
|||
/***** End box *****/
|
||||
Box_BoxEnd ();
|
||||
}
|
||||
else // I am not allowed to view this event result
|
||||
else // I am not allowed to view this session result
|
||||
Lay_NoPermissionExit ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************** Get if I can see event result ************************/
|
||||
/********************** Get if I can see session result ************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static bool ExaRes_CheckIfICanSeePrintResult (struct ExaEvt_Event *Event,long UsrCod)
|
||||
static bool ExaRes_CheckIfICanSeePrintResult (struct ExaSes_Session *Session,long UsrCod)
|
||||
{
|
||||
bool ItsMe;
|
||||
|
||||
|
@ -1317,8 +1317,8 @@ static bool ExaRes_CheckIfICanSeePrintResult (struct ExaEvt_Event *Event,long Us
|
|||
{
|
||||
case Rol_STD:
|
||||
ItsMe = Usr_ItsMe (UsrCod);
|
||||
if (ItsMe && Event->ShowUsrResults)
|
||||
return ExaEvt_CheckIfICanListThisEventBasedOnGrps (Event->EvtCod);
|
||||
if (ItsMe && Session->ShowUsrResults)
|
||||
return ExaSes_CheckIfICanListThisSessionBasedOnGrps (Session->SesCod);
|
||||
return false;
|
||||
case Rol_NET:
|
||||
case Rol_TCH:
|
||||
|
@ -1333,7 +1333,7 @@ static bool ExaRes_CheckIfICanSeePrintResult (struct ExaEvt_Event *Event,long Us
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************** Get if I can see event result ************************/
|
||||
/********************** Get if I can see session result ************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static bool ExaRes_CheckIfICanViewScore (bool ICanViewResult,unsigned Visibility)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +1,7 @@
|
|||
// swad_exam_event.h: exam events (each ocurrence of an exam)
|
||||
// swad_exam_session.h: exam sessions (each ocurrence of an exam)
|
||||
|
||||
#ifndef _SWAD_EXA_EVE
|
||||
#define _SWAD_EXA_EVE
|
||||
#ifndef _SWAD_EXA_SES
|
||||
#define _SWAD_EXA_SES
|
||||
/*
|
||||
SWAD (Shared Workspace At a Distance in Spanish),
|
||||
is a web platform developed at the University of Granada (Spain),
|
||||
|
@ -34,11 +34,11 @@
|
|||
/************************** Public types and constants ***********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define ExaEvt_NEW_EVENT_SECTION_ID "new_event"
|
||||
#define ExaSes_NEW_SESSION_SECTION_ID "new_session"
|
||||
|
||||
#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
|
||||
#define ExaSes_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 session is finished
|
||||
|
||||
struct ExaEvt_UsrAnswer
|
||||
struct ExaSes_UsrAnswer
|
||||
{
|
||||
int NumOpt; // < 0 ==> no answer selected
|
||||
int AnsInd; // < 0 ==> no answer selected
|
||||
|
@ -48,47 +48,47 @@ struct ExaEvt_UsrAnswer
|
|||
/***************************** Public prototypes *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void ExaEvt_ResetEvent (struct ExaEvt_Event *Event);
|
||||
void ExaSes_ResetSession (struct ExaSes_Session *Session);
|
||||
|
||||
void ExaEvt_ListEvents (struct Exa_Exams *Exams,
|
||||
struct Exa_Exam *Exam,
|
||||
struct ExaEvt_Event *Event,
|
||||
bool PutFormEvent);
|
||||
void ExaEvt_GetDataOfEventByCod (struct ExaEvt_Event *Event);
|
||||
bool ExaEvt_CheckIfEventIsVisibleAndOpen (long EvtCod);
|
||||
void ExaSes_ListSessions (struct Exa_Exams *Exams,
|
||||
struct Exa_Exam *Exam,
|
||||
struct ExaSes_Session *Session,
|
||||
bool PutFormSession);
|
||||
void ExaSes_GetDataOfSessionByCod (struct ExaSes_Session *Session);
|
||||
bool ExaSes_CheckIfSessionIsVisibleAndOpen (long SesCod);
|
||||
|
||||
void ExaEvt_ToggleVisResultsEvtUsr (void);
|
||||
void ExaSes_ToggleVisResultsSesUsr (void);
|
||||
|
||||
void ExaEvt_RequestRemoveEvent (void);
|
||||
void ExaEvt_RemoveEvent (void);
|
||||
void ExaSes_RequestRemoveSession (void);
|
||||
void ExaSes_RemoveSession (void);
|
||||
|
||||
void ExaEvt_RemoveEventsInExamFromAllTables (long ExaCod);
|
||||
void ExaEvt_RemoveEventInCourseFromAllTables (long CrsCod);
|
||||
void ExaEvt_RemoveUsrFromEventTablesInCrs (long UsrCod,long CrsCod);
|
||||
void ExaSes_RemoveSessionsInExamFromAllTables (long ExaCod);
|
||||
void ExaSes_RemoveSessionInCourseFromAllTables (long CrsCod);
|
||||
void ExaSes_RemoveUsrFromSessionTablesInCrs (long UsrCod,long CrsCod);
|
||||
|
||||
void ExaEvt_HideEvent (void);
|
||||
void ExaEvt_UnhideEvent (void);
|
||||
void ExaSes_HideSession (void);
|
||||
void ExaSes_UnhideSession (void);
|
||||
|
||||
void ExaEvt_PutParamsEdit (void *Exams);
|
||||
void ExaEvt_GetAndCheckParameters (struct Exa_Exams *Exams,
|
||||
void ExaSes_PutParamsEdit (void *Exams);
|
||||
void ExaSes_GetAndCheckParameters (struct Exa_Exams *Exams,
|
||||
struct Exa_Exam *Exam,
|
||||
struct ExaEvt_Event *Event);
|
||||
long ExaEvt_GetParamEvtCod (void);
|
||||
struct ExaSes_Session *Session);
|
||||
long ExaSes_GetParamSesCod (void);
|
||||
|
||||
void ExaEvt_PutButtonNewEvent (struct Exa_Exams *Exams,long ExaCod);
|
||||
void ExaEvt_RequestCreatOrEditEvent (void);
|
||||
void ExaEvt_ReceiveFormEvent (void);
|
||||
void ExaSes_PutButtonNewSession (struct Exa_Exams *Exams,long ExaCod);
|
||||
void ExaSes_RequestCreatOrEditSession (void);
|
||||
void ExaSes_ReceiveFormSession (void);
|
||||
|
||||
void ExaEvt_RemoveGroup (long GrpCod);
|
||||
void ExaEvt_RemoveGroupsOfType (long GrpTypCod);
|
||||
void ExaSes_RemoveGroup (long GrpCod);
|
||||
void ExaSes_RemoveGroupsOfType (long GrpTypCod);
|
||||
|
||||
unsigned ExaEvt_GetNumEventsInExam (long ExaCod);
|
||||
unsigned ExaEvt_GetNumOpenEventsInExam (long ExaCod);
|
||||
unsigned ExaSes_GetNumSessionsInExam (long ExaCod);
|
||||
unsigned ExaSes_GetNumOpenSessionsInExam (long ExaCod);
|
||||
|
||||
bool ExaEvt_CheckIfICanAnswerThisEvent (const struct ExaEvt_Event *Event);
|
||||
bool ExaEvt_CheckIfICanListThisEventBasedOnGrps (long EvtCod);
|
||||
bool ExaSes_CheckIfICanAnswerThisSession (const struct ExaSes_Session *Session);
|
||||
bool ExaSes_CheckIfICanListThisSessionBasedOnGrps (long SesCod);
|
||||
|
||||
void ExaEvt_GetQstAnsFromDB (long EvtCod,long UsrCod,unsigned QstInd,
|
||||
struct ExaEvt_UsrAnswer *UsrAnswer);
|
||||
void ExaSes_GetQstAnsFromDB (long SesCod,long UsrCod,unsigned QstInd,
|
||||
struct ExaSes_UsrAnswer *UsrAnswer);
|
||||
|
||||
#endif
|
|
@ -36,8 +36,8 @@
|
|||
|
||||
#include "swad_database.h"
|
||||
#include "swad_exam.h"
|
||||
#include "swad_exam_event.h"
|
||||
#include "swad_exam_result.h"
|
||||
#include "swad_exam_session.h"
|
||||
#include "swad_exam_set.h"
|
||||
#include "swad_exam_type.h"
|
||||
#include "swad_figure.h"
|
||||
|
@ -901,7 +901,7 @@ static unsigned ExaSet_GetNextSetIndexInExam (long ExaCod,unsigned SetInd)
|
|||
{
|
||||
MYSQL_RES *mysql_res;
|
||||
MYSQL_ROW row;
|
||||
unsigned NextSetInd = ExaEvt_AFTER_LAST_QUESTION; // End of sets has been reached
|
||||
unsigned NextSetInd = ExaSes_AFTER_LAST_QUESTION; // End of sets has been reached
|
||||
|
||||
/***** Get next set index in an exam from database *****/
|
||||
// Although indexes are always continuous...
|
||||
|
|
|
@ -44,8 +44,8 @@
|
|||
#define ExaSet_MAX_CHARS_TITLE (128 - 1) // 127
|
||||
#define ExaSet_MAX_BYTES_TITLE ((ExaSet_MAX_CHARS_TITLE + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
|
||||
|
||||
#define ExaEvt_MAX_CHARS_TITLE (128 - 1) // 127
|
||||
#define ExaEvt_MAX_BYTES_TITLE ((ExaEvt_MAX_CHARS_TITLE + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
|
||||
#define ExaSes_MAX_CHARS_TITLE (128 - 1) // 127
|
||||
#define ExaSes_MAX_BYTES_TITLE ((ExaSes_MAX_CHARS_TITLE + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
|
||||
|
||||
#define Exa_NUM_ORDERS 3
|
||||
typedef enum
|
||||
|
@ -76,20 +76,20 @@ struct Exa_Exams
|
|||
char *ExaCodsSelected; // String with selected exam codes separated by separator multiple
|
||||
long ExaCod; // Selected/current exam code
|
||||
long SetCod; // Selected/current set code
|
||||
long EvtCod; // Selected/current match code
|
||||
long SesCod; // Selected/current session code
|
||||
unsigned SetInd; // Current set index
|
||||
long QstCod; // Current question code
|
||||
};
|
||||
|
||||
/* Student 1
|
||||
+----------------+ +-----------+ +--------------+ +--------------+
|
||||
| Exam 1 |--+--| Event 1 |--+--| Print 1 | | Result 1 |
|
||||
| Exam 1 |--+--| Session 1 |--+--| Print 1 | | Result 1 |
|
||||
|+--------------+| | | * Start | | | * Question 2 | | * Question 2 |
|
||||
|| Set 1 || | | * End | | |--------------|-->|--------------|
|
||||
|| * Question 1 || | | * Groups | | | * Question 5 | | * Question 5 |
|
||||
|| * Question 2 || | +-----------+ | | * Question 3 | | * Question 3 |
|
||||
|+--------------+| | +-----------+ | +--------------+ +--------------+
|
||||
|+--------------+| +--| Event 2 | | Student 2
|
||||
|+--------------+| +--| Session 2 | | Student 2
|
||||
|| Set 2 || | * Start | | +--------------+ +--------------+
|
||||
|| * Question 3 || | * End | +--| Print 2 | | Result 2 |
|
||||
|| * Question 4 || | * Groups | | * Question 1 | | * Question 1 |
|
||||
|
@ -113,8 +113,8 @@ struct Exa_Exam
|
|||
bool Hidden; // Exam is hidden
|
||||
unsigned NumSets; // Number of sets in the exam
|
||||
unsigned NumQsts; // Number of questions in the exam
|
||||
unsigned NumEvts; // Number of events in the exam
|
||||
unsigned NumOpenEvts; // Number of open events in the exam
|
||||
unsigned NumSess; // Number of sessions in the exam
|
||||
unsigned NumOpenSess; // Number of open sessions in the exam
|
||||
};
|
||||
|
||||
struct ExaSet_Set
|
||||
|
@ -127,13 +127,13 @@ struct ExaSet_Set
|
|||
char Title[ExaSet_MAX_BYTES_TITLE + 1]; // Title of the set
|
||||
};
|
||||
|
||||
struct ExaEvt_Event
|
||||
struct ExaSes_Session
|
||||
{
|
||||
long EvtCod;
|
||||
long SesCod;
|
||||
long ExaCod;
|
||||
long UsrCod;
|
||||
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
||||
char Title[ExaEvt_MAX_BYTES_TITLE + 1];
|
||||
char Title[ExaSes_MAX_BYTES_TITLE + 1];
|
||||
bool Hidden;
|
||||
bool Open; // If now is between start and end dates
|
||||
bool ShowUsrResults; // Show exam with results of all questions for the student
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include "swad_attendance.h"
|
||||
#include "swad_box.h"
|
||||
#include "swad_database.h"
|
||||
#include "swad_exam_event.h"
|
||||
#include "swad_exam_session.h"
|
||||
#include "swad_form.h"
|
||||
#include "swad_game.h"
|
||||
#include "swad_global.h"
|
||||
|
@ -1700,7 +1700,7 @@ void Grp_ListGrpsToEditAsgAttSvyEvtMch (struct GroupType *GrpTyp,long Cod,
|
|||
[Grp_ASSIGNMENT] = {"asg_grp" ,"AsgCod"},
|
||||
[Grp_ATT_EVENT ] = {"att_grp" ,"AttCod"},
|
||||
[Grp_SURVEY ] = {"svy_grp" ,"SvyCod"},
|
||||
[Grp_EXA_EVENT ] = {"exa_groups","EvtCod"},
|
||||
[Grp_EXA_EVENT ] = {"exa_groups","SesCod"},
|
||||
[Grp_MATCH ] = {"mch_groups","MchCod"},
|
||||
};
|
||||
struct ListCodGrps LstGrpsIBelong;
|
||||
|
|
|
@ -1474,7 +1474,7 @@ const char *Hlp_ASSESSMENT_Exams_question_sets =
|
|||
"ASSESSMENT.Exams.en#question-set";
|
||||
#endif
|
||||
|
||||
const char *Hlp_ASSESSMENT_Exams_events =
|
||||
const char *Hlp_ASSESSMENT_Exams_sessions =
|
||||
#if L==1
|
||||
"ASSESSMENT.Exams.es#eventos";
|
||||
#elif L==2
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include "swad_connected.h"
|
||||
#include "swad_database.h"
|
||||
#include "swad_exam_announcement.h"
|
||||
#include "swad_exam_event.h"
|
||||
#include "swad_exam_session.h"
|
||||
#include "swad_firewall.h"
|
||||
#include "swad_follow.h"
|
||||
#include "swad_form.h"
|
||||
|
@ -1446,12 +1446,12 @@ void Lay_WrongSetExit (void)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************** Write error message and exit when wrong event ****************/
|
||||
/*********** Write error message and exit when wrong exam session ************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Lay_WrongEventExit (void)
|
||||
void Lay_WrongExamSessionExit (void)
|
||||
{
|
||||
Lay_ShowErrorAndExit ("Wrong event.");
|
||||
Lay_ShowErrorAndExit ("Wrong exam session.");
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -76,7 +76,7 @@ void Lay_WrongTypeOfViewExit (void);
|
|||
void Lay_WrongProjectExit (void);
|
||||
void Lay_WrongExamExit (void);
|
||||
void Lay_WrongSetExit (void);
|
||||
void Lay_WrongEventExit (void);
|
||||
void Lay_WrongExamSessionExit (void);
|
||||
void Lay_NoPermissionExit (void);
|
||||
void Lay_ShowErrorAndExit (const char *Txt);
|
||||
|
||||
|
|
|
@ -735,7 +735,7 @@ static void MchRes_ShowMchResults (struct Gam_Games *Games,
|
|||
long GamCod, // <= 0 ==> any
|
||||
const char *GamesSelectedCommas)
|
||||
{
|
||||
extern const char *Txt_Match_result;
|
||||
extern const char *Txt_Result;
|
||||
char *MchSubQuery;
|
||||
char *GamSubQuery;
|
||||
MYSQL_RES *mysql_res;
|
||||
|
@ -973,7 +973,7 @@ static void MchRes_ShowMchResults (struct Gam_Games *Games,
|
|||
Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EncryptedUsrCod);
|
||||
break;
|
||||
}
|
||||
Ico_PutIconLink ("tasks.svg",Txt_Match_result);
|
||||
Ico_PutIconLink ("tasks.svg",Txt_Result);
|
||||
Frm_EndForm ();
|
||||
}
|
||||
else
|
||||
|
|
|
@ -570,7 +570,7 @@ void Tst_ReceiveTestDraft (void)
|
|||
void Tst_AssessTest (void)
|
||||
{
|
||||
extern const char *Hlp_ASSESSMENT_Tests;
|
||||
extern const char *Txt_Test_result;
|
||||
extern const char *Txt_Result;
|
||||
extern const char *Txt_Test_No_X_that_you_make_in_this_course;
|
||||
extern const char *Txt_Score;
|
||||
extern const char *Txt_Grade;
|
||||
|
@ -615,7 +615,7 @@ void Tst_AssessTest (void)
|
|||
TstPrn_UpdatePrintInDB (&Print);
|
||||
|
||||
/***** Begin box *****/
|
||||
Box_BoxBegin (NULL,Txt_Test_result,
|
||||
Box_BoxBegin (NULL,Txt_Result,
|
||||
NULL,NULL,
|
||||
Hlp_ASSESSMENT_Tests,Box_NOT_CLOSABLE);
|
||||
Lay_WriteHeaderClassPhoto (false,false,
|
||||
|
@ -5627,7 +5627,7 @@ static long Tst_CreateNewTag (long CrsCod,const char *TagTxt)
|
|||
"INSERT INTO tst_tags"
|
||||
" (CrsCod,ChangeTime,TagTxt,TagHidden)"
|
||||
" VALUES"
|
||||
" (%ld,NOW(),'%s','N')",
|
||||
" (%ld,NOW(),'%s','Y')", // Hidden by default
|
||||
CrsCod,TagTxt);
|
||||
}
|
||||
|
||||
|
|
|
@ -1874,7 +1874,7 @@ static void TstPrn_ShowExamsSummaryRow (bool ItsMe,
|
|||
void TstPrn_ShowOneExam (void)
|
||||
{
|
||||
extern const char *Hlp_ASSESSMENT_Tests_results;
|
||||
extern const char *Txt_Test_result;
|
||||
extern const char *Txt_Result;
|
||||
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];
|
||||
|
@ -1952,7 +1952,7 @@ void TstPrn_ShowOneExam (void)
|
|||
TstPrn_GetPrintQuestionsFromDB (&Print);
|
||||
|
||||
/***** Begin box *****/
|
||||
Box_BoxBegin (NULL,Txt_Test_result,
|
||||
Box_BoxBegin (NULL,Txt_Result,
|
||||
NULL,NULL,
|
||||
Hlp_ASSESSMENT_Tests_results,Box_NOT_CLOSABLE);
|
||||
Lay_WriteHeaderClassPhoto (false,false,
|
||||
|
|
233
swad_text.c
233
swad_text.c
|
@ -11456,27 +11456,6 @@ const char *Txt_Event_X_removed = // Warning: it is very important to include %s
|
|||
"Evento <strong>%s</strong> removido.";
|
||||
#endif
|
||||
|
||||
const char *Txt_Event_result =
|
||||
#if L==1 // ca
|
||||
"Resultat del esdeveniment";
|
||||
#elif L==2 // de
|
||||
"Ergebnis der Ereignis";
|
||||
#elif L==3 // en
|
||||
"Event result";
|
||||
#elif L==4 // es
|
||||
"Resultado del evento";
|
||||
#elif L==5 // fr
|
||||
"Résultat de l'événement";
|
||||
#elif L==6 // gn
|
||||
"Resultado del evento"; // Okoteve traducción
|
||||
#elif L==7 // it
|
||||
"Risultato dell'evento";
|
||||
#elif L==8 // pl
|
||||
"Wynik wydarzenia";
|
||||
#elif L==9 // pt
|
||||
"Resultado do evento";
|
||||
#endif
|
||||
|
||||
const char *Txt_Event_visible_to_the_users_of_your_courses_click_to_make_it_private =
|
||||
#if L==1 // ca
|
||||
"Esdeveniment visible pels usuaris de les seves assignatures; feu clic per fer-lo privat";
|
||||
|
@ -18946,27 +18925,6 @@ const char *Txt_MATCH_respond =
|
|||
"respondem";
|
||||
#endif
|
||||
|
||||
const char *Txt_Match_result =
|
||||
#if L==1 // ca
|
||||
"Resultat de la partida";
|
||||
#elif L==2 // de
|
||||
"Spielergebnis";
|
||||
#elif L==3 // en
|
||||
"Match result";
|
||||
#elif L==4 // es
|
||||
"Resultado de la partida";
|
||||
#elif L==5 // fr
|
||||
"Résultat du match";
|
||||
#elif L==6 // gn
|
||||
"Resultado de la partida"; // Okoteve traducción
|
||||
#elif L==7 // it
|
||||
"Risultato della partita";
|
||||
#elif L==8 // pl
|
||||
"Wynik mecz";
|
||||
#elif L==9 // pt
|
||||
"Resultado do jogo";
|
||||
#endif
|
||||
|
||||
const char *Txt_Matches = // of a game
|
||||
#if L==1 // ca
|
||||
"Partides";
|
||||
|
@ -25493,6 +25451,27 @@ const char *Txt_New_room =
|
|||
"Nova sala";
|
||||
#endif
|
||||
|
||||
const char *Txt_New_session =
|
||||
#if L==1 // ca
|
||||
"Nova sessió";
|
||||
#elif L==2 // de
|
||||
"Neue Sitzung";
|
||||
#elif L==3 // en
|
||||
"New session";
|
||||
#elif L==4 // es
|
||||
"Nueva sesión";
|
||||
#elif L==5 // fr
|
||||
"Nouvelle session";
|
||||
#elif L==6 // gn
|
||||
"Nueva sesión"; // Okoteve traducción
|
||||
#elif L==7 // it
|
||||
"Nuova sessione";
|
||||
#elif L==8 // pl
|
||||
"Nowy sesji";
|
||||
#elif L==9 // pt
|
||||
"Nova sessão";
|
||||
#endif
|
||||
|
||||
const char *Txt_New_set_of_questions =
|
||||
#if L==1 // ca
|
||||
"Nou conjunt de preguntes";
|
||||
|
@ -34753,6 +34732,48 @@ const char *Txt_Reset_survey =
|
|||
"Reiniciar inquérito";
|
||||
#endif
|
||||
|
||||
const char *Txt_Result =
|
||||
#if L==1 // ca
|
||||
"Resultat";
|
||||
#elif L==2 // de
|
||||
"Ergebnis";
|
||||
#elif L==3 // en
|
||||
"Result";
|
||||
#elif L==4 // es
|
||||
"Resultado";
|
||||
#elif L==5 // fr
|
||||
"Résultat";
|
||||
#elif L==6 // gn
|
||||
"Resultado"; // Okoteve traducción
|
||||
#elif L==7 // it
|
||||
"Risultato";
|
||||
#elif L==8 // pl
|
||||
"Wynik";
|
||||
#elif L==9 // pt
|
||||
"Resultado";
|
||||
#endif
|
||||
|
||||
const char *Txt_Result_visibility =
|
||||
#if L==1 // ca
|
||||
"Visibilitat de resultats";
|
||||
#elif L==2 // de
|
||||
"Ergebnis Sichtbarkeit";
|
||||
#elif L==3 // en
|
||||
"Result visibility";
|
||||
#elif L==4 // es
|
||||
"Visibilidad de resultados";
|
||||
#elif L==5 // fr
|
||||
"Visibilité des résultats";
|
||||
#elif L==6 // gn
|
||||
"Visibilidad de resultados"; // Okoteve traducción
|
||||
#elif L==7 // it
|
||||
"Visibilità dei risultati";
|
||||
#elif L==8 // pl
|
||||
"Widoczność wyników";
|
||||
#elif L==9 // pt
|
||||
"Visibilidade dos resultados";
|
||||
#endif
|
||||
|
||||
const char *Txt_Results =
|
||||
#if L==1 // ca
|
||||
"Resultats";
|
||||
|
@ -34795,27 +34816,6 @@ const char *Txt_Results_of_game_X = // Warning: it is very important to include
|
|||
"Resultados do jogo "%s"";
|
||||
#endif
|
||||
|
||||
const char *Txt_Results_of_event_X = // Warning: it is very important to include %s in the following sentences
|
||||
#if L==1 // ca
|
||||
"Resultats del esdeveniment "%s"";
|
||||
#elif L==2 // de
|
||||
"Ergebnisse von Ereignis "%s"";
|
||||
#elif L==3 // en
|
||||
"Results of event "%s"";
|
||||
#elif L==4 // es
|
||||
"Resultados del evento "%s"";
|
||||
#elif L==5 // fr
|
||||
"Résultats de l'événement "%s"";
|
||||
#elif L==6 // gn
|
||||
"Resultados del evento "%s""; // Okoteve traducción
|
||||
#elif L==7 // it
|
||||
"Risultati del evento "%s"";
|
||||
#elif L==8 // pl
|
||||
"Wyniki wydarzenie "%s"";
|
||||
#elif L==9 // pt
|
||||
"Resultados do evento "%s"";
|
||||
#endif
|
||||
|
||||
const char *Txt_Results_of_exam_X = // Warning: it is very important to include %s in the following sentences
|
||||
#if L==1 // ca
|
||||
"Resultats del examen "%s"";
|
||||
|
@ -34858,6 +34858,27 @@ const char *Txt_Results_of_match_X = // Warning: it is very important to include
|
|||
"Resultados do jogo "%s"";
|
||||
#endif
|
||||
|
||||
const char *Txt_Results_of_session_X = // Warning: it is very important to include %s in the following sentences
|
||||
#if L==1 // ca
|
||||
"Resultats de la sessió "%s"";
|
||||
#elif L==2 // de
|
||||
"Ergebnisse von Sitzung "%s"";
|
||||
#elif L==3 // en
|
||||
"Results of session "%s"";
|
||||
#elif L==4 // es
|
||||
"Resultados de la sesión "%s"";
|
||||
#elif L==5 // fr
|
||||
"Résultats de la session "%s"";
|
||||
#elif L==6 // gn
|
||||
"Resultados de la sesión "%s""; // Okoteve traducción
|
||||
#elif L==7 // it
|
||||
"Risultati della sessione "%s"";
|
||||
#elif L==8 // pl
|
||||
"Wyniki sesji "%s"";
|
||||
#elif L==9 // pt
|
||||
"Resultados da sessão "%s"";
|
||||
#endif
|
||||
|
||||
const char *Txt_results_per_page =
|
||||
#if L==1 // ca
|
||||
"resultats per pàgina";
|
||||
|
@ -41127,6 +41148,48 @@ const char *Txt_session =
|
|||
"sessão";
|
||||
#endif
|
||||
|
||||
const char *Txt_Session_X_removed = // Warning: it is very important to include %s in the following sentences
|
||||
#if L==1 // ca
|
||||
"Sessió <strong>%s</strong> eliminada.";
|
||||
#elif L==2 // de
|
||||
"Sitzung <strong>%s</strong> entfernt.";
|
||||
#elif L==3 // en
|
||||
"Session <strong>%s</strong> removed.";
|
||||
#elif L==4 // es
|
||||
"Sesión <strong>%s</strong> eliminada.";
|
||||
#elif L==5 // fr
|
||||
"Session <strong>%s</strong> supprimé.";
|
||||
#elif L==6 // gn
|
||||
"Sesión <strong>%s</strong> eliminada."; // Okoteve traducción
|
||||
#elif L==7 // it
|
||||
"Sessione <strong>%s</strong> rimossa.";
|
||||
#elif L==8 // pl
|
||||
"Sesja <strong>%s</strong> usunięte.";
|
||||
#elif L==9 // pt
|
||||
"Sessão <strong>%s</strong> removida.";
|
||||
#endif
|
||||
|
||||
const char *Txt_Sessions =
|
||||
#if L==1 // ca
|
||||
"Sessions";
|
||||
#elif L==2 // de
|
||||
"Sitzungen";
|
||||
#elif L==3 // en
|
||||
"Sessions";
|
||||
#elif L==4 // es
|
||||
"Sesiones";
|
||||
#elif L==5 // fr
|
||||
"Sessions";
|
||||
#elif L==6 // gn
|
||||
"Sesiones"; // Okoteve traducción
|
||||
#elif L==7 // it
|
||||
"Sessioni";
|
||||
#elif L==8 // pl
|
||||
"Sesje";
|
||||
#elif L==9 // pt
|
||||
"Sessões";
|
||||
#endif
|
||||
|
||||
const char *Txt_sessions =
|
||||
#if L==1 // ca
|
||||
"sessions";
|
||||
|
@ -41143,7 +41206,7 @@ const char *Txt_sessions =
|
|||
#elif L==7 // it
|
||||
"sessioni";
|
||||
#elif L==8 // pl
|
||||
"sessions"; // Potrzebujesz tlumaczenie
|
||||
"sesje";
|
||||
#elif L==9 // pt
|
||||
"sessões";
|
||||
#endif
|
||||
|
@ -45655,27 +45718,6 @@ const char *Txt_Test_No_X_that_you_make_in_this_course = // Warning: it is very
|
|||
"Teste nº %u que você faz nesta disciplina";
|
||||
#endif
|
||||
|
||||
const char *Txt_Test_result =
|
||||
#if L==1 // ca
|
||||
"Resultat del test";
|
||||
#elif L==2 // de
|
||||
"Testergebnis";
|
||||
#elif L==3 // en
|
||||
"Test result";
|
||||
#elif L==4 // es
|
||||
"Resultado del test";
|
||||
#elif L==5 // fr
|
||||
"Résultat du test";
|
||||
#elif L==6 // gn
|
||||
"Resultado del test"; // Okoteve traducción
|
||||
#elif L==7 // it
|
||||
"Risultato del test";
|
||||
#elif L==8 // pl
|
||||
"Wynik testu";
|
||||
#elif L==9 // pt
|
||||
"Resultado do teste";
|
||||
#endif
|
||||
|
||||
const char *Txt_Text =
|
||||
#if L==1 // ca
|
||||
"Text";
|
||||
|
@ -55962,27 +56004,6 @@ const char *Txt_View_homework =
|
|||
"Ver trabalhos";
|
||||
#endif
|
||||
|
||||
const char *Txt_Result_visibility =
|
||||
#if L==1 // ca
|
||||
"Visibilitat de resultats";
|
||||
#elif L==2 // de
|
||||
"Ergebnis Sichtbarkeit";
|
||||
#elif L==3 // en
|
||||
"Result visibility";
|
||||
#elif L==4 // es
|
||||
"Visibilidad de resultados";
|
||||
#elif L==5 // fr
|
||||
"Visibilité des résultats";
|
||||
#elif L==6 // gn
|
||||
"Visibilidad de resultados"; // Okoteve traducción
|
||||
#elif L==7 // it
|
||||
"Visibilità dei risultati";
|
||||
#elif L==8 // pl
|
||||
"Widoczność wyników";
|
||||
#elif L==9 // pt
|
||||
"Visibilidade dos resultados";
|
||||
#endif
|
||||
|
||||
const char *Txt_Visible_by_BR_the_student =
|
||||
#if L==1 // ca
|
||||
"¿Visible por<br />el estudiante?"; // Necessita traduccio
|
||||
|
|
Loading…
Reference in New Issue