Skip to content

Commit

Permalink
Add option to colorize rows with no selection in Kprim type
Browse files Browse the repository at this point in the history
  • Loading branch information
zjosua committed Apr 2, 2022
1 parent d41fb99 commit e9bae82
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
10 changes: 8 additions & 2 deletions card/back.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
wrongwrong: 'correct', // Should be wrong and got marked as wrong
correctcorrect: 'correct', // Should be correct and got marked as correct
wrongcorrect: 'wrong', // Should be wrong but got marked as correct
correctwrong: 'wrong' // Should be correct but got marked as wrong
correctwrong: 'wrong', // Should be correct but got marked as wrong
eithernone: "wrong" // Kprim was marked neither correct nor wrong
}
},
atable: {
Expand All @@ -38,7 +39,8 @@
wrongwrong: 'correct', // Should be wrong and got marked as wrong
correctcorrect: 'correct', // Should be correct and got marked as correct
wrongcorrect: 'wrong', // Should be wrong but got marked as correct
correctwrong: 'wrong' // Should be correct but got marked as wrong
correctwrong: 'wrong', // Should be correct but got marked as wrong
eithernone: "wrong" // Kprim was marked neither correct nor wrong
}
}
}
Expand Down Expand Up @@ -81,6 +83,8 @@
qrows[(type != 0) ? i : i + 1].setAttribute("class", options.qtable.colors.wrongcorrect);
} else if (solutions[i] && answers[i] === "0"){
qrows[(type != 0) ? i : i + 1].setAttribute("class", options.qtable.colors.correctwrong);
} else if (type == 0 && answers[i] === "-") {
qrows[(type != 0) ? i : i + 1].setAttribute("class", options.qtable.colors.eithernone);
}
}
}
Expand All @@ -105,6 +109,8 @@
arows[(type != 0) ? i : i + 1].setAttribute("class", options.atable.colors.wrongcorrect);
} else if (solutions[i] && answers[i] === "0") {
arows[(type != 0) ? i : i + 1].setAttribute("class", options.atable.colors.correctwrong);
} else if (type == 0 && answers[i] === "-") {
arows[(type != 0) ? i : i + 1].setAttribute("class", options.atable.colors.eithernone);
}
}
//Count correct answers.
Expand Down
4 changes: 2 additions & 2 deletions src/multiple_choice/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@

# default configurations
# TODO: update version number before release
default_conf_local = {'version': "2.4.3"}
default_conf_syncd = {'version': "2.4.3"}
default_conf_local = {'version': "2.5.0"}
default_conf_syncd = {'version': "2.5.0"}

def getSyncedConfig():
# Synced preferences
Expand Down
10 changes: 8 additions & 2 deletions src/multiple_choice/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@
wrongwrong: 'correct', // Should be wrong and got marked as wrong
correctcorrect: 'correct', // Should be correct and got marked as correct
wrongcorrect: 'wrong', // Should be wrong but got marked as correct
correctwrong: 'wrong' // Should be correct but got marked as wrong
correctwrong: 'wrong', // Should be correct but got marked as wrong
eithernone: "wrong" // Kprim was marked neither correct nor wrong
}
},
atable: {
Expand All @@ -316,7 +317,8 @@
wrongwrong: 'correct', // Should be wrong and got marked as wrong
correctcorrect: 'correct', // Should be correct and got marked as correct
wrongcorrect: 'wrong', // Should be wrong but got marked as correct
correctwrong: 'wrong' // Should be correct but got marked as wrong
correctwrong: 'wrong', // Should be correct but got marked as wrong
eithernone: "wrong" // Kprim was marked neither correct nor wrong
}
}
}
Expand Down Expand Up @@ -359,6 +361,8 @@
qrows[(type != 0) ? i : i + 1].setAttribute("class", options.qtable.colors.wrongcorrect);
} else if (solutions[i] && answers[i] === "0"){
qrows[(type != 0) ? i : i + 1].setAttribute("class", options.qtable.colors.correctwrong);
} else if (type == 0 && answers[i] === "-") {
qrows[(type != 0) ? i : i + 1].setAttribute("class", options.qtable.colors.eithernone);
}
}
}
Expand All @@ -383,6 +387,8 @@
arows[(type != 0) ? i : i + 1].setAttribute("class", options.atable.colors.wrongcorrect);
} else if (solutions[i] && answers[i] === "0") {
arows[(type != 0) ? i : i + 1].setAttribute("class", options.atable.colors.correctwrong);
} else if (type == 0 && answers[i] === "-") {
arows[(type != 0) ? i : i + 1].setAttribute("class", options.atable.colors.eithernone);
}
}
//Count correct answers.
Expand Down

0 comments on commit e9bae82

Please sign in to comment.