Skip to content

Commit

Permalink
Merge branch 'master' into 15954_archive
Browse files Browse the repository at this point in the history
  • Loading branch information
destitutus committed Sep 13, 2024
2 parents 2134cb6 + 1c1b2df commit 501fdd0
Show file tree
Hide file tree
Showing 50 changed files with 706 additions and 6 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,5 @@ dist
.tern-port

/lib
examples

*.iml
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ codio.v1.setDomain('codio.com') // codio.co.uk for UK domain, codio.com is defau

Follow https://docs.codio.com/develop/develop/ide/tools/ghapi.html#api-integration-information to generate
API keys.
## Requirements
- Nodejs
- zstd

## How to build
- Run `yarn`
- Run `yarn build`


## Authentication
```
Expand Down
12 changes: 12 additions & 0 deletions examples/assessment/find.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { codio, auth } = require('../auth.js')
const { libraryId, libraryName } = require('../data.js')

async function main() {
await auth
const search = {"Assessment Type": "Advanced Code Test"}
const result = await codio.assessment.find(libraryId, search)
console.log(result)

}

main()
14 changes: 14 additions & 0 deletions examples/assessment/fromCodioProject.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { codio, auth } = require('../auth.js')
const { libraryId, libraryName, projectPath } = require('../data.js')

async function main() {

await auth

const result = await codio.assessment.fromCodioProject(libraryId, projectPath)
// const result = await codio.assessment.fromCodioProject(libraryName, projectPath)
console.log(result)

}

main()
10 changes: 10 additions & 0 deletions examples/assessment/listLibraries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const { codio, auth } = require('../auth.js')

async function main() {
await auth
const result = await codio.assessment.listLibraries()
console.log(result)

}

main()
11 changes: 11 additions & 0 deletions examples/assignment/getSettings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { codio, auth } = require('../auth.js')
const { assignmentId, courseId } = require('../data.js')

async function main() {
await auth

const result = await codio.assignment.getSettings(courseId, assignmentId)
console.log(result)
}

main()
14 changes: 14 additions & 0 deletions examples/assignment/publish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { codio, auth } = require('../auth.js')
const { assignmentId, courseId, projectPath, stackVersionId } = require('../data.js')

async function main() {
await auth

changelog = 'test'
data = {changelog: changelog, stack: `${stackVersionId}:latest`, withStackUpdate: true}

const result = await codio.assignment.publish(courseId, assignmentId, projectPath, data)

}

main()
13 changes: 13 additions & 0 deletions examples/assignment/publishArchive.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const { codio, auth } = require('../auth.js')
const { assignmentId, courseId, stackVersionId, archivePath } = require('../data.js')

async function main() {
await auth

changelog = 'changelog value'
data = {changelog: changelog, stack: `${stackVersionId}:latest`, withStackUpdate: true}

const result = await codio.assignment.publishArchive(courseId, assignmentId, archivePath, data)
}

main()
14 changes: 14 additions & 0 deletions examples/assignment/reducePublish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { codio, auth } = require('../auth.js')
const { assignmentId, courseId, stackVersionId, projectPath, yamlMapDir } = require('../data.js')

async function main() {
await auth

changelog = 'changelog value'
data = {changelog: changelog, stack: `${stackVersionId}:latest`, withStackUpdate: true}

const result = await codio.assignment.reducePublish(courseId, projectPath, yamlMapDir, data)

}

main()
29 changes: 29 additions & 0 deletions examples/assignment/updateSettings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const { codio, auth } = require('../auth.js')
const { assignmentId, courseId } = require('../data.js')

async function main() {
await auth

const result = await codio.assignment.updateSettings(courseId, assignmentId, {
enableResetAssignmentByStudent: true,
disableDownloadByStudent: true,
// visibilityOnDisabled: 'NO_ACCESS',
visibilityOnDisabled: 'READ_ONLY',
// visibilityOnCompleted: 'NO_ACCESS',
// visibilityOnCompleted: 'READ_ONLY',
visibilityOnCompleted: 'READ_ONLY_RESUBMIT',
// startTime: null,
startTime: new Date('2024-05-01T13:59:59+01:00'),
// endTime: null,
// endTime: new Date('2022-05-20T13:59:59+01:00'),
endTime: new Date('2025-07-31T13:59:59Z'),
// action: 'DISABLE',
// action: 'COMPLETE',
action: 'DISABLE_AND_COMPLETE'

})
console.log(result)

}

main()
15 changes: 15 additions & 0 deletions examples/assignment/updateStudentTimeExtension.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { codio, auth } = require('../auth.js')
const { assignmentId, courseId, studentId } = require('../data.js')

async function main() {
await auth

const result = await codio.assignment.updateStudentTimeExtension(courseId, assignmentId, studentId, {
extendedDeadline: 55,
extendedTimeLimit: '22'
})
console.log(result)

}

main()
7 changes: 7 additions & 0 deletions examples/auth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const library = require('../lib')
const codio = library.default.v1

codio.setDomain('codio.com') // codio.co.uk for UK domain
const auth = codio.auth(`your client_id`, `your client_secret`)

module.exports = { codio, auth }
12 changes: 12 additions & 0 deletions examples/course/assignmentStudentsProgress.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { codio, auth } = require('../auth.js')
const { assignmentId, courseId } = require('../data.js')

async function main() {
await auth

const result = await codio.course.assignmentStudentsProgress(courseId, assignmentId)
console.log(result)

}

main()
11 changes: 11 additions & 0 deletions examples/course/createSourceExport.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { codio, auth } = require('../auth.js')
const { courseId } = require('../data.js')

async function main() {
await auth

const result = await codio.course.createSourceExport(courseId)
console.log(result)
}

main()
11 changes: 11 additions & 0 deletions examples/course/createWorkExport.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { codio, auth } = require('../auth.js')
const { courseId } = require('../data.js')

async function main() {
await auth

const result = await codio.course.createWorkExport(courseId)
console.log(result)
}

main()
12 changes: 12 additions & 0 deletions examples/course/downloadAssessmentData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { codio, auth } = require('../auth.js')
const { assignmentId, courseId } = require('../data.js')

async function main() {
await auth
const filePath = '/home/codio/workspace/assessmentData.csv'

const result = await codio.course.downloadAssessmentData(courseId, assignmentId, filePath)

}

main()
12 changes: 12 additions & 0 deletions examples/course/downloadAssignmentCSV.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { codio, auth } = require('../auth.js')
const { assignmentId, courseId } = require('../data.js')

async function main() {
await auth
const filePath = '/home/codio/workspace/assignment.csv'

const result = await codio.course.downloadAssignmentCSV(courseId, assignmentId, filePath)

}

main()
12 changes: 12 additions & 0 deletions examples/course/downloadSourceExport.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { codio, auth } = require('../auth.js')
const { courseId } = require('../data.js')

async function main() {
await auth
const filePath = '/home/codio/workspace/export_source.zip'

const result = await codio.course.downloadSourceExport(courseId, filePath)

}

main()
12 changes: 12 additions & 0 deletions examples/course/downloadStudentAssignment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { codio, auth } = require('../auth.js')
const { assignmentId, courseId, studentId } = require('../data.js')

async function main() {
await auth
const filePath = '/home/codio/workspace/file.csv'

const result = await codio.course.downloadStudentAssignment(courseId, assignmentId, studentId, filePath)

}

main()
12 changes: 12 additions & 0 deletions examples/course/downloadStudentCSV.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { codio, auth } = require('../auth.js')
const { courseId, studentId } = require('../data.js')

async function main() {
await auth
const filePath = '/home/codio/workspace/student.csv'

const result = await codio.course.downloadStudentCSV(courseId, studentId, filePath)

}

main()
12 changes: 12 additions & 0 deletions examples/course/downloadWorkExport.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { codio, auth } = require('../auth.js')
const { assignmentId, courseId, studentId } = require('../data.js')

async function main() {
await auth
const filePath = '/home/codio/workspace/export_work.zip'

const result = await codio.course.downloadWorkExport(courseId, filePath)

}

main()
11 changes: 11 additions & 0 deletions examples/course/exportAssessmentData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { codio, auth } = require('../auth.js')
const { assignmentId, courseId } = require('../data.js')

async function main() {
await auth

const result = await codio.course.exportAssessmentData(courseId, assignmentId)
console.log(result)
}

main()
11 changes: 11 additions & 0 deletions examples/course/exportAssignmentCSV.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { codio, auth } = require('../auth.js')
const { assignmentId, courseId } = require('../data.js')

async function main() {
await auth

const result = await codio.course.exportAssignmentCSV(courseId, assignmentId)
console.log(result)
}

main()
11 changes: 11 additions & 0 deletions examples/course/exportStudentAssignment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { codio, auth } = require('../auth.js')
const { assignmentId, courseId, studentId } = require('../data.js')

async function main() {
await auth

const result = await codio.course.exportStudentAssignment(courseId, assignmentId, studentId)
console.log(result)
}

main()
11 changes: 11 additions & 0 deletions examples/course/exportStudentCSV.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { codio, auth } = require('../auth.js')
const { courseId, studentId } = require('../data.js')

async function main() {
await auth

const result = await codio.course.exportStudentCSV(courseId, studentId)
console.log(result)
}

main()
12 changes: 12 additions & 0 deletions examples/course/findByName.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { codio, auth } = require('../auth.js')
const { courseName} = require('../data.js')

async function main() {
await auth

const result = await codio.course.findByName(courseName, true)
console.log(result)

}

main()
12 changes: 12 additions & 0 deletions examples/course/getSourceExportProgress.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { codio, auth } = require('../auth.js')
const { courseId } = require('../data.js')

async function main() {
await auth
const taskId = 'your task id'

const result = await codio.course.getSourceExportProgress(courseId, taskId)
console.log(result)
}

main()
11 changes: 11 additions & 0 deletions examples/course/getSourceExports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { codio, auth } = require('../auth.js')
const { courseId } = require('../data.js')

async function main() {
await auth

const result = await codio.course.getSourceExports(courseId)
console.log(result)
}

main()
12 changes: 12 additions & 0 deletions examples/course/getStudents.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { codio, auth } = require('../auth.js')
const { courseId } = require('../data.js')

async function main() {
await auth

const result = await codio.course.getStudents(courseId)
console.log(result)

}

main()
12 changes: 12 additions & 0 deletions examples/course/getTeachers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { codio, auth } = require('../auth.js')
const { courseId } = require('../data.js')

async function main() {
await auth

const result = await codio.course.getTeachers(courseId)
console.log(result)

}

main()
Loading

0 comments on commit 501fdd0

Please sign in to comment.