canvaslms-cli 1.3.1 → 1.3.3
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/commands/submit.js +19 -4
- package/package.json +1 -1
- package/src/index.js +1 -1
package/commands/submit.js
CHANGED
|
@@ -46,8 +46,15 @@ async function submitAssignment(options) {
|
|
|
46
46
|
const starIcon = course.is_favorite ? '⭐ ' : '';
|
|
47
47
|
console.log(`${index + 1}. ${starIcon}${course.name}`);
|
|
48
48
|
});
|
|
49
|
+
const courseChoice = await askQuestion(rl, '\nEnter course number: ');
|
|
50
|
+
|
|
51
|
+
// Handle empty input
|
|
52
|
+
if (!courseChoice.trim()) {
|
|
53
|
+
console.log('No course selected. Exiting...');
|
|
54
|
+
rl.close();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
49
57
|
|
|
50
|
-
const courseChoice = await askQuestion(rl, '\nEnter course number: ');
|
|
51
58
|
const courseIndex = parseInt(courseChoice) - 1;
|
|
52
59
|
|
|
53
60
|
if (courseIndex < 0 || courseIndex >= starredCourses.length) {
|
|
@@ -123,14 +130,22 @@ async function submitAssignment(options) {
|
|
|
123
130
|
} else if (assignment.points_possible) {
|
|
124
131
|
gradeDisplay = ` | Grade: –/${assignment.points_possible}`;
|
|
125
132
|
}
|
|
126
|
-
|
|
127
|
-
console.log(`${index + 1}. ${submissionIcon} ${assignment.name} ${submitted}`);
|
|
133
|
+
console.log(`${index + 1}. ${submissionIcon} ${assignment.name} ${submitted}`);
|
|
128
134
|
console.log(` Due: ${dueDate} | Points: ${assignment.points_possible || 'N/A'}${gradeDisplay}`);
|
|
129
135
|
if (!canSubmitFiles) {
|
|
130
136
|
console.log(` 📋 Note: This assignment doesn't accept file uploads`);
|
|
131
137
|
}
|
|
132
138
|
});
|
|
133
|
-
const
|
|
139
|
+
const assignmentChoice = await askQuestion(rl, '\nEnter assignment number: ');
|
|
140
|
+
|
|
141
|
+
// Handle empty input
|
|
142
|
+
if (!assignmentChoice.trim()) {
|
|
143
|
+
console.log('No assignment selected. Exiting...');
|
|
144
|
+
rl.close();
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const assignmentIndex = parseInt(assignmentChoice) - 1;
|
|
134
149
|
|
|
135
150
|
if (assignmentIndex < 0 || assignmentIndex >= assignments.length) {
|
|
136
151
|
console.log('Invalid assignment selection.');
|
package/package.json
CHANGED