BountyOneBounties / Issues

4 stars 0 forks source link

Design a smart contract that award students proof of knowledge token. #10

Closed jackwzp closed 6 years ago

jackwzp commented 6 years ago

As a student progress through an online course by watching videos, doing coding projects and completing quizzes, record these events on the blockchain. Once they have reached certain milestone reward them with a token that represent their proof of knowledge.

Leave the link to your work and your ETH address below to be rewarded.

rajilini commented 6 years ago

Hi, I am new to Bounties. But wishes to participate since I have done a similar work, pls let me know how i can?

rajilini commented 6 years ago

My Etherwallet ID===0xC35CdFd8af91041631Bfd9CD7ffC810245A22F4E=== -------------------------MY SOLUTION -------------------------- pragma solidity ^0.4.21;

contract EduToken{ // Track how many tokens are owned by each address. mapping (address => uint256) public balanceOf;

string public name = "EduTX";
string public symbol = "ETX";

uint256 public totalSupply = 100000;

event Transfer(address indexed from, address indexed to, uint256 value);

constructor() public {
    // Initially assign all tokens to the contract's creator.
    balanceOf[msg.sender] = totalSupply;
    emit Transfer(address(0), msg.sender, totalSupply);
}

function transfer(address to, uint256 value) public returns (bool success) {
    require(balanceOf[msg.sender] >= value);

    balanceOf[msg.sender] -= value;  // deduct from sender's balance
    balanceOf[to] += value;          // add to recipient's balance
    emit Transfer(msg.sender, to, value);
    return true;
}

}

contract academic is EduToken{ uint private min_assign; uint private min_proj; uint private min_att; struct marks{ uint assign; uint proj; uint attstudy; } address owner; mapping (uint=>marks) student; constructor(uint _min1,uint _min2,uint _min3) public{ owner=msg.sender; min_assign=_min1; min_proj=_min2; min_att=_min3;

}

function  setassign(uint _sid,uint _assign)public{
    student[_sid].assign+=_assign;
}
function  setproj(uint _sid,uint _proj)public{
    student[_sid].proj+=_proj;
}
function  setattitude(uint _sid,uint _attstudy)public{
    student[_sid].attstudy+=_attstudy;
}
function getstudentdata(uint _sid)public view returns(uint,uint,uint){
    return(student[_sid].assign,student[_sid].proj,student[_sid].attstudy);
}
function transferToken(uint _sid,address _stuaddress) public{
    if(msg.sender==owner && student[_sid].assign>=min_assign && student[_sid].proj>=min_proj && student[_sid].attstudy>=min_att){
      transfer(_stuaddress,1);  
      student[_sid].assign=0;
      student[_sid].proj=0;
      student[_sid].attstudy=0;
    }
}

} ----------------- ENDS HERE-------------------------------------

hnamzian commented 6 years ago

This is a rather comprehensive code supports creating a course curriculum, student registration, student progress and token reward based on ERC20 token.

https://github.com/hnamzian/Proof-of-Knowledge/tree/master/contracts

email: namazian87@gmail.com ETH: 0xB3EeCE8b0d3a389Fd182e46Ef55B3a6E270cFB17

tomvanbraeckel commented 6 years ago

This wouldn't really be proof of knowledge, would it? It would be proof of "you played a video". To have proof of knowledge you would have to test for that knowledge and record the test results on the blockchain...

hnamzian commented 6 years ago

@tomvanbraeckel greate point. Actually I considered code project and quizes but I didn't think of accomplishment. The 0-1 concept. I will add it.

hnamzian commented 6 years ago

updated

thebkr7 commented 6 years ago

@cryptoweb3 Welcome! I'll check out everyone's code today and tomorrow

hnamzian commented 6 years ago

I'd be so glad to get some feedback. thanks

bountyone commented 6 years ago

@cryptoweb3 Great job. You've been rewarded the bounty!