|
1 | | -/*=================================== |
2 | | -===================================== |
3 | | -==== Begin Timed Assessment Code ==== |
4 | | -===================================== |
5 | | -===================================*/ |
| 1 | +/*========================================== |
| 2 | +======== Master timed.js ========= |
| 3 | +============================================ |
| 4 | +=== This file contains the JS for === |
| 5 | +=== the Runestone timed component. === |
| 6 | +============================================ |
| 7 | +=== Created By === |
| 8 | +=== Kirby Olson === |
| 9 | +=== 6/11/15 === |
| 10 | +==========================================*/ |
6 | 11 |
|
7 | 12 | var TimedList = {}; // Timed dictionary |
8 | 13 |
|
@@ -257,6 +262,10 @@ Timed.prototype.createRenderedQuestionArray = function () { |
257 | 262 | } else if ($(tmpChild).is("[data-component=fillintheblank]")) { |
258 | 263 | var newFITB = new TimedFITB({"orig": tmpChild}); |
259 | 264 | this.renderedQuestionArray.push(newFITB); |
| 265 | + } else if ($(tmpChild).is("[data-component=dragndrop]")) { |
| 266 | + this.renderedQuestionArray.push(new TimedDragNDrop({"orig": tmpChild})); |
| 267 | + } else if ($(tmpChild).is("[data-component=clickablearea]")) { |
| 268 | + this.renderedQuestionArray.push(new TimedClickableArea({"orig":tmpChild})); |
260 | 269 | } |
261 | 270 | } |
262 | 271 | if (this.random) { |
@@ -472,20 +481,7 @@ Timed.prototype.submitTimedProblems = function () { |
472 | 481 |
|
473 | 482 | Timed.prototype.hideTimedFeedback = function () { |
474 | 483 | for (var i = 0; i < this.renderedQuestionArray.length; i++) { |
475 | | - var blanks = this.renderedQuestionArray[i].blankArray; |
476 | | - if (blanks !== undefined) { |
477 | | - for (var j = 0; j < blanks.length; j++) { |
478 | | - $(blanks[j]).removeClass("input-validation-error"); |
479 | | - } |
480 | | - this.renderedQuestionArray[i].feedBackDiv.style.display = "none"; |
481 | | - } |
482 | | - var feedbacks = this.renderedQuestionArray[i].feedBackEachArray; |
483 | | - if (feedbacks !== undefined) { |
484 | | - for (var j = 0; j < feedbacks.length; j++) { |
485 | | - $(feedbacks[j]).hide(); |
486 | | - } |
487 | | - } |
488 | | - |
| 484 | + this.renderedQuestionArray[i].hideFeedback(); // Defined in each timed class |
489 | 485 | } |
490 | 486 | }; |
491 | 487 |
|
@@ -550,22 +546,4 @@ $(document).ready(function () { |
550 | 546 | $("[data-component=timedAssessment]").each(function (index) { |
551 | 547 | TimedList[this.id] = new Timed({"orig": this}); |
552 | 548 | }); |
553 | | - for (var key in TimedList) { |
554 | | - if (TimedList.hasOwnProperty(key)) { |
555 | | - var TimedChildren = TimedList[key].origElem.childNodes; |
556 | | - } |
557 | | - } |
558 | | - |
559 | | - $("[data-component=fillintheblank]").each(function (index) { // FITB |
560 | | - if ($.inArray(this.id, TimedChildren) < 0) { // If the fillintheblank element exists within a timed component, don"t render it here |
561 | | - FITBList[this.id] = new FITB({"orig": this}); |
562 | | - } |
563 | | - }); |
564 | | - |
565 | | - $("[data-component=multiplechoice]").each(function (index) { // MC |
566 | | - if ($.inArray(this.id, TimedChildren) < 0) { // If the MC element exists within a timed component, don"t render it here |
567 | | - mcList[this.id] = new MultipleChoice({"orig": this}); |
568 | | - } |
569 | | - }); |
570 | | - |
571 | 549 | }); |
0 commit comments