@jutge.org/toolkit 4.4.28 → 4.4.31

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.
@@ -89,7 +89,7 @@ Problem statements are stored in LaTeX files named `problem.lang.tex`, where `la
89
89
 
90
90
  ### Demo problem
91
91
 
92
- The clonable `demo` problem contains an example of a problem statement with many features that can be used in your own problem statements; see [demo.tex](demo.tex) for examples and inspiration.
92
+ The clonable `demo` problem contains an example of a problem statement with many features that can be used in your own problem statements; see [demo.tex](../assets/problems/demo/demo.pbm/problem.en.tex) for examples and inspiration.
93
93
 
94
94
  ### Structure
95
95
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jutge.org/toolkit",
3
3
  "description": "Toolkit to prepare problems for Jutge.org",
4
- "version": "4.4.28",
4
+ "version": "4.4.31",
5
5
  "homepage": "https://jutge.org",
6
6
  "author": {
7
7
  "name": "Jutge.org",
package/toolkit/index.ts CHANGED
@@ -18,6 +18,7 @@ import { makeCmd } from './make'
18
18
  import { quizCmd } from './quiz'
19
19
  import { upgradeCmd } from './upgrade'
20
20
  import { uploadCmd } from './upload'
21
+ import { removeCmd } from './remove'
21
22
  import { cmdShare } from './share'
22
23
  import { submitCmd } from './submit'
23
24
  import { askCmd } from './ask'
@@ -36,6 +37,7 @@ program.addHelpText('after', '\nMore documentation:\n https://github.com/jutge-
36
37
 
37
38
  program.addCommand(makeCmd)
38
39
  program.addCommand(uploadCmd)
40
+ program.addCommand(removeCmd)
39
41
  program.addCommand(cmdShare)
40
42
  program.addCommand(cleanCmd)
41
43
  program.addCommand(cloneCmd)
@@ -0,0 +1,18 @@
1
+ import { Command } from '@commander-js/extra-typings'
2
+ import { removeProblemInDirectory } from '../lib/remove'
3
+
4
+ export const removeCmd = new Command('remove')
5
+ .summary('Remove problem from Jutge.org')
6
+ .description(
7
+ `Remove problem from Jutge.org. Only problems that have a few submissions can be removed.
8
+
9
+ Removes the problem from Jutge.org using the problem_nm in problem.yml.
10
+ On success, deletes the problem.yml file. On error, shows the error.`,
11
+ )
12
+
13
+ .option('-d, --directory <directory>', 'problem directory', '.')
14
+ .option('-y, --yes', 'skip confirmation prompt')
15
+
16
+ .action(async ({ directory, yes }) => {
17
+ await removeProblemInDirectory(directory, { yes })
18
+ })