Skip to content

Commit

Permalink
Display corrections even when answer is same as original
Browse files Browse the repository at this point in the history
  • Loading branch information
landy8697 committed May 16, 2024
1 parent 2a0aec1 commit 3d42ea0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fermi.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ function applyCorrections(curData, source){
curData["originalAnswer"] = curData["answer"];
curData["originalQuestion"] = curData["question"];
curData["id"] = curID;
curData["hasAnswerCorrection"] = (corrections[source]["answer"] != "");
//Check and apply correction if it exists
if(source in corrections){
console.log("CORRECTION FOUND");
Expand Down Expand Up @@ -188,7 +189,7 @@ function placeQuestionHTML(curData, source){
console.log(curData);
let curCredit = (curData.credit != null) ? curData.credit : "______"
//QUESTION AND CREDIT DISPLAY
if(curData.answer != curData.originalAnswer && curCredit.toUpperCase() != "NONE"){
if(curData["hasAnswerCorrection"] && curCredit.toUpperCase() != "NONE"){
document.getElementById("question-box").innerHTML =
`<p>${curData.question}</p>
<small><i>${source}<br>Answer corrected by ${curCredit}
Expand Down Expand Up @@ -296,7 +297,7 @@ function submitAnswer(){
}
console.log("Original Answer", curData.originalAnswer);
console.log("Current Answer", curData.answer);
if(curData.answer != curData.originalAnswer){
if(curData["hasAnswerCorrection"]){
let explanation = "Explanation: " + (curData.explanation != "" ? curData.explanation : "None");
console.log(curData.explanation);
document.getElementById("change-alert").classList.remove("d-none");
Expand Down

0 comments on commit 3d42ea0

Please sign in to comment.