npms-exam-kit 2.0.0 → 2.0.1

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.
Files changed (2) hide show
  1. package/bin/exam-kit.js +7 -7
  2. package/package.json +1 -1
package/bin/exam-kit.js CHANGED
@@ -129,13 +129,13 @@ function buildChecklist(baseDir, projectType) {
129
129
  auto: () => read(b('database.sql')).includes('CREATE TABLE') && read(b('database.sql')).toLowerCase().includes('user') ? 'PASS' : 'FAIL',
130
130
  guide: 'Add CREATE TABLE Users (UserID INT PK, Username, Password)' },
131
131
  { id: 'C31', cat: 'Process (50%)', label: `${projectType === 'SIMS' ? 'Spare_Part' : 'Services'} table created`,
132
- auto: () => { const s = read(b('database.sql')).toLowerCase(); return projectType === 'SIMS' ? s.includes('spare_part') : s.includes('services'); } ? 'PASS' : 'FAIL',
132
+ auto: () => { const s = read(b('database.sql')).toLowerCase(); return projectType === 'SIMS' ? (s.includes('spare_part') ? 'PASS' : 'FAIL') : (s.includes('services') ? 'PASS' : 'FAIL'); },
133
133
  guide: projectType === 'SIMS' ? 'Add CREATE TABLE Spare_Part (SparePartID PK, Name, Category, Quantity, UnitPrice, TotalPrice)' : 'Add CREATE TABLE Services (ServiceCode PK, ServiceName, ServicePrice)' },
134
134
  { id: 'C32', cat: 'Process (50%)', label: `${projectType === 'SIMS' ? 'Stock_Out' : 'ServiceRecord'} table created`,
135
- auto: () => { const s = read(b('database.sql')).toLowerCase(); return projectType === 'SIMS' ? s.includes('stock_out') : s.includes('servicerecord'); } ? 'PASS' : 'FAIL',
135
+ auto: () => { const s = read(b('database.sql')).toLowerCase(); return projectType === 'SIMS' ? (s.includes('stock_out') ? 'PASS' : 'FAIL') : (s.includes('servicerecord') ? 'PASS' : 'FAIL'); },
136
136
  guide: projectType === 'SIMS' ? 'Add CREATE TABLE Stock_Out (StockOutID PK, SparePartID FK, StockOutQuantity, StockOutUnitPrice, StockOutTotalPrice, StockOutDate)' : 'Add CREATE TABLE ServiceRecord (RecordNumber PK, ServiceDate, PlateNumber FK, ServiceCode FK)' },
137
137
  { id: 'C33', cat: 'Process (50%)', label: `${projectType === 'SIMS' ? 'Stock_In' : 'Payment'} table created`,
138
- auto: () => { const s = read(b('database.sql')).toLowerCase(); return projectType === 'SIMS' ? s.includes('stock_in') : s.includes('payment'); } ? 'PASS' : 'FAIL',
138
+ auto: () => { const s = read(b('database.sql')).toLowerCase(); return projectType === 'SIMS' ? (s.includes('stock_in') ? 'PASS' : 'FAIL') : (s.includes('payment') ? 'PASS' : 'FAIL'); },
139
139
  guide: projectType === 'SIMS' ? 'Add CREATE TABLE Stock_In (StockInID PK, SparePartID FK, StockInQuantity, StockInDate)' : 'Add CREATE TABLE Payment (PaymentNumber PK, AmountPaid, PaymentDate, RecordNumber FK, UserID FK)' },
