Ajout possibilité de configurer le champ permettant de créer la liste des derniers quizs
This commit is contained in:
parent
71b71a2520
commit
df0bacf181
@ -39,6 +39,7 @@ module.exports =
|
|||||||
hourGiveNewQuestionnaireEnd: 8, // idem
|
hourGiveNewQuestionnaireEnd: 8, // idem
|
||||||
numberNewQuestionnaireAtSameTime: 50, // for mass mailing sending new quiz
|
numberNewQuestionnaireAtSameTime: 50, // for mass mailing sending new quiz
|
||||||
minSearchQuestionnaires: 3,
|
minSearchQuestionnaires: 3,
|
||||||
|
fieldNewQuestionnaires : "publishingAt", // field to be used to create the list of the last questionnaires, can be "createdAt", "updatedAt" or "publishingAt"
|
||||||
// Illustrations:
|
// Illustrations:
|
||||||
nbIllustrationsMin: 0,
|
nbIllustrationsMin: 0,
|
||||||
nbIllustrationsMax: 1,
|
nbIllustrationsMax: 1,
|
||||||
|
@ -37,7 +37,7 @@ module.exports =
|
|||||||
Choice :
|
Choice :
|
||||||
{
|
{
|
||||||
text: { maxlength: 255, required: true }
|
text: { maxlength: 255, required: true }
|
||||||
},
|
},
|
||||||
nbQuestionsMin: 1,
|
nbQuestionsMin: 1,
|
||||||
nbQuestionsMax: 0,
|
nbQuestionsMax: 0,
|
||||||
nbChoicesMax: 10,
|
nbChoicesMax: 10,
|
||||||
|
@ -586,7 +586,7 @@ const checkQuestionnairesPublishedHaveHTML = async (regenerate=false) =>
|
|||||||
const creaNewQuestionnairesJson = async () =>
|
const creaNewQuestionnairesJson = async () =>
|
||||||
{
|
{
|
||||||
const db = require("../models/index");
|
const db = require("../models/index");
|
||||||
const Questionnaires=await db["Questionnaire"].findAll({ where: { isPublished : true }, order: [["updatedAt", "DESC"], ["id", "DESC"]], attributes: ["id"], limit: config.nbNewQuestionnaires });
|
const Questionnaires=await db["Questionnaire"].findAll({ where: { isPublished : true }, order: [[config.fieldNewQuestionnaires, "DESC"], ["id", "DESC"]], attributes: ["id"], limit: config.nbNewQuestionnaires });
|
||||||
if(Questionnaires)
|
if(Questionnaires)
|
||||||
{
|
{
|
||||||
await toolFile.createJSON(config.dirCacheQuestionnaires, "last", Questionnaires);
|
await toolFile.createJSON(config.dirCacheQuestionnaires, "last", Questionnaires);
|
||||||
|
Loading…
Reference in New Issue
Block a user