Skip to content

Commit

Permalink
page: gapfill bugfix #3
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayDewnarain committed Aug 18, 2018
1 parent 81b2ea8 commit 0ef65bd
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,15 @@
this.leavePage = function() {
if(x_currentPageXML.getAttribute("interactivity") == "Drag Drop")
{
if(!this.hasBeenTracked && this.isTracked){
this.dragDropSubmit(true);

}
}
else if(x_currentPageXML.getAttribute("interactivity") == "Fill in Blank"){
if(!this.hasBeenTracked && this.isTracked){
else if(x_currentPageXML.getAttribute("interactivity") == "Fill in Blank")
{
this.fillInSubmit(true);
}
}
else if (x_currentPageXML.getAttribute("interactivity") == "Drop Down Menu")
{
if (!this.hasBeenTracked && this.isTracked){
this.dropDownSubmit(true);
}
}
};

Expand Down Expand Up @@ -978,15 +972,16 @@
}
};

this.fillInSubmit = function(){
this.fillInSubmit = function(forceTracking){
debugger;
var empty = 0;
$targetHolder.find("input").each(function() {
if ($(this).val() == "") {
empty += 1;
}
});

if (empty > 0) {
if (empty > 0 && !forceTracking) {
$("#feedbackTxt #txt").html(x_addLineBreaks(x_currentPageXML.getAttribute("gapFillIncomplete") != undefined && x_currentPageXML.getAttribute("gapFillIncomplete") != "" ? x_currentPageXML.getAttribute("gapFillIncomplete") : "Please complete the exercise."));
$feedbackTxt.fadeIn();
} else {
Expand Down Expand Up @@ -1203,6 +1198,7 @@

//Stopping the tracking
this.finishTracking = function() {
debugger;
if(total != 0)
{
XTSetPageScore(x_currentPage, ((correct_answers * 100.0)/total), x_currentPageXML.getAttribute("trackinglabel"));
Expand Down

0 comments on commit 0ef65bd

Please sign in to comment.