140
140
  { id: 'C34', cat: 'Process (50%)', label: 'Primary keys applied in all tables',
141
141
  auto: () => read(b('database.sql')).includes('PRIMARY KEY') ? 'PASS' : 'FAIL',
@@ -144,7 +144,7 @@ function buildChecklist(baseDir, projectType) {
144
144
  auto: () => read(b('database.sql')).includes('FOREIGN KEY') ? 'PASS' : 'FAIL',
145
145
  guide: `Add FOREIGN KEY references in ${projectType === 'SIMS' ? 'Stock_In (SparePartID -> Spare_Part)' : 'ServiceRecord (PlateNumber -> Car, ServiceCode -> Services)'}` },
146
146
  { id: 'C36', cat: 'Process (50%)', label: `FKs applied in ${projectType === 'SIMS' ? 'Stock_Out' : 'Payment'}`,
147
- auto: () => { const s = read(b('database.sql')); return s.includes('FOREIGN KEY'); } ? 'PASS' : 'FAIL',
147
+ auto: () => { const s = read(b('database.sql')); return s.includes('FOREIGN KEY') ? 'PASS' : 'FAIL'; },
148
148
  guide: `Add FOREIGN KEY in ${projectType === 'SIMS' ? 'Stock_Out' : 'Payment'}` },
149
149
  { id: 'C37', cat: 'Process (50%)', label: 'React function component declared',
150
150
  auto: () => read(src('App.jsx')).includes('function') || read(src('App.jsx')).includes('=>') || read(src('App.jsx')).includes('export default function') ? 'PASS' : 'FAIL',
@@ -165,7 +165,7 @@ function buildChecklist(baseDir, projectType) {
165
165
  auto: () => existsSync(src('pages/Login.jsx')) ? 'PASS' : 'FAIL',
166
166
  guide: 'Create src/pages/Login.jsx with username/password inputs' },
167
167
  { id: 'C43', cat: 'Process (50%)', label: `${projectType === 'SIMS' ? 'Spare_Part' : 'Cars/Services'} form created`,
168
- auto: () => { const p = inDir(src('pages')); return projectType === 'SIMS' ? p.some(f => f.toLowerCase().includes('spare')) : (p.some(f => f.toLowerCase().includes('car')) && p.some(f => f.toLowerCase().includes('service'))); } ? 'PASS' : 'FAIL',
168
+ auto: () => { const p = inDir(src('pages')); return projectType === 'SIMS' ? (p.some(f => f.toLowerCase().includes('spare')) ? 'PASS' : 'FAIL') : (p.some(f => f.toLowerCase().includes('car')) && p.some(f => f.toLowerCase().includes('service')) ? 'PASS' : 'FAIL'); },
169
169
  guide: projectType === 'SIMS' ? 'Create SparePart.jsx with fields: Name, Category, Quantity, UnitPrice' : 'Create Cars.jsx and Services.jsx' },
170
170
  { id: 'C44', cat: 'Process (50%)', label: `${projectType === 'SIMS' ? 'Stock_In' : 'ServiceRecord'} form created`,
171
171
  auto: () => inDir(src('pages')).some(f => f.toLowerCase().includes(projectType === 'SIMS' ? 'stockin' : 'record')) ? 'PASS' : 'FAIL',
@@ -251,10 +251,10 @@ function buildChecklist(baseDir, projectType) {
251
251
  auto: () => { const r = read(be('routes/stockOut.js')) || read(be('routes/payments.js')); return r.includes('return res.status(400)') ? 'PASS' : 'FAIL';
252
252
  }, guide: 'Add validation checks: if (!field) return res.status(400).json({error: "Field required"})' },
253
253
  { id: 'C72', cat: 'Product (30%)', label: 'Form submission saves data to DB',
254
- auto: () => { const r = inDir(be('routes')); return r.some(f => read(be('routes/'+f)).includes('INSERT INTO') || read(be('routes/'+f)).includes('res.status(201)')); } ? 'PASS' : 'FAIL',
254
+ auto: () => { const r = inDir(be('routes')); return r.some(f => read(be('routes/'+f)).includes('INSERT INTO') || read(be('routes/'+f)).includes('res.status(201)')) ? 'PASS' : 'FAIL'; },
255
255
  guide: 'Use INSERT INTO SQL statements in POST route handlers' },
256
256
  { id: 'C73', cat: 'Product (30%)', label: 'Data retrieval displays records',
257
- auto: () => { const r = inDir(be('routes')); return r.some(f => read(be('routes/'+f)).includes('SELECT') && read(be('routes/'+f)).includes('router.get')); } ? 'PASS' : 'FAIL',
257
+ auto: () => { const r = inDir(be('routes')); return r.some(f => read(be('routes/'+f)).includes('SELECT') && read(be('routes/'+f)).includes('router.get')) ? 'PASS' : 'FAIL'; },
258
258
  guide: 'Use SELECT queries in GET route handlers and return JSON' },
259
259
  { id: 'C74', cat: 'Product (30%)', label: 'Update functionality works (PUT)',
260
260
  auto: () => inDir(be('routes')).some(f => read(be('routes/'+f)).includes('UPDATE') && read(be('routes/'+f)).includes('router.put')) ? 'PASS' : 'FAIL',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npms-exam-kit",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "NESA National Practical Exam Projects Installer - SIMS & CRPMS",
5
5
  "bin": "bin/exam-kit.js",
6
6
  "keywords": [