mirror of https://github.com/acanas/swad-core.git
Version 20.100.5: Sep 12, 2021 Fixed bug removing all students in a course. Reported by José Luis Bernier Villamor and Francisco J. Pelayo Valle.
This commit is contained in:
parent
b4b1e17db2
commit
719df886c8
29
swad_admin.c
29
swad_admin.c
|
@ -25,38 +25,9 @@
|
|||
/*********************************** Headers *********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
// #define _GNU_SOURCE // For asprintf
|
||||
// #include <stdio.h> // For asprintf
|
||||
// #include <stdlib.h> // For exit, system, malloc, free, rand, etc.
|
||||
// #include <string.h> // For string functions
|
||||
|
||||
// #include "swad_account.h"
|
||||
// #include "swad_account_database.h"
|
||||
#include "swad_admin.h"
|
||||
#include "swad_admin_database.h"
|
||||
// #include "swad_announcement.h"
|
||||
// #include "swad_attendance_database.h"
|
||||
// #include "swad_box.h"
|
||||
// #include "swad_database.h"
|
||||
// #include "swad_duplicate.h"
|
||||
// #include "swad_enrolment.h"
|
||||
// #include "swad_enrolment_database.h"
|
||||
// #include "swad_error.h"
|
||||
// #include "swad_exam_print.h"
|
||||
// #include "swad_form.h"
|
||||
#include "swad_global.h"
|
||||
// #include "swad_hierarchy.h"
|
||||
// #include "swad_HTML.h"
|
||||
// #include "swad_ID.h"
|
||||
// #include "swad_match.h"
|
||||
// #include "swad_message.h"
|
||||
// #include "swad_notification.h"
|
||||
// #include "swad_parameter.h"
|
||||
// #include "swad_photo.h"
|
||||
// #include "swad_role.h"
|
||||
// #include "swad_setting.h"
|
||||
// #include "swad_test_print.h"
|
||||
// #include "swad_user.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************************** Public constants *****************************/
|
||||
|
|
|
@ -602,13 +602,14 @@ TODO: FIX BUG, URGENT! En las fechas como par
|
|||
|
||||
TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo.
|
||||
*/
|
||||
#define Log_PLATFORM_VERSION "SWAD 20.100.4 (2021-09-11)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 20.100.5 (2021-09-12)"
|
||||
#define CSS_FILE "swad20.45.css"
|
||||
#define JS_FILE "swad20.69.1.js"
|
||||
/*
|
||||
TODO: Rename CENTRE to CENTER in help wiki.
|
||||
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
|
||||
|
||||
Version 20.100.5: Sep 12, 2021 Fixed bug removing all students in a course. Reported by José Luis Bernier Villamor and Francisco J. Pelayo Valle. (314909 lines)
|
||||
Version 20.100.4: Sep 11, 2021 Queries moved to module swad_timeline_database. (314934 lines)
|
||||
Version 20.100.3: Sep 11, 2021 Queries moved to module swad_file_browser. (314923 lines)
|
||||
Version 20.100.2: Sep 11, 2021 Queries moved to module swad_institution_database. (314919 lines)
|
||||
|
|
|
@ -1798,7 +1798,7 @@ void Enr_RemAllStdsThisCrs (void)
|
|||
/*****************************************************************************/
|
||||
/***************** Remove all the students from a given course ***************/
|
||||
/*****************************************************************************/
|
||||
// Returns the numbers of students in the course before deletion
|
||||
// Returns the numbers of students in list
|
||||
|
||||
unsigned Enr_RemAllStdsInCrs (struct Crs_Course *Crs)
|
||||
{
|
||||
|
@ -1816,6 +1816,7 @@ unsigned Enr_RemAllStdsInCrs (struct Crs_Course *Crs)
|
|||
NumUsr++)
|
||||
{
|
||||
Gbl.Usrs.Other.UsrDat.UsrCod = Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].UsrCod;
|
||||
Gbl.Usrs.Other.UsrDat.Roles.InCurrentCrs = Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].RoleInCurrentCrsDB;
|
||||
Enr_EffectivelyRemUsrFromCrs (&Gbl.Usrs.Other.UsrDat,Crs,
|
||||
Enr_REMOVE_USR_PRODUCTION,
|
||||
Cns_QUIET);
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For exit, system, malloc, free, rand, etc.
|
||||
|
||||
#include "swad_database.h"
|
||||
#include "swad_error.h"
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For exit, system, malloc, free, rand, etc.
|
||||
|
||||
#include "swad_database.h"
|
||||
#include "swad_error.h"
|
||||
|
|
|
@ -2071,11 +2071,11 @@ void Rec_ShowFormSignUpInCrsWithMySharedRecord (void)
|
|||
void Rec_ShowFormOtherNewSharedRecord (struct UsrData *UsrDat,Rol_Role_t DefaultRole)
|
||||
{
|
||||
/***** Show the form *****/
|
||||
/* In this case UsrDat->Roles.InCurrentCrsDB
|
||||
/* In this case UsrDat->Roles.InCurrentCrs
|
||||
is not the current role in current course.
|
||||
Instead it is initialized with the preferred role. */
|
||||
UsrDat->Roles.InCurrentCrs = (Gbl.Hierarchy.Level == HieLvl_CRS) ? DefaultRole : // Course selected
|
||||
Rol_UNK; // No course selected
|
||||
Rol_UNK; // No course selected
|
||||
Rec_ShowSharedUsrRecord (Rec_SHA_OTHER_NEW_USR_FORM,UsrDat,NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -597,13 +597,12 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat,
|
|||
{
|
||||
case Usr_DONT_GET_ROLE_IN_CURRENT_CRS:
|
||||
UsrDat->Roles.InCurrentCrs = Rol_UNK;
|
||||
UsrDat->Roles.InCrss = -1;
|
||||
UsrDat->Roles.InCrss = -1; // Force roles to be got from database
|
||||
break;
|
||||
case Usr_GET_ROLE_IN_CURRENT_CRS:
|
||||
UsrDat->Roles.InCurrentCrs = Rol_GetRoleUsrInCrs (UsrDat->UsrCod,
|
||||
Gbl.Hierarchy.Crs.CrsCod);
|
||||
UsrDat->Roles.InCrss = -1; // Force roles to be got from database
|
||||
// Rol_GetRolesInAllCrss (UsrDat);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue