Quiz API
API change historyList of APIs related to Quiz
Get assessments for gradebook
Get list of normal assessments under a module which have valid marks to be exported to gradebook.
Try itRequest
Request URL
Request parameters
-
string
Format - uuid. Module id
-
(optional)string
-
(optional)integer
Format - int32.
-
(optional)integer
Format - int32.
-
(optional)string
Request headers
Request body
Responses
200 OK
List of assessments which are available for export
Representations
{
"type": "array",
"items": {
"description": "output class for assessment",
"required": [
"assessmentType",
"endDate",
"name",
"publish",
"startDate"
],
"type": "object",
"properties": {
"id": {
"format": "uuid",
"description": "The assessment ID",
"type": "string"
},
"parentId": {
"format": "uuid",
"description": "the parent entity of the assessment, usually the module. if it is same as ID, means it has no parent.",
"type": "string"
},
"access": {
"description": "Access rights of the current login user",
"allOf": [
{
"description": "flags to define access rights",
"type": "object",
"properties": {
"access_Full": {
"description": "all accesses on the resource and its contents",
"type": "boolean"
},
"access_Read": {
"description": "read-only access on the contents",
"type": "boolean"
},
"access_Create": {
"description": "create access on the contents",
"type": "boolean"
},
"access_Update": {
"description": "update access on the contents",
"type": "boolean"
},
"access_Delete": {
"description": "delete access on the contents",
"type": "boolean"
},
"access_Settings_Read": {
"description": "read-only access on the resource setting",
"type": "boolean"
},
"access_Settings_Update": {
"description": "update access on the resource setting",
"type": "boolean"
}
}
}
]
},
"creatorID": {
"format": "uuid",
"description": "ID of the user who created this assessment",
"type": "string"
},
"createdDate": {
"format": "date-time",
"description": "the date this assessment created",
"type": "string"
},
"lastUpdatedBy": {
"format": "uuid",
"description": "ID of the user who lastly updated the assessment",
"type": "string"
},
"lastUpdatedDate": {
"format": "date-time",
"description": "the last updated date of the assessment",
"type": "string"
},
"creatorName": {
"description": "the name of the user who created the assessment",
"type": "string"
},
"updatorName": {
"description": "the name of the user who lastly updated the assessment",
"type": "string"
},
"isOpen": {
"description": "whether the assessment is open to student",
"type": "boolean",
"readOnly": true
},
"assessmentType": {
"description": "Assessment type: 0 - normal assessment, 1 - in-video assessment",
"allOf": [
{
"format": "int32",
"description": "assessment type",
"enum": [
0,
1,
2
],
"type": "integer"
}
]
},
"hasPassword": {
"description": "whether this normal assessment is password protected",
"type": "boolean"
},
"fileName": {
"description": "video file name for a in-video assessment",
"type": "string"
},
"fileSize": {
"format": "double",
"description": "video file size for a in-video assessment",
"type": "number"
},
"streamUrl": {
"description": "video stream url for a in-video assessment",
"type": "string"
},
"posterUrl": {
"description": "poster url for the uploaded video",
"type": "string"
},
"fullMark": {
"format": "double",
"description": "full mark of the assessment",
"type": "number"
},
"isAdaptiveAssessment": {
"description": "adaptive flag for Assessment",
"type": "boolean"
},
"name": {
"description": "assessment name",
"type": "string"
},
"publish": {
"description": "publish flag of the assessment",
"type": "boolean"
},
"startDate": {
"format": "date-time",
"description": "assessment start date",
"type": "string"
},
"endDate": {
"format": "date-time",
"description": "assessment expiry date",
"type": "string"
},
"description": {
"description": "instructional text for students before they taking the assessment",
"type": "string"
},
"password": {
"description": "password required to take the assessment, if specified, used for normal assessemnt only",
"type": "string"
},
"attemptLimit": {
"format": "int32",
"description": "maximum number of sessions student can have.0 means unlimited attempt",
"maximum": 2147483647,
"minimum": 0,
"type": "integer"
},
"timeLimit": {
"format": "int32",
"description": "time limit in minutes, 0 means no time limit, used for normal assessemnt only",
"maximum": 2147483647,
"minimum": 0,
"type": "integer"
},
"resumeType": {
"description": "resume type for quiz with time-limit, used for normal assessemnt only\r\n\r\n0 - resume with continuous timer\r\n\r\n1 - resume with stop timer",
"allOf": [
{
"format": "int32",
"description": "resume type for quiz with time-limit",
"enum": [
0,
1
],
"type": "integer"
}
]
},
"displayType": {
"description": "content display type, used for normal assessemnt only\r\n0 - display all content in one page\r\n\r\n1 - display section per page\r\n\r\n2- display a question per page\r\n\r\n3- display section per page, student cannot navigate to previous section\r\n\r\n4 - display a question per page, student cannot navigate to previous question",
"allOf": [
{
"format": "int32",
"description": "content display type",
"enum": [
0,
1,
2,
3,
4
],
"type": "integer"
}
]
},
"feedbackContents": {
"description": "contents which lecturer decide to show after student completed the assessment, used for normal assessemnt only\r\n\r\n0 - responses made by students in each question\r\n \r\n1 - correct answer for each question\r\n\r\n2 - feedback which user entered when creating question\r\n\r\n3 - lecturer comments on a student's response for a question, as well as the overal comments for the student's session\r\n\r\n4 - score obtained for a question\r\n\r\n5 - total score and overall comment obtained for the session\r\n\r\n6 - feedback for student selected options.",
"type": "array",
"items": {
"format": "int32",
"description": "type of contents which lecturer decide to show after student completed the assessment",
"enum": [
0,
1,
2,
3,
4,
5,
6
],
"type": "integer"
}
},
"viewFeedbackFromDate": {
"format": "date-time",
"description": "The time when student can view feedback since. If not specified, means student can always view feedback after submission, used for normal assessemnt only",
"type": "string"
},
"viewFeedbackToDate": {
"format": "date-time",
"description": "The time when student can view feedback until. If not specified, means student can always view feedback after submission, used for normal assessemnt only",
"type": "string"
},
"passingMark": {
"format": "float",
"description": "indicate a passing mark for normal assessment.\r\n\r\nIt can be set if there are questions inside the assesment and there is no complete student attempts. \r\n\r\nIt cannot be used if there are Essay questions inside the assessment.",
"maximum": 100000,
"minimum": 0,
"type": "number"
},
"is2FaEnabled": {
"description": "whether user need 2FA security when navigating into staff pages of this quiz",
"type": "boolean"
},
"randomizeSections": {
"description": "indicate whether the sections are displayed in randomized order when students taking the assessment.",
"type": "boolean"
},
"backgroundColor": {
"description": "The html color code which defines the background color of the webpage when student taking the normal quiz (if any). The color has to be light color.",
"type": "string"
}
}
}
}
[
{
"id": "string",
"parentId": "string",
"access": {
"access_Full": true,
"access_Read": true,
"access_Create": true,
"access_Update": true,
"access_Delete": true,
"access_Settings_Read": true,
"access_Settings_Update": true
},
"creatorID": "string",
"createdDate": "string",
"lastUpdatedBy": "string",
"lastUpdatedDate": "string",
"creatorName": "string",
"updatorName": "string",
"isOpen": true,
"assessmentType": {},
"hasPassword": true,
"fileName": "string",
"fileSize": 0.0,
"streamUrl": "string",
"posterUrl": "string",
"fullMark": 0.0,
"isAdaptiveAssessment": true,
"name": "string",
"publish": true,
"startDate": "string",
"endDate": "string",
"description": "string",
"password": "string",
"attemptLimit": 0,
"timeLimit": 0,
"resumeType": {},
"displayType": {},
"feedbackContents": [
0
],
"viewFeedbackFromDate": "string",
"viewFeedbackToDate": "string",
"passingMark": 0.0,
"is2FaEnabled": true,
"randomizeSections": true,
"backgroundColor": "string"
}
]
{
"type": "array",
"items": {
"description": "output class for assessment",
"required": [
"assessmentType",
"endDate",
"name",
"publish",
"startDate"
],
"type": "object",
"properties": {
"id": {
"format": "uuid",
"description": "The assessment ID",
"type": "string"
},
"parentId": {
"format": "uuid",
"description": "the parent entity of the assessment, usually the module. if it is same as ID, means it has no parent.",
"type": "string"
},
"access": {
"description": "Access rights of the current login user",
"allOf": [
{
"description": "flags to define access rights",
"type": "object",
"properties": {
"access_Full": {
"description": "all accesses on the resource and its contents",
"type": "boolean"
},
"access_Read": {
"description": "read-only access on the contents",
"type": "boolean"
},
"access_Create": {
"description": "create access on the contents",
"type": "boolean"
},
"access_Update": {
"description": "update access on the contents",
"type": "boolean"
},
"access_Delete": {
"description": "delete access on the contents",
"type": "boolean"
},
"access_Settings_Read": {
"description": "read-only access on the resource setting",
"type": "boolean"
},
"access_Settings_Update": {
"description": "update access on the resource setting",
"type": "boolean"
}
}
}
]
},
"creatorID": {
"format": "uuid",
"description": "ID of the user who created this assessment",
"type": "string"
},
"createdDate": {
"format": "date-time",
"description": "the date this assessment created",
"type": "string"
},
"lastUpdatedBy": {
"format": "uuid",
"description": "ID of the user who lastly updated the assessment",
"type": "string"
},
"lastUpdatedDate": {
"format": "date-time",
"description": "the last updated date of the assessment",
"type": "string"
},
"creatorName": {
"description": "the name of the user who created the assessment",
"type": "string"
},
"updatorName": {
"description": "the name of the user who lastly updated the assessment",
"type": "string"
},
"isOpen": {
"description": "whether the assessment is open to student",
"type": "boolean",
"readOnly": true
},
"assessmentType": {
"description": "Assessment type: 0 - normal assessment, 1 - in-video assessment",
"allOf": [
{
"format": "int32",
"description": "assessment type",
"enum": [
0,
1,
2
],
"type": "integer"
}
]
},
"hasPassword": {
"description": "whether this normal assessment is password protected",
"type": "boolean"
},
"fileName": {
"description": "video file name for a in-video assessment",
"type": "string"
},
"fileSize": {
"format": "double",
"description": "video file size for a in-video assessment",
"type": "number"
},
"streamUrl": {
"description": "video stream url for a in-video assessment",
"type": "string"
},
"posterUrl": {
"description": "poster url for the uploaded video",
"type": "string"
},
"fullMark": {
"format": "double",
"description": "full mark of the assessment",
"type": "number"
},
"isAdaptiveAssessment": {
"description": "adaptive flag for Assessment",
"type": "boolean"
},
"name": {
"description": "assessment name",
"type": "string"
},
"publish": {
"description": "publish flag of the assessment",
"type": "boolean"
},
"startDate": {
"format": "date-time",
"description": "assessment start date",
"type": "string"
},
"endDate": {
"format": "date-time",
"description": "assessment expiry date",
"type": "string"
},
"description": {
"description": "instructional text for students before they taking the assessment",
"type": "string"
},
"password": {
"description": "password required to take the assessment, if specified, used for normal assessemnt only",
"type": "string"
},
"attemptLimit": {
"format": "int32",
"description": "maximum number of sessions student can have.0 means unlimited attempt",
"maximum": 2147483647,
"minimum": 0,
"type": "integer"
},
"timeLimit": {
"format": "int32",
"description": "time limit in minutes, 0 means no time limit, used for normal assessemnt only",
"maximum": 2147483647,
"minimum": 0,
"type": "integer"
},
"resumeType": {
"description": "resume type for quiz with time-limit, used for normal assessemnt only\r\n\r\n0 - resume with continuous timer\r\n\r\n1 - resume with stop timer",
"allOf": [
{
"format": "int32",
"description": "resume type for quiz with time-limit",
"enum": [
0,
1
],
"type": "integer"
}
]
},
"displayType": {
"description": "content display type, used for normal assessemnt only\r\n0 - display all content in one page\r\n\r\n1 - display section per page\r\n\r\n2- display a question per page\r\n\r\n3- display section per page, student cannot navigate to previous section\r\n\r\n4 - display a question per page, student cannot navigate to previous question",
"allOf": [
{
"format": "int32",
"description": "content display type",
"enum": [
0,
1,
2,
3,
4
],
"type": "integer"
}
]
},
"feedbackContents": {
"description": "contents which lecturer decide to show after student completed the assessment, used for normal assessemnt only\r\n\r\n0 - responses made by students in each question\r\n \r\n1 - correct answer for each question\r\n\r\n2 - feedback which user entered when creating question\r\n\r\n3 - lecturer comments on a student's response for a question, as well as the overal comments for the student's session\r\n\r\n4 - score obtained for a question\r\n\r\n5 - total score and overall comment obtained for the session\r\n\r\n6 - feedback for student selected options.",
"type": "array",
"items": {
"format": "int32",
"description": "type of contents which lecturer decide to show after student completed the assessment",
"enum": [
0,
1,
2,
3,
4,
5,
6
],
"type": "integer"
}
},
"viewFeedbackFromDate": {
"format": "date-time",
"description": "The time when student can view feedback since. If not specified, means student can always view feedback after submission, used for normal assessemnt only",
"type": "string"
},
"viewFeedbackToDate": {
"format": "date-time",
"description": "The time when student can view feedback until. If not specified, means student can always view feedback after submission, used for normal assessemnt only",
"type": "string"
},
"passingMark": {
"format": "float",
"description": "indicate a passing mark for normal assessment.\r\n\r\nIt can be set if there are questions inside the assesment and there is no complete student attempts. \r\n\r\nIt cannot be used if there are Essay questions inside the assessment.",
"maximum": 100000,
"minimum": 0,
"type": "number"
},
"is2FaEnabled": {
"description": "whether user need 2FA security when navigating into staff pages of this quiz",
"type": "boolean"
},
"randomizeSections": {
"description": "indicate whether the sections are displayed in randomized order when students taking the assessment.",
"type": "boolean"
},
"backgroundColor": {
"description": "The html color code which defines the background color of the webpage when student taking the normal quiz (if any). The color has to be light color.",
"type": "string"
}
}
}
}
[
{
"id": "string",
"parentId": "string",
"access": {
"access_Full": true,
"access_Read": true,
"access_Create": true,
"access_Update": true,
"access_Delete": true,
"access_Settings_Read": true,
"access_Settings_Update": true
},
"creatorID": "string",
"createdDate": "string",
"lastUpdatedBy": "string",
"lastUpdatedDate": "string",
"creatorName": "string",
"updatorName": "string",
"isOpen": true,
"assessmentType": {},
"hasPassword": true,
"fileName": "string",
"fileSize": 0.0,
"streamUrl": "string",
"posterUrl": "string",
"fullMark": 0.0,
"isAdaptiveAssessment": true,
"name": "string",
"publish": true,
"startDate": "string",
"endDate": "string",
"description": "string",
"password": "string",
"attemptLimit": 0,
"timeLimit": 0,
"resumeType": {},
"displayType": {},
"feedbackContents": [
0
],
"viewFeedbackFromDate": "string",
"viewFeedbackToDate": "string",
"passingMark": 0.0,
"is2FaEnabled": true,
"randomizeSections": true,
"backgroundColor": "string"
}
]
{
"type": "array",
"items": {
"description": "output class for assessment",
"required": [
"assessmentType",
"endDate",
"name",
"publish",
"startDate"
],
"type": "object",
"properties": {
"id": {
"format": "uuid",
"description": "The assessment ID",
"type": "string"
},
"parentId": {
"format": "uuid",
"description": "the parent entity of the assessment, usually the module. if it is same as ID, means it has no parent.",
"type": "string"
},
"access": {
"description": "Access rights of the current login user",
"allOf": [
{
"description": "flags to define access rights",
"type": "object",
"properties": {
"access_Full": {
"description": "all accesses on the resource and its contents",
"type": "boolean"
},
"access_Read": {
"description": "read-only access on the contents",
"type": "boolean"
},
"access_Create": {
"description": "create access on the contents",
"type": "boolean"
},
"access_Update": {
"description": "update access on the contents",
"type": "boolean"
},
"access_Delete": {
"description": "delete access on the contents",
"type": "boolean"
},
"access_Settings_Read": {
"description": "read-only access on the resource setting",
"type": "boolean"
},
"access_Settings_Update": {
"description": "update access on the resource setting",
"type": "boolean"
}
}
}
]
},
"creatorID": {
"format": "uuid",
"description": "ID of the user who created this assessment",
"type": "string"
},
"createdDate": {
"format": "date-time",
"description": "the date this assessment created",
"type": "string"
},
"lastUpdatedBy": {
"format": "uuid",
"description": "ID of the user who lastly updated the assessment",
"type": "string"
},
"lastUpdatedDate": {
"format": "date-time",
"description": "the last updated date of the assessment",
"type": "string"
},
"creatorName": {
"description": "the name of the user who created the assessment",
"type": "string"
},
"updatorName": {
"description": "the name of the user who lastly updated the assessment",
"type": "string"
},
"isOpen": {
"description": "whether the assessment is open to student",
"type": "boolean",
"readOnly": true
},
"assessmentType": {
"description": "Assessment type: 0 - normal assessment, 1 - in-video assessment",
"allOf": [
{
"format": "int32",
"description": "assessment type",
"enum": [
0,
1,
2
],
"type": "integer"
}
]
},
"hasPassword": {
"description": "whether this normal assessment is password protected",
"type": "boolean"
},
"fileName": {
"description": "video file name for a in-video assessment",
"type": "string"
},
"fileSize": {
"format": "double",
"description": "video file size for a in-video assessment",
"type": "number"
},
"streamUrl": {
"description": "video stream url for a in-video assessment",
"type": "string"
},
"posterUrl": {
"description": "poster url for the uploaded video",
"type": "string"
},
"fullMark": {
"format": "double",
"description": "full mark of the assessment",
"type": "number"
},
"isAdaptiveAssessment": {
"description": "adaptive flag for Assessment",
"type": "boolean"
},
"name": {
"description": "assessment name",
"type": "string"
},
"publish": {
"description": "publish flag of the assessment",
"type": "boolean"
},
"startDate": {
"format": "date-time",
"description": "assessment start date",
"type": "string"
},
"endDate": {
"format": "date-time",
"description": "assessment expiry date",
"type": "string"
},
"description": {
"description": "instructional text for students before they taking the assessment",
"type": "string"
},
"password": {
"description": "password required to take the assessment, if specified, used for normal assessemnt only",
"type": "string"
},
"attemptLimit": {
"format": "int32",
"description": "maximum number of sessions student can have.0 means unlimited attempt",
"maximum": 2147483647,
"minimum": 0,
"type": "integer"
},
"timeLimit": {
"format": "int32",
"description": "time limit in minutes, 0 means no time limit, used for normal assessemnt only",
"maximum": 2147483647,
"minimum": 0,
"type": "integer"
},
"resumeType": {
"description": "resume type for quiz with time-limit, used for normal assessemnt only\r\n\r\n0 - resume with continuous timer\r\n\r\n1 - resume with stop timer",
"allOf": [
{
"format": "int32",
"description": "resume type for quiz with time-limit",
"enum": [
0,
1
],
"type": "integer"
}
]
},
"displayType": {
"description": "content display type, used for normal assessemnt only\r\n0 - display all content in one page\r\n\r\n1 - display section per page\r\n\r\n2- display a question per page\r\n\r\n3- display section per page, student cannot navigate to previous section\r\n\r\n4 - display a question per page, student cannot navigate to previous question",
"allOf": [
{
"format": "int32",
"description": "content display type",
"enum": [
0,
1,
2,
3,
4
],
"type": "integer"
}
]
},
"feedbackContents": {
"description": "contents which lecturer decide to show after student completed the assessment, used for normal assessemnt only\r\n\r\n0 - responses made by students in each question\r\n \r\n1 - correct answer for each question\r\n\r\n2 - feedback which user entered when creating question\r\n\r\n3 - lecturer comments on a student's response for a question, as well as the overal comments for the student's session\r\n\r\n4 - score obtained for a question\r\n\r\n5 - total score and overall comment obtained for the session\r\n\r\n6 - feedback for student selected options.",
"type": "array",
"items": {
"format": "int32",
"description": "type of contents which lecturer decide to show after student completed the assessment",
"enum": [
0,
1,
2,
3,
4,
5,
6
],
"type": "integer"
}
},
"viewFeedbackFromDate": {
"format": "date-time",
"description": "The time when student can view feedback since. If not specified, means student can always view feedback after submission, used for normal assessemnt only",
"type": "string"
},
"viewFeedbackToDate": {
"format": "date-time",
"description": "The time when student can view feedback until. If not specified, means student can always view feedback after submission, used for normal assessemnt only",
"type": "string"
},
"passingMark": {
"format": "float",
"description": "indicate a passing mark for normal assessment.\r\n\r\nIt can be set if there are questions inside the assesment and there is no complete student attempts. \r\n\r\nIt cannot be used if there are Essay questions inside the assessment.",
"maximum": 100000,
"minimum": 0,
"type": "number"
},
"is2FaEnabled": {
"description": "whether user need 2FA security when navigating into staff pages of this quiz",
"type": "boolean"
},
"randomizeSections": {
"description": "indicate whether the sections are displayed in randomized order when students taking the assessment.",
"type": "boolean"
},
"backgroundColor": {
"description": "The html color code which defines the background color of the webpage when student taking the normal quiz (if any). The color has to be light color.",
"type": "string"
}
}
}
}
400 Bad Request
Bad Request
Representations
{
"type": "string"
}
string
{
"type": "string"
}
string
{
"type": "string"
}
403 Forbidden
Login user not authorized to perform this action
Representations
{
"type": "string"
}
string
{
"type": "string"
}
string
{
"type": "string"
}
500 Internal Server Error
Server Error
Representations
{
"type": "string"
}
string
{
"type": "string"
}
string
{
"type": "string"
}
Code samples
@ECHO OFF
curl -v -X GET "https://luminus.azure-api.net/assessment/{moduleID}/exportToGradebook?sortby={string}&offset={integer}&limit={integer}&where={string}"
-H "Ocp-Apim-Subscription-Key: {subscription key}"
--data-ascii "{body}"
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;
namespace CSHttpClientSample
{
static class Program
{
static void Main()
{
MakeRequest();
Console.WriteLine("Hit ENTER to exit...");
Console.ReadLine();
}
static async void MakeRequest()
{
var client = new HttpClient();
var queryString = HttpUtility.ParseQueryString(string.Empty);
// Request headers
client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");
// Request parameters
queryString["sortby"] = "{string}";
queryString["offset"] = "{integer}";
queryString["limit"] = "{integer}";
queryString["where"] = "{string}";
var uri = "https://luminus.azure-api.net/assessment/{moduleID}/exportToGradebook?" + queryString;
var response = await client.GetAsync(uri);
}
}
}
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
public class JavaSample
{
public static void main(String[] args)
{
HttpClient httpclient = HttpClients.createDefault();
try
{
URIBuilder builder = new URIBuilder("https://luminus.azure-api.net/assessment/{moduleID}/exportToGradebook");
builder.setParameter("sortby", "{string}");
builder.setParameter("offset", "{integer}");
builder.setParameter("limit", "{integer}");
builder.setParameter("where", "{string}");
URI uri = builder.build();
HttpGet request = new HttpGet(uri);
request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");
// Request body
StringEntity reqEntity = new StringEntity("{body}");
request.setEntity(reqEntity);
HttpResponse response = httpclient.execute(request);
HttpEntity entity = response.getEntity();
if (entity != null)
{
System.out.println(EntityUtils.toString(entity));
}
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
}
}
<!DOCTYPE html>
<html>
<head>
<title>JSSample</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>
<script type="text/javascript">
$(function() {
var params = {
// Request parameters
"sortby": "{string}",
"offset": "{integer}",
"limit": "{integer}",
"where": "{string}",
};
$.ajax({
url: "https://luminus.azure-api.net/assessment/{moduleID}/exportToGradebook?" + $.param(params),
beforeSend: function(xhrObj){
// Request headers
xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
},
type: "GET",
// Request body
data: "{body}",
})
.done(function(data) {
alert("success");
})
.fail(function() {
alert("error");
});
});
</script>
</body>
</html>
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString* path = @"https://luminus.azure-api.net/assessment/{moduleID}/exportToGradebook";
NSArray* array = @[
// Request parameters
@"entities=true",
@"sortby={string}",
@"offset={integer}",
@"limit={integer}",
@"where={string}",
];
NSString* string = [array componentsJoinedByString:@"&"];
path = [path stringByAppendingFormat:@"?%@", string];
NSLog(@"%@", path);
NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
[_request setHTTPMethod:@"GET"];
// Request headers
[_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
// Request body
[_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
NSURLResponse *response = nil;
NSError *error = nil;
NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];
if (nil != error)
{
NSLog(@"Error: %@", error);
}
else
{
NSError* error = nil;
NSMutableDictionary* json = nil;
NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
NSLog(@"%@", dataString);
if (nil != _connectionData)
{
json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
}
if (error || !json)
{
NSLog(@"Could not parse loaded json with error:%@", error);
}
NSLog(@"%@", json);
_connectionData = nil;
}
[pool drain];
return 0;
}
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';
$request = new Http_Request2('https://luminus.azure-api.net/assessment/{moduleID}/exportToGradebook');
$url = $request->getUrl();
$headers = array(
// Request headers
'Ocp-Apim-Subscription-Key' => '{subscription key}',
);
$request->setHeader($headers);
$parameters = array(
// Request parameters
'sortby' => '{string}',
'offset' => '{integer}',
'limit' => '{integer}',
'where' => '{string}',
);
$url->setQueryVariables($parameters);
$request->setMethod(HTTP_Request2::METHOD_GET);
// Request body
$request->setBody("{body}");
try
{
$response = $request->send();
echo $response->getBody();
}
catch (HttpException $ex)
{
echo $ex;
}
?>
########### Python 2.7 #############
import httplib, urllib, base64
headers = {
# Request headers
'Ocp-Apim-Subscription-Key': '{subscription key}',
}
params = urllib.urlencode({
# Request parameters
'sortby': '{string}',
'offset': '{integer}',
'limit': '{integer}',
'where': '{string}',
})
try:
conn = httplib.HTTPSConnection('luminus.azure-api.net')
conn.request("GET", "/assessment/{moduleID}/exportToGradebook?%s" % params, "{body}", headers)
response = conn.getresponse()
data = response.read()
print(data)
conn.close()
except Exception as e:
print("[Errno {0}] {1}".format(e.errno, e.strerror))
####################################
########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64
headers = {
# Request headers
'Ocp-Apim-Subscription-Key': '{subscription key}',
}
params = urllib.parse.urlencode({
# Request parameters
'sortby': '{string}',
'offset': '{integer}',
'limit': '{integer}',
'where': '{string}',
})
try:
conn = http.client.HTTPSConnection('luminus.azure-api.net')
conn.request("GET", "/assessment/{moduleID}/exportToGradebook?%s" % params, "{body}", headers)
response = conn.getresponse()
data = response.read()
print(data)
conn.close()
except Exception as e:
print("[Errno {0}] {1}".format(e.errno, e.strerror))
####################################
require 'net/http'
uri = URI('https://luminus.azure-api.net/assessment/{moduleID}/exportToGradebook')
query = URI.encode_www_form({
# Request parameters
'sortby' => '{string}',
'offset' => '{integer}',
'limit' => '{integer}',
'where' => '{string}'
})
if query.length > 0
if uri.query && uri.query.length > 0
uri.query += '&' + query
else
uri.query = query
end
end
request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"
response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
http.request(request)
end
puts response.body