Guest User

Untitled

a guest
May 31st, 2018
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. aight chief this be the bread and butter of it
  2.  
  3.   var signInGood = "false";
  4.   readRecords("users", {}, function(records) {
  5.     for (var i = 0; i < records.length && signInGood == "false"; i++) {
  6.       if (records[i].Username == getText("usernameInput")){
  7.         if (records[i].Password == getText("passwordInput")){
  8.           signInGood = "true";
  9.           setScreen("mainScreen");
  10.         }
  11.       } else {
  12.         if (getText("incorrectTxt") != "Incorrect Username/Password"){
  13.         textLabel("incorrectTxt" ,"Incorrect Username/Password");
  14.         }
  15.       }
  16.     }
  17.   });
  18. });
  19.  
  20. onEvent("signUpBtn", "click", function() {
  21.   createRecord("users", {FirstName: getText("firstNameInput"), LastName: getText("lastNameInput"), Username: getText("createUsernameInput"), Password: getText("createPasswordInput")}, function() {});
  22.   setScreen("studentLoginScreen");
  23. });
  24.  
  25. onEvent("createQuestionBtn", "click", function() {
  26.   createRecord("questions", {QuestionSet: getText("questionSetInput"), Question: getText("questionInput"), AnswerA: getText("answerAInput"), AnswerB: getText("answerBInput"), AnswerC: getText("answerCInput"), AnswerD: getText("answerDInput"), CorrectAnswer: getText("correctAnswerInput")}, function() {});
  27.   createRecord("questionSets", {QuestionSet: getText("questionSetInput")});
  28.   setScreen("mainScreen");
  29. });
Add Comment
Please, Sign In to add comment