eduSteem developement update (Week 3b)

in #utopian-io6 years ago

Repository

https://github.com/bflanagin/EduSteem

Banner.png

New Feature: User Profile

With many of the core features working I've turned my attention to the "Steem" part of eduSteem. Currently the Steem integration is limited to the setup and retrieving relevant information about the account. The implementation also gives the users a place to update their eduSteem profile which will be needed for planned features listed below.

shot-2018-06-27_01-31-50.jpg

The planed feature set includes:

Educators

  • Sharing lesson plans and activities to the Steem network.
  • Searching and "Downloading" lesson plans and activities from Steem
  • Being able to vote, comment, reply on the lesson plans and activities.

Students

  • Upload finished projects to the Steem network
  • Share parent or guardian account for any rewards given
  • Weekly semi-automated "report" for those that are investing in the child's future through liking their submissions.

Implementation

Pull requests: 7,8

Using the Steemit API found here I was able to build a simple function set and retrieve data from the Steem block chain. Using XMLHttpRequest() to create a connection to the server I simply reformatted the returned data into various variables for the interface to access and display. For full code reference of my Steemit functions check out steemit.js

The interface is built in the same fashion as all QML based interfaces and can be found in the Profile.qml file.

The Steem information is stored locally in the program's private data store, and written to the database using the saveSteem function found in general.js the function in its entirety is pasted below.


function saveSteem(userid, type, steemAccount, steemKey) {

    var pull = ""

    var data = [userid,type,steemAccount,steemKey,""]
    var dtable = "INSERT INTO Steem VALUES(?,?,?,?,?)"

    db.transaction(function (tx) {
        tx.executeSql(
                    'CREATE TABLE IF NOT EXISTS Steem (id TEXT, type INT,data1 TEXT,data2 TEXT,data3 TEXT)')

        pull = tx.executeSql("SELECT * FROM Steem WHERE id='" + userid + "'")

        if (pull.rows.length !== 1) {

            tx.executeSql(dtable, data)
        } else {
            tx.executeSql("UPDATE Steem SET data1='"+steemAccount+"', data2='"+steemKey+"' WHERE id='"+userid+"'")
        }
    })
}

Find out more

eduSteem is going through a development sprint. These weekly updates, help keep me on track as well as giving those that are interested detailed reporting of my progress. The goal is to have it ready for use in a small school setting by the end of July. For further reading check out these other posts here on Steemit.

GitHub Account

https://github.com/bflanagin

Sort:  

Congratulations @bflanagin! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of comments received

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard!


Participate in the SteemitBoard World Cup Contest!
Collect World Cup badges and win free SBD
Support the Gold Sponsors of the contest: @good-karma and @lukestokes


You can upvote this notification to to help all Steemit users. Learn why here!

Two updates in a day! Someone wants some upvote :D

So this is bad =>
https://github.com/bflanagin/EduSteem/blob/3b7d3b4ca2071e2ab29c4ee5017cfb073ea70d7a/Desktop/General/general.js#L9 every time you want to load some data you try to create the corresponding table. You should have a script that initialize your database and may be populate it with some basic mandatory data (like categories, languages, whatever)

I've also noticed that you open a transaction for a SELECT operation. Transactions are opened in case a rollback is needed. Here since you simply select some data just opening a connection should be fine.

Improving the performance right now will save you later !

Try to split your pull requests. Adding features and fixing bugs should be in separated PR.

Otherwise same comments than in the previous review :)

Good luck for your next PR

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Heh, I'm just trying to stay on schedule. I don't see a function in qtquick-localstorage to let me just pull from it without opening a transaction. There is the ability to have read only transactions. That's the closest thing I see.

Hey @bflanagin
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.27
TRX 0.12
JST 0.031
BTC 61785.67
ETH 2891.86
USDT 1.00
SBD 3.54