Canvas LMS REST API Quiz creation - canvas-lms

I'm having an issue with quiz creation using the Canvas REST API:
I can create a new quiz with title set.
I can add N questions with the following parameters set:
question_name
question_text
question_type
points_possible
answers
When I look at my quizzes page, I can see the quiz exists, but it only shows that 1 question has been created for the quiz. I have to go to the quiz page, click the Edit button and then save the quiz for all of the questions to show up on the quizzes page.
What am I missing in this workflow?

So, for anyone interested in this question, the best solution I've been able to find is a hack. I tried doing comparisons of the quiz model data structure returned both before and after manually saving the quiz. There were some trivial differences, but only a couple meaningful ones. The only relevant difference was in the question_count attribute. It isn't being updated after adding questions.
To "fix" this: after adding your questions, manually update the question_count attribute (via a PUSH).
Perhaps this is a bug, perhaps I don't know what I'm doing. Either way, if anyone else has a better understanding of the Canvas REST API, please comment or provide a better answer.

Just ran into this same issue and here's a possible fix: Create the quiz first with published set to False. Add your questions. Then edit the quiz (https://canvas.instructure.com/doc/api/quizzes.html#method.quizzes/quizzes_api.update) to set published to True. Then add any overrides, etc.

Related

Google Classroom API - studentSubmission - comment, grade, respond

Big picture - I want to build a bot to respond to my students on SHORT_ANSWER_QUESTION assignments -- I'm running into a couple of hurtles, but the biggest at this time is that there doesn't seem to be a way to give a comment along with a grade.
Does anyone know how to patch a comment or response of some sort to a student's submission?
Relevant documentation: https://developers.google.com/classroom/reference/rest/v1/courses.courseWork.studentSubmissions
currently there is no way to directly do this in the studentSubmisson context. There's the option to Grade student responses, but this only allows for numeric values.
There already is a Feature Request filed on Issue Tracker related to this issue. You can find it here. I suggest upvoting it to give it more visibility.

First or second person in url naming

I am creating a web app and I'm not sure how should I name the page that the user uses to set its preferences, I called it set-my-preferences but I'm wondering if it should be set-your-preferences.
Is there a naming convention for the urls relative to the user?
Should I use first (my) or second (your) person in the url?
PS: I doubt this question has not been asked already but I googled it and looked for it on stackoverflow and could not find anything
I suggest using set-my-preferences because it involves the user because they are more focused if a thing is about them. From my personal experience this has worked best for me.

Running a Moodle quiz via API

I have been asked to see if we can incorporate some of our Moodle quizes on our webpage, and am having issues finding any information on this.
In effect, what I want to do is allow our webserver to request the quiz from the Moodle system, either under a session where the Moodle system supplies the question one by one (preferable in JSON) and receives the answers, or a way to get the full set of questions (and answers including answer type and correct answer) to allow the quiz to be embeded. The webserver will need to know if the test was successful in the end.
I found a couple of articles which eluded to such functionality either being suggests (https://docs.moodle.org/dev/Quiz_web_services) and an article which described a model which had been used, but I can find no useful information about how it may be done.

Workflows with google app script

Hello I'd like to know if google app script/google forms/google spreadsheet is a good way to achieve the following. (Similar to previous posts on google scripting, i am struggling a bit to understand the 'landscape' of coding problems that these google tools are good for):
A cohort of N players (could be hundreds) is asked to click a link to a web page where they enter a player id
Once the id is entered they see a message that asks them to wait until all the cohort has entered their id, and a scenario and a question (text).
Once everyone has entered their id players are paired at random and can answer the question by simply selecting a number from a drop down menu (e.g. 1-21)
The numbers given as answers are then scored according to a simple payoff matrix and each player is presented with an outcome based on the difference between the numbers they submitted as answers.
The game then repeats i.e. the players are asked the same question, and paired randomly again (they shouldn't need to re-enter their id)
What I want is a simple way to create this workflow/process/game, and a simple way to monitor the progress of the game. Something like a google form for the questions and answers and a google spreadsheet where the data is visible by the researchers.
What I don't know is whether app script and google forms/spreadsheets can be used to setup this process/workflow.
Forms + spreadsheets would also be neat because there are many versions of this basic game/process/workflow in economics i.e. different scoring matrices and questions.
I don't think you can do this in Forms, as it is not all too dynamic (not too sure), but you can easily achieve this with HtmlOutput.
You'll have to setup a linking sheet, it will store everybodys answers, and you'll constantly check this sheet for new values with setInterval to check periodically, and google.script.run to retrieve the info.
Also, this platform is not the fastest or most suitable (I don't know an alternative), but it's totally doable.

Terminology: What is this web gui action/type actually called

Terminology: What do you call this type of web gui feature?
I'm trying to research on a gui interaction where the user chooses an option, and the next set of options are loaded based on the previous.
I'm calling it cascading, but that doesn't seem to be right.
Example below:
User chooses company A
company A services load
user chooses service 1
serivce 1 loads, with only options company A wants
...cycle continues...
Silly question probably, but I am tired of getting all these search results that have nothing to do with what I'm after. Thanks in advance for any guidance.
If it matters, I'm thinking of using jquery for this, with C#/asp.net backend. Chose not to include those in the topic tags as I didn't think the language would change the terminology.
I think you're right with cascading if I understand you properly, ASP.Net/AJAX example here:
http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/CascadingDropDown/CascadingDropDown.aspx