@sybelblue/prairielearn-navigator 1.2.0 → 1.2.2

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/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # @sybelblue/prairielearn-navigator
2
2
 
3
3
  Checks a [PrairieLearn](https://www.prairielearn.com) course for problems that
4
- should fail CI. These are the same diagnostics the
4
+ should fail CI, and bulk-updates semantic QID references. The diagnostics are
5
+ the same ones the
5
6
  [PrairieLearn Navigator](https://github.com/SybelBlue/prairielearn-navigator)
6
7
  VS Code extension shows. `check` looks at every course JSON file
7
8
  (`infoCourse.json`, `infoCourseInstance.json`, `infoAssessment.json`, the
@@ -155,6 +156,41 @@ the pull request. Run it from the repository root so annotation paths resolve:
155
156
 
156
157
  Requires Node.js 22 or newer.
157
158
 
159
+ ## Rename QIDs
160
+
161
+ `rename-qids` bulk-updates semantic references to one or more question IDs:
162
+ assessment question IDs, assessment alternative IDs, and question `template`
163
+ values. It does not replace matching prose or comments.
164
+
165
+ ```sh
166
+ npx -y @sybelblue/prairielearn-navigator rename-qids [options] \
167
+ <old-qid> <new-qid> [<old-qid> <new-qid> ...]
168
+ ```
169
+
170
+ | Option | |
171
+ | --- | --- |
172
+ | `--course <path>` | Course directory or a path inside one (default: `.`) |
173
+ | `--write` | Apply the planned edits. Without this flag, the command only previews them. |
174
+
175
+ For example:
176
+
177
+ ```sh
178
+ # Preview four QID changes made necessary by a folder reorganization
179
+ npx -y @sybelblue/prairielearn-navigator rename-qids \
180
+ algebra/add algebra/basics/add \
181
+ algebra/subtract algebra/basics/subtract
182
+
183
+ # Apply the same reference edits
184
+ npx -y @sybelblue/prairielearn-navigator rename-qids --write \
185
+ algebra/add algebra/basics/add \
186
+ algebra/subtract algebra/basics/subtract
187
+ ```
188
+
189
+ The command changes references only. Move the question directories separately;
190
+ the command can run before or after that move and does not require either QID's
191
+ directory to exist. Automatic move detection is available only for moves made
192
+ through the PrairieLearn Navigator VS Code extension.
193
+
158
194
  ## Library API
159
195
 
160
196
  The package also exposes a typed, headless resolver for tools that need the