Generate Demo Fixture
How to generate a demo fixture file
Download a current database dump from RadGrad
Login to RadGrad as administrator. Go to the Manage Database Page:
Click the Dump Database
button. RadGrad will create a zip file containing all the collections and download it. Unzip the file and copy/move the JSON file to the scripts/radgrad-db/
directory. This directory is .gitignored so the student data will not be shared.
Edit the "create-demo-fixture": "npm run tsc && node js/fixture-generator/demo-fixture-generator.js radgrad-db/2021-05-18-10-14-34.json data/demo-fixture-generator-config.json"
script in scripts/package.json
to use the downloaded database.
demo-fixture-generator-config.json
file (optional)
Edit the The demo-fixture-generator-config.json
file defines five students:
abi@hawaii.edu
Abi is a sophomore who has planned her Junior year.alfred@hawaii.edu
Alfred is a senior with one academic term left.betty@hawaii.edu
Betty is a junior with about a full year left.charley@hawaii.edu
Charley is a blank student with no interests or career goals.dora@hawaii.edu
Dora is a Level 5 student.ella@hawaii.edu
Ella is an alumni.
You can edit the data/demo-fixture-generator-config.json
file if you want to change the students or their plans.
The demo-fixture-generator-config.json
file has two parts studentProfiles
and studentPlans
.
The
The StudentProfileCollection
defines five student profiles. Setting up their interests, career goals, and their sharing preferences.
The studentPlans
is an array of plans for each student. The plan has four components
username
the name of the student.courses
an array of course information.{ "slug": "ics_111", "academicYearOffset": -2, "termNum": 0, "grade": "A" },
The
slug
is the course slug. TheacademicYearOffset
is the number of years from the current year this course is in the plan. ThetermNum
is the term in the year. For semester base systems 0 = 'Fall', 1 = 'Spring', 2 = 'Summer'. For quarter based systems 0 = 'Fall', 1 = 'Winter', 2 = 'Spring', 3 = 'Summer'. Thegrade
is either the earned grade for courses in the past or the planned grade for future courses.opportunities
an array of opportunity information.{ "slug": "acm-manoa", "academicYearOffset": -1, "termNum": 1, "verified": true },
The
slug
is the opportunity slug. TheacademicYearOffset
andtermNum
are the same as courses.verified
indicates if the opportunity was verified.reviews
an array of review information.{ "academicYearOffset": -1, "termNum": 1, "reviewee": "ics_111", "rating": 5, "comments": "Lecture can be boring. Tests can be tricky... so pay attention and read the questions and answers twice before answering them. Lab is were all the fun is. If you're not an ICS major or don't like programing, you probably shouldn't take the course." },
The
academicYearOffset
andtermNum
are the same as above. Thereviewee
is the slug of the course or opportunity being reviewed. Therating
is the rating andcomments
are the student's comments about the course or opportunity.
Run the script
Cd into the scripts
directory and run the script.
The new demo fixture is created in the scripts/data
directory.