This repository was archived by the owner on Jun 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- /*==========================================
1+ p ; /*==========================================
22======== Master mchoice.js =========
33============================================
44=== This file contains the JS for the ===
@@ -453,10 +453,8 @@ export default class MultipleChoice extends RunestoneBase {
453453 this . correct = numCorrect === numNeeded && numNeeded === numGiven ;
454454 if ( numGiven === numNeeded ) {
455455 this . percent = numCorrect / numNeeded ;
456- } else if ( numGiven < numNeeded ) {
457- this . percent = ( numCorrect - ( numNeeded - numGiven ) ) / numNeeded ;
458456 } else {
459- this . percent = ( numCorrect - ( numGiven - numNeeded ) ) / numNeeded ;
457+ this . percent = numCorrect / Math . max ( numGiven , numNeeded ) ;
460458 }
461459 }
462460
Original file line number Diff line number Diff line change @@ -88,7 +88,9 @@ class LineBasedGrader {
8888 var answerLines = problem . answerLines ( ) ;
8989 var i ;
9090 var state ;
91- this . percentLines = answerLines . length / solutionLines . length ;
91+ this . percentLines =
92+ Math . min ( answerLines . length , solutionLines . length ) /
93+ Math . max ( answerLines . length , solutionLines . length ) ;
9294 if ( answerLines . length < solutionLines . length ) {
9395 state = "incorrectTooShort" ;
9496 this . correctLength = false ;
@@ -1466,7 +1468,8 @@ export default class Parsons extends RunestoneBase {
14661468 // Increment Parsons area height based on number of lines of text in the current Parsons block - Vincent Qiu (September 2020)
14671469 var singleHeight = 40 ;
14681470 var additionalHeight = 20 ;
1469- areaHeight += Math . ceil ( // For future more accurate height display, this calculation should also be conditionally based on fontFamily
1471+ areaHeight += Math . ceil (
1472+ // For future more accurate height display, this calculation should also be conditionally based on fontFamily
14701473 singleHeight +
14711474 ( linesItem [ linesIndex ] . children . length - 1 ) *
14721475 additionalHeight +
You can’t perform that action at this time.
0 commit comments