v4.2.0
Changes to how tossups and bonuses are represented in the MongoDB database. This release also adds pages to display user statistics in graphs, more singleplayer code organization (and better code organization in general), and some minor bug fixes.
Frontend
- Fix category selection bug in database (#198)
- Fix issues with packet numbers at the end of a set
- Fix geoword issue where ties would result in both players getting a tossup (in
/geoword/compare
) - Add graphs showing individual stats (#192)
- Update list of contributors in about page
- Fix multiplayer bug where tossup is undefined on connection
Backend
- By default, don't test timing functions when running
npm test
- Test random question functions in correctness test (makes sure they run without throwing errors)
- Add routes and database functions to show individual stats (#192)
- Routes:
/user/stats/tossup-graph
,/user/stats/bonus-graph
,/auth/user-stats/tossup-graph
,/auth/user-stats/bonus-graph
)
- Routes:
- Fix bug where
setName
parameter in stats would never match anything - Reorganize sending email to
server/email.js
file - Use
Date.now()
instead of whatever monstrosities I was using before - Don't authenticate
nodeMailer
if no API key is provided- This should make it easy for others to run the program locally, as previously they would run into authentication issues
Database
- A new packets collection exists. The
_id
of a packet corresponds to the original_id
of the packets originally stored as embedded documents in the sets collection. In addition, packet documents no longer store an array of the tossups and bonuses they contain, as that data was previous unreliable and inaccurate. Set documents no longer store the packets they contain, but packet documents do store the _id of the sets they contain. - The
set
parameter on tossup and bonus documents now contains an embedded document. The previous value, the_id
of the set that the tossup/bonus belonged to, is now stored in theset_id
field. This embedded document contains the following fields:
set: {
_id: ObjectId,
name: string,
year: number,
}
- The
packet
parameter on tossup and bonus documents now contains an embedded document. The previous value, the_id
of the set that the tossup/bonus belonged to, is now stored in thepacket_id
field. This embedded document contains the following fields:
packet: {
_id: ObjectId,
name: string,
number: number,
}
- The
set_id
,packet_id
,setYear
,setName
,packetName
, andpacketNumber
fields are deprecated and will be removed in a future release. As a reminder, thetype
field is still deprecated.- As an alternative, use the fields in the embedded documents stored in the
set
andpacket
fields. In MongoDB methods, these fields can be accessed by using quotes and dot notation, such asset.year
. - If there is a v5.0.0, these fields will be removed by then. Otherwise, warning will be provided when these fields are removed.
- As an alternative, use the fields in the embedded documents stored in the
- Similar changes were made to the
packet
field of geoword documents, but since no external API relies on these (or should), this isn't given as much attention. - For details about code changes, see #203
Answer Checking
- Fix bug where
extractKeyWords
would not extract all key words, allowing some insufficient answers to be accepted - Add typo correction for "contentinal" -> "continental"
Geoword
- Fix issue where geoword ranking is wrong (#194)
- Avoid destructuring function parameters when unnecessary
- By default, geoword functions use
user_id
, notusername
- Fix missing awaits and wrong return types
Full Changelog: v4.1.6...v4.2.0