Forum Trivial Pursuit - New Computer Science and Mathematics Trivia for UNIX.com


 
Thread Tools Search this Thread
The Lounge What is on Your Mind? Forum Trivial Pursuit - New Computer Science and Mathematics Trivia for UNIX.com
# 8  
Old 10-27-2019
Added a field to validate:

Code:
mysql> describe neo_open_trivia;
+-------------------+------------------+------+-----+---------+----------------+
| Field             | Type             | Null | Key | Default | Extra          |
+-------------------+------------------+------+-----+---------+----------------+
| id                | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| category          | varchar(254)     | NO   |     | NULL    |                |
| type              | varchar(16)      | NO   |     | NULL    |                |
| difficulty        | varchar(16)      | NO   |     | NULL    |                |
| question          | varchar(1024)    | NO   |     | NULL    |                |
| correct_answer    | varchar(1024)    | NO   |     | NULL    |                |
| incorrect_answers | varchar(5000)    | NO   |     | NULL    |                |
| validated         | tinyint(1)       | NO   |     | NULL    |                |
+-------------------+------------------+------+-----+---------+----------------+
8 rows in set (0.00 sec)

# 9  
Old 10-27-2019
Added userid (submitted), time submitted and time modified:

Code:
mysql> describe neo_open_trivia;
+--------------------+------------------+------+-----+---------+----------------+
| Field              | Type             | Null | Key | Default | Extra          |
+--------------------+------------------+------+-----+---------+----------------+
| id                 | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| category           | varchar(254)     | NO   |     | NULL    |                |
| type               | varchar(16)      | NO   |     | NULL    |                |
| difficulty         | varchar(16)      | NO   |     | NULL    |                |
| question           | varchar(1024)    | NO   |     | NULL    |                |
| correct_answer     | varchar(1024)    | NO   |     | NULL    |                |
| incorrect_answers  | varchar(5000)    | NO   |     | NULL    |                |
| validated          | tinyint(1)       | NO   |     | NULL    |                |
| userid             | int(10) unsigned | NO   |     | NULL    |                |
| time_submitted     | int(10) unsigned | NO   |     | NULL    |                |
| time_last_modified | int(10) unsigned | NO   |     | NULL    |                |
+--------------------+------------------+------+-----+---------+----------------+
11 rows in set (0.01 sec)

Sample Test Data:

Code:
mysql> select * from neo_open_trivia;
+----+--------------------+----------+------------+------------------------------------------------------------------------------------------+----------------+-------------------+-----------+--------+----------------+--------------------+
| id | category           | type     | difficulty | question                                                                                 | correct_answer | incorrect_answers | validated | userid | time_submitted | time_last_modified |
+----+--------------------+----------+------------+------------------------------------------------------------------------------------------+----------------+-------------------+-----------+--------+----------------+--------------------+
|  1 | Science: Computers | boolean  | easy       | The name of this forum is 'The UNIX and Linux Forums'?                                   | True           | ["False"]         |         0 |      1 |     1572151119 |         1572151119 |
|  2 | Science: Computers | multiple | easy       | According to the International System of Units, how many bytes are in a kilobyte of RAM? | 1000           | [512,1024,500]    |         0 |      1 |     1572151119 |         1572151119 |
|  3 | Science: Computers | multiple | easy       | What does 'Hello World' Mean?                                                            | Hello          | ["Bye","Go","Mo"] |         0 |      1 |     1572151119 |         1572151119 |
|  4 | Science: Computers | boolean  | easy       | 'Hello World' Means Bite Me?                                                             | False          | ["True"]          |         0 |      1 |     1572151119 |         1572151119 |
|  5 | Science: Computers | boolean  | easy       | 'Hello World' Means Hello World?                                                         | True           | ["False"]         |         0 |      1 |     1572151119 |         1572151119 |
+----+--------------------+----------+------------+------------------------------------------------------------------------------------------+----------------+-------------------+-----------+--------+----------------+--------------------+
5 rows in set (0.00 sec)

# 10  
Old 10-27-2019
Updated. Added more DB fields:


Code:
mysql> describe neo_open_trivia;
+--------------------+------------------+------+-----+---------+----------------+
| Field              | Type             | Null | Key | Default | Extra          |
+--------------------+------------------+------+-----+---------+----------------+
| id                 | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| category           | varchar(254)     | NO   |     | NULL    |                |
| type               | varchar(16)      | NO   |     | NULL    |                |
| difficulty         | varchar(16)      | NO   |     | NULL    |                |
| question           | varchar(1024)    | NO   |     | NULL    |                |
| correct_answer     | varchar(1024)    | NO   |     | NULL    |                |
| incorrect_answers  | varchar(5000)    | NO   |     | NULL    |                |
| validated          | tinyint(1)       | NO   |     | NULL    |                |
| time_validated     | int(10) unsigned | YES  |     | NULL    |                |
| userid_validated   | int(10) unsigned | YES  |     | NULL    |                |
| userid_submitted   | int(10) unsigned | NO   |     | NULL    |                |
| time_submitted     | int(10) unsigned | NO   |     | NULL    |                |
| time_last_modified | int(10) unsigned | NO   |     | NULL    |                |
+--------------------+------------------+------+-----+---------+----------------+
13 rows in set (0.00 sec)

