Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- aight chief this be the bread and butter of it
- var signInGood = "false";
- readRecords("users", {}, function(records) {
- for (var i = 0; i < records.length && signInGood == "false"; i++) {
- if (records[i].Username == getText("usernameInput")){
- if (records[i].Password == getText("passwordInput")){
- signInGood = "true";
- setScreen("mainScreen");
- }
- } else {
- if (getText("incorrectTxt") != "Incorrect Username/Password"){
- textLabel("incorrectTxt" ,"Incorrect Username/Password");
- }
- }
- }
- });
- });
- onEvent("signUpBtn", "click", function() {
- createRecord("users", {FirstName: getText("firstNameInput"), LastName: getText("lastNameInput"), Username: getText("createUsernameInput"), Password: getText("createPasswordInput")}, function() {});
- setScreen("studentLoginScreen");
- });
- onEvent("createQuestionBtn", "click", function() {
- createRecord("questions", {QuestionSet: getText("questionSetInput"), Question: getText("questionInput"), AnswerA: getText("answerAInput"), AnswerB: getText("answerBInput"), AnswerC: getText("answerCInput"), AnswerD: getText("answerDInput"), CorrectAnswer: getText("correctAnswerInput")}, function() {});
- createRecord("questionSets", {QuestionSet: getText("questionSetInput")});
- setScreen("mainScreen");
- });
Add Comment
Please, Sign In to add comment