Form validation from complete novice - forms

After quite a few Google searches, I have finally found my way here for this question. If this is something that could be better asked elsewhere, any direction that could be provided would be greatly appreciated.
I have made some HTML forms in the past, but I am trying to do some validation, of which, I have never done before.
What I would like to do is have a form that has two drop down lists that are sort of tied together, the first being one of two choices (say A and B) and the other being a list of the numbers 1 through 30.
What I need to do is have 30 of such "questions" and I need to validate that each number (1 through 30) are used in the form and only used once.
As stated I am a novice at any type of the programming required to make such a form from scratch. I can read some code and understand what is going on sometimes, but I don't have the knowledge to be 100% sure.
Any help, or direction to where I could get this answered is greatly appreciated.
Thank you

Related

Security of smart contract data not returned by a view function

I've been looking through some of the NEAR demos and came across the one regarding posting quizzes that can be answered for a reward.
Source code here: https://github.com/Learn-NEAR/NCD-02--riddles
Video here: https://www.youtube.com/watch?v=u4jP2a2mbiI
My question is related to how secure the answer hash is. In the current implementation, the answer hash is returned with the quizzes, but I imagine it would be better if that wasn't the case. Even then, if the hash was stored on the NEAR network without it being returned by any view functions, how secure would that be? If there was code in this contract to only give a certain number of guesses per account before denying additional attempts, would someone be able to get the hash through some other means and then have as many chances to answer as they want by locally hashing answers with sha256 and seeing if one matches?
Thanks,
Christopher
for sure all data on chain is public so storing anything means sharing it with the world
one reasonable way to handle something like this would be to store the hash but accept the raw string and then hash it to compare the two for a possible win
if you choose a secure hashing algorithm then it would be nearly impossible to guess the required input string based on seeing the hash
update: it was poined out to me that this answer is in incomplete or misleading because if the set of possible answers is small then this would still be a bad design because you could just quickly hash all the possible answers (eg. in a multiple choice question) and compare those hashes with the answer
heads up!
everything in that GitHub org that starts with NCD is a student project submitted after just a week of learning about NEAR
so there is a huge pile of mistakes there just waiting to be refactored and commented on by experts in the community
the projects that are presented for study all start with the prefix sample
those are the ones we generated to help students explore the possibilities of contracts on the NEAR platform along with all our core contracts, Sputnik contracts and others
sign up to learn more about NEAR Certified Developer Programs here: https://near.training

Retrieve Output parameters from stored procedure using entity framework/MVC

After hours upon hours of research, I can't retrieve the output parameter from the stored procedure through entity, or a helpful link about the issue. All solutions and suggested practices I have come across don't work or if they do work, they are missing enough detail so their solution can be done correctly. Any help would be appreciated, especially detailed help. Thank you.
Example of approaches that don't work:
ObjectParameter Output = new ObjectParameter("ID", typeof(Int32));
context.InsertPerson(Name, Description, Output);
this link has a solution that I have not tried because it is a bit beyond my knowledge and a bit too invasive, and doesn't really use entity framework in the end.

How to break up large document into smaller answer units on Retrieve and Rank?

I am still very new to Retrieve and Rank, and Document Conversion services, so I have been playing around with that lately.
I encountered a problem where when I upload a large document (100+ pages) - Retrieve and Rank would help me automatically break it up into answer units, which is great and helpful.
However, some questions only require ONE small line in the big chunks of answer units, is there a way that I can manually break further down the answer units that Retrieve and Rank service has provided me?
I heard that you can do it through JavaScript, but is there a way to do it through the UI?
I am contemplating to manually break up the huge doc into multiple smaller documents, but that could potentially lead to 100s of them - which is probably the last option that I'd resort to.
Any help or suggestions is greatly appreciated!
Thank you all!
First off, one clarification:
Retrieve and Rank does not break up your documents into answer units. That is something that the Document Conversion Service does when your conversion target is ANSWER_UNITS.
Regarding your question:
I don't fully understand exactly what you're trying to do, but if the answer units that are produced by default don't meet your requirements, you can customize different steps of the conversion process to adjust the produced answer units. Take a look at the documentation here.
Specifically, you want to make sure that the heading levels (for Word, PDF or HTML, depending on your document type) are defined in a way that
they detect the start of each answer unit. Then, make sure that the heading levels that you defined (h1, h2, h3, etc.) are included in the selector_tags list within the answer_units section.
Once your custom Document Conversion Service configuration produces the answer units you are looking for, you will be ready to send them to Retrieve and Rank to be indexed.

Best way to create Non-Random Questions for Quiz app - Swift

New to swift and just wondering if anyone could give me some insight on the best way to create questions for a true or false quiz app I am working on.
I saw another thread about making questions non-random but as my expertise isn`t that great yet I am still struggling to understand the concepts.
Would I create a dictionary with a key value pair with a String being a question and Int being the answers?
Any insight would be greatly appreciated.
Thank you!
That would be the basic setup. You might also consider using a Bool instead of an Int for the answer, and other fields for difficulty level, number of times used, etc. The true power of dictionaries is that you can add as many key:value pairs as you like, thus being able to track all sorts of metrics over time.

distributing pivot graphs to departments through email efficiently

I work at an institution with a lot of departments and subdivisions. I have an "excel-database" with pivotcharts that can show the results for the progress of the different departments and subdivisions, but there are quite a lot, and to get through all graphs (Dep 1, subdivision 1, Dep 1 subdivision 2, etc...) I have to go through quite a bunch of iterations sending out the graphs for each department and subdivision.
I'm considering creating a macro - that selects each option in the pivotchart and then exports to a word document, but I don't know if there's an easier way to go, since I guess thiss will take me quite some time too.
I'm thinking that someone probably has been in the same situation, so if anyone has any suggestions as to how this could be solved efficiently, please let me know.
EDIT:
So as I see it there are three steps to this question that need solving (steps that are striked are steps that I know how to do)
Iterate through pivot table options
Copy charts to word OR other excel file and save
attach that file to a mail, and send it to the correct department-mail
The general thinking about how to handle a case like yours has changed over the years. Currently I would recommend making the data accessible on an internal website of some kind and allowing each department to generate their own graph on demand. They would then be able to look at the data whenever they wanted and you would not have to send out graphs. See if Google Drive or MS Office365 can do this for you.