Custom quiz integration

Home Forums Legacy Support Support queries How-to & Troubleshooting Custom quiz integration

Viewing 15 posts - 1 through 15 (of 41 total)
  • Author
    Posts
  • #231401
    proskurius
    Participant
    Hello. I developed a custom quiz on JS. It's a Go(chess) problems. I want to integrate it into WPLMS quizzes. I can embed it into WPLMS quiz, it's easy, but how can i send information with marks to WPLMS? What i have to do?
    #231426
    MrVibe
    Keymaster
    ok, it is easy. At the end of the quiz, you need to send an API call. I am sharing some code from our react Quiz update which is coming up this week : fetch('yoursitelink/wp-json/user/submitresult/' , { method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization':AUTHORISATION_TOKEN_FROM_WPLMS }, body: JSON.stringify( { 'quiz_id':nquiz.id, 'course_id':nquiz.course_id, 'results':nquiz.meta.questions,'marks':20 } ) }).then( res => res.json());   What all parameters you can give for the quizzes. Here's how it would work :
    1. Your Go quiz need to be ebedded in the Quiz content section.
    2. At the end of your quiz, the go quiz need to trigger an event or make a direct API call which looks like above.
     
    #231649
    proskurius
    Participant
    Ok. Thank you. It will works only after WPLMS update, right? I dont understand this part of code: ... 'results':nquiz.meta.questions,'marks':20 } If i have 3 questions with marks, for example: 6/10, 8/10, 15/20. How i have to send this information?
    #231785
    Anshuman Sahu
    Keymaster
    result : it is actually the array of all questions in quiz [ { auto: 0 content: " Which metal is heavier, silver or gold? " correct: "{"ct":"Snu+O1KOEOL6gWQj3xZQ4w==","iv":"8fd3dc6327e7126b13448dac021a6d3b","s":"c150bc504643cc3a"}" explanation: "" hint: "" id: "273" key: "KzbMMKSE" marked: null marked_answer: "gold" marks: 2 options: [] original_content: " Which metal is heavier, silver or gold? " show: false show_hint: false status: 0 type: "smalltext" user_marks: 0 } }, { auto: 0 content: " Which metal is heavier, silver or gold? " correct: "{"ct":"Snu+O1KOEOL6gWQj3xZQ4w==","iv":"8fd3dc6327e7126b13448dac021a6d3b","s":"c150bc504643cc3a"}" explanation: "" hint: "" id: "273" key: "KzbMMKSE" marked: null marked_answer: "gold" marks: 2 options: [] original_content: " Which metal is heavier, silver or gold? " show: false show_hint: false status: 0 type: "smalltext" user_marks: 0 } } ] and marks is not necessary you can skip it. in question json data these properties are important : 'content' 'type' 'marked_answer' 'correct_answer' 'explaination' 'max_marks' 'marks'
    #231890
    proskurius
    Participant
    I'm sorry, i don't understand again :) I haven't WPLMS questions, i have only Go quiz with Go problems (questions). And i want to send only result with marks/max_marks for every problem of Go quiz. If i can't send marks for every problem, so i want to send total marks and total max_marks for my quiz.
    #231983
    Diana
    Participant
    @proskurius The solution for this is added in the version which will be released after wplms 3.9.7. For the mean time, you have to wait for this.
    #232100
    proskurius
    Participant
    Ok, i will wait it. And can you create fully and understandable documentation for API calls?
    #232157
    logan
    Member
    Hello, once it is live then we will update the documentation part. i appreciate your patience. regards.
    #233663
    proskurius
    Participant
    Hello. WPLMS 3.9.7 is released. What about API calls for my Go quizzes? When will I see the new API documentation?
    #233691
    logan
    Member
    Dear, The responsible person for this section is working on the docs. i will notify you once it is done. i request you for your patience.
    #233703
    MrVibe
    Keymaster
    While the docs are being updated, we can do this in your site. Can you give us a sample quiz link where we can check this live. So, we will like to give you a ready solution on how this will work with Go quizzes.
    #233709
    proskurius
    Participant
    I fully understand your first reply:
    
    fetch('yoursitelink/wp-json/user/submitresult/' , {
    
    method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization':AUTHORISATION_TOKEN_FROM_WPLMS },
    
    body: JSON.stringify( { 'quiz_id':nquiz.id, 'course_id':nquiz.course_id, 'results':nquiz.meta.questions,'marks':20 } ) }).then( res => res.json());
    
    except 'results':nquiz.meta.questions,'marks':20 } I have only Go quiz with Go problems. No WPLMS questions. I want to send only marks and max_marks.
    #233838
    MrVibe
    Keymaster
    is there any link where i can check Go quiz and Go problems ? Can you atleast share 1 link to introduce us with Go quiz ? which link should i refer : https://www.google.com/search?q=Go+quiz&oq=Go+quiz right from pre-sale to this point, we've been asking you to give us something to check the mythical Go quiz. What you're asking is possible but we can not guide you without any knowledge of Go quiz.  
    #233904
    proskurius
    Participant
    Go is a board game like chess. About Go you can read wiki - https://en.wikipedia.org/wiki/Go_(game) Website with Go problems: http://www.goproblems.com An example of Go problem with my web-board: http://dev.nikoraido.ru/problem-testing/ Sources: https://github.com/proskurius/GoMagic.Board Go quiz = a set of Go problems. English is not my native language, sorry if it's difficult to understand me.
    #233975
    MrVibe
    Keymaster
    Thank you, we'll share example tomorrow.
Viewing 15 posts - 1 through 15 (of 41 total)
  • The topic ‘Custom quiz integration’ is closed to new replies.