Code Monkey home page Code Monkey logo

ham-radio-freedom's People

Contributors

et1083 avatar hcarter333 avatar

Watchers

 avatar

ham-radio-freedom's Issues

Play with Tech Question Pool in Datasette

Load the tech question pool into a database to use for learning @simonw 's datasette

This is related to #13 . It's also related to working through the tutorial at

https://datasette.io/tutorials/data-analysis#exploring-data-with-datasette

and

https://sqlite-tutorial-pycon-2023.readthedocs.io/en/latest/datasette.html

Steps:

  1. Load tech question pool at jscript/tqs.js into a python file tqs.py
  2. Create methods for loading up a dictionary with the question data
  3. Write the existing qestion data into a sqlite .db file.
  4. Use datasette to play with the data and possibly add help links as in #13 using the datasette write plugin.

User name not displayed in ham scores

Top line above graph does not display user name. No error messages in the browser relate to this. Look into the javascript simply not placing the username there.
image

Simplify random question selection

I want question selection to be very, very simple. At the moment, it is the most complex portion of the application

New question list design:

  • Build a data structure that holds the number of questions per subelement
    • There are always 10 subelements
    • This data structure may change with each question pool release
  • Choose one question from each group in each subelement

The database can actually return each group all on its own. The app could then randomly select a question from within the group depending on the size of the group. (again with the database giving the size of the group.) The chosen question would be referenced using its group_number.

unsafe header fields

Saving scores gives the followign two error messages:

image

Try removing those two lines of code since they're not workign anyway per the error messages.

Create python question parser (again)

Build a parser that does the following:

**Isolates all questions out of the pool using sed to start at lines that match
^T\d[A-Za-z]\d\d
(For the general class pool use 'G' instead of the 'T' shown above)
until a line matching
^~~
is found

Pulls out answer
Found with
([A-D])

Collapses question and answers into single line matching the following example format
1|T|1|A|01|D|[97.3(a)(4)] For whom is the Amateur Radio Service ....

2|T|1|A|02|C|[97.1] What agency regulates an.....

Where the first field is a unique number in sequence, the second is T for technician exam, the following three are deconstructed from the first line of the question and indicate group|subgroup|correct_answer, and finally the last five fields are the question and all four possible answers. All questions go on the same line for the moment.

Change all double quotes to backslash_double_quote style
Use sed for this as well

Consrtruct a test case that loads the resulting line into a javascript in an html page and passes if there are no errors.

Steering directly to examhelp pages results in 404 error

https://hamdaise.wl.r.appspot.com/hamtest/examhelp/techpowerfor.html

returns

image

These links may have helpful information:
https://stackoverflow.com/questions/1058119/how-to-redirect-all-urls-with-google-app-engine

https://stackoverflow.com/questions/72641794/google-app-engine-static-file-referenced-by-handler-not-found

Error log message:
{
"protoPayload": {
"@type": "type.googleapis.com/google.appengine.logging.v1.RequestLog",
"appId": "m~hamdaise",
"versionId": "20230126t043437",
"requestId": "63d273e600ff00ffb02995f35c7d00016d7e68616d64616973650001323032333031323674303433343337000100",
"ip": "2601:645:c380:2210:bd0e:c154:7266:325c",
"startTime": "2023-01-26T12:36:54.051245Z",
"endTime": "2023-01-26T12:36:54.058614Z",
"latency": "0.007369s",
"megaCycles": "90",
"method": "GET",
"resource": "/hamtest/examhelp/techpowerfor.html",
"httpVersion": "HTTP/1.1",
"status": 404,
"responseSize": "188",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",
"urlMapEntry": "main.py",
"host": "hamdaise.wl.r.appspot.com",
"cost": 2.101e-8,
"instanceIndex": -1,
"finished": true,
"instanceId": "00c61b117c5b3b594da2c490ad3d136766f4f26b38c7aecaa1fd3552290e7eb3458f63951eb617602bb168d8460a3e70de8a3b0de16544d9",
"appEngineRelease": "1.9.71",
"traceId": "d6fbc8e13fb802a62d1c500285722afe",
"first": true,
"traceSampled": true,
"spanId": "2860484800307601475"
},
"insertId": "63d273e60000e57f93f4f509",
"httpRequest": {
"status": 404
},
"resource": {
"type": "gae_app",
"labels": {
"project_id": "hamdaise",
"zone": "us-west2-1",
"version_id": "20230126t043437",
"module_id": "default"
}
},
"timestamp": "2023-01-26T12:36:54.051245Z",
"labels": {
"clone_id": "00c61b117c5b3b594da2c490ad3d136766f4f26b38c7aecaa1fd3552290e7eb3458f63951eb617602bb168d8460a3e70de8a3b0de16544d9"
},
"logName": "projects/hamdaise/logs/appengine.googleapis.com%2Frequest_log",
"operation": {
"id": "63d273e600ff00ffb02995f35c7d00016d7e68616d64616973650001323032333031323674303433343337000100",
"producer": "appengine.googleapis.com/request_id",
"first": true,
"last": true
},
"trace": "projects/hamdaise/traces/d6fbc8e13fb802a62d1c500285722afe",
"receiveTimestamp": "2023-01-26T12:36:54.059856499Z",
"spanId": "2860484800307601475",
"traceSampled": true
}

Add ham help update page to app

Fix the class HamTestHelp in main.py
First, remove the put in the get method to see if help will be displayed.

Then, make a UI to specify where the help pages for each questions are. The UI should also display the questions and its available answer so the user will be able to make an informed decision about which help page to link to the question, or alternatively, if no help page exists, what information to place in the newly created help page.

To see the existing page (which does not work--see below) go to
https://hamdaise.wl.r.appspot.com/hamtesthelp

Update to Python 3

This is the problem:
File upload done.
WARNING: Python 2.7 is no longer supported by the Python community as of 1 January, 2020. Python 2.7 will be end of support on 2024-01-30. As of 2024-01-30 you will no longer be able to deploy your App Engine Standard using python27. We recommend you to upgrade to the latest version of Python as soon as possible.

Is this the answer?

NeedIndexError on saving scores

The following error was produced:\

NeedIndexError: no matching index found. recommended index is: - kind: HamTestScore properties: - name: name - name: tclass - name: scoredate The suggested index for this query is: - kind: HamTestScore properties: - name: name - name: tclass - name: scoredate

After researching I found
https://stackoverflow.com/questions/29807215/google-app-engine-error-needindexerror-no-matching-index-found

Looking through the original ham exam site, I found index.yaml. I moved it to the current deployment, and then executed the command

gcloud app deploy index.yaml

After which ham scores are saved.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.