Advertisement
paulCodes

jp502-diff

Aug 22nd, 2013
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.74 KB | None | 0 0
  1. Index: build/fb/JP502/src/com/regislearning/activities/loe/controller/JP502StateMachine.as
  2. ===================================================================
  3. --- build/fb/JP502/src/com/regislearning/activities/loe/controller/JP502StateMachine.as (revision 2193)
  4. +++ build/fb/JP502/src/com/regislearning/activities/loe/controller/JP502StateMachine.as (working copy)
  5. @@ -180,7 +180,7 @@
  6.                         }
  7.                         else
  8.                         {  
  9. -                           if(dataModel.j5SniffTest.attempts >= 3)
  10. +                           if(dataModel.j5SniffTest.attempts >= dataModel.j5SniffTest.maxAttempts && dataModel.j5SniffTest.maxAttempts != 0)
  11.                             {
  12.                                 dispatch(new MainViewEvent(MainViewEvent.RESET_CLICKED));
  13.                                 feedback = "j5SniffTestFailed";
  14. Index: build/fb/JP502/src/com/regislearning/activities/loe/model/J5SniffTest.as
  15. ===================================================================
  16. --- build/fb/JP502/src/com/regislearning/activities/loe/model/J5SniffTest.as    (revision 2193)
  17. +++ build/fb/JP502/src/com/regislearning/activities/loe/model/J5SniffTest.as    (working copy)
  18. @@ -11,6 +11,7 @@
  19.          public var required:Dictionary = null;
  20.          private var _passedLines:int = 0;
  21.          private var _attempts:int = 0;
  22. +       private var _maxAttempts:int = 0;
  23.          public var testing:Boolean = false;
  24.          private var _passed:Boolean = false;
  25.          public var askQuestions:Boolean = false;
  26. @@ -34,6 +35,14 @@
  27.          {
  28.              return _attempts;
  29.          }
  30. +      
  31. +       public function get maxAttempts():int {
  32. +           return _maxAttempts;
  33. +       }
  34. +      
  35. +       public function set maxAttempts(value:int):void{
  36. +           _maxAttempts = value;
  37. +       }
  38.  
  39.          public function J5SniffTest()
  40.          {
  41. @@ -63,7 +72,7 @@
  42.              _passedLines = 0;
  43.              if(testing)
  44.                  return _passed = true;
  45. -            if(_attempts < 3)
  46. +            if(_attempts < _maxAttempts || _maxAttempts == 0)
  47.              {
  48.                  _attempts++;
  49.              }
  50. Index: build/fb/JP502/src/com/regislearning/activities/loe/view/mediator/ConfirmationViewMediator.as
  51. ===================================================================
  52. --- build/fb/JP502/src/com/regislearning/activities/loe/view/mediator/ConfirmationViewMediator.as   (revision 2193)
  53. +++ build/fb/JP502/src/com/regislearning/activities/loe/view/mediator/ConfirmationViewMediator.as   (working copy)
  54. @@ -89,7 +89,8 @@
  55.                          view.text = "<font color='#FFFFFF'>You have identified enough valid decisive points and placed them in the correct order. Select Complete to conclude the activity.</font>";
  56.                      }
  57.                  }else{
  58. -                    if(dataModel.j5SniffTest.attempts >= 3)
  59. +                    var maxAttempts:int = dataModel.j5SniffTest.maxAttempts;
  60. +                    if(maxAttempts != 0 && dataModel.j5SniffTest.attempts >= maxAttempts)
  61.                      {
  62.                          view.footer.htmlText = "";
  63.                          view.continueButton.enabled = false;
  64. @@ -107,8 +108,11 @@
  65.                          view.continueButton.enabled = false;
  66.                          view.continueButton.buttonMode = false;
  67.                          view.text = "<font color='#FFFFFF'>The J-5 has reviewed your LOE chart.</font><br><br>" + view.text;
  68. -                        var attemptsFeedback:String = (dataModel.feedback["attemptsFeedback"] as String).replace("[$N]", 3 - dataModel.j5SniffTest.attempts);
  69. -                        if(dataModel.j5SniffTest.attempts >= 2) attemptsFeedback = attemptsFeedback.replace("opportunities", "opportunity");
  70. +                        var attemptsFeedback:String = (dataModel.feedback["attemptsFeedback"] as String).replace("[$N]", "infinite");
  71. +                        if(maxAttempts >= 1){
  72. +                            attemptsFeedback = (dataModel.feedback["attemptsFeedback"] as String).replace("[$N]", maxAttempts - dataModel.j5SniffTest.attempts);
  73. +                        if(dataModel.j5SniffTest.attempts >= Math.abs(maxAttempts - 1)) attemptsFeedback = attemptsFeedback.replace("opportunities", "opportunity");
  74. +                    }
  75.                          view.text += "<font color='#FFFFFF'>" + attemptsFeedback + "</font>";
  76.                      }
  77.  
  78. Index: build/website/JP502/xml/j5Test.xml
  79. ===================================================================
  80. --- build/website/JP502/xml/j5Test.xml  (revision 2193)
  81. +++ build/website/JP502/xml/j5Test.xml  (working copy)
  82. @@ -1,6 +1,6 @@
  83.  <?xml version="1.0" encoding="utf-8"?>
  84.  
  85. -<j5Test testing="false" askQuestions="false">
  86. +<j5Test testing="false" askQuestions="false" maxAttempts="0">
  87.     <required>
  88.         <loe id="1" dps="1,6,12,18,19" numCorrect="3"/> <!-- 'dps' is a list of comma delimited DPs required to be on the chart for the loe -->
  89.         <loe id="2" dps="2,7,10,13,15" numCorrect="3"/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement