diff --git a/app/(main)/questions/edit/page.tsx b/app/(main)/questions/edit/page.tsx
index 1a392d2..df1b2c7 100644
--- a/app/(main)/questions/edit/page.tsx
+++ b/app/(main)/questions/edit/page.tsx
@@ -142,12 +142,16 @@ const EditQuestion = () => {
throw "No answer selected"
console.log(answer)
//populate skills for mcq
+ let selectedTopics: number[] = [];
let selectedSkills: number[] = [];
if(selectedTopicNodes){
Object.entries(selectedTopicNodes).forEach(([key, data]) => {
+ console.log("key", key, "data", data);
let topic_skill = key.split("-");
if(topic_skill.length>1){
- selectedSkills.push(parseInt(topic_skill[1]));
+ selectedSkills.push(parseInt(topic_skill[1]));
+ } else {
+ selectedTopics.push(parseInt(topic_skill[0]));
}
});
}
@@ -155,10 +159,10 @@ const EditQuestion = () => {
let mcq = {
stem: stem,
options: addedOptions,
- // topics: null,
+ topics: selectedTopics,
skills: selectedSkills,
// isAnswer: answer[0].no,
- status: "Draft",
+ // status: "Draft",
}
console.log("mcq to be created ", mcq);
diff --git a/app/(main)/questions/searchlist/page.tsx b/app/(main)/questions/searchlist/page.tsx
index 0f4652c..6745a47 100644
--- a/app/(main)/questions/searchlist/page.tsx
+++ b/app/(main)/questions/searchlist/page.tsx
@@ -44,10 +44,10 @@ const QuestioSearchList = () => {
const itemTemplate = (rowData: Questions.MCQ) => {
const topics = rowData.topics.map((topic) =>
-