@stackfactor/client-api 1.1.22 → 1.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/exports.js +2 -0
- package/lib/aiAssistant.js +3 -3
- package/lib/microSkillsQuizes.js +68 -0
- package/package.json +1 -1
package/exports.js
CHANGED
|
@@ -24,6 +24,7 @@ import groups from "./lib/groups.js";
|
|
|
24
24
|
import learningContent from "./lib/learningContent.js";
|
|
25
25
|
import learningPath from "./lib/learningPath.js";
|
|
26
26
|
import logger from "./lib/logger.js";
|
|
27
|
+
import microSkillsQuizes from "./lib/microSkillsQuizes.js";
|
|
27
28
|
import role from "./lib/role.js";
|
|
28
29
|
import roleTemplate from "./lib/roleTemplate.js";
|
|
29
30
|
import skill from "./lib/skill.js";
|
|
@@ -55,6 +56,7 @@ export {
|
|
|
55
56
|
learningContent,
|
|
56
57
|
learningPath,
|
|
57
58
|
logger,
|
|
59
|
+
microSkillsQuizes,
|
|
58
60
|
PERMISSIONS,
|
|
59
61
|
PERMISSION_DESCRIPTIONS,
|
|
60
62
|
RESPONSE_TYPE,
|
package/lib/aiAssistant.js
CHANGED
|
@@ -22,7 +22,7 @@ export const askQuestion = (
|
|
|
22
22
|
};
|
|
23
23
|
let confirmationRequest = client.post(
|
|
24
24
|
"/api/v1/aiassistant/askquestion",
|
|
25
|
-
|
|
25
|
+
data,
|
|
26
26
|
{
|
|
27
27
|
headers: { authorization: token },
|
|
28
28
|
}
|
|
@@ -50,7 +50,7 @@ export const endConversation = (conversationId, token) => {
|
|
|
50
50
|
};
|
|
51
51
|
let confirmationRequest = client.post(
|
|
52
52
|
"/api/v1/aiassistant/endconversation",
|
|
53
|
-
|
|
53
|
+
data,
|
|
54
54
|
{
|
|
55
55
|
headers: { authorization: token },
|
|
56
56
|
}
|
|
@@ -121,7 +121,7 @@ const startConversation = (
|
|
|
121
121
|
}
|
|
122
122
|
let confirmationRequest = client.post(
|
|
123
123
|
"/api/v1/aiassistant/startconversation",
|
|
124
|
-
|
|
124
|
+
data,
|
|
125
125
|
{
|
|
126
126
|
headers: { authorization: token },
|
|
127
127
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { client } from "./axiosClient.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Get responses for a microskill quiz
|
|
5
|
+
* @param {String} learningContentId
|
|
6
|
+
* @param {String} microSkillId
|
|
7
|
+
* @param {String} token
|
|
8
|
+
* @returns {Promise}
|
|
9
|
+
*/
|
|
10
|
+
const getResponses = (learningContentId, microSkillId, token) => {
|
|
11
|
+
return new Promise(function (resolve, reject) {
|
|
12
|
+
let confirmationRequest = client.get(
|
|
13
|
+
`/api/v1/microskillsresponses/${learningContentId}/${microSkillId}`,
|
|
14
|
+
{
|
|
15
|
+
headers: { authorization: token },
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
confirmationRequest
|
|
19
|
+
.then((response) => {
|
|
20
|
+
resolve(response.data);
|
|
21
|
+
})
|
|
22
|
+
.catch((error) => {
|
|
23
|
+
reject(error);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Save responses for a microskill quiz
|
|
30
|
+
* @param {String} learningContentId
|
|
31
|
+
* @param {String} microSkillId
|
|
32
|
+
* @param {Array<Object>} responses
|
|
33
|
+
* @param {String} token Authorization token
|
|
34
|
+
* @returns {Promise}
|
|
35
|
+
*/
|
|
36
|
+
export const saveResponses = (
|
|
37
|
+
learningContentId,
|
|
38
|
+
microSkillId,
|
|
39
|
+
responses,
|
|
40
|
+
token
|
|
41
|
+
) => {
|
|
42
|
+
return new Promise(function (resolve, reject) {
|
|
43
|
+
let data = {
|
|
44
|
+
responses: responses,
|
|
45
|
+
};
|
|
46
|
+
let confirmationRequest = client.post(
|
|
47
|
+
`/api/v1/microskillsresponses/${learningContentId}/${microSkillId}`,
|
|
48
|
+
data,
|
|
49
|
+
{
|
|
50
|
+
headers: { authorization: token },
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
confirmationRequest
|
|
54
|
+
.then((response) => {
|
|
55
|
+
resolve(response.data);
|
|
56
|
+
})
|
|
57
|
+
.catch((error) => {
|
|
58
|
+
reject(error);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const microSkillsQuizes = {
|
|
64
|
+
getResponses,
|
|
65
|
+
saveResponses,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default microSkillsQuizes;
|