Skip to content

Commit 4768184

Browse files
committed
change the naming of level wise quizzes to school and olympiad level quizzes
1 parent a8245a9 commit 4768184

File tree

5 files changed

+12
-48
lines changed

5 files changed

+12
-48
lines changed

components/meeting.component.js

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ const getMeetingLink = async (emailParam) => {
9999

100100
const sessionBody = {
101101
select_query:
102-
!difficultyLevel || difficultyLevel === "Level 1"
103-
? `select Session_Grade, LMS_Activity_ID,Explanation_Meeting_Link from Sessions where (((Session_Grade = '${gradeGroup}') and (Session_Date_Time between '${formattedDateStart}' and '${formattedDateEnd}')) and (Difficulty != 'Level 2'))`
104-
: `select Session_Grade, LMS_Activity_ID,Explanation_Meeting_Link from Sessions where (((Session_Grade = '${gradeGroup}') and (Session_Date_Time between '${formattedDateStart}' and '${formattedDateEnd}')) and (Difficulty = 'Level 2'))`,
102+
!difficultyLevel || difficultyLevel === "School"
103+
? `select Session_Grade, LMS_Activity_ID,Explanation_Meeting_Link from Sessions where (((Session_Grade = '${gradeGroup}') and (Session_Date_Time between '${formattedDateStart}' and '${formattedDateEnd}')) and (Difficulty != 'Olympiad'))`
104+
: `select Session_Grade, LMS_Activity_ID,Explanation_Meeting_Link from Sessions where (((Session_Grade = '${gradeGroup}') and (Session_Date_Time between '${formattedDateStart}' and '${formattedDateEnd}')) and (Difficulty = 'Olympiad'))`,
105105
};
106106

107107
const session = await axios.post(
@@ -117,22 +117,6 @@ const getMeetingLink = async (emailParam) => {
117117
};
118118
}
119119

120-
// const attemptBody = {
121-
// select_query: `select Session.id as Session_id, Session.Name as Session_Name,Session.Subject as Subject, Session.Number_of_Questions as Total_Questions, Session_Date_Time, Quiz_Score from Attempts where Contact_Name = '${contactid}'`,
122-
// };
123-
124-
// const attempt = await axios.post(
125-
// `https://www.zohoapis.com/crm/v6/coql`,
126-
// attemptBody,
127-
// zohoConfig
128-
// );
129-
130-
// const finalAddress = address
131-
// ? address
132-
// : attempt.status === 200 && attempt.data.info.count <= 3
133-
// ? "Temp Address"
134-
// : null;
135-
136120
const meetLink =
137121
session.status === 200
138122
? session.data.data[0].Explanation_Meeting_Link

components/quiz.component.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ const getQuizLink = async (emailParam) => {
7474

7575
const sessionBody = {
7676
select_query:
77-
!difficultyLevel || difficultyLevel === "Level 1"
78-
? `select Session_Grade, LMS_Activity_ID from Sessions where (((Session_Grade = '${gradeGroup}') and (Session_Date_Time between '${formattedDateStart}' and '${formattedDateEnd}')) and (Difficulty != 'Level 2'))`
79-
: `select Session_Grade, LMS_Activity_ID from Sessions where (((Session_Grade = '${gradeGroup}') and (Session_Date_Time between '${formattedDateStart}' and '${formattedDateEnd}')) and (Difficulty = 'Level 2'))`,
77+
!difficultyLevel || difficultyLevel === "School"
78+
? `select Session_Grade, LMS_Activity_ID from Sessions where (((Session_Grade = '${gradeGroup}') and (Session_Date_Time between '${formattedDateStart}' and '${formattedDateEnd}')) and (Difficulty != 'Olympiad'))`
79+
: `select Session_Grade, LMS_Activity_ID from Sessions where (((Session_Grade = '${gradeGroup}') and (Session_Date_Time between '${formattedDateStart}' and '${formattedDateEnd}')) and (Difficulty = 'Olympiad'))`,
8080
};
8181

8282
const session = await axios.post(

components/student.component.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,6 @@ const getStudentDetails = async (email) => {
7272
gradeGroup = "7;8";
7373
} else gradeGroup = grade;
7474
const age = getNumberOfDays(createdTime);
75-
const today = moment();
76-
const currDay = today.day();
77-
const diff = today.date() - currDay + (currDay === 0 ? -6 : 1);
78-
const monday = moment(new Date(today.date(diff)));
79-
const sunday = monday.clone().add(6, "days");
80-
const formattedDateStart = `${monday.format("YYYY-MM-DD")}T00:00:00+05:30`;
81-
const formattedDateEnd = `${sunday.format("YYYY-MM-DD")}T23:59:59+05:30`;
8275

8376
const currentDate = moment();
8477
const sevenDaysBefore = `${currentDate
@@ -151,6 +144,9 @@ const getStudentDetails = async (email) => {
151144
"July",
152145
"August",
153146
"September",
147+
"Olympiad",
148+
"Level",
149+
"School",
154150
];
155151

156152
for (let i = 0; i < sessionData.length; i++) {
@@ -188,7 +184,7 @@ const getStudentDetails = async (email) => {
188184
joinedWisechamps,
189185
weeklyQuizzes: finalWeeklyQuizzes,
190186
newUser,
191-
difficulty: difficultyLevel === "Level 2",
187+
difficulty: difficultyLevel === "Olympiad",
192188
};
193189
}
194190

@@ -234,7 +230,7 @@ const getStudentDetails = async (email) => {
234230
joinedWisechamps,
235231
weeklyQuizzes: finalWeeklyQuizzes,
236232
newUser,
237-
difficulty: difficultyLevel === "Level 2",
233+
difficulty: difficultyLevel === "Olympiad",
238234
};
239235
} catch (error) {
240236
throw new Error(error);

components/user.component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ const updateUserDifficulty = async ({ contactId, difficulty }) => {
577577
data: [
578578
{
579579
id: contactId,
580-
Difficulty: difficulty ? "Level 2" : "Level 1",
580+
Difficulty: difficulty ? "Olympiad" : "School",
581581
},
582582
],
583583
duplicate_check_fields: ["id"],

controllers/payment.controller.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,6 @@ paymentRouter.post("/payment/capture", async (req, res) => {
6060
credits: credits,
6161
payId: payId,
6262
});
63-
// let oldDate = new Date().setMinutes(new Date().getMinutes() + 330);
64-
// logsData.paymentLogs?.push({
65-
// email: email,
66-
// description: `PaymentCaptured 200`,
67-
// date: new Date().toDateString(),
68-
// time: new Date(oldDate).toLocaleTimeString("en-US"),
69-
// });
70-
// logsData.paymentLogs
71-
// ? fs.writeFile(
72-
// "./logs.json",
73-
// JSON.stringify(logsData, null, 2),
74-
// (err) => {
75-
// if (err) throw err;
76-
// }
77-
// )
78-
// : null;
7963
return res.status(200).send({ status: "success", data: createdPayment });
8064
} catch (error) {
8165
console.log(error);

0 commit comments

Comments
 (0)