Test Data:

Code:
mysql> select * from neo_open_trivia;
+----+--------------------+----------+------------+------------------------------------------------------------------------------------------+----------------+-------------------+-----------+----------------+------------------+------------------+----------------+--------------------+
| id | category           | type     | difficulty | question                                                                                 | correct_answer | incorrect_answers | validated | time_validated | userid_validated | userid_submitted | time_submitted | time_last_modified |
+----+--------------------+----------+------------+------------------------------------------------------------------------------------------+----------------+-------------------+-----------+----------------+------------------+------------------+----------------+--------------------+
|  1 | Science: Computers | boolean  | easy       | The name of this forum is 'The UNIX and Linux Forums'?                                   | True           | ['False']         |         0 |              0 |                0 |                1 |     1572151119 |         1572151119 |
|  2 | Science: Computers | multiple | easy       | According to the International System of Units, how many bytes are in a kilobyte of RAM? | 1000           | [512,1024,500]    |         0 |              0 |                0 |                1 |     1572151119 |         1572151119 |
|  3 | Science: Computers | multiple | easy       | What does 'Hello World' Mean?                                                            | Hello          | ['Bye','Go','Mo'] |         0 |              0 |                0 |                1 |     1572151119 |         1572151119 |
|  4 | Science: Computers | boolean  | easy       | 'Hello World' Means Bite Me?                                                             | False          | ['True']          |         0 |              0 |                0 |                1 |     1572151119 |         1572151119 |
|  5 | Science: Computers | boolean  | easy       | 'Hello World' Means Hello World?                                                         | True           | ['False']         |         0 |              0 |                0 |                1 |     1572151119 |         1572151119 |
+----+--------------------+----------+------------+------------------------------------------------------------------------------------------+----------------+-------------------+-----------+----------------+------------------+------------------+----------------+--------------------+
5 rows in set (0.00 sec)

Time to take a break from this and go watch Terminator: Dark Fate (2019) now in theaters here.
# 11  
Old 10-27-2019
Note:

I just looked at another site admin's unfinished project from 5 years ago when we started collecting multiple choice exam questions.

At some time in the future, I will port all 78 multiple choice questions (validated, unvalidated and draft) into the new "trivia" database.

Then, as some other point in time, I will start to build the UI for this.

Example questions from that unfinished project:

Code:
mysql> select question from neo_exam_questions Limit 5;
+---------------------------------------------------------------------------------------------------------------+
| question                                                                                                      |
+---------------------------------------------------------------------------------------------------------------+
| What is the highest priority for syslogd?                                                                     |
| Starting a shell script with a dot 

[code]$ . ./script.sh[/code]

when you execute the script does what? |
| Where should you not keep your system backup when you backup your critical production server?          |
| Which of  these commands would show the users who are currently logged in to a Linux server?                  |
| Which Linux command erases the previously displayed output on a terminal display?                             |
+---------------------------------------------------------------------------------------------------------------+
5 rows in set (0.01 sec)

I will change the "flavor" of this project and finish it.... More than likely it will be in the form of "trivia questions" which will appear in the forums (as the open trivia DB questions appear now) and members can answer as they wish; and I will add some scoring system to track correct and incorrect answers, add timers, and more over time.

Will start out "simple" and then add more features over time, trying to stay compatible with the Open Trivia DB (which seems to be in "super pause" mode lately, which I totally understand since our "exam" project has been on "super pause" for 5 years... !!!) ....
# 12  
Old 10-27-2019
We really liked Terminator Dark Fate.

I decided to only focus on TRUE / FALSE questions in Phase I of this caper.

This also means there is no need to immediate port the questions from 5 years ago since all those questions are multiple choice.

I may manually enter 100 T/F questions into the new DB table myself to kick things off.

More to come ....
# 13  
Old 10-27-2019
From the Open Trivia DB API:

Need these parameters:
  • amount (integer, 1 to 10)
  • category (integer, Science: Computers - category 18)
  • difficulty (text: easy, medium, difficult)
  • type (text: boolean, multiple)

So, changed the DB table structure as follows:

