Skip to content

Commit

Permalink
add support for alternate_subcategory
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrey-wu committed Jan 19, 2023
1 parent adf3f17 commit 02228ab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions client/database/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function TossupCard({
className: "card my-2"
}, /*#__PURE__*/React.createElement("div", {
className: "card-header"
}, /*#__PURE__*/React.createElement("b", null, tossup.setName, " | ", tossup.category, " | ", tossup.subcategory, " | ", tossup.difficulty), /*#__PURE__*/React.createElement("b", {
}, /*#__PURE__*/React.createElement("b", null, tossup.setName, " | ", tossup.category, " | ", tossup.subcategory, " ", tossup.alternate_subcategory ? ' (' + tossup.alternate_subcategory + ')' : '', " | ", tossup.difficulty), /*#__PURE__*/React.createElement("b", {
className: "float-end"
}, "Packet ", tossup.packetNumber, " | Question ", tossup.questionNumber)), /*#__PURE__*/React.createElement("div", {
className: "card-container"
Expand Down Expand Up @@ -139,7 +139,7 @@ function BonusCard({
className: "card my-2"
}, /*#__PURE__*/React.createElement("div", {
className: "card-header"
}, /*#__PURE__*/React.createElement("b", null, bonus.setName, " | ", bonus.category, " | ", bonus.subcategory, " | ", bonus.difficulty), /*#__PURE__*/React.createElement("b", {
}, /*#__PURE__*/React.createElement("b", null, bonus.setName, " | ", bonus.category, " | ", bonus.subcategory, " ", bonus.alternate_subcategory ? ' (' + bonus.alternate_subcategory + ')' : '', " | ", bonus.difficulty), /*#__PURE__*/React.createElement("b", {
className: "float-end"
}, "Packet ", bonus.packetNumber, " | Question ", bonus.questionNumber)), /*#__PURE__*/React.createElement("div", {
className: "card-container"
Expand Down
4 changes: 2 additions & 2 deletions client/database/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function TossupCard({ tossup }) {
return (
<div className="card my-2">
<div className="card-header">
<b>{tossup.setName} | {tossup.category} | {tossup.subcategory} | {tossup.difficulty}</b>
<b>{tossup.setName} | {tossup.category} | {tossup.subcategory} {tossup.alternate_subcategory ? ' (' + tossup.alternate_subcategory + ')' : ''} | {tossup.difficulty}</b>
<b className="float-end">Packet {tossup.packetNumber} | Question {tossup.questionNumber}</b>
</div>
<div className="card-container">
Expand Down Expand Up @@ -179,7 +179,7 @@ function BonusCard({ bonus }) {
return (
<div className="card my-2">
<div className="card-header">
<b>{bonus.setName} | {bonus.category} | {bonus.subcategory} | {bonus.difficulty}</b>
<b>{bonus.setName} | {bonus.category} | {bonus.subcategory} {bonus.alternate_subcategory ? ' (' + bonus.alternate_subcategory + ')' : ''} | {bonus.difficulty}</b>
<b className="float-end">Packet {bonus.packetNumber} | Question {bonus.questionNumber}</b>
</div>
<div className="card-container">
Expand Down
8 changes: 4 additions & 4 deletions client/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const createBonusCard = (function () {
if (!bonus || Object.keys(bonus).length === 0) return;

questionCounter++;
const { leadin, parts, answers, category, subcategory, setName, packetNumber, questionNumber, _id } = bonus;
const { leadin, parts, answers, category, subcategory, alternate_subcategory, setName, packetNumber, questionNumber, _id } = bonus;

const bonusLength = bonus.parts.length;

Expand Down Expand Up @@ -103,7 +103,7 @@ const createBonusCard = (function () {
${cardBody}
</div>
<div class="card-footer">
<small class="text-muted">${setName} / ${category} / ${subcategory}</small>
<small class="text-muted">${setName} / ${category} / ${subcategory} ${alternate_subcategory ? '(' + alternate_subcategory + ')' : ''}</small>
<small class="text-muted float-end">Packet ${packetNumber} / Question ${questionNumber}</small>
</div>
</div>
Expand All @@ -124,7 +124,7 @@ const createTossupCard = (function () {
if (!tossup || Object.keys(tossup).length === 0) return;

questionCounter++;
const { question, answer, category, subcategory, packetNumber, questionNumber, _id } = tossup;
const { question, answer, category, subcategory, alternate_subcategory, packetNumber, questionNumber, _id } = tossup;

// append a card containing the question to the history element
const card = document.createElement('div');
Expand All @@ -141,7 +141,7 @@ const createTossupCard = (function () {
</p>
</div>
<div class="card-footer">
<small class="text-muted">${setName} / ${category} / ${subcategory}</small>
<small class="text-muted">${setName} / ${category} / ${subcategory} ${alternate_subcategory ? '(' + alternate_subcategory + ')' : ''}</small>
<small class="text-muted float-end">Packet ${packetNumber} / Question ${questionNumber}</small>
</div>
</div>
Expand Down

0 comments on commit 02228ab

Please sign in to comment.