REST Service for POPCORN - ILIAS
alex
5 hours ago b8c5990374e828bea9de4b057709a07d230da6ab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const db = require("../lib/db")
const yargs = require("yargs")
 
/////////////////////////////////////////////////////////////////////////
 
const argv = yargs
   .usage("$0 <ref_id>", "get kurs learning progress using <ref_id>",)
   .option("raw", {
      describe: "print raw learning progress of the sub-objects",
      type: "boolean",
      default: false,
   })
   .strict()
   .parse()
 
run(argv)
   .then(console.log)
   .catch(console.error)
   .finally(process.exit)
 
async function run({ref_id, raw}) {
   const {obj_id} = await db.getObjIdFromRefId(ref_id)
   return await db.getKursLp(obj_id, raw)
}