public void SaveLevelState(string NextLevel) { // Find the game objects LevelManager = GameObject.Find("LevelManager").GetComponent <LevelManager>(); AttemptManager = GameObject.Find("AttemptManager").GetComponent <AttemptManager>(); Timer = GameObject.Find("Timer").GetComponent <Timer>(); ScoreManager = GameObject.Find("Score").GetComponent <ScoreManager>(); InventoryManager = GameObject.Find("InventoryManager").GetComponent <InventoryManager>(); AlgorithmPathManager = GameObject.Find("AlgorithmPathManager").GetComponent <AlgorithmPathManager>(); // Store all values into the persistent game object CurrentAttempts = AttemptManager.GetCurrentAttempts(); ElapsedTime = Timer.GetElapsedTime(); StartTime = Timer.GetStartTime(); CurrentScore = ScoreManager.GetCurrentScore(); CurAluminumItems = InventoryManager.GetCurAluminumItems(); CurGlassItems = InventoryManager.GetCurGlassItems(); CurPlasticItems = InventoryManager.GetCurPlasticItems(); Algorithm = AlgorithmPathManager.GetAlgorithm(); AlgorithmIndexI = AlgorithmPathManager.GetAlgorithmIndexI(); AlgorithmIndexJ = AlgorithmPathManager.GetAlgorithmIndexJ(); // Stop time Time.timeScale = 0; // Load the specified level LevelManager.LoadLevel(NextLevel); }
public int AddAttemptForAttemptCreator(int userId, int testId) { AttemptDTO attempt = new AttemptDTO() { userID = userId, testID = testId, dateTime = DateTime.Now }; AttemptManager student = new AttemptManager(); return(student.AddAttemptAutoNumber(attempt)); }
public void RecountAttemptsResult(int id, byte count) { QuestionCRUD question = new QuestionCRUD(); QuestionDTO questions = question.GetById(id); questions.Weight = count; question.Update(questions); AttemptQuestionAnswerCRUD attemptQuestionAnswerCRUD = new AttemptQuestionAnswerCRUD(); List <AttemptQuestionAnswerDTO> attemptQuestionAnswers = attemptQuestionAnswerCRUD.GetAll(); AttemptManager manager = new AttemptManager(); foreach (AttemptQuestionAnswerDTO aqa in attemptQuestionAnswers) { if (aqa.QuestionID == id) { manager.UpdateResult(aqa.AttemptID); } } }
public List <AttemptResultDTO> GetAttemptsByUserIdTestId(UserIdTestIdDTO attempt) { AttemptManager teacher = new AttemptManager(); return(teacher.GetAttemptByUserIdTestId(attempt)); }
public List <AttemptResultDTO> GetBestResultsOfStudentsByTestId(int testId) //Лучшие Результаты всех студентов для тестов группы { AttemptManager teacher = new AttemptManager(); return(teacher.GetBestResultsOfStudentsByTestId(testId)); }
public List <QuestionAnswerDTO> GetAllAnswerByAttemptId(int attemptId) { AttemptManager b = new AttemptManager(); return(b.GetAllAnswersByAttemptId(attemptId)); }
public void AddQuestionToAttempt(int attemptId, int questionId) { AttemptManager newattempt = new AttemptManager(); newattempt.AddQuestionToAttempt(attemptId, questionId); }
public int AddAttemptAutoNumber(AttemptDTO attempt) { AttemptManager newattempt = new AttemptManager(); return(newattempt.AddAttemptAutoNumber(attempt)); }
public int GetQtyOfAnswersInAttempt(int attemptId) { AttemptManager student = new AttemptManager(); return(student.GetQtyOfAnswersInAttempt(attemptId)); }