Skip to content

Commit

Permalink
SAK-41231 Allow Minimum Point Value to Equal Answer Point Value
Browse files Browse the repository at this point in the history
  • Loading branch information
dnhutchins authored and Miguel Pellicer committed Apr 9, 2019
1 parent e76ad04 commit d15771a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions samigo/samigo-app/src/webapp/js/authoring.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ $( document ).ready( function() {
// minField may not be on the page if disabled
if (minField) {
var minValue = parseFloat(minField.val());
if (minValue < 0 || minValue >= pointValue) {
if (minValue < 0 || minValue > pointValue) {
validationWarningSetDefault(minField, "");
}
}
Expand All @@ -271,8 +271,8 @@ $( document ).ready( function() {
$( "#itemForm\\:minPoints\\:answerminptr" ).change( function() {
var pointValue = parseFloat( $( "#itemForm\\:answerptr" ).val() );
var minValue = parseFloat( $( this ).val() );
// minValue should not be equal to or greater than pointValue
if (minValue < 0 || minValue >= pointValue) {
// minValue should not be greater than pointValue
if (minValue < 0 || minValue > pointValue) {
validationWarningSetDefault($( this ), "0")
} else {
// minValue is valid disable negative points
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,7 @@ public int compare(ItemGradingData o1, ItemGradingData o2) {
//entry.getValue()[1] = min score
//entry.getValue()[2] = how many question answers to divide minScore across
for(Entry<Long, Double[]> entry : minScoreCheck.entrySet()){
if(entry.getValue()[0] < entry.getValue()[1]){
if(entry.getValue()[0] <= entry.getValue()[1]){
//reset all scores to 0 since the user didn't get all correct answers
iter = itemGradingSet.iterator();
while(iter.hasNext()){
Expand Down

0 comments on commit d15771a

Please sign in to comment.