1	#!/bin/bash
2
3 # extension1_11 - Sub script of an example extension quiz
4 # this quiz asks the user about the areas of USA and Canada (country number 031)
5
6 ext1_11_quiz()
7 {
8 stage_n=$((stage_n + 1))
9 target="031"
10 compare_quiz_message
11 quiz_of_world $target_c_name
12 echo -n "1)$nation 2)USA "
13 read answer
14 if [ $answer -eq 1 ] ; then
15 clear
16 choose_area_list
17 if [ "$cswitch" = on ] ;then
18 echo "territory = $territory"
19 fi
20 .cusam_Cu$territory
21 choose_next_gstate_list
22 echo "$w_correct_message_h $o_gstate $w_correct_message_t"
23 sleep 5
24 clear
25 .worldmap
26 sleep 3
27 if [ "$tswitch" = off ] ; then
28 echo "$report2"
29 else
30 cut_and_sleep "$report2"
31 fi
32 world_compare $target
33 else
34 echo "$wrong_message"
35 exit 3
36 fi
37 }

The above is the code of "extension1_11".
You can create easily your own extension quiz by modifying "extesion1_11" and saving as a diffrently named file for example "extension1_21"
in the directory "~/mos/ext/".
To modify the file please change the number in the line 9. Now it is "031" which calls the data of Canada.
Now, let's change it to "074" which calls the data of India. And let's ask a user about the difference of personal income between
India and USA.
Then, please change "quiz_of_world" in the line 11 to "quiz_of_world3" which asks a user
about the difference of personal income.
Personal income of USA is higher than one of India, then let's change "
if [ $answer -eq 1 ] ; then" in the line 14 to "if [ $answer -eq 2 ] ; then".
"1" indicates India "2" indicates USA in this case.
And please change
"ext1_11_quiz()" to "ext1_21_quiz()" which is the name of the fucntion of this file, "extension1_21" and executes the code
from the line 7 to the lin 37 of this file in the main script,
"mos0.993" when it is called by "add_extension" in the line 1827 of the main script.
Don't forget to change the comment
"# extension1_11 - Sub script of an example extension quiz" in the line 3 to
"# extension1_21 - Sub script of an example extension quiz", though this change does not affect any funciton at all.
To add the extensions to the gmos0.992h you must have prepared at least a set of quizzes which consists of four ones, however the extensions may be one, consecutive two or three in this version.
.The developer will explain the way to create those files next tiime.
However you may be able to create the files without the explanation.
Good luck!
inserted by FC2 system