Exemplo n.º 1
0
 public int getPagesID(btSHFUnitPractice shfUnitPratice)
 {
     int unitID = shfUnitPratice.UnitID;
     String where = "FatherID=" + unitID + " AND SubOrder=0";
     btCHSTRAS_091_Database database = new btCHSTRAS_091_Database();
     IDataReader reader = database.query("E_SHFStructures", new String[]{"StructureID"}, where, null);
     reader.Read();
     return reader.GetInt32(0);
 }
Exemplo n.º 2
0
 public String disForeword()
 {
     String condition = "ProgramId=" + pratice.UnitID;
     btCHSTRAS_091_Database database = new btCHSTRAS_091_Database();
     btCHSTRAS_091_File file = new btCHSTRAS_091_File();
     database.query("E_SHFPages", new String[] { "TextInfo" }, condition, null);
     String textInfo = database.moveToNextString()[0];
     return file.getText(textInfo);
 }
Exemplo n.º 3
0
 public btCHSTRAS_091_Teach(btSHFUserLogin shfUserLogin, btSHFUnitPractice shfUnitPratice)
 {
     this.shfUserLogin = shfUserLogin;
     file = new btCHSTRAS_091_File();
     database = new btCHSTRAS_091_Database();
     btCHSTRAS_091_Base bt = new btCHSTRAS_091_Base();
     String[] columns = new String[] { "ProgramID", "PageID" };
     String where = "ProgramID=" + bt.getPagesID(shfUnitPratice);
     readerPages = database.query("E_SHFPages", columns, where, null);
     total = database.getSize();
     itemLearned = -1;
     itemCurrent = -1;
     arrayList = new ArrayList();
     startTime = DateTime.Now;
 }
Exemplo n.º 4
0
 public btCHSTRAS_091_Link(btSHFUserLogin shfUserLogin, btSHFUnitPractice shfUnitPratice)
 {
     this.shfUserLogin = shfUserLogin;
     this.shfUnitPratice = shfUnitPratice;
     btCHSTRAS_091_Base bt = new btCHSTRAS_091_Base();
     int programID = bt.getPagesID(shfUnitPratice);
     btCHSTRAS_091_Database database = new btCHSTRAS_091_Database();
     String where = "ProgramID=" + programID;
     String[] selection = new String[] { "TextInfo", "ImageInfo" };
     reader = database.query("E_SHFPages", selection, where, null);
     unit = new btCHSTRAS_091_Unit(DateTime.Now, database.getSize(), shfUserLogin, shfUnitPratice);
     item = new btCHSTRAS_091_Item(shfUserLogin, shfUnitPratice);
     texts = new String[4];
     images = new String[4];
 }
 public btCHSTRAS_091_Question(btSHFUnitPractice unitPractice,
     int courseType)
 {
     btCHSTRAS_091_Base bt = new btCHSTRAS_091_Base();
     file = new btCHSTRAS_091_File();
     int pageID = bt.getPagesID(unitPractice);
     database = new btCHSTRAS_091_Database();
     String where = "QuestionType=" + pageID + " AND " +
         "QuestionTag=\'" + courseType + "\'";
     String[] columns = new String[] {"QuestionID", "QuestionDiff",
         "QuestionScore", "AverageTime", "QuestionSubject",
         "Question","QuestionSolution", "QuestionAnswer"};
     reader = database.query("E_SHFQuestions", columns, where, null);
     angry = file.getImage("angry.gif");
     happy = file.getImage("happy.gif");
 }
Exemplo n.º 6
0
 public Correct[] getAnswers(int clickNum)
 {
     btCHSTRAS_091_Database db = new btCHSTRAS_091_Database();
     String[] selections = new String[] {"Question","QuestionAnswer" };
     String where = "QuestionSubject=\'" + QuestionID + "." + clickNum + "\'";
     IDataReader reader = db.query("E_SHFQuestions", selections, where, null);
     reader.Read();
     String question = reader.GetString(0);
     String answer = reader.GetString(1);
     String[] questions = question.Split(new char[] { ',' });
     int right = System.Convert.ToInt32(answer);
     Correct[] correct = new Correct[questions.Length];
     for (int i = 0; i < questions.Length; i++)
     {
         correct[i] = new Correct();
         correct[i].text = questions[i];
         if (i == right)
             correct[i].right = true;
         else
             correct[i].right = false;
     }
     return correct;
 }