@speakableio/core 0.1.18 → 0.1.19
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/dist/index.js +10 -5
- package/dist/index.mjs +10 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1371,6 +1371,7 @@ var getScore = withErrorHandler(_getScore, "getScore");
|
|
|
1371
1371
|
|
|
1372
1372
|
// src/domains/assignment/utils/calculateScoreAndProgress.ts
|
|
1373
1373
|
var calculateScoreAndProgress = (scores, cardsList, weights) => {
|
|
1374
|
+
console.log("calculateScoreAndProgress", scores, cardsList, weights);
|
|
1374
1375
|
const totalSetPoints = cardsList.reduce((acc, cardId) => {
|
|
1375
1376
|
acc += _optionalChain([weights, 'optionalAccess', _32 => _32[cardId]]) || 1;
|
|
1376
1377
|
return acc;
|
|
@@ -1481,7 +1482,7 @@ async function clearScore(params) {
|
|
|
1481
1482
|
|
|
1482
1483
|
// src/domains/assignment/services/submit-assignment-score.service.ts
|
|
1483
1484
|
|
|
1484
|
-
async function
|
|
1485
|
+
async function _submitAssignmentScore({
|
|
1485
1486
|
cardIds,
|
|
1486
1487
|
assignment,
|
|
1487
1488
|
setWeights,
|
|
@@ -1513,6 +1514,10 @@ async function submitAssignmentScore({
|
|
|
1513
1514
|
await api.updateDoc(path, { ...fieldsUpdated });
|
|
1514
1515
|
return { success: true, fieldsUpdated };
|
|
1515
1516
|
}
|
|
1517
|
+
var submitAssignmentScore = withErrorHandler(
|
|
1518
|
+
_submitAssignmentScore,
|
|
1519
|
+
"submitAssignmentScore"
|
|
1520
|
+
);
|
|
1516
1521
|
async function handleAssessment(assignment, userId, cardIds, setWeights, fieldsUpdated, studentName) {
|
|
1517
1522
|
const path = refsAssignmentFiresotre.assignmentScores({ id: assignment.id, userId });
|
|
1518
1523
|
const response = await api.getDoc(path);
|
|
@@ -1532,7 +1537,7 @@ async function handleAssessment(assignment, userId, cardIds, setWeights, fieldsU
|
|
|
1532
1537
|
return { success: true, fieldsUpdated };
|
|
1533
1538
|
}
|
|
1534
1539
|
async function handleCourseAssignment(assignment, userId) {
|
|
1535
|
-
|
|
1540
|
+
await _optionalChain([SpeakableFirebaseFunctions, 'optionalAccess', _51 => _51.submitAssignmentV2, 'optionalCall', _52 => _52({
|
|
1536
1541
|
assignmentId: assignment.id,
|
|
1537
1542
|
userId
|
|
1538
1543
|
})]);
|
|
@@ -1622,11 +1627,11 @@ function useUpdateCardScore({
|
|
|
1622
1627
|
const mutation = _reactquery.useMutation.call(void 0, {
|
|
1623
1628
|
mutationFn: async ({ cardId, cardScore }) => {
|
|
1624
1629
|
const previousScores = queryClient.getQueryData(queryKey);
|
|
1625
|
-
console.log({
|
|
1626
|
-
previousScores,
|
|
1630
|
+
console.log("useUpdateCardScore", {
|
|
1631
|
+
previousScores: _nullishCoalesce(previousScores, () => ( {})),
|
|
1627
1632
|
cardId,
|
|
1628
1633
|
cardScore,
|
|
1629
|
-
|
|
1634
|
+
activityId
|
|
1630
1635
|
});
|
|
1631
1636
|
const { progress, score, newScoreUpdated, updatedCardScore } = getScoreUpdated({
|
|
1632
1637
|
previousScores: _nullishCoalesce(previousScores, () => ( {})),
|
package/dist/index.mjs
CHANGED
|
@@ -1371,6 +1371,7 @@ var getScore = withErrorHandler(_getScore, "getScore");
|
|
|
1371
1371
|
|
|
1372
1372
|
// src/domains/assignment/utils/calculateScoreAndProgress.ts
|
|
1373
1373
|
var calculateScoreAndProgress = (scores, cardsList, weights) => {
|
|
1374
|
+
console.log("calculateScoreAndProgress", scores, cardsList, weights);
|
|
1374
1375
|
const totalSetPoints = cardsList.reduce((acc, cardId) => {
|
|
1375
1376
|
acc += weights?.[cardId] || 1;
|
|
1376
1377
|
return acc;
|
|
@@ -1481,7 +1482,7 @@ async function clearScore(params) {
|
|
|
1481
1482
|
|
|
1482
1483
|
// src/domains/assignment/services/submit-assignment-score.service.ts
|
|
1483
1484
|
import dayjs4 from "dayjs";
|
|
1484
|
-
async function
|
|
1485
|
+
async function _submitAssignmentScore({
|
|
1485
1486
|
cardIds,
|
|
1486
1487
|
assignment,
|
|
1487
1488
|
setWeights,
|
|
@@ -1513,6 +1514,10 @@ async function submitAssignmentScore({
|
|
|
1513
1514
|
await api.updateDoc(path, { ...fieldsUpdated });
|
|
1514
1515
|
return { success: true, fieldsUpdated };
|
|
1515
1516
|
}
|
|
1517
|
+
var submitAssignmentScore = withErrorHandler(
|
|
1518
|
+
_submitAssignmentScore,
|
|
1519
|
+
"submitAssignmentScore"
|
|
1520
|
+
);
|
|
1516
1521
|
async function handleAssessment(assignment, userId, cardIds, setWeights, fieldsUpdated, studentName) {
|
|
1517
1522
|
const path = refsAssignmentFiresotre.assignmentScores({ id: assignment.id, userId });
|
|
1518
1523
|
const response = await api.getDoc(path);
|
|
@@ -1532,7 +1537,7 @@ async function handleAssessment(assignment, userId, cardIds, setWeights, fieldsU
|
|
|
1532
1537
|
return { success: true, fieldsUpdated };
|
|
1533
1538
|
}
|
|
1534
1539
|
async function handleCourseAssignment(assignment, userId) {
|
|
1535
|
-
|
|
1540
|
+
await SpeakableFirebaseFunctions?.submitAssignmentV2?.({
|
|
1536
1541
|
assignmentId: assignment.id,
|
|
1537
1542
|
userId
|
|
1538
1543
|
});
|
|
@@ -1622,11 +1627,11 @@ function useUpdateCardScore({
|
|
|
1622
1627
|
const mutation = useMutation2({
|
|
1623
1628
|
mutationFn: async ({ cardId, cardScore }) => {
|
|
1624
1629
|
const previousScores = queryClient.getQueryData(queryKey);
|
|
1625
|
-
console.log({
|
|
1626
|
-
previousScores,
|
|
1630
|
+
console.log("useUpdateCardScore", {
|
|
1631
|
+
previousScores: previousScores ?? {},
|
|
1627
1632
|
cardId,
|
|
1628
1633
|
cardScore,
|
|
1629
|
-
|
|
1634
|
+
activityId
|
|
1630
1635
|
});
|
|
1631
1636
|
const { progress, score, newScoreUpdated, updatedCardScore } = getScoreUpdated({
|
|
1632
1637
|
previousScores: previousScores ?? {},
|