1 / 72

AutoQuiz 交接

AutoQuiz 交接. 交接項目. 硬體設備 AutoQuiz 、 AutoQuiz toolbar 網站 資料庫結構說明 Client 端程式碼. 硬體設備. Server 1 : 140.109.18.137 (autoquiz1) 已無使用機器壞了沒都不知道,應該是壞了 Server 2 : 140.109.18.061 ( autoquiz ) 目前使用的機器,所有程式碼資料庫資料都在這台 Administrator/mcc@aip1614

ishana
Download Presentation

AutoQuiz 交接

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. AutoQuiz交接

  2. 交接項目 • 硬體設備 • AutoQuiz、AutoQuiz toolbar網站 • 資料庫結構說明 • Client端程式碼

  3. 硬體設備 • Server 1 : 140.109.18.137 (autoquiz1) 已無使用機器壞了沒都不知道,應該是壞了 • Server 2 : 140.109.18.061 (autoquiz) 目前使用的機器,所有程式碼資料庫資料都在這台 Administrator/mcc@aip1614 • Server 3 : 140.109.16.180 (autoquizhttp) 機房虛擬機器,備份用機器 Administrator/mcc@aip1614 • Server 4 : 沒有IP,306前面Dell新機器旁邊那台,部分備份資料還在這台機器上面沒處理

  4. AutoQuiz、AutoQuiz toolbar網站 • AutoQuiz網站 • AutoQuiz toolbar網站 • Toolbar service 網頁 • Toolbar Admin

  5. AutoQuiz網站 • 位置 :140.109.18.061 • 資料夾 :D:\wwwroot\autoquiz\ • 網址 :autoquiz.sinica.edu.tw • 型態 :HTML靜態文字圖片展示網頁(但檔案是.php)

  6. AutoQuiz toolbar網站 • 位置 :140.109.18.061 • 資料夾 :D:\wwwroot\autoquiz\toolbar\ • 網址 :autoquiz.sinica.edu.tw\toolbar\ • 型態 :php + smarty + mysql • 網站資料結構 :

  7. AutoQuiz toolbar網站 – 結構

  8. AutoQuiz toolbar網站 – 頁面組成1 session_start(); include("Class/SmartyConfig/SmartyMain.php"); require("./php/dbAccess.php"); $smarty = new SmartyTemplate(); $db = new dbAccess(); if(isset($_SESSION["autoquiz.user"]) && $_SESSION["autoquiz.user"] !=null) { $db->execute(); $smarty->assign(); } else { } $smarty->display("webMain.tpl");

  9. AutoQuiz toolbar網站 – 頁面組成2 $(document).ready(init);//jquery document ready function init() { if(/firefox/.test(navigator.userAgent.toLowerCase())) { if($("#loginInfo").html() == "-1") {//檢查登入狀態,由toolbar修改html } } else { } }

  10. Toolbar service 網頁 • 位置 :140.109.18.061 • 資料夾 :D:\wwwroot\autoquiz\toolbar\ • 網址 :autoquiz.sinica.edu.tw\toolbar\ • 型態 :php + mysql • 介面 :json

  11. Toolbar service 網頁 • AutoquizToolbarLogin.php • 用途 : 接收toolbar傳送使用者帳號密碼檢查 • Input : $_POST[“myemail”] 帳號 , $_POST[“mypass”] 密碼 • Output : • 帳號密碼不正確 : “code:201” • 帳號密碼正確 : “code:100 \r\n userid:使用者ID” • Config.php • 用途 : toolbar初始化設定,toolbar每次開啟都會先連到此檔案下載設定 • Input : $_GET[“x”] 亂數x • Output : JSON物件,參考程式碼內容

  12. Toolbar service 網頁 • getHistory.php • 用途 : 取得toolbar登入使用者歷史考試紀錄 • Input : $_GET[“userid”] 使用者ID • Output : history JSON物件,參考history資料表 • getQuestion.php • 用途 : 取得使用者目前瀏覽頁面的題目 • Input : $_POST[“URL”] 網址, $_POST[“textContent”] 網頁內容, • Output : • 資料錯誤 :0 • 超出出題範圍 :-1 • 正確取出題目 :JSON物件 ‘{“articleID”:資料庫文章ID,“questionArray”:題目陣列}'

  13. Toolbar service 網頁 • handleFB.php • 用途 : 處理Facebook資料 • Input : • $_GET[“type”]: 資料處理類型,login, post, getFriends, tag • $_GET[“link”]:post到FB上的連結 • $_GET[“message”]:post到FB上的文字訊息 • $_POST[“fromToolbar”] : 從toolbar傳遞資料的tag,true, flase • $_POST[“articleNo”] : 文章的ID • $_POST[“userid”]: 使用者ID • $_POST[“logLink”]: 這在瀏覽的網址 • $_POST[“tags”]:FB朋友ID列表,用”逗號”分隔 • Output : JSON$message = array('state'=>"",'url'=>"",'message'=>"");

  14. Toolbar service 網頁 • saveAnswer.php • 用途 : 記錄學生答題資料 • Input : • $_POST[“ansObj”] :JSON格式答案陣列 • $_POST[“studentID”]: 學生ID • Output : null • saveTime.php • 用途 : 記錄toolbar使用時間 • Input : • $_POST[“userid”] : 使用者ID • $_POST[“url”]: 瀏覽的頁面URL • $_POST[“duration”]: 毫秒 • $_POST[“type”]: 紀錄類型, stay : 瀏覽時間, quiz : 考試時間 • Output : null

  15. 資料庫結構說明 • Autoquiztoolbar • Googlengram_indexed • CollocationExplorer

  16. 資料庫結構 - Autoquiztoolbar Article QuizLog studentID articleID Question AnswerLog articleID quizID questionID studentID Student

  17. 資料庫結構 - Autoquiztoolbar • Answerlog : 紀錄學生答案 • No: 流水號、主鍵 • quizID: 考試記錄編號 • questionID: 題號 • studentID: 學生編號 • Answer: 答案 • yes_no: 學生自憑此題有沒有問題 • Delete: 刪除預留

  18. 資料庫結構 - Autoquiztoolbar • Article:TED已出好題目的文章 • No: 流水號、主鍵 • url: 文章URL • Content: 逐字稿 • Date: 新增日期 • Enable: 是否允許出題 • Delete:刪除預留

  19. 資料庫結構 - Autoquiztoolbar • Ceec: 大考中心單字 • Id: 流水號 • Lemma: 字根 • Pos: 詞性 • Level:?

  20. 資料庫結構 - Autoquiztoolbar • Fbclicklog:FB post連結點擊紀錄 • No: 流水號、主鍵 • addTime: 點擊時間 • Type: 類型,tag or post • Userid : click user ID • Gid : FB Gid • url : click URL • delete: 刪除預留

  21. 資料庫結構 - Autoquiztoolbar • Fbpostlog : FB post 紀錄 • No: 流水號、主鍵 • addTime:post 時間 • Userid:post user ID • Gid : FB Gid • url : post URL • delete: 刪除預留

  22. 資料庫結構 - Autoquiztoolbar • Fbtaglog : FB tage friend紀錄 • No: 流水號、主鍵 • addTime:tag 時間 • Userid:post user ID • Tag : tag誰,fbid • Gid : FB Gid • url : post URL • delete: 刪除預留

  23. 資料庫結構 - Autoquiztoolbar • Message : 影片留言板 • No: 流水號、主鍵 • addTime: 新增時間 • Talk: 所屬影片 • Content: 內容 • Author: 作者 • Enable: 是否顯示在頁面上 • Delete: 刪除預留

  24. 資料庫結構 - Autoquiztoolbar • Posttestlog: 後測紀錄 • No: 流水號、主鍵 • Date: 考試時間 • Name: 學生姓名 • Account: 學生帳號 • q1~q10, q16~q45:q1~q10,Q16~q45答案 • Score: 分數 • delete: 刪除預留

  25. 資料庫結構 - Autoquiztoolbar • Prequestionlog: 前測紀錄 • No: 流水號、主鍵 • Date: 測驗時間 • Name: 學生姓名 • Account: 學生帳號 • q16~q45:q16~q45答案 • Score: 分數 • Delete: 刪除預留

  26. 資料庫結構 - Autoquiztoolbar • Question: 題目列表 • No: 流水號、主鍵 • Question: 題目文字 • Original_sentence: 文章原始句 • Simplize_sentence: 簡化後句子 • Answer: 標準答案 • articleID: 所屬文章ID • Score: 題目分數 • Delete: 刪除預留 • D1: 選項1 • D2: 選項2 • D3: 選項3

  27. 資料庫結構 - Autoquiztoolbar • Quizlog: 考試紀錄 • No: 流水號、主鍵 • studentID: 學生ID • articleID: 考試文章ID • Date: 考試時間 • Percent: 學生自評百分比 • Score: 分數 • Delete: 刪除預留

  28. 資料庫結構 - Autoquiztoolbar • Quiztime : 考試經過時間紀錄 • No: 流水號、主鍵 • addTime: 寫入時間 • userID: 學生ID • url: 考試網址連結 • Duration: 時間(毫秒) • Delete: 刪除預留

  29. 資料庫結構 - Autoquiztoolbar • Staytime: 網頁停留時間紀錄 • No: 流水號、主鍵 • addTime: 寫入時間 • userID: 學生ID • url: 停留網站URL • Duration: 停留時間(毫秒) • Delete: 刪除預留

  30. 資料庫結構 - Autoquiztoolbar • Stopwords: 過濾文字 • No: 流水號、主鍵 • Word: 文字

  31. 資料庫結構 - Autoquiztoolbar • Student: 學生帳號資料 • No: 流水號、主鍵 • Account: 帳號 • Password: 密碼 • Nickname: 學生暱稱 • Enable: 啟用帳號 • Delete: 刪除預留

  32. 資料庫結構 - Autoquiztoolbar • Talks:TED 所有影片列表 • No: 流水號、主鍵 • Id:TEDtalk ID • talkURL:TEDURL • Title: 影片標題 • Duration: 影片長度 • videoURL: 影片直接下載連結 • talkContent_JSON: 逐字稿原始格式 • talkContent: 逐字稿內容 • Length: 逐字稿長度 • Enable: 是否提供出題

  33. 資料庫結構 - Autoquiztoolbar • Wordlog: 學生不會的字 • No: 流水號、主鍵 • studentID: 學生ID • quizID: 考試ID • Question: 題目ID • Word: 單字 • Delete: 刪除預留

  34. 資料庫結構 - Googlengram_indexed • Google • No • N • Text • Freq • T1 • T2 • T3 • T4 • t5

  35. 資料庫結構 - collocationExplorer • C5_bigrams : 不同c5 tag collocation組合 • C51:lemma1 c5 tag • C52 : lemma2 c5 tag • Freq : 出現次數

  36. 資料庫結構 - collocationExplorer • Collocations:collocation list • Lemmapos_id1 : lemma1 pos組合id • Pos1 : lemma1 pos • Lemmapos_id2 : lemma2 pos組合id • Pos2 : lemma2 pos • Mi: mutual information • Mi2 : mutual information平方(lemma1 freq平方,lemma2 freq平方) • Mi3:mutual information 三次方 • Nmi: normalized mutual information(除wordnet synonym sets個數) • Nmi2:normalized mutual information平方 • Ex: 第一個example • Freq : 出現次數

  37. 資料庫結構 - collocationExplorer • Collocation_positions:collocation出現在corpus的位置 • Lemmapos_id1:lemma1 • Lemmapos_id2 : lemma2 • Positions_json : 位置json [[file_id,sent_id,location1,location2],….]

  38. 資料庫結構 - collocationExplorer • Marks : 非文字符號 • Mark_id: 流水號 • Mark: 符號 • Freq: 出現次數

  39. 資料庫結構 - collocationExplorer • Sents:BNC corpus所有文章句子 • FileName: 檔案名稱 • File_id: 檔案id • Sent_id : 句子id • Sent_json : 句子json [[位置,world],…….]

  40. 資料庫結構 - collocationExplorer • Terms : word資料 • Wordc5_id:word + c5 tag 流水編號 • Word:word • C5 : c5 tag • Word_id : word 流水編號 • Lemmapos_id:lemma + pos tag流水編號 • Lemma:lemma • Pos : 詞性 • Lemma_id:lemma流水編號 • Freq: 出現次數

  41. Client端程式碼 - Firefoxaddon • 開發工具 :Mozilla firefoxaddon SDK + Mozilla build • https://addons.mozilla.org/zh-TW/developers/builder • 語言:javaScript+HTML • Library : SDK core library + JQuery 1.9

  42. Client端程式碼 - Firefoxaddon系統架構 Button : main.js Panel : /data/login.html Background javascript : /data/js/pageCommunication.js

  43. Client端程式碼 - Firefoxaddon

  44. Client端程式碼 - Firefoxaddon main.js 定義sdk中會用到的library constpanels = require(“sdk/panel”); //panel元件(登入畫面) const data = require(“sdk/self”).data;//toolbar外部資料(圖片 jscss等) const tabs = require(“sdk/tabs”);//tab元件(控制網頁上的分頁) const windows = require(“sdk/windows”).browserWindows;// windows元件(控制整個browser) const toolbar = require(“toolbarbutton”); //tutton元件(第三方lib) conststoreCookie = require(“sdk/simple-storage”); //storage元件(資料儲存空間) constpageMod = require(“sdk/page-mod”);//pageMode元件(背景執行程式碼) const request = require(“sdk/request”);//外部request元件(與server溝通用)

  45. main.js 定義額外寫的js物件 varhandleLogin = require(‘handleLogin’);//處理login帳號密碼判斷 varhandleQuestion = require(‘handleQuestion’);//取得和處理question varhandleFacebook = require(‘handleFacebook’); //處理facebook post tage varhandleSaveTime = require(‘handleSaveTime’); //處理儲存考試時間 停留時間

  46. main.js 定義panel varsaveLoginPanel; varloginPanelObj = { width: 270, height: 230, contentURL: data.url(“html/Loginpanel.html”), //panel內容 contentScriptFile: [data.url(“js/jquery.js”),data.url(“js/Loinpanel.js”)],//panel帶入的js contentScriptWhen: “ready“ //網頁ready就執行js };

  47. main.js 定義toolbar本身(第三方元件) varautoquizToolbar = { id : "autoquiz-bar" }; vartoolbarID = toolbar.createToolbar(autoquizToolbar);

  48. main.js 定義按鈕和分隔線 varsaveAQButton; varsaveAQButtonSep; saveAQPanel = panels.Panel(AQPanelObj); varAQButtonObj = { id : “AQIconButton”,//按鈕ID label : “”,//按鈕文字 panel : saveAQPanel,//按鈕點選彈出來的panel image : data.url(“pic/aq.jpg”), //按鈕上的圖片 toolbarID : toolbarID//所屬toolbar };

  49. main.js 定義出題按鈕 varsaveQuestionButton = null; varsaveQuestionButtonSep; varquestionButtonObj = { id : "questionButton", label : “出題”,//按鈕上文字 disabled : true,//disabled onCommand : function(){quizStatus=1;questionButtonClick();},//onClick事件 toolbarID : toolbarID };

More Related