//------------------------
        public DataTable mdl_question_usages_DS()
        {
            string procname         = @"select * from mdl_question_usages";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            return(db.ExecuteDataTable(procname));
        }
        public DataTable mdl_quiz_DS_moodle()
        {
            string procname         = @"SELECT * FROM `mdl_quiz`";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            return(db.ExecuteDataTable(procname));
        }
        public string mdl_quiz_grades_ID_1()
        {
            string procname         = @"ALTER TABLE `mdl_quiz_grades` AUTO_INCREMENT = 1";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            return(db.ExecuteData_string(procname));
        }
        public void mdl_quiz_grades_Xoa_ID_1()
        {
            string procname         = @"DELETE FROM `mdl_quiz_grades` WHERE 1;ALTER TABLE `mdl_quiz_grades` AUTO_INCREMENT = 1";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            db.ExecuteNonQueryWithTransaction_Text(procname);
        }
        public void mdl_quiz_grades_Them(string quiz_, string userid_, string grade_, string timemodified_)
        {
            string procname         = @"INSERT INTO `mdl_quiz_grades`(`quiz`, `userid`, `grade`, `timemodified`) VALUES (" + quiz_ + "," + userid_ + "," + grade_ + "," + timemodified_ + ")";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            db.ExecuteNonQueryWithTransaction_Text(procname);
        }
        public DataTable mdl_question_usages_max()
        {
            string procname         = @"SELECT max(id) FROM `mdl_question_usages`";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            return(db.ExecuteDataTable(procname));
        }
        public DataTable mdl_question_usages_DS_state_finished()
        {
            string procname         = @"SELECT mdl_question_usages.id, mdl_question_usages.contextid, mdl_question_usages.component, mdl_question_usages.preferredbehaviour, mdl_quiz_attempts.timefinish FROM mdl_question_usages INNER JOIN mdl_quiz_attempts ON mdl_question_usages.id = mdl_quiz_attempts.uniqueid WHERE (mdl_quiz_attempts.state = 'finished') ORDER BY mdl_quiz_attempts.timefinish ASC";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            return(db.ExecuteDataTable(procname));
        }
        public DataTable mdl_question_attempt_steps_DS(string questionattempt_id, string sequencenumber_)
        {
            string procname         = @"SELECT * FROM `mdl_question_attempt_steps` WHERE questionattemptid=" + questionattempt_id + " AND sequencenumber=" + sequencenumber_ + "";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            return(db.ExecuteDataTable(procname));
        }
Ejemplo n.º 9
0
        public DataTable mdl_grade_grades_ds_userid(int userid)
        {
            string procname         = @"select * from mdl_grade_grades WHERE userid=" + userid + " and finalgrade <>'' ";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            return(db.ExecuteDataTable(procname));
        }
Ejemplo n.º 10
0
        public DataTable mdl_quiz_attempts_DS_uniqueid(string uniqueid_)
        {
            string procname         = @"select * from mdl_quiz_attempts where uniqueid=" + uniqueid_ + "";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            return(db.ExecuteDataTable(procname));
        }
Ejemplo n.º 11
0
        public DataTable mdl_block_recentlyaccesseditems_CMID(string CMID)
        {
            string procname         = @"SELECT * FROM `mdl_block_recentlyaccesseditems` WHERE cmid=" + CMID + "";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            return(db.ExecuteDataTable(procname));
        }
Ejemplo n.º 12
0
        public DataTable mdl_user_lastaccess_DS_Top1()
        {
            string procname         = @"SELECT * FROM `mdl_user_lastaccess` ORDER by timeaccess DESC LIMIT 1";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            return(db.ExecuteDataTable(procname));
        }
        public DataTable mdl_groups_members_ds()
        {
            string procname         = @"SELECT * FROM `mdl_groups_members`";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            return(db.ExecuteDataTable(procname));
        }
Ejemplo n.º 14
0
        public string mdl_logstore_standard_log_DS_Top1()
        {
            string procname         = @"SELECT userid from mdl_logstore_standard_log ORDER BY mdl_logstore_standard_log.timecreated DESC LIMIT 0,1";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            return(db.ExecuteData_string(procname));
        }
        public int mdl_question_usages_DS_state_finished_()
        {
            string procname         = @"SELECT mdl_question_usages.id, mdl_question_usages.contextid, mdl_question_usages.component, mdl_question_usages.preferredbehaviour FROM mdl_question_usages INNER JOIN mdl_quiz_attempts ON mdl_question_usages.id = mdl_quiz_attempts.uniqueid WHERE mdl_quiz_attempts.state='finished'";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            return(db.Execute_int(procname));
        }
Ejemplo n.º 16
0
        public DataTable mdl_course_modules_completion_userid()
        {
            string procname         = @"SELECT * FROM `mdl_course_modules_completion` WHERE completionstate=1 ORDER by timemodified ASC";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            return(db.ExecuteDataTable(procname));
        }
Ejemplo n.º 17
0
        //----------------------------
        public DataTable mdl_quiz_grades_DS(string userid)
        {
            string procname         = @"select * from mdl_quiz_grades where userid=" + userid + "";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            return(db.ExecuteDataTable(procname));
        }
        public DataTable mdl_question_attempts_DS()
        {
            string procname         = @"SELECT * FROM mdl_question_attempts";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            return(db.ExecuteDataTable(procname));
        }
        public DataTable mdl_question_attempt_step_data_DS(string attemptstep_id)
        {
            string procname         = @"SELECT * FROM `mdl_question_attempt_step_data` WHERE attemptstepid=" + attemptstep_id + "";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            return(db.ExecuteDataTable(procname));
        }
        public string mdl_question_attempt_steps_max()
        {
            string procname         = @"SELECT max(id) FROM `mdl_question_attempt_steps` WHERE 1";
            DbAccessMySqlOffline db = new DbAccessMySqlOffline();

            db.CreateNewSqlCommand_Text();
            return(db.ExecuteData_string(procname));
        }
Ejemplo n.º 21
0
        public bool mdl_question_attempt_steps_MacDinh()
        {
            try
            {
                string procname         = @"DELETE FROM `mdl_question_attempt_steps`;ALTER TABLE `mdl_question_attempt_steps` AUTO_INCREMENT = 1;";
                DbAccessMySqlOffline db = new DbAccessMySqlOffline();
                db.CreateNewSqlCommand_Text();
                db.ExecuteNonQueryWithTransaction(procname);

                return(true);
            }
            catch
            {
                return(false);
            }
        }
Ejemplo n.º 22
0
        public bool mdl_course_modules_completion_MySql_Them(string coursemoduleid_, string userid_, string completionstate_, string viewed_, string overrideby_, string timemodified_)
        {
            try
            {
                string procname         = @"INSERT INTO `mdl_course_modules_completion`( `coursemoduleid`, `userid`, `completionstate`, `viewed`, `timemodified`) VALUES (" + coursemoduleid_ + "," + userid_ + "," + completionstate_ + "," + viewed_ + "," + timemodified_ + ")";
                DbAccessMySqlOffline db = new DbAccessMySqlOffline();
                db.CreateNewSqlCommand_Text();
                db.ExecuteNonQueryWithTransaction_Text(procname);

                return(true);
            }
            catch
            {
                return(false);
            }
        }
 public bool mmdl_question_attempts_Them(string questionusage_id, string slot_, string behaviour_, string questionid_, string variant_, string maxmark_, string minfraction_, string maxfraction_, string flagged_, string questionsummary_, string rightanswer_, string responsesummary_, string timemodified_)
 {
     try
     {
         string procname         = @"INSERT INTO `mdl_question_attempts`(`questionusageid`, `slot`, `behaviour`, `questionid`, `variant`, `maxmark`, `minfraction`, `maxfraction`, `flagged`, `questionsummary`, `rightanswer`, `responsesummary`, `timemodified`) VALUES (" + questionusage_id + "," + slot_ + ",'" + behaviour_ + "'," + questionid_ + "," + variant_ + "," + maxmark_ + "," + minfraction_ + "," + maxfraction_ + "," + flagged_ + ",'" + questionsummary_ + "','" + rightanswer_ + "','" + responsesummary_ + "'," + timemodified_ + ")";
         DbAccessMySqlOffline db = new DbAccessMySqlOffline();
         db.CreateNewSqlCommand_Text();
         db.ExecuteNonQueryWithTransaction_Text(procname);
         db.CommitTransaction();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
 public bool mdl_question_attempt_step_data_Them(string attemptstepid_, string name_, string value_)
 {
     try
     {
         string procname         = @"INSERT INTO `mdl_question_attempt_step_data`(`attemptstepid`, `name`, `value`) VALUES (" + attemptstepid_ + ",'" + name_ + "','" + value_ + "')";
         DbAccessMySqlOffline db = new DbAccessMySqlOffline();
         db.CreateNewSqlCommand_Text();
         db.ExecuteNonQueryWithTransaction_Text(procname);
         db.CommitTransaction();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
 public bool mdl_question_attempt_steps__fraction_Them(string questionattemptid_, string sequencenumber_, string state_, string fraction_, string timecreated_, string userid_)
 {
     try
     {
         string procname         = @"INSERT INTO `mdl_question_attempt_steps`(`questionattemptid`, `sequencenumber`, `state`, `fraction`, `timecreated`, `userid`) VALUES (" + questionattemptid_ + "," + sequencenumber_ + ",'" + state_ + "'," + fraction_ + "," + timecreated_ + "," + userid_ + ")";
         DbAccessMySqlOffline db = new DbAccessMySqlOffline();
         db.CreateNewSqlCommand_Text();
         db.ExecuteNonQueryWithTransaction_Text(procname);
         db.CommitTransaction();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
 public bool mdl_question_usages_Them(string context_id, string compone_nt, string preferredbehavio_ur)
 {
     try
     {
         string procname         = @"INSERT INTO `mdl_question_usages`( `contextid`, `component`, `preferredbehaviour`) VALUES ('80','mod_quiz','deferredfeedback')";
         DbAccessMySqlOffline db = new DbAccessMySqlOffline();
         db.CreateNewSqlCommand_Text();
         db.ExecuteNonQueryWithTransaction_Text(procname);
         db.CommitTransaction();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
 public bool mdl_quiz_attempts_Them(string quiz_, string userid_, string attempt_, string uniqueid_, string layout_, string currentpage_, string preview_, string state_, string timestart_, string timefinish_, string timemodified_, string timemodifiedoffline_, string timecheckstate_, string sumgrades_)
 {
     try
     {
         string procname         = @"INSERT INTO `mdl_quiz_attempts`(`quiz`, `userid`, `attempt`, `uniqueid`, `layout`, `currentpage`, `preview`, `state`, `timestart`, `timefinish`, `timemodified`, `timemodifiedoffline`, `timecheckstate`, `sumgrades`) VALUES (" + quiz_ + "," + userid_ + "," + attempt_ + "," + uniqueid_ + ",'" + layout_ + "'," + currentpage_ + "," + preview_ + ",'" + state_ + "'," + timestart_ + "," + timefinish_ + "," + timemodified_ + "," + timemodifiedoffline_ + "," + timecheckstate_ + "," + sumgrades_ + ")";
         DbAccessMySqlOffline db = new DbAccessMySqlOffline();
         db.CreateNewSqlCommand_Text();
         db.ExecuteNonQueryWithTransaction_Text(procname);
         db.CommitTransaction();
         return(true);
     }
     catch
     {
         return(false);
     }
 }