Skip to content

Instantly share code, notes, and snippets.

@ddikodroid
Last active January 13, 2022 15:23
Show Gist options
  • Select an option

  • Save ddikodroid/5cbb4e99e0edf786a88acae76a61e9a1 to your computer and use it in GitHub Desktop.

Select an option

Save ddikodroid/5cbb4e99e0edf786a88acae76a61e9a1 to your computer and use it in GitHub Desktop.
const response = await axios({
method: 'GET',
url: 'https://app.plex.coach/plapi/v1/partners/assessments/next-assessment',
headers: {
apikey: PL_API_KEY,
learnerid: '94752476999971',
},
});
console.log('PL Next Assesment Response Data: ', response.data);
PL Next Assesment Response Data: {"assessment_id": "27483269192103", "assessment_version": 0.5, "status": "available", "target_group": "students"}
assessment_id: 27483269192103
assessment_session: 9800648725115
questions:
[
{
"DisplayOrder":2,
"Group":"Personal Growth",
"Question":"Where are you now in your academic career & how do you feel towards it?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"5143712996293"
},
{
"DisplayOrder":3,
"Group":"Personal Growth",
"Question":"Out of the following, what would you like to accomplish?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"52477710108843"
},
{
"DisplayOrder":4,
"Group":"Personal Growth",
"Question":"How important is it for you to achieve these outcomes",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"107696104477360"
},
{
"DisplayOrder":5,
"Group":"Personal Growth",
"Question":"Tell me about times when everything has been going the way you want it to go",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"51803461714387"
},
{
"DisplayOrder":6,
"Group":"Personal Growth",
"Question":"What are your strengths as a person in relation to your academic performance",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"58857329683917"
},
{
"DisplayOrder":7,
"Group":"Personal Growth",
"Question":"How do you cope with pressure?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"105765644826126"
},
{
"DisplayOrder":8,
"Group":"Personal Growth",
"Question":"How do you mostly feel in class?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"2828591960523"
},
{
"DisplayOrder":9,
"Group":"Time management",
"Question":"Tell me about how organised you are ",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"106024908017409"
},
{
"DisplayOrder":10,
"Group":"Time management",
"Question":"Tell me about how you complete work ",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"26657338002883"
},
{
"DisplayOrder":11,
"Group":"Time management",
"Question":"Tell me about your environment where you work and a little more on how you work ",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"104882341652530"
},
{
"DisplayOrder":12,
"Group":"Retention & Recollection",
"Question":"Tell me about your memory",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"43430101198420"
},
{
"DisplayOrder":13,
"Group":"Retention & Recollection",
"Question":"When you read a textbook or anything you need to memorise, which of the following do you find happening to you? ",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"22773847720439"
},
{
"DisplayOrder":14,
"Group":"Retention & Recollection",
"Question":"Out of the following what is the one thing you would like to change about your ability to recall and remember information?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"3428755140231"
},
{
"DisplayOrder":15,
"Group":"Retention & Recollection",
"Question":"What about during exams or tests? ",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"6989917699313"
},
{
"DisplayOrder":16,
"Group":"Retention & Recollection",
"Question":"When it comes to remembering what youave learned, do you find any of the following scenarios taking place?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"81906153791808"
},
{
"DisplayOrder":17,
"Group":"Retention & Recollection",
"Question":"Do you currently have a structured way / method you use to remember information?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"4075919988624"
},
{
"DisplayOrder":18,
"Group":"Retention & Recollection",
"Question":"Have you ever had time where youave remembered pretty much everything youave learned and itas flowed well?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"44112931976160"
},
{
"DisplayOrder":19,
"Group":"Sleep and Wellbeing",
"Question":"What time do you go to bed?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"34034067672550"
},
{
"DisplayOrder":20,
"Group":"Sleep and Wellbeing",
"Question":"What time do you wake up on a school day?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"99025354750869"
},
{
"DisplayOrder":21,
"Group":"Sleep and Wellbeing",
"Question":"How long does it take you to go to sleep?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"23338995767339"
},
{
"DisplayOrder":22,
"Group":"Sleep and Wellbeing",
"Question":"Once youare asleep, do you sleep through the night or wake up frequently?",
"answers":[
[
"Object"
],
[
"Object"
]
],
"id":"59582306502720"
},
{
"DisplayOrder":23,
"Group":"Sleep and Wellbeing",
"Question":"Do you wake up feeling rested?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"115751826929643"
},
{
"DisplayOrder":24,
"Group":"Sleep and Wellbeing",
"Question":"What do you do 30-45 minutes before bed?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"91473656923481"
},
{
"DisplayOrder":25,
"Group":"Sleep and Wellbeing",
"Question":"Do you often feel sleepy during the day?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"22319890279201"
},
{
"DisplayOrder":26,
"Group":"Sleep and Wellbeing",
"Question":"Do you fall asleep at inappropriate times or places?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"1055886768046"
},
{
"DisplayOrder":27,
"Group":"Sleep and Wellbeing",
"Question":"Have you ever been treated with anxiety and depression?",
"answers":[
[
"Object"
],
[
"Object"
]
],
"id":"89056516965638"
},
{
"DisplayOrder":28,
"Group":"Sleep and Wellbeing",
"Question":"Does your weekday sleep pattern differ from your weekend sleep pattern?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"54513867412096"
},
{
"DisplayOrder":29,
"Group":"Sleep and Wellbeing",
"Question":"Do you find yourself getting tired as the day progresses? Do you ever feel burnt out / extreme tiredness?",
"answers":[
[
"Object"
],
[
"Object"
]
],
"id":"89347811104896"
},
{
"DisplayOrder":58,
"Group":"Your lifestyle",
"Question":"What time do you go to bed on a school night?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"18040786406444"
},
{
"DisplayOrder":59,
"Group":"Your lifestyle",
"Question":"What time do you go to bed at the weekend?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"65001305632601"
},
{
"DisplayOrder":60,
"Group":"Your lifestyle",
"Question":"What do you normally do 45-60 minutes before you go to sleep?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"101088608437460"
},
{
"DisplayOrder":62,
"Group":"Your lifestyle",
"Question":"How do you feel when you wake up in the morning, during the week?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"43989289275424"
},
{
"DisplayOrder":63,
"Group":"Your lifestyle",
"Question":"On a scale of 1-10, 10 being aso much energya and 1 being anone at alla how do you feel mostly at school?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"86332283466079"
},
{
"DisplayOrder":64,
"Group":"Your lifestyle",
"Question":"When do you feel you have the most amount of energy at school?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"80156739787966"
},
{
"DisplayOrder":65,
"Group":"Your lifestyle",
"Question":"When do you feel you have the least amount of energy at school?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"124180341234137"
},
{
"DisplayOrder":66,
"Group":"Your lifestyle",
"Question":"How often do you feel at your best in school?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"85027605121369"
},
{
"DisplayOrder":67,
"Group":"Your lifestyle",
"Question":"If you could pick one feeling out of the list of feelings below to feel on a regular basis, what would it be?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"112997251567782"
},
{
"DisplayOrder":68,
"Group":"Your classwork",
"Question":"Give yourself a score out of 5,5 being amazing and 1 being poor at speaking",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"26590654450872"
},
{
"DisplayOrder":69,
"Group":"Your classwork",
"Question":"Give yourself a score out of 5,5 being amazing and 1 being poor at writing",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"121243586435840"
},
{
"DisplayOrder":70,
"Group":"Your classwork",
"Question":"Give yourself a score out of 5,5 being amazing and 1 being poor at reading",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"86069791196812"
},
{
"DisplayOrder":71,
"Group":"Your classwork",
"Question":"Give yourself a score out of 5,5 being amazing and 1 being poor at listening",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"36867416200357"
},
{
"DisplayOrder":72,
"Group":"Your classwork",
"Question":"Give yourself a score out of 5,5 being amazing and 1 being poor at remembering",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"4237409458560"
},
{
"DisplayOrder":73,
"Group":"Your classwork",
"Question":"Give yourself a score out of 5,5 being amazing and 1 being poor at completing my homework",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"36202880314105"
},
{
"DisplayOrder":74,
"Group":"Your classwork",
"Question":"Give yourself a score out of 5,5 being amazing and 1 being poor at adding and subtracting",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"63903834309654"
},
{
"DisplayOrder":75,
"Group":"Your classwork",
"Question":"Give yourself a score out of 5,5 being amazing and 1 being poor at multiplying and dividing",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"88664345060304"
},
{
"DisplayOrder":76,
"Group":"Your goals",
"Question":"Out of the following, what would you like to achieve the most this year in class (you can only pick one so think carefully)?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"42982229420635"
},
{
"DisplayOrder":77,
"Group":"Your goals",
"Question":"Exactly like Question 1 above if you could only pick one of the options below, which one would you pick?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"10953244063919"
}
]
Function that modify the question data
let allQuestion = [];
for (let i = 0; i < questions.length; i++) {
let allAnswer = [];
questions[i].answers.forEach((element) => {
const result = element;
result.label = element.AnswerCopy;
allAnswer.push(result);
});
allQuestion.push({...questions[i], answers: allAnswer});
}
Modified Question:
[
{
"DisplayOrder":2,
"Group":"Personal Growth",
"Question":"Where are you now in your academic career & how do you feel towards it?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"5143712996293"
},
{
"DisplayOrder":3,
"Group":"Personal Growth",
"Question":"Out of the following, what would you like to accomplish?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"52477710108843"
},
{
"DisplayOrder":4,
"Group":"Personal Growth",
"Question":"How important is it for you to achieve these outcomes",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"107696104477360"
},
{
"DisplayOrder":5,
"Group":"Personal Growth",
"Question":"Tell me about times when everything has been going the way you want it to go",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"51803461714387"
},
{
"DisplayOrder":6,
"Group":"Personal Growth",
"Question":"What are your strengths as a person in relation to your academic performance",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"58857329683917"
},
{
"DisplayOrder":7,
"Group":"Personal Growth",
"Question":"How do you cope with pressure?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"105765644826126"
},
{
"DisplayOrder":8,
"Group":"Personal Growth",
"Question":"How do you mostly feel in class?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"2828591960523"
},
{
"DisplayOrder":9,
"Group":"Time management",
"Question":"Tell me about how organised you are ",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"106024908017409"
},
{
"DisplayOrder":10,
"Group":"Time management",
"Question":"Tell me about how you complete work ",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"26657338002883"
},
{
"DisplayOrder":11,
"Group":"Time management",
"Question":"Tell me about your environment where you work and a little more on how you work ",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"104882341652530"
},
{
"DisplayOrder":12,
"Group":"Retention & Recollection",
"Question":"Tell me about your memory",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"43430101198420"
},
{
"DisplayOrder":13,
"Group":"Retention & Recollection",
"Question":"When you read a textbook or anything you need to memorise, which of the following do you find happening to you? ",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"22773847720439"
},
{
"DisplayOrder":14,
"Group":"Retention & Recollection",
"Question":"Out of the following what is the one thing you would like to change about your ability to recall and remember information?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"3428755140231"
},
{
"DisplayOrder":15,
"Group":"Retention & Recollection",
"Question":"What about during exams or tests? ",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"6989917699313"
},
{
"DisplayOrder":16,
"Group":"Retention & Recollection",
"Question":"When it comes to remembering what youave learned, do you find any of the following scenarios taking place?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"81906153791808"
},
{
"DisplayOrder":17,
"Group":"Retention & Recollection",
"Question":"Do you currently have a structured way / method you use to remember information?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"4075919988624"
},
{
"DisplayOrder":18,
"Group":"Retention & Recollection",
"Question":"Have you ever had time where youave remembered pretty much everything youave learned and itas flowed well?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"44112931976160"
},
{
"DisplayOrder":19,
"Group":"Sleep and Wellbeing",
"Question":"What time do you go to bed?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"34034067672550"
},
{
"DisplayOrder":20,
"Group":"Sleep and Wellbeing",
"Question":"What time do you wake up on a school day?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"99025354750869"
},
{
"DisplayOrder":21,
"Group":"Sleep and Wellbeing",
"Question":"How long does it take you to go to sleep?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"23338995767339"
},
{
"DisplayOrder":22,
"Group":"Sleep and Wellbeing",
"Question":"Once youare asleep, do you sleep through the night or wake up frequently?",
"answers":[
[
"Object"
],
[
"Object"
]
],
"id":"59582306502720"
},
{
"DisplayOrder":23,
"Group":"Sleep and Wellbeing",
"Question":"Do you wake up feeling rested?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"115751826929643"
},
{
"DisplayOrder":24,
"Group":"Sleep and Wellbeing",
"Question":"What do you do 30-45 minutes before bed?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"91473656923481"
},
{
"DisplayOrder":25,
"Group":"Sleep and Wellbeing",
"Question":"Do you often feel sleepy during the day?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"22319890279201"
},
{
"DisplayOrder":26,
"Group":"Sleep and Wellbeing",
"Question":"Do you fall asleep at inappropriate times or places?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"1055886768046"
},
{
"DisplayOrder":27,
"Group":"Sleep and Wellbeing",
"Question":"Have you ever been treated with anxiety and depression?",
"answers":[
[
"Object"
],
[
"Object"
]
],
"id":"89056516965638"
},
{
"DisplayOrder":28,
"Group":"Sleep and Wellbeing",
"Question":"Does your weekday sleep pattern differ from your weekend sleep pattern?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"54513867412096"
},
{
"DisplayOrder":29,
"Group":"Sleep and Wellbeing",
"Question":"Do you find yourself getting tired as the day progresses? Do you ever feel burnt out / extreme tiredness?",
"answers":[
[
"Object"
],
[
"Object"
]
],
"id":"89347811104896"
},
{
"DisplayOrder":58,
"Group":"Your lifestyle",
"Question":"What time do you go to bed on a school night?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"18040786406444"
},
{
"DisplayOrder":59,
"Group":"Your lifestyle",
"Question":"What time do you go to bed at the weekend?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"65001305632601"
},
{
"DisplayOrder":60,
"Group":"Your lifestyle",
"Question":"What do you normally do 45-60 minutes before you go to sleep?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"101088608437460"
},
{
"DisplayOrder":62,
"Group":"Your lifestyle",
"Question":"How do you feel when you wake up in the morning, during the week?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"43989289275424"
},
{
"DisplayOrder":63,
"Group":"Your lifestyle",
"Question":"On a scale of 1-10, 10 being aso much energya and 1 being anone at alla how do you feel mostly at school?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"86332283466079"
},
{
"DisplayOrder":64,
"Group":"Your lifestyle",
"Question":"When do you feel you have the most amount of energy at school?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"80156739787966"
},
{
"DisplayOrder":65,
"Group":"Your lifestyle",
"Question":"When do you feel you have the least amount of energy at school?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"124180341234137"
},
{
"DisplayOrder":66,
"Group":"Your lifestyle",
"Question":"How often do you feel at your best in school?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"85027605121369"
},
{
"DisplayOrder":67,
"Group":"Your lifestyle",
"Question":"If you could pick one feeling out of the list of feelings below to feel on a regular basis, what would it be?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"112997251567782"
},
{
"DisplayOrder":68,
"Group":"Your classwork",
"Question":"Give yourself a score out of 5,5 being amazing and 1 being poor at speaking",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"26590654450872"
},
{
"DisplayOrder":69,
"Group":"Your classwork",
"Question":"Give yourself a score out of 5,5 being amazing and 1 being poor at writing",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"121243586435840"
},
{
"DisplayOrder":70,
"Group":"Your classwork",
"Question":"Give yourself a score out of 5,5 being amazing and 1 being poor at reading",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"86069791196812"
},
{
"DisplayOrder":71,
"Group":"Your classwork",
"Question":"Give yourself a score out of 5,5 being amazing and 1 being poor at listening",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"36867416200357"
},
{
"DisplayOrder":72,
"Group":"Your classwork",
"Question":"Give yourself a score out of 5,5 being amazing and 1 being poor at remembering",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"4237409458560"
},
{
"DisplayOrder":73,
"Group":"Your classwork",
"Question":"Give yourself a score out of 5,5 being amazing and 1 being poor at completing my homework",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"36202880314105"
},
{
"DisplayOrder":74,
"Group":"Your classwork",
"Question":"Give yourself a score out of 5,5 being amazing and 1 being poor at adding and subtracting",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"63903834309654"
},
{
"DisplayOrder":75,
"Group":"Your classwork",
"Question":"Give yourself a score out of 5,5 being amazing and 1 being poor at multiplying and dividing",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"88664345060304"
},
{
"DisplayOrder":76,
"Group":"Your goals",
"Question":"Out of the following, what would you like to achieve the most this year in class (you can only pick one so think carefully)?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"42982229420635"
},
{
"DisplayOrder":77,
"Group":"Your goals",
"Question":"Exactly like Question 1 above if you could only pick one of the options below, which one would you pick?",
"answers":[
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
],
[
"Object"
]
],
"id":"10953244063919"
}
]
The assessment answer looks like this
[
{
"answer":"1562068991204",
"answeredtime":1642086156640,
"interactions":1,
"question":"5143712996293",
"timeon":724661
},
{
"answer":"67645884927697",
"answeredtime":1642086158174,
"interactions":1,
"question":"52477710108843",
"timeon":510
},
{
"answer":"102027042182494",
"answeredtime":1642086159718,
"interactions":1,
"question":"107696104477360",
"timeon":1003
},
{
"answer":"114773450461963",
"answeredtime":1642086161327,
"interactions":1,
"question":"51803461714387",
"timeon":1092
},
{
"answer":"107875974389162",
"answeredtime":1642086162896,
"interactions":1,
"question":"58857329683917",
"timeon":640
},
{
"answer":"121936676081294",
"answeredtime":1642086164754,
"interactions":1,
"question":"105765644826126",
"timeon":1309
},
{
"answer":"87960146806137",
"answeredtime":1642086165870,
"interactions":1,
"question":"2828591960523",
"timeon":574
},
{
"answer":"56706695984844",
"answeredtime":1642086167389,
"interactions":1,
"question":"106024908017409",
"timeon":655
},
{
"answer":"89464007649726",
"answeredtime":1642086168715,
"interactions":1,
"question":"26657338002883",
"timeon":598
},
{
"answer":"44736193135413",
"answeredtime":1642086170122,
"interactions":1,
"question":"104882341652530",
"timeon":680
},
{
"answer":"35986409001296",
"answeredtime":1642086171649,
"interactions":1,
"question":"43430101198420",
"timeon":663
},
{
"answer":"83106473146953",
"answeredtime":1642086173428,
"interactions":1,
"question":"22773847720439",
"timeon":607
},
{
"answer":"37838253559891",
"answeredtime":1642086174754,
"interactions":1,
"question":"3428755140231",
"timeon":583
},
{
"answer":"74904582255637",
"answeredtime":1642086176338,
"interactions":1,
"question":"6989917699313",
"timeon":542
},
{
"answer":"79203614896477",
"answeredtime":1642086178310,
"interactions":1,
"question":"81906153791808",
"timeon":1057
},
{
"answer":"109535238485857",
"answeredtime":1642086188512,
"interactions":1,
"question":"4075919988624",
"timeon":9483
},
{
"answer":"115461085248805",
"answeredtime":1642086189903,
"interactions":1,
"question":"44112931976160",
"timeon":744
},
{
"answer":"117350863429793",
"answeredtime":1642086191115,
"interactions":1,
"question":"34034067672550",
"timeon":687
},
{
"answer":"122221455056154",
"answeredtime":1642086192457,
"interactions":1,
"question":"99025354750869",
"timeon":849
},
{
"answer":"16714355125340",
"answeredtime":1642086194583,
"interactions":1,
"question":"23338995767339",
"timeon":1455
},
{
"answer":"66122957592805",
"answeredtime":1642086196289,
"interactions":1,
"question":"59582306502720",
"timeon":979
},
{
"answer":"122757505668460",
"answeredtime":1642086197550,
"interactions":1,
"question":"115751826929643",
"timeon":631
},
{
"answer":"48581623933844",
"answeredtime":1642086198488,
"interactions":1,
"question":"91473656923481",
"timeon":542
},
{
"answer":"97655785448646",
"answeredtime":1642086199797,
"interactions":1,
"question":"22319890279201",
"timeon":703
},
{
"answer":"114935165244591",
"answeredtime":1642086200759,
"interactions":1,
"question":"1055886768046",
"timeon":606
},
{
"answer":"81510878161973",
"answeredtime":1642086206491,
"interactions":1,
"question":"89056516965638",
"timeon":719
},
{
"answer":"95664599167465",
"answeredtime":1642086207485,
"interactions":1,
"question":"54513867412096",
"timeon":614
},
{
"answer":"93376010665878",
"answeredtime":1642086208755,
"interactions":1,
"question":"89347811104896",
"timeon":753
},
{
"answer":"100738286281781",
"answeredtime":1642086209886,
"interactions":1,
"question":"18040786406444",
"timeon":719
},
{
"answer":"112580598910113",
"answeredtime":1642086211188,
"interactions":1,
"question":"65001305632601",
"timeon":728
},
{
"answer":"85215484827110",
"answeredtime":1642086212385,
"interactions":1,
"question":"101088608437460",
"timeon":769
},
{
"answer":"35366189734002",
"answeredtime":1642086213703,
"interactions":1,
"question":"43989289275424",
"timeon":777
},
{
"answer":"118240400022907",
"answeredtime":1642086214583,
"interactions":1,
"question":"86332283466079",
"timeon":469
},
{
"answer":"94829509211682",
"answeredtime":1642086215691,
"interactions":1,
"question":"80156739787966",
"timeon":704
},
{
"answer":"77732200773229",
"answeredtime":1642086217243,
"interactions":1,
"question":"124180341234137",
"timeon":711
},
{
"answer":"114235435834268",
"answeredtime":1642086218294,
"interactions":1,
"question":"85027605121369",
"timeon":647
},
{
"answer":"101713306623186",
"answeredtime":1642086219604,
"interactions":1,
"question":"112997251567782",
"timeon":898
},
{
"answer":"103764792222814",
"answeredtime":1642086220679,
"interactions":1,
"question":"26590654450872",
"timeon":655
},
{
"answer":"106749479692804",
"answeredtime":1642086221997,
"interactions":1,
"question":"121243586435840",
"timeon":849
},
{
"answer":"114823574602149",
"answeredtime":1642086222902,
"interactions":1,
"question":"86069791196812",
"timeon":461
},
{
"answer":"85241137800157",
"answeredtime":1642086224131,
"interactions":1,
"question":"36867416200357",
"timeon":816
},
{
"answer":"105256446634306",
"answeredtime":1642086227381,
"interactions":1,
"question":"4237409458560",
"timeon":1189
},
{
"answer":"125483036149532",
"answeredtime":1642086228869,
"interactions":1,
"question":"36202880314105",
"timeon":833
},
{
"answer":"113356651917405",
"answeredtime":1642086230437,
"interactions":1,
"question":"63903834309654",
"timeon":930
},
{
"answer":"104128162112860",
"answeredtime":1642086231795,
"interactions":1,
"question":"88664345060304",
"timeon":784
},
{
"answer":"51351197067976",
"answeredtime":1642086233331,
"interactions":1,
"question":"42982229420635",
"timeon":954
},
{
"answer":"120260839128468",
"answeredtime":1642086287805,
"interactions":1,
"question":"10953244063919",
"timeon":53673
}
]
Submit Assessment Payload
{
"responses":[
{
"answer":"1562068991204",
"answeredtime":1642086156640,
"interactions":1,
"question":"5143712996293",
"timeon":724661
},
{
"answer":"67645884927697",
"answeredtime":1642086158174,
"interactions":1,
"question":"52477710108843",
"timeon":510
},
{
"answer":"102027042182494",
"answeredtime":1642086159718,
"interactions":1,
"question":"107696104477360",
"timeon":1003
},
{
"answer":"114773450461963",
"answeredtime":1642086161327,
"interactions":1,
"question":"51803461714387",
"timeon":1092
},
{
"answer":"107875974389162",
"answeredtime":1642086162896,
"interactions":1,
"question":"58857329683917",
"timeon":640
},
{
"answer":"121936676081294",
"answeredtime":1642086164754,
"interactions":1,
"question":"105765644826126",
"timeon":1309
},
{
"answer":"87960146806137",
"answeredtime":1642086165870,
"interactions":1,
"question":"2828591960523",
"timeon":574
},
{
"answer":"56706695984844",
"answeredtime":1642086167389,
"interactions":1,
"question":"106024908017409",
"timeon":655
},
{
"answer":"89464007649726",
"answeredtime":1642086168715,
"interactions":1,
"question":"26657338002883",
"timeon":598
},
{
"answer":"44736193135413",
"answeredtime":1642086170122,
"interactions":1,
"question":"104882341652530",
"timeon":680
},
{
"answer":"35986409001296",
"answeredtime":1642086171649,
"interactions":1,
"question":"43430101198420",
"timeon":663
},
{
"answer":"83106473146953",
"answeredtime":1642086173428,
"interactions":1,
"question":"22773847720439",
"timeon":607
},
{
"answer":"37838253559891",
"answeredtime":1642086174754,
"interactions":1,
"question":"3428755140231",
"timeon":583
},
{
"answer":"74904582255637",
"answeredtime":1642086176338,
"interactions":1,
"question":"6989917699313",
"timeon":542
},
{
"answer":"79203614896477",
"answeredtime":1642086178310,
"interactions":1,
"question":"81906153791808",
"timeon":1057
},
{
"answer":"109535238485857",
"answeredtime":1642086188512,
"interactions":1,
"question":"4075919988624",
"timeon":9483
},
{
"answer":"115461085248805",
"answeredtime":1642086189903,
"interactions":1,
"question":"44112931976160",
"timeon":744
},
{
"answer":"117350863429793",
"answeredtime":1642086191115,
"interactions":1,
"question":"34034067672550",
"timeon":687
},
{
"answer":"122221455056154",
"answeredtime":1642086192457,
"interactions":1,
"question":"99025354750869",
"timeon":849
},
{
"answer":"16714355125340",
"answeredtime":1642086194583,
"interactions":1,
"question":"23338995767339",
"timeon":1455
},
{
"answer":"66122957592805",
"answeredtime":1642086196289,
"interactions":1,
"question":"59582306502720",
"timeon":979
},
{
"answer":"122757505668460",
"answeredtime":1642086197550,
"interactions":1,
"question":"115751826929643",
"timeon":631
},
{
"answer":"48581623933844",
"answeredtime":1642086198488,
"interactions":1,
"question":"91473656923481",
"timeon":542
},
{
"answer":"97655785448646",
"answeredtime":1642086199797,
"interactions":1,
"question":"22319890279201",
"timeon":703
},
{
"answer":"114935165244591",
"answeredtime":1642086200759,
"interactions":1,
"question":"1055886768046",
"timeon":606
},
{
"answer":"81510878161973",
"answeredtime":1642086206491,
"interactions":1,
"question":"89056516965638",
"timeon":719
},
{
"answer":"95664599167465",
"answeredtime":1642086207485,
"interactions":1,
"question":"54513867412096",
"timeon":614
},
{
"answer":"93376010665878",
"answeredtime":1642086208755,
"interactions":1,
"question":"89347811104896",
"timeon":753
},
{
"answer":"100738286281781",
"answeredtime":1642086209886,
"interactions":1,
"question":"18040786406444",
"timeon":719
},
{
"answer":"112580598910113",
"answeredtime":1642086211188,
"interactions":1,
"question":"65001305632601",
"timeon":728
},
{
"answer":"85215484827110",
"answeredtime":1642086212385,
"interactions":1,
"question":"101088608437460",
"timeon":769
},
{
"answer":"35366189734002",
"answeredtime":1642086213703,
"interactions":1,
"question":"43989289275424",
"timeon":777
},
{
"answer":"118240400022907",
"answeredtime":1642086214583,
"interactions":1,
"question":"86332283466079",
"timeon":469
},
{
"answer":"94829509211682",
"answeredtime":1642086215691,
"interactions":1,
"question":"80156739787966",
"timeon":704
},
{
"answer":"77732200773229",
"answeredtime":1642086217243,
"interactions":1,
"question":"124180341234137",
"timeon":711
},
{
"answer":"114235435834268",
"answeredtime":1642086218294,
"interactions":1,
"question":"85027605121369",
"timeon":647
},
{
"answer":"101713306623186",
"answeredtime":1642086219604,
"interactions":1,
"question":"112997251567782",
"timeon":898
},
{
"answer":"103764792222814",
"answeredtime":1642086220679,
"interactions":1,
"question":"26590654450872",
"timeon":655
},
{
"answer":"106749479692804",
"answeredtime":1642086221997,
"interactions":1,
"question":"121243586435840",
"timeon":849
},
{
"answer":"114823574602149",
"answeredtime":1642086222902,
"interactions":1,
"question":"86069791196812",
"timeon":461
},
{
"answer":"85241137800157",
"answeredtime":1642086224131,
"interactions":1,
"question":"36867416200357",
"timeon":816
},
{
"answer":"105256446634306",
"answeredtime":1642086227381,
"interactions":1,
"question":"4237409458560",
"timeon":1189
},
{
"answer":"125483036149532",
"answeredtime":1642086228869,
"interactions":1,
"question":"36202880314105",
"timeon":833
},
{
"answer":"113356651917405",
"answeredtime":1642086230437,
"interactions":1,
"question":"63903834309654",
"timeon":930
},
{
"answer":"104128162112860",
"answeredtime":1642086231795,
"interactions":1,
"question":"88664345060304",
"timeon":784
},
{
"answer":"51351197067976",
"answeredtime":1642086233331,
"interactions":1,
"question":"42982229420635",
"timeon":954
},
{
"answer":"120260839128468",
"answeredtime":1642086287805,
"interactions":1,
"question":"10953244063919",
"timeon":53673
}
],
"session":9800648725115
}
const submitPLAssessment = async ({data, assessmentId, learnerId}) => {
console.log('PL Assessment Answer Data', data);
const SUBMIT_PL_ASSESSMENT_URL =
'https://app.plex.coach/plapi/v1/partners/assessments/submit-assessment';
const PL_ASSESSMENT_RESULT_URL =
'https://app.plex.coach/plapi/v1/partners/assessments/results';
try {
const result = await axios({
method: 'POST',
url: SUBMIT_PL_ASSESSMENT_URL,
headers: {
apikey: PL_API_KEY,
learnerid: learnerId,
},
data,
});
console.log('Result Data from Submit PL Assessment: ', result.data);
const response = await axios({
method: 'GET',
url: `${PL_ASSESSMENT_RESULT_URL}/${assessmentId}`,
headers: {
apikey: PL_API_KEY,
learnerid: learnerId,
},
});
console.log('Submit Assessment Response Data: ', response.data);
return response.data;
} catch (error) {
console.log(error);
}
};
Result Data from Submit PL Assessment: {"data": {"message": "OK", "percentage_score": 45.6}, "message_type": "completion_notification", "status": true}
And from the API call below, it gaves me Error when submitting PL assessment with error: Error: Request failed with status code 500
const response = await axios({
method: 'GET',
url: `${PL_ASSESSMENT_RESULT_URL}/${assessmentId}`,
headers: {
apikey: PL_API_KEY,
learnerid: learnerId,
},
});
Using the postman, it said Internal Server Error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment