代码拉取完成,页面将自动刷新
const Web3 = require('web3');
let WEB3;
let Address;
let User_Contract;
let Log_Contract;
let Experiment_Contract;
let Course_Contract;
let List_Contract;
const UserAddr = "0x49785D4d5857056B411A56f7E2BFcDBD2385CeC8";
const LogAddr = "0x837F2969189b39f193Cd4c5445CC7E07e5463b5c";
const ExperimentAddr = "0x341430f7b5104614B82Ee0158F0a61aDDff33c39";
const CourseAddr = "0x8AF78682deF33D23c5FE074C188125aB29202320";
const ListAddr = "0xa1C640d96E5b2a1BeAb2ee146B1a3C829fF05C32";
//region User ABI码
const User = [
{
"inputs": [
{
"internalType": "address",
"name": "adrs",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "GiveupSuperadmin",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "uint256",
"name": "_stuNo",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_grade",
"type": "uint256"
},
{
"internalType": "enum User.Identity",
"name": "_identity",
"type": "uint8"
},
{
"internalType": "address",
"name": "ModifiedUser",
"type": "address"
}
],
"name": "SuperAdminModify",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "Received",
"type": "address"
}
],
"name": "TransferSuperAdmin",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_adrs",
"type": "address"
}
],
"name": "checkIfCanCheck",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "adrs",
"type": "address"
},
{
"internalType": "address[]",
"name": "adrss",
"type": "address[]"
}
],
"name": "checkIfExist",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getAllAdmins",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "UserAds",
"type": "address"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "uint256",
"name": "StuNo",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "Grade",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "NameNoHash",
"type": "bytes32"
},
{
"internalType": "enum User.Authority",
"name": "authority",
"type": "uint8"
},
{
"internalType": "enum User.Identity",
"name": "identity",
"type": "uint8"
}
],
"internalType": "struct User.User[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getAllUsers",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "UserAds",
"type": "address"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "uint256",
"name": "StuNo",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "Grade",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "NameNoHash",
"type": "bytes32"
},
{
"internalType": "enum User.Authority",
"name": "authority",
"type": "uint8"
},
{
"internalType": "enum User.Identity",
"name": "identity",
"type": "uint8"
}
],
"internalType": "struct User.User[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getMyInfo",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "UserAds",
"type": "address"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "uint256",
"name": "StuNo",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "Grade",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "NameNoHash",
"type": "bytes32"
},
{
"internalType": "enum User.Authority",
"name": "authority",
"type": "uint8"
},
{
"internalType": "enum User.Identity",
"name": "identity",
"type": "uint8"
}
],
"internalType": "struct User.User",
"name": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "userAdrs",
"type": "address"
}
],
"name": "getUserInfo",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "UserAds",
"type": "address"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "uint256",
"name": "StuNo",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "Grade",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "NameNoHash",
"type": "bytes32"
},
{
"internalType": "enum User.Authority",
"name": "authority",
"type": "uint8"
},
{
"internalType": "enum User.Identity",
"name": "identity",
"type": "uint8"
}
],
"internalType": "struct User.User",
"name": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "initiateUser",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "UserAds",
"type": "address"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "uint256",
"name": "StuNo",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "Grade",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "NameNoHash",
"type": "bytes32"
},
{
"internalType": "enum User.Authority",
"name": "authority",
"type": "uint8"
},
{
"internalType": "enum User.Identity",
"name": "identity",
"type": "uint8"
}
],
"internalType": "struct User.User",
"name": "",
"type": "tuple"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "uint256",
"name": "_stuNo",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_grade",
"type": "uint256"
},
{
"internalType": "enum User.Identity",
"name": "_identity",
"type": "uint8"
}
],
"name": "modifyMyInfo",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "UserAds",
"type": "address"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "uint256",
"name": "StuNo",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "Grade",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "NameNoHash",
"type": "bytes32"
},
{
"internalType": "enum User.Authority",
"name": "authority",
"type": "uint8"
},
{
"internalType": "enum User.Identity",
"name": "identity",
"type": "uint8"
}
],
"internalType": "struct User.User",
"name": "",
"type": "tuple"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "uint256",
"name": "_stuNo",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_grade",
"type": "uint256"
},
{
"internalType": "enum User.Identity",
"name": "_identity",
"type": "uint8"
},
{
"internalType": "address",
"name": "ModifiedUser",
"type": "address"
}
],
"name": "modifyUserInfo",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "UserAds",
"type": "address"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "uint256",
"name": "StuNo",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "Grade",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "NameNoHash",
"type": "bytes32"
},
{
"internalType": "enum User.Authority",
"name": "authority",
"type": "uint8"
},
{
"internalType": "enum User.Identity",
"name": "identity",
"type": "uint8"
}
],
"internalType": "struct User.User",
"name": "",
"type": "tuple"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "toString",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "toString",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "toString",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "value",
"type": "bytes32"
}
],
"name": "toString",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "userAdrs",
"type": "address"
}
],
"name": "upUserToAdmin",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
];
//endregion
//region Log ABI码
const Log = [
{
"inputs": [
{
"internalType": "string",
"name": "_actionTo",
"type": "string"
},
{
"internalType": "string",
"name": "_actionFor",
"type": "string"
},
{
"internalType": "address",
"name": "_msgSender",
"type": "address"
},
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "bool",
"name": "_ifSuccess",
"type": "bool"
}
],
"name": "addLog",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_actionTo",
"type": "string"
},
{
"internalType": "string",
"name": "_actionFor",
"type": "string"
},
{
"internalType": "address",
"name": "_msgSender",
"type": "address"
},
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "bool",
"name": "_ifSuccess",
"type": "bool"
}
],
"name": "addLog_User",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_courseId",
"type": "uint256"
}
],
"name": "getCourseLog",
"outputs": [
{
"components": [
{
"internalType": "string",
"name": "ActionTo",
"type": "string"
},
{
"internalType": "string",
"name": "UserName",
"type": "string"
},
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "ActionFor",
"type": "string"
},
{
"internalType": "address",
"name": "TxOrigin",
"type": "address"
},
{
"internalType": "uint256",
"name": "Timestamp",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "blockNum",
"type": "uint256"
},
{
"internalType": "address",
"name": "MsgSender",
"type": "address"
},
{
"internalType": "bool",
"name": "ifSuccess",
"type": "bool"
}
],
"internalType": "struct Log.Log[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_experimentId",
"type": "uint256"
}
],
"name": "getExperimentLog",
"outputs": [
{
"components": [
{
"internalType": "string",
"name": "ActionTo",
"type": "string"
},
{
"internalType": "string",
"name": "UserName",
"type": "string"
},
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "ActionFor",
"type": "string"
},
{
"internalType": "address",
"name": "TxOrigin",
"type": "address"
},
{
"internalType": "uint256",
"name": "Timestamp",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "blockNum",
"type": "uint256"
},
{
"internalType": "address",
"name": "MsgSender",
"type": "address"
},
{
"internalType": "bool",
"name": "ifSuccess",
"type": "bool"
}
],
"internalType": "struct Log.Log[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getMyLog",
"outputs": [
{
"components": [
{
"internalType": "string",
"name": "ActionTo",
"type": "string"
},
{
"internalType": "string",
"name": "UserName",
"type": "string"
},
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "ActionFor",
"type": "string"
},
{
"internalType": "address",
"name": "TxOrigin",
"type": "address"
},
{
"internalType": "uint256",
"name": "Timestamp",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "blockNum",
"type": "uint256"
},
{
"internalType": "address",
"name": "MsgSender",
"type": "address"
},
{
"internalType": "bool",
"name": "ifSuccess",
"type": "bool"
}
],
"internalType": "struct Log.Log[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_userAddress",
"type": "address"
}
],
"name": "getUserLog",
"outputs": [
{
"components": [
{
"internalType": "string",
"name": "ActionTo",
"type": "string"
},
{
"internalType": "string",
"name": "UserName",
"type": "string"
},
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "ActionFor",
"type": "string"
},
{
"internalType": "address",
"name": "TxOrigin",
"type": "address"
},
{
"internalType": "uint256",
"name": "Timestamp",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "blockNum",
"type": "uint256"
},
{
"internalType": "address",
"name": "MsgSender",
"type": "address"
},
{
"internalType": "bool",
"name": "ifSuccess",
"type": "bool"
}
],
"internalType": "struct Log.Log[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
}
];
//endregion
//region Course ABI码
const Course = [
{
"inputs": [
{
"internalType": "address",
"name": "_logAddress",
"type": "address"
},
{
"internalType": "address",
"name": "_userAddress",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_tag",
"type": "string"
},
{
"internalType": "string",
"name": "_class",
"type": "string"
},
{
"internalType": "string",
"name": "_description",
"type": "string"
}
],
"name": "addCourseInfo",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "enum Course.Check",
"name": "Status",
"type": "uint8"
},
{
"internalType": "address[]",
"name": "Operators",
"type": "address[]"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
},
{
"internalType": "string[]",
"name": "CheckComments",
"type": "string[]"
},
{
"internalType": "address[]",
"name": "Checker",
"type": "address[]"
}
],
"internalType": "struct Course.Course",
"name": "",
"type": "tuple"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_tag",
"type": "string"
},
{
"internalType": "string",
"name": "_class",
"type": "string"
},
{
"internalType": "string",
"name": "_description",
"type": "string"
},
{
"internalType": "string",
"name": "_filename",
"type": "string"
},
{
"internalType": "string",
"name": "_filepath",
"type": "string"
}
],
"name": "addCourseInfoWithUpload",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "enum Course.Check",
"name": "Status",
"type": "uint8"
},
{
"internalType": "address[]",
"name": "Operators",
"type": "address[]"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
},
{
"internalType": "string[]",
"name": "CheckComments",
"type": "string[]"
},
{
"internalType": "address[]",
"name": "Checker",
"type": "address[]"
}
],
"internalType": "struct Course.Course",
"name": "",
"type": "tuple"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "string",
"name": "_filepath",
"type": "string"
},
{
"internalType": "string",
"name": "_filename",
"type": "string"
}
],
"name": "addCourseUpload",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "address",
"name": "_newOperator",
"type": "address"
}
],
"name": "addOperator",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "score",
"type": "uint256"
}
],
"name": "addScore",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "calculateScore",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256[]",
"name": "_ids",
"type": "uint256[]"
},
{
"internalType": "enum Course.Check[]",
"name": "_results",
"type": "uint8[]"
},
{
"internalType": "string[]",
"name": "_comments",
"type": "string[]"
}
],
"name": "checkBatch",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "enum Course.Check",
"name": "result",
"type": "uint8"
},
{
"internalType": "string",
"name": "checkComment",
"type": "string"
}
],
"name": "checkCourse",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "adrs",
"type": "address"
},
{
"internalType": "address[]",
"name": "adrss",
"type": "address[]"
}
],
"name": "checkIfExist",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "adrs",
"type": "string"
},
{
"internalType": "string[]",
"name": "adrss",
"type": "string[]"
}
],
"name": "checkIfExist",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
}
],
"name": "checkIfMyCourseNameExist",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "string",
"name": "_filename",
"type": "string"
}
],
"name": "checkUploadIfExist",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "string",
"name": "_filename",
"type": "string"
}
],
"name": "deleteCourseUpload",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "disableCourse",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "string",
"name": "_filename",
"type": "string"
}
],
"name": "enableCourseUpload",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getAllCourseInfo",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "enum Course.Check",
"name": "Status",
"type": "uint8"
},
{
"internalType": "address[]",
"name": "Operators",
"type": "address[]"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
},
{
"internalType": "string[]",
"name": "CheckComments",
"type": "string[]"
},
{
"internalType": "address[]",
"name": "Checker",
"type": "address[]"
}
],
"internalType": "struct Course.Course[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getAllMyCourseInfo",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "enum Course.Check",
"name": "Status",
"type": "uint8"
},
{
"internalType": "address[]",
"name": "Operators",
"type": "address[]"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
},
{
"internalType": "string[]",
"name": "CheckComments",
"type": "string[]"
},
{
"internalType": "address[]",
"name": "Checker",
"type": "address[]"
}
],
"internalType": "struct Course.Course[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "getCourseInfo",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "enum Course.Check",
"name": "Status",
"type": "uint8"
},
{
"internalType": "address[]",
"name": "Operators",
"type": "address[]"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
},
{
"internalType": "string[]",
"name": "CheckComments",
"type": "string[]"
},
{
"internalType": "address[]",
"name": "Checker",
"type": "address[]"
}
],
"internalType": "struct Course.Course",
"name": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256[]",
"name": "Ids",
"type": "uint256[]"
}
],
"name": "getCourseInfoByArray",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "enum Course.Check",
"name": "Status",
"type": "uint8"
},
{
"internalType": "address[]",
"name": "Operators",
"type": "address[]"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
},
{
"internalType": "string[]",
"name": "CheckComments",
"type": "string[]"
},
{
"internalType": "address[]",
"name": "Checker",
"type": "address[]"
}
],
"internalType": "struct Course.Course[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "string",
"name": "_filename",
"type": "string"
}
],
"name": "getCourseUpload",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "getCourseUploadInfo",
"outputs": [
{
"internalType": "string[]",
"name": "",
"type": "string[]"
},
{
"internalType": "string[]",
"name": "",
"type": "string[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getNotCheck",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "enum Course.Check",
"name": "Status",
"type": "uint8"
},
{
"internalType": "address[]",
"name": "Operators",
"type": "address[]"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
},
{
"internalType": "string[]",
"name": "CheckComments",
"type": "string[]"
},
{
"internalType": "address[]",
"name": "Checker",
"type": "address[]"
}
],
"internalType": "struct Course.Course[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_tag",
"type": "string"
},
{
"internalType": "string",
"name": "_class",
"type": "string"
},
{
"internalType": "string",
"name": "_description",
"type": "string"
}
],
"name": "modifyCourseInfo",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "enum Course.Check",
"name": "Status",
"type": "uint8"
},
{
"internalType": "address[]",
"name": "Operators",
"type": "address[]"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
},
{
"internalType": "string[]",
"name": "CheckComments",
"type": "string[]"
},
{
"internalType": "address[]",
"name": "Checker",
"type": "address[]"
}
],
"internalType": "struct Course.Course",
"name": "",
"type": "tuple"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "string",
"name": "_filepath",
"type": "string"
},
{
"internalType": "string",
"name": "_filename",
"type": "string"
}
],
"name": "modifyCourseUpload",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "toString",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "toString",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "toString",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "value",
"type": "bytes32"
}
],
"name": "toString",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
}
];
//endregion
//region Experiment ABI码
const Experiment = [
{
"inputs": [
{
"internalType": "address",
"name": "_logAddress",
"type": "address"
},
{
"internalType": "address",
"name": "_userAddress",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_tag",
"type": "string"
},
{
"internalType": "string",
"name": "_class",
"type": "string"
},
{
"internalType": "string",
"name": "_description",
"type": "string"
}
],
"name": "addExperimentInfo",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "enum Experiment.Check",
"name": "Status",
"type": "uint8"
},
{
"internalType": "address[]",
"name": "Operators",
"type": "address[]"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
},
{
"internalType": "string[]",
"name": "CheckComments",
"type": "string[]"
},
{
"internalType": "address[]",
"name": "Checker",
"type": "address[]"
}
],
"internalType": "struct Experiment.Experiment",
"name": "",
"type": "tuple"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_tag",
"type": "string"
},
{
"internalType": "string",
"name": "_class",
"type": "string"
},
{
"internalType": "string",
"name": "_description",
"type": "string"
},
{
"internalType": "string",
"name": "_filename",
"type": "string"
},
{
"internalType": "string",
"name": "_filepath",
"type": "string"
}
],
"name": "addExperimentInfoWithUpload",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "enum Experiment.Check",
"name": "Status",
"type": "uint8"
},
{
"internalType": "address[]",
"name": "Operators",
"type": "address[]"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
},
{
"internalType": "string[]",
"name": "CheckComments",
"type": "string[]"
},
{
"internalType": "address[]",
"name": "Checker",
"type": "address[]"
}
],
"internalType": "struct Experiment.Experiment",
"name": "",
"type": "tuple"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "string",
"name": "_filepath",
"type": "string"
},
{
"internalType": "string",
"name": "_filename",
"type": "string"
}
],
"name": "addExperimentUpload",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "address",
"name": "_newOperator",
"type": "address"
}
],
"name": "addOperator",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "score",
"type": "uint256"
}
],
"name": "addScore",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "calculateScore",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256[]",
"name": "_ids",
"type": "uint256[]"
},
{
"internalType": "enum Experiment.Check[]",
"name": "_results",
"type": "uint8[]"
},
{
"internalType": "string[]",
"name": "_comments",
"type": "string[]"
}
],
"name": "checkBatch",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "enum Experiment.Check",
"name": "result",
"type": "uint8"
},
{
"internalType": "string",
"name": "checkComment",
"type": "string"
}
],
"name": "checkExperiment",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "adrs",
"type": "address"
},
{
"internalType": "address[]",
"name": "adrss",
"type": "address[]"
}
],
"name": "checkIfExist",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "adrs",
"type": "string"
},
{
"internalType": "string[]",
"name": "adrss",
"type": "string[]"
}
],
"name": "checkIfExist",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
}
],
"name": "checkIfMyExperimentNameExist",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "string",
"name": "_filename",
"type": "string"
}
],
"name": "checkUploadIfExist",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "string",
"name": "_filename",
"type": "string"
}
],
"name": "deleteExperimentUpload",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "disableExperiment",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "string",
"name": "_filename",
"type": "string"
}
],
"name": "enableExperimentUpload",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getAllExperimentInfo",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "enum Experiment.Check",
"name": "Status",
"type": "uint8"
},
{
"internalType": "address[]",
"name": "Operators",
"type": "address[]"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
},
{
"internalType": "string[]",
"name": "CheckComments",
"type": "string[]"
},
{
"internalType": "address[]",
"name": "Checker",
"type": "address[]"
}
],
"internalType": "struct Experiment.Experiment[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getAllMyExperimentInfo",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "enum Experiment.Check",
"name": "Status",
"type": "uint8"
},
{
"internalType": "address[]",
"name": "Operators",
"type": "address[]"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
},
{
"internalType": "string[]",
"name": "CheckComments",
"type": "string[]"
},
{
"internalType": "address[]",
"name": "Checker",
"type": "address[]"
}
],
"internalType": "struct Experiment.Experiment[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "getExperimentInfo",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "enum Experiment.Check",
"name": "Status",
"type": "uint8"
},
{
"internalType": "address[]",
"name": "Operators",
"type": "address[]"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
},
{
"internalType": "string[]",
"name": "CheckComments",
"type": "string[]"
},
{
"internalType": "address[]",
"name": "Checker",
"type": "address[]"
}
],
"internalType": "struct Experiment.Experiment",
"name": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "string",
"name": "_filename",
"type": "string"
}
],
"name": "getExperimentUpload",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "getExperimentUploadInfo",
"outputs": [
{
"internalType": "string[]",
"name": "",
"type": "string[]"
},
{
"internalType": "string[]",
"name": "",
"type": "string[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getNotCheck",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "enum Experiment.Check",
"name": "Status",
"type": "uint8"
},
{
"internalType": "address[]",
"name": "Operators",
"type": "address[]"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
},
{
"internalType": "string[]",
"name": "CheckComments",
"type": "string[]"
},
{
"internalType": "address[]",
"name": "Checker",
"type": "address[]"
}
],
"internalType": "struct Experiment.Experiment[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_tag",
"type": "string"
},
{
"internalType": "string",
"name": "_class",
"type": "string"
},
{
"internalType": "string",
"name": "_description",
"type": "string"
}
],
"name": "modifyExperimentInfo",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "enum Experiment.Check",
"name": "Status",
"type": "uint8"
},
{
"internalType": "address[]",
"name": "Operators",
"type": "address[]"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
},
{
"internalType": "string[]",
"name": "CheckComments",
"type": "string[]"
},
{
"internalType": "address[]",
"name": "Checker",
"type": "address[]"
}
],
"internalType": "struct Experiment.Experiment",
"name": "",
"type": "tuple"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "string",
"name": "_filepath",
"type": "string"
},
{
"internalType": "string",
"name": "_filename",
"type": "string"
}
],
"name": "modifyExperimentUpload",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "toString",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "toString",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "toString",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "value",
"type": "bytes32"
}
],
"name": "toString",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
}
];
//endregion
//region List ABI码
const List = [
{
"inputs": [
{
"internalType": "uint256",
"name": "_itemId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_courseId",
"type": "uint256"
}
],
"name": "addCourseToItem",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_itemId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_experimentId",
"type": "uint256"
}
],
"name": "addExperimentToItem",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "lessonIndex",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "itemIndex",
"type": "uint256"
}
],
"name": "addItemForLesson",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_tag",
"type": "string"
},
{
"internalType": "string",
"name": "_class",
"type": "string"
},
{
"internalType": "string",
"name": "_description",
"type": "string"
}
],
"name": "addItemList",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "stationIndex",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "lessonIndex",
"type": "uint256"
}
],
"name": "addLessonForStation",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_tag",
"type": "string"
},
{
"internalType": "string",
"name": "_class",
"type": "string"
},
{
"internalType": "string",
"name": "_description",
"type": "string"
}
],
"name": "addLessonList",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "score",
"type": "uint256"
}
],
"name": "addScoreForItem",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "score",
"type": "uint256"
}
],
"name": "addScoreForLesson",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_stationId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "score",
"type": "uint256"
}
],
"name": "addScoreForStation",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_tag",
"type": "string"
},
{
"internalType": "string",
"name": "_class",
"type": "string"
},
{
"internalType": "string",
"name": "_description",
"type": "string"
}
],
"name": "addStationList",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "calculateItemScore",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "calculateLessonScore",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "calculateStationScore",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "adrs",
"type": "address"
},
{
"internalType": "address[]",
"name": "adrss",
"type": "address[]"
}
],
"name": "checkIfExist",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getAllItem",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "bool",
"name": "Status",
"type": "bool"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256[]",
"name": "CourseIds",
"type": "uint256[]"
},
{
"internalType": "uint256[]",
"name": "ExperimentIds",
"type": "uint256[]"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
}
],
"internalType": "struct List.ItemList[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getAllLesson",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "bool",
"name": "Status",
"type": "bool"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
}
],
"internalType": "struct List.LessonList[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getAllStation",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "bool",
"name": "Status",
"type": "bool"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
}
],
"internalType": "struct List.StationList[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_itemId",
"type": "uint256"
}
],
"name": "getCoursesIdsFromItemId",
"outputs": [
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_itemId",
"type": "uint256"
}
],
"name": "getExperimentIdsFromItemId",
"outputs": [
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "getItemFromId",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "bool",
"name": "Status",
"type": "bool"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256[]",
"name": "CourseIds",
"type": "uint256[]"
},
{
"internalType": "uint256[]",
"name": "ExperimentIds",
"type": "uint256[]"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
}
],
"internalType": "struct List.ItemList",
"name": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_lessonId",
"type": "uint256"
}
],
"name": "getItemsFromLessonId",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "bool",
"name": "Status",
"type": "bool"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256[]",
"name": "CourseIds",
"type": "uint256[]"
},
{
"internalType": "uint256[]",
"name": "ExperimentIds",
"type": "uint256[]"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
}
],
"internalType": "struct List.ItemList[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "getLessonnFromId",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "bool",
"name": "Status",
"type": "bool"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
}
],
"internalType": "struct List.LessonList",
"name": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_stationId",
"type": "uint256"
}
],
"name": "getLessonsFromStationId",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "bool",
"name": "Status",
"type": "bool"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
}
],
"internalType": "struct List.LessonList[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "getMyItemScore",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "getMyLessonScore",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "getMyStationScore",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "getStationFromId",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "Id",
"type": "uint256"
},
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "address",
"name": "Author",
"type": "address"
},
{
"internalType": "bool",
"name": "Status",
"type": "bool"
},
{
"internalType": "string",
"name": "Class",
"type": "string"
},
{
"internalType": "string",
"name": "Tag",
"type": "string"
},
{
"internalType": "string",
"name": "Description",
"type": "string"
},
{
"internalType": "uint256",
"name": "Time",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "BlockNum",
"type": "uint256"
}
],
"internalType": "struct List.StationList",
"name": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_tag",
"type": "string"
},
{
"internalType": "string",
"name": "_class",
"type": "string"
},
{
"internalType": "string",
"name": "_description",
"type": "string"
}
],
"name": "modifyItemInfo",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_tag",
"type": "string"
},
{
"internalType": "string",
"name": "_class",
"type": "string"
},
{
"internalType": "string",
"name": "_description",
"type": "string"
}
],
"name": "modifyLessonInfo",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
},
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_tag",
"type": "string"
},
{
"internalType": "string",
"name": "_class",
"type": "string"
},
{
"internalType": "string",
"name": "_description",
"type": "string"
}
],
"name": "modifyStationInfo",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_itemId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "removeCourseIndexFromItem",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_itemId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_value",
"type": "uint256"
}
],
"name": "removeCourseValueFromItem",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_itemId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "removeExperimentIndexFromItem",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_itemId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_value",
"type": "uint256"
}
],
"name": "removeExperimentValueFromItem",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_lessonId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_itemId",
"type": "uint256"
}
],
"name": "removeItemIdValueFromLesson",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_lessonId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_itemIndex",
"type": "uint256"
}
],
"name": "removeItemIndexFromLesson",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_stationId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_lessonId",
"type": "uint256"
}
],
"name": "removeLessonIdValueFromStation",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_stationId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_lessonIndex",
"type": "uint256"
}
],
"name": "removeLessonIndexFromStation",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
];
//endregion
function Connection() {
if (typeof web3 !== 'undefined') {
if (ethereum.selectedAddress !== 'undefined') {
if (ethereum.networkVersion === '84736') {
WEB3 = new Web3(web3.currentProvider);
//WEB3 = new Web3(new Web3.providers.HttpProvider('http://172.22.105.33:8001'));
console.log(WEB3);
ethereum.enable();
Address = ethereum.selectedAddress;//这个地址主要是后面在进行web3调用的时候方便使用
// Awards=new WEB3.eth.Contract(Award,AwardAddr);
// Contracts = new WEB3.eth.Contract(Ballot, ContractAddr);
Log_Contract = new WEB3.eth.Contract(Log, LogAddr);
User_Contract = new WEB3.eth.Contract(User, UserAddr);
Experiment_Contract = new WEB3.eth.Contract(Experiment, ExperimentAddr);
Course_Contract = new WEB3.eth.Contract(Course, CourseAddr);
List_Contract = new WEB3.eth.Contract(List, ListAddr);
} else {
// alert("请选择Kovan测试网络!");
}
} else {
alert("请解锁MetaMask并创建账号!");
}
} else {
alert("请在浏览器安装MetaMask插件!");
}
return WEB3;
}
function FaucetGet(address){
WEB3 = new Web3(new Web3.providers.HttpProvider('http://129.226.118.153:8545/'));
WEB3.eth.sendTransaction({
from: "0xdF3F7b6c4eE18a735e780F6692b1A232B30Fd459",
to: address,
value: 1000000000000000000
}, function(err, hash) {
if (err) hash = err;
return hash;
});
}
//region User合约方法
//对于合约的函数调用而言(这次调用会修改合约当中的数据)-》send
function initiateUser() {
return User_Contract.methods.initiateUser().send({from: Address})//从自己的账户发出的交易
}
//对于合约的数据获取而言(这次调用不会修改合约当中的数据)->call
function getMyInfo() {
return User_Contract.methods.getMyInfo().call({from: Address})
}
function SuperAdminModify(name, stuNo, grade, identity, userAddress) {
return User_Contract.methods.SuperAdminModify(name, stuNo, grade, identity, userAddress).send({from: Address})
}
function modifyUserInfo(name, stuNo, grade, identity, userAddress) {
return User_Contract.methods.modifyUserInfo(name, stuNo, grade, identity, userAddress).send({from: Address})
}
function modifyMyInfo(name, stuNo, grade, identity) {
return User_Contract.methods.modifyMyInfo(name, stuNo, grade, identity).send({from: Address})
}
function upUserToAdmin(userAddress) {
return User_Contract.methods.upUserToAdmin(userAddress).send({from: Address})
}
function getAllUsers() {
return User_Contract.methods.getAllUsers().call({from: Address})
}
function getAllAdmins() {
return User_Contract.methods.getAllAdmins().call({from: Address})
}
function getUserInfo(userAddress) {
return User_Contract.methods.getUserInfo(userAddress).call({from: Address})
}
//endregion
//region Log合约方法
function getMyLog() {
return Log_Contract.methods.getMyLog().call({from: Address})
}
function getCourseLog(_courseId) {
return Log_Contract.methods.getCourseLog(_courseId).call({from: Address})
}
function getExperimentLog(_experimentId) {
return Log_Contract.methods.getExperimentLog(_experimentId).call({from: Address})
}
function getUserLog(_userAddress) {
return Log_Contract.methods.getUserLog(_userAddress).call({from: Address})
}
//endregion
//region Experiment合约方法
function checkExperiment(_id,result,checkComment){
return Experiment_Contract.methods.checkExperiment(_id,result,checkComment).send({from:Address})
}
function getExperimentNotCheck(){
return Experiment_Contract.methods.getNotCheck().call({from:Address})
}
function checkExperimentBatch(_ids,_results,_comments) {
return Experiment_Contract.methods.checkBatch(_ids,_results,_comments).send({from:Address})
}
function addExperimentInfoWithUpload(_name, _tag, _class, _description, _filename, _filepath) {
// TODO:上传功能
return Experiment_Contract.methods.addExperimentInfoWithUpload(_name, _tag, _class, _description,_filename,_filepath).send({from: Address})
}
function addExperimentInfo(_name, _tag, _class, _description) {
return Experiment_Contract.methods.addExperimentInfo(_name, _tag, _class, _description).send({from: Address})
}
function getExperimentInfo(_id) {
return Experiment_Contract.methods.getExperimentInfo(_id).call({from: Address})
}
function modifyExperimentInfo(_id, _name, _tag, _class, _description) {
return Experiment_Contract.methods.modifyExperimentInfo(_id, _name, _tag, _class, _description).send({from: Address})
}
function disableExperiment(_id) {
return Experiment_Contract.methods.disableExperiment(_id).send({from: Address})
}
function getExperimentUploadInfo(_id) {
return Experiment_Contract.methods.getExperimentUploadInfo(_id).call({from: Address})
}
function addExperimentUpload(_id, _filepath, _filename) {
return Experiment_Contract.methods.addExperimentUpload(_id, _filepath, _filename).send({from: Address})
}
function modifyExperimentUpload(_id, _filepath, _filename) {
return Experiment_Contract.methods.modifyExperimentUpload(_id, _filepath, _filename).send({from: Address})
}
function deleteExperimentUpload(_id, _filename) {
return Experiment_Contract.methods.deleteExperimentUpload(_id, _filename).send({from: Address})
}
function enableExperimentUpload(_id, _filename) {
return Experiment_Contract.methods.enableExperimentUpload(_id, _filename).send({from: Address})
}
function getExperimentUpload(_id, _filename) {
return Experiment_Contract.methods.getExperimentUpload(_id, _filename).call({from: Address})
}
function addOperator(_id, _newOperator) {
return Experiment_Contract.methods.addOperator(_id, _newOperator).send({from: Address})
}
function addScore(_id, score) {
return Experiment_Contract.methods.addScore(_id, score).send({from: Address})
}
function calculateScore(_id) {
return Experiment_Contract.methods.calculateScore(_id).call({from: Address})
}
function getAllMyExperimentInfo() {
return Experiment_Contract.methods.getAllMyExperimentInfo().call({from: Address})
}
function getAllExperimentInfo() {
return Experiment_Contract.methods.getAllExperimentInfo().call({from: Address})
}
//endregion
//region Course合约方法
function checkCourse(_id,result,checkComment){
return Course_Contract.methods.checkCourse(_id,result,checkComment).send({from:Address})
}
function getNotCheck(){
return Course_Contract.methods.getNotCheck().call({from:Address})
}
function checkBatch(_ids,_results,_comments) {
return Course_Contract.methods.checkBatch(_ids,_results,_comments).send({from:Address})
}
function addCourseInfoWithUpload(_name, _tag, _class, _description,_filename,_filepath) {
return Course_Contract.methods.addCourseInfoWithUpload(_name, _tag, _class, _description,_filename,_filepath).send({from: Address})
}
function addCourseInfo(_name, _tag, _class, _description) {
return Course_Contract.methods.addCourseInfo(_name, _tag, _class, _description).send({from: Address})
}
function getCourseInfo(_id) {
return Course_Contract.methods.getCourseInfo(_id).call({from: Address})
}
function modifyCourseInfo(_id, _name, _tag, _class, _description) {
return Course_Contract.methods.modifyCourseInfo(_id, _name, _tag, _class, _description).send({from: Address})
}
function disableCourse(_id) {
return Course_Contract.methods.disableCourse(_id).send({from: Address})
}
function getCourseUploadInfo(_id) {
return Course_Contract.methods.getCourseUploadInfo(_id).call({from: Address})
}
function addCourseUpload(_id, _filepath, _filename) {
return Course_Contract.methods.addCourseUpload(_id, _filepath, _filename).send({from: Address})
}
function modifyCourseUpload(_id, _filepath, _filename) {
return Course_Contract.methods.modifyCourseUpload(_id, _filepath, _filename).send({from: Address})
}
function deleteCourseUpload(_id, _filename) {
return Course_Contract.methods.deleteCourseUpload(_id, _filename).send({from: Address})
}
function enableCourseUpload(_id, _filename) {
return Course_Contract.methods.enableCourseUpload(_id, _filename).send({from: Address})
}
function getCourseUpload(_id, _filename) {
return Course_Contract.methods.getCourseUpload(_id, _filename).call({from: Address})
}
function addCourseOperator(_id, _newOperator) {
return Course_Contract.methods.addCourseOperator(_id, _newOperator).send({from: Address})
}
function addCourseScore(_id, score) {
return Course_Contract.methods.addScore(_id, score).send({from: Address})
}
function calculateCourseScore(_id) {
return Course_Contract.methods.calculateCourseScore(_id).call({from: Address})
}
function getAllMyCourseInfo() {
return Course_Contract.methods.getAllMyCourseInfo().call({from: Address})
}
function getAllCourseInfo() {
return Course_Contract.methods.getAllCourseInfo().call({from: Address})
}
//endregion
//region List合约方法
function addStationList(_name, _tag, _class, _description) {
return List_Contract.methods.addStationList(_name, _tag, _class, _description).send({from: Address})
}
function addItemList(_name, _tag, _class, _description) {
return List_Contract.methods.addItemList(_name, _tag, _class, _description).send({from: Address})
}
function addLessonList(_name, _tag, _class, _description) {
return List_Contract.methods.addLessonList(_name, _tag, _class, _description).send({from: Address})
}
function addLessonForStation(_stationIndex,_lessonIndex) {
return List_Contract.methods.addLessonForStation(_stationIndex,_lessonIndex).send({from: Address})
}
function addItemForLesson(_lessonIndex, _itemIndex) {
return List_Contract.methods.addItemForLesson(_lessonIndex, _itemIndex).send({from: Address})
}
function addCourseToItem(_itemId, _courseId) {
return List_Contract.methods.addCourseToItem(_itemId, _courseId).send({from: Address})
}
function addExperimentToItem(_itemId, _experimentId) {
return List_Contract.methods.addExperimentToItem(_itemId, _experimentId).send({from: Address})
}
function removeLessonIdValueFromStation(_stationId, _lessonId) {
return List_Contract.methods.removeLessonIdValueFromStation(_stationId, _lessonId).send({from: Address})
}
function removeItemIdValueFromLesson(_lessonId, _itemId) {
return List_Contract.methods.removeItemIdValueFromLesson(_lessonId, _itemId).send({from: Address})
}
function removeCourseValueFromItem(_itemId, _value) {
return List_Contract.methods.removeCourseValueFromItem(_itemId, _value).send({from: Address})
}
function removeExperimentValueFromItem(_itemId, _value) {
return List_Contract.methods.removeExperimentValueFromItem(_itemId, _value).send({from: Address})
}
function getLessonsFromStationId(_stationId) {
return List_Contract.methods.getLessonsFromStationId(_stationId).call({from: Address})
}
function getItemsFromLessonId(_lessonId) {
return List_Contract.methods.getItemsFromLessonId(_lessonId).call({from: Address})
}
function getAllStation() {
return List_Contract.methods.getAllStation().call({from: Address})
}
function getAllLesson() {
return List_Contract.methods.getAllLesson().call({from: Address})
}
function getAllItem() {
return List_Contract.methods.getAllItem().call({from: Address})
}
function getCoursesIdsFromItemId(_itemId) {
return List_Contract.methods.getCoursesIdsFromItemId(_itemId).call({from: Address})
}
function getExperimentIdsFromItemId(_itemId) {
return List_Contract.methods.getExperimentIdsFromItemId(_itemId).call({from: Address})
}
function addScoreForStation(_stationId,score){
return List_Contract.methods.addScoreForStation(_stationId,score).send({from: Address})
}
function addScoreForLesson(_id,score){
return List_Contract.methods.addScoreForLesson(_id,score).send({from: Address})
}
function addScoreForItem(_id,score){
return List_Contract.methods.addScoreForItem(_id,score).send({from: Address})
}
function getMyStationScore(_id){
return List_Contract.methods.getMyStationScore(_id).call({from: Address})
}
function getMyLessonScore(_id){
return List_Contract.methods.getMyLessonScore(_id).call({from: Address})
}
function getMyItemScore(_id){
return List_Contract.methods.getMyItemScore(_id).call({from: Address})
}
function calculateStationScore(_id){
return List_Contract.methods.calculateStationScore(_id).call({from: Address})
}
function calculateLessonScore(_id){
return List_Contract.methods.calculateLessonScore(_id).call({from: Address})
}
function calculateItemScore(_id){
return List_Contract.methods.calculateItemScore(_id).call({from: Address})
}
function modifyStationInfo(_id,_name,_tag,_class,_description){
return List_Contract.methods.modifyStationInfo(_id,_name,_tag,_class,_description).send({from: Address})
}
function modifyLessonInfo(_id,_name,_tag,_class,_description){
return List_Contract.methods.modifyLessonInfo(_id,_name,_tag,_class,_description).send({from: Address})
}
function modifyItemInfo(_id,_name,_tag,_class,_description){
return List_Contract.methods.modifyItemInfo(_id,_name,_tag,_class,_description).send({from: Address})
}
function getStationFromId(_id){
return List_Contract.methods.getStationFromId(_id).call({from: Address})
}
function getLessonnFromId(_id){
return List_Contract.methods.getLessonnFromId(_id).call({from: Address})
}
function getItemFromId(_id){
return List_Contract.methods.getItemFromId(_id).call({from: Address})
}
//endregion
//region 1215新增函数
//以下是Course的:
// function checkCourse(_name, _tag, _class, _description) {
// return Course_Contract.methods.checkCourse(_name, _tag, _class, _description).send({from: Address})
// }
// function getNotCheck(_name, _tag, _class, _description) {
// return Course_Contract.methods.getNotCheck(_name, _tag, _class, _description).call({from: Address})
// }
// function checkBatch(_name, _tag, _class, _description) {
// return Course_Contract.methods.checkBatch(_name, _tag, _class, _description).send({from: Address})
// }
// function addCourseInfoWithUpload(_name, _tag, _class, _description) {
// return Course_Contract.methods.addCourseInfoWithUpload(_name, _tag, _class, _description).send({from: Address})
// }
//以下是Experiment的:
// function checkCourse(_name, _tag, _class, _description) {
// return Course_Contract.methods.checkCourse(_name, _tag, _class, _description).send({from: Address})
// }
// function getNotCheck(_name, _tag, _class, _description) {
// return Course_Contract.methods.getNotCheck(_name, _tag, _class, _description).call({from: Address})
// }
// function checkBatch(_name, _tag, _class, _description) {
// return Course_Contract.methods.checkBatch(_name, _tag, _class, _description).send({from: Address})
// }
// function addCourseInfoWithUpload(_name, _tag, _class, _description) {
// return Course_Contract.methods.addCourseInfoWithUpload(_name, _tag, _class, _description).send({from: Address})
// }
//endregion
export { //关键
WEB3,
Connection,
initiateUser,
getMyInfo,
getMyLog,
SuperAdminModify,
modifyUserInfo,
modifyMyInfo,
upUserToAdmin,
getAllUsers,
getAllAdmins,
getUserInfo,
getCourseLog,
getExperimentLog,
getUserLog,
addExperimentInfo,
getExperimentInfo,
modifyExperimentInfo,
disableExperiment,
getExperimentUploadInfo,
addExperimentUpload,
modifyExperimentUpload,
deleteExperimentUpload,
enableExperimentUpload,
getExperimentUpload,
addOperator,
addScore,
calculateScore,
getAllMyExperimentInfo,
getAllExperimentInfo,
checkExperiment,
getExperimentNotCheck,
checkExperimentBatch,
addExperimentInfoWithUpload,
addCourseInfo,
getCourseInfo,
modifyCourseInfo,
disableCourse,
getCourseUploadInfo,
addCourseUpload,
modifyCourseUpload,
deleteCourseUpload,
enableCourseUpload,
getCourseUpload,
addCourseOperator,
addCourseScore,
calculateCourseScore,
getAllMyCourseInfo,
getAllCourseInfo,
checkCourse,
getNotCheck,
checkBatch,
addCourseInfoWithUpload,
addStationList,
addItemList,
addLessonList,
addLessonForStation,
addItemForLesson,
addCourseToItem,
addExperimentToItem,
removeLessonIdValueFromStation,
removeItemIdValueFromLesson,
removeCourseValueFromItem,
removeExperimentValueFromItem,
getLessonsFromStationId,
getItemsFromLessonId,
getAllStation,
getAllLesson,
getAllItem,
getCoursesIdsFromItemId,
getExperimentIdsFromItemId,
addScoreForStation,
addScoreForLesson,
addScoreForItem,
getMyStationScore,
getMyLessonScore,
getMyItemScore,
calculateStationScore,
calculateLessonScore,
calculateItemScore,
modifyStationInfo,
modifyLessonInfo,
modifyItemInfo,
getStationFromId,
getLessonnFromId,
getItemFromId,
FaucetGet,
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。