Code:
mysql> describe neo_open_trivia;
+--------------------+------------------+------+-----+---------+----------------+
| Field              | Type             | Null | Key | Default | Extra          |
+--------------------+------------------+------+-----+---------+----------------+
| id                 | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| category           | smallint(2)      | NO   |     | NULL    |                |
| type               | varchar(16)      | NO   |     | NULL    |                |
| difficulty         | varchar(16)      | NO   |     | NULL    |                |
| question           | varchar(1024)    | NO   |     | NULL    |                |
| correct_answer     | varchar(1024)    | NO   |     | NULL    |                |
| incorrect_answers  | varchar(5000)    | NO   |     | NULL    |                |
| validated          | tinyint(1)       | NO   |     | NULL    |                |
| time_validated     | int(10) unsigned | YES  |     | NULL    |                |
| userid_validated   | int(10) unsigned | YES  |     | NULL    |                |
| userid_submitted   | int(10) unsigned | NO   |     | NULL    |                |
| time_submitted     | int(10) unsigned | NO   |     | NULL    |                |
| time_last_modified | int(10) unsigned | NO   |     | NULL    |                |
+--------------------+------------------+------+-----+---------+----------------+
13 rows in set (0.00 sec)

and started PHP array for mapping categories as SMALLINT to VARCHAR:

Code:
<?php
$categories = array();
$categories[18] = "Science: Computers";

Test Data Now:

Code:
mysql> select * from neo_open_trivia;
+----+----------+----------+------------+------------------------------------------------------------------------------------------+----------------+-------------------+-----------+----------------+------------------+------------------+----------------+--------------------+
| id | category | type     | difficulty | question                                                                                 | correct_answer | incorrect_answers | validated | time_validated | userid_validated | userid_submitted | time_submitted | time_last_modified |
+----+----------+----------+------------+------------------------------------------------------------------------------------------+----------------+-------------------+-----------+----------------+------------------+------------------+----------------+--------------------+
|  1 |       18 | boolean  | easy       | The name of this forum is 'The UNIX and Linux Forums'?                                   | True           | ['False']         |         0 |              0 |                0 |                1 |     1572151119 |         1572151119 |
|  2 |       18 | multiple | easy       | According to the International System of Units, how many bytes are in a kilobyte of RAM? | 1000           | [512,1024,500]    |         0 |              0 |                0 |                1 |     1572151119 |         1572151119 |
|  3 |       18 | multiple | easy       | What does 'Hello World' Mean?                                                            | Hello          | ['Bye','Go','Mo'] |         0 |              0 |                0 |                1 |     1572151119 |         1572151119 |
|  4 |       18 | boolean  | easy       | 'Hello World' Means Bite Me?                                                             | False          | ['True']          |         0 |              0 |                0 |                1 |     1572151119 |         1572151119 |
|  5 |       18 | boolean  | easy       | 'Hello World' Means Hello World?                                                         | True           | ['False']         |         0 |              0 |                0 |                1 |     1572151119 |         1572151119 |
+----+----------+----------+------------+------------------------------------------------------------------------------------------+----------------+-------------------+-----------+----------------+------------------+------------------+----------------+--------------------+
5 rows in set (0.00 sec)

Will modify this in the future to permit a subcatgegory (for unix.com) while insuring the API remains compatible with the Open Trivia DB API.

I guess next:
  • I will write and text the API in PHP to return JSON, almost exactly like Open Trivia DB API (but with return JSON only, no other formats).
  • Manually enter 100 TRUE / FALSE unix/linux/networking/security (future subcategories) related questions into the database for category
18.

Then after the Beta API is working OK, will probably extent the functionality to:
  • Write AJAX query for user in browser to update DB (might require a new table, will think about this) when a user answers a question.

Then think of what feature to add next... Smilie

Was going to reverse engineer the SMALLINT to VARCHAR mappings for all the Open Trivia DB categories, but I think for now will just stick with category 18 - "Science: Computers".

However, if anyone else wants to do this and post the PHP array for that mapping in this format $categories[18] = "Science: Computers";, please help me out and do it.
# 14  
Old 10-27-2019
Updated the initial 5 questions for testing the future API :

Code:
mysql> select * from neo_open_trivia;
+----+----------+---------+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------+-------------------+-----------+----------------+------------------+------------------+----------------+--------------------+
| id | category | type    | difficulty | question                                                                                                                                                                                     | correct_answer | incorrect_answers | validated | time_validated | userid_validated | userid_submitted | time_submitted | time_last_modified |
+----+----------+---------+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------+-------------------+-----------+----------------+------------------+------------------+----------------+--------------------+
|  1 |       18 | boolean | medium     | The UNIX and Linux Forums (UNIX.com) was founded in 1985?                                                                                                                                    | True           | ['False']         |         0 |              0 |                0 |                1 |     1572151119 |         1572151119 |
|  2 |       18 | boolean | easy       | Unix was invented by Steve Jobs of Apple Computer?                                                                                                                                           | False          | ['True']          |         0 |              0 |                0 |                1 |     1572151119 |         1572151119 |
|  3 |       18 | boolean | easy       | 'Hello World' is a program only for advanced programmers?                                                                                                                                    | False          | ['True']          |         0 |              0 |                0 |                1 |     1572151119 |         1572151119 |
|  4 |       18 | boolean | medium     | The UNIX and Linux Forum was one of the first forums on the Internet to have a strong moderation policy to encourage users of all skill levels to participate without fear of being bullied? | True           | ['False']         |         0 |              0 |                0 |                1 |     1572151119 |         1572151119 |
|  5 |       18 | boolean | easy       | The UNIX trademark is a "certification mark"?                                                                                                                                                | True           | ['False']         |         0 |              0 |                0 |                1 |     1572151119 |         1572151119 |
+----+----------+---------+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------+-------------------+-----------+----------------+------------------+------------------+----------------+--------------------+
5 rows in set (0.00 sec)

I plan to bootstrap this process by writing 100 TRUE/FALSE questions.

If anyone wants to write any TRUE/FALSE questions (which I will manually enter into the DB, until I build a UI for this), please do so and email or PM them to me (so we don't have all the questions and answers to questions in the open forum). -- Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. What is on Your Mind?

Computer Trivia Feature Tops 50,000 Questions Answered

Just noticed that our successful computer trivia feature (stats here) has surpassed over 50,000 questions answered by users: https://www.unix.com/trivia_stats.php This was a coding effort worth while and I'm pleased to see so many people enjoying it in such a short time since it was released... (3 Replies)
Discussion started by: Neo
3 Replies

2. What is on Your Mind?

Debugging Our Computer Science Trivia Feature

Only a few days after I coded this new feature from scratch, we are seeing over 3000 entries in the database from members (mostly guests) playing CS trivia. I have spend a lot of time coding this (from scratch) and testing the API. From the logs, it seems to have an API bug which appears... (31 Replies)
Discussion started by: Neo
31 Replies

3. What is on Your Mind?

New Member and Country Computer Trivia Leaderboards

Thanks to Akshay, who helped me write the core MySQL queries, we now have two new draft leaderboards, by (1) member and by (2) country: https://www.unix.com/trivia_stats.php Currently milhan leads the members with a high score of 90%: ... (3 Replies)
Discussion started by: Neo
3 Replies

4. What is on Your Mind?

1000+ Computer Science Trivia Questions at UNIX.COM

The UNIX and Linux Forums now has over 1000 TRUE / FALSE computer science and computer related trivia question in our database. These questions are of relatively high quality (compared to similar sites on the web) and are fun (according to feedback by users). In the first week during the... (1 Reply)
Discussion started by: Neo
1 Replies

5. Web Development

Is Web Development is a part of computer science ?

I am now a student in university in 2nd year. I am studying computer science. But I am not sure what type of jobs computer science provide. I know some of them are software programming or network management. Recently, I hear some about Web Development. I wonder if it is a part of computer... (3 Replies)
Discussion started by: Anna Hussie
3 Replies

6. Programming

Is Web Development is a part of computer science ?

I am now a student in university in 2nd year. I am studying computer science. But I am not sure what type of jobs computer science provide. I know some of them are software programming or network management. Recently, I hear some about Web Development. I wonder if it is a part of computer science.... (1 Reply)
Discussion started by: Anna Hussie
1 Replies

7. What is on Your Mind?

Computer Science and Information Technology

Hi, I haven't posted on the forums for a while now, I tried to find the most appropriate section for this post, but if this is in the wrong section please forgive me. First, let me say I'm a sophomore in HS. I know that job wise I definitely want to do something in computers. A while ago I was... (5 Replies)
Discussion started by: hpicracing
5 Replies

8. Shell Programming and Scripting

Which is the best way/command to do mathematics in UNIX scripting?

Hello all! I used to use expr for doing simple mathematics, but has a main advantage and a main disadvantage: The advantage is that it can take variables for numbers (e.g.{1}: echo "Give me first" read lol echo "Give other" read lil sum=`expr $lol + $lil` echo "The sum of $lol and $lil =... (5 Replies)
Discussion started by: hakermania
5 Replies

9. UNIX for Dummies Questions & Answers

mathematics operations in unix

Hello guys! Can say me anybody about operatios with unix, I don't to make operations, only inside in a variable, like this #y=4 #x=2 #let z=$y-$x #echo $z # 2 but I can't to make mathematical operations with decimal like this #y=3.2 #x=1.5 #let z=$y-$x #echo $z # 3 this... (2 Replies)
Discussion started by: cesar720213
2 Replies
Login or Register to Ask a Question