Skip to content

Commit

Permalink
Bug fix undefined rawscores in reviewlibrary
Browse files Browse the repository at this point in the history
  • Loading branch information
drlippman committed Sep 14, 2018
1 parent 1fd4c7c commit 1e6abb4
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions course/reviewlibrary.php
Expand Up @@ -277,10 +277,21 @@
}

$seed = rand(0,10000);
$lastanswers = array();
$scores = array();
$rawscores = array();
$qn = 27; //question number to use during testing
$lastanswers[$qn] = '';
$rawscores[$qn] = -1;
$scores[$qn] = -1;
require("../assessment/displayq2.php");
if (isset($_POST['seed'])) {
list($score,$rawscores) = scoreq(0,$qsetid,$_POST['seed'],$_POST['qn0']);
list($score,$rawscores[$qn]) = scoreq($qn,$qsetid,$_POST['seed'],$_POST['qn'.$qn]);
$scores[$qn] = $score;
$page_lastScore = "<p>Score on last answer: ".Sanitize::onlyFloat($score)."/1</p>\n";
} else {
$page_lastScore = "";
$_SESSION['choicemap'] = array();
}

$twobx = ($lineQSet['qcontrol']=='' && $lineQSet['answer']=='');
Expand Down Expand Up @@ -372,7 +383,7 @@ function setlibnames(libn) {

<?php
unset($lastanswers);
displayq(0,$qsetid,$seed,true,true,0);
displayq($qn,$qsetid,$seed,true,true,0);
?>
<input type=submit value="Submit">
</form>
Expand Down

0 comments on commit 1e6abb4

Please sign in to comment.