Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › Custom quiz integration
- This topic has 40 replies, 6 voices, and was last updated 4 years, 1 month ago by Diana.
-
AuthorPosts
-
November 22, 2019 at 9:02 pm #234415proskuriusParticipantHow's it going? I just need API documentation for submitting quiz results.November 25, 2019 at 11:58 am #234625proskuriusParticipantI'm waiting for your reply.November 25, 2019 at 1:09 pm #234652Scott LangModeratorHi, We have created gist for the quiz submission: https://gist.github.com/shubham-99fusion/b6750a35a7e124bd1a3d2a8b5a6eae91/raw/0afd3b1b5d0aee813fd1a65e9fca217a803f1cd5/quiz%2520APINovember 25, 2019 at 1:56 pm #234660proskuriusParticipantThank you! A few questions =)
- What properties of "results" are required?
- May be i have to create custom question type for Go problems?
- Why do the "results" contain all the information about questions: "type", "explanation", "content" etc?? More simple to submit question id only. Am I missing something here?
- Is it possible to POST smth like this in my case?
{ "quiz_id": "714", "course_id": 710, "results": [ { "marks": 2, "user_marks": 0, "status": 2, "marked": 1, "auto": 1 }, { "marks": 2, "user_marks": 0, "status": 2, "marked": "1", "auto": 1 }, ] }
- And what does means these properties: "marks", "user_marks", "status", "marked", "auto"?
November 26, 2019 at 12:53 pm #234796Scott LangModeratorHi, Basically, in-app we get the question and after user attempt, we modified the question and send back to the server Marks = how much mark question is User marks = How much marks user get for question Status = Not in use Marked = what use marks like true/false or selected 1,2,4,3 Auto = Use for quiz evaluation and result add for the user Also, you can refer this function function add_user_result($request) in vibe-course-module plugin Maybe i have to create custom question type for Go problems? Please explainDecember 8, 2019 at 8:15 pm #236208proskuriusParticipantHello.- I embedded my Go problems into Quiz content with shortcode, but it's not displayed. If I embed them into Unit content — it works fine, if I embed H5P quiz to Quiz content — it works ok too. I want to embed my Go problems like a H5P quiz.
- At the end of my quiz I call this function:
- I can give you access to my website, if necessary.
December 8, 2019 at 9:36 pm #236215proskuriusParticipantOne problem else. My Go problems don't work in ajax mode. What should I do for it?December 9, 2019 at 11:18 am #236304Anshuman SahuKeymasterPlease try enabling " Disable ajax in Course unit load " from wp-admin -> lms -> settings. For submit results api call. No it will not store the total marks of the user if you send it. You will have to send the data like we told you in our previous replies . atleast and array of json objects of question containing these two properties : user_marks : scored marks by the user . and marks : marks of the question . eg : [ { 'user_marks'=>4 'marks'=>4 }, { 'user_marks'=>2 'marks'=>4 } ]December 9, 2019 at 11:47 am #236311proskuriusParticipantOf course I can disable ajax, but I want use it. So I can submit marks only for every question without "type" and other properties, right? What about my first question? I can't use my web Go board in Quiz content.December 9, 2019 at 1:15 pm #236335Anshuman SahuKeymasteryes you can submit without anything to record the marks in quiz for the user . but I want use it : could you please tell exactly what do you need .Do you want your Go quiz working with ajax ? for that we have to integrate it with wplms which may take time .December 9, 2019 at 1:32 pm #236339proskuriusParticipantOk. Thanks. But how can I embed my Go quiz into WPLMS Quiz content?? Yes, I want my Go quiz working with ajax. What is the general problem? What should I do?December 10, 2019 at 2:14 pm #236491Anshuman SahuKeymasterWell problem may appear with go quiz and on course status page the unit's or quiz's content is fetched from database and shown there and most of plugin's script does not load and hence their shortcodes does not works there . This is why we asked you to disable the ajax which actually solves this issue . But how can I embed my Go quiz into WPLMS Quiz content?? That is upto you .You can add the go quiz in unit itself .December 11, 2019 at 12:03 pm #236579proskuriusParticipantOh! I don't have to add the Go quiz to Quiz content? Will it work in usual Unit content and collect results? I will try. Thanks. I disable ajax mode now, and it works ok. But using ajax in the future would be great.December 11, 2019 at 4:02 pm #236607proskuriusParticipantI have error: POST http://dev24.gomagic.org/wp-json/wplms/v1/user/submitresult/ 401 (Unauthorized) I double-checked API Security State and tried do like here: https://wplms.io/forums/topic/rest-api-401-unauthorized/December 11, 2019 at 4:53 pm #236616proskuriusParticipantAlso I tried to create app with secret token and use secret token in 'Authorization' header. "Enable oAuth2 Server" and "Enable Registrations via API" are checked in Api settings. -
AuthorPosts
- The topic ‘Custom quiz integration’ is closed to new replies.