Changes between Version 16 and Version 17 of BossaExampleOne
- Timestamp:
- Jul 21, 2008, 3:11:53 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BossaExampleOne
v16 v17 20 20 == Example application == 21 21 22 We'll create an application in which volunteers view images,22 We'll create an application in which volunteers view synthetic images, 23 23 looking for ellipses on a noisy background. 24 24 Their task is to click on the center of the ellipse, … … 28 28 [[Image(bossa_test.png, nolink)]] 29 29 30 (th is has an ellipse slightly below/left of center).30 (there's an ellipse slightly below/left of center). 31 31 32 32 Visit http://a.b.c/test_ops/bossa_ops.php, … … 35 35 The application is define by three scripts in ~/projects/test/html/: 36 36 37 * '''ops/bossa_example_make_files.php''': thiscreates image files.38 * '''ops/bossa_example_make_jobs.php''': thiscreates jobs.39 * '''inc/bossa_example.inc''': display jobs and handle completed jobs.37 * '''ops/bossa_example_make_files.php''': a script that creates image files. 38 * '''ops/bossa_example_make_jobs.php''': a script that creates jobs. 39 * '''inc/bossa_example.inc''': display and policy functions. 40 40 41 41 We'll go through these scripts and explain how they work. … … 44 44 == Creating jobs == 45 45 46 To create some jobs, first we'll create some image files using the script46 First we'll create some image files using the script 47 47 [source:/trunk/boinc/html/ops/bossa_example_make_files.php html/ops/bossa_example_make_files.php]. 48 48 … … 60 60 61 61 Now, create jobs using 62 [source:/trunk/boinc/html/ops/bossa_example_make_jobs.php html/ops/bossa_example_make_jobs.php] .62 [source:/trunk/boinc/html/ops/bossa_example_make_jobs.php html/ops/bossa_example_make_jobs.php]: 63 63 {{{ 64 64 php bossa_example_make_jobs --app_name bossa_example --dir example … … 68 68 and collects them into a "batch". 69 69 70 == Display ing jobs ==70 == Display and policy functions == 71 71 72 The application is described by a PHP file ([source:/trunk/boinc/html/inc/bossa_example.inchtml/inc/bossa_example.inc]) 73 that contains several functions. 74 75 The first of these displays a job: 72 The file ([source:/trunk/boinc/html/inc/bossa_example.inc html/inc/bossa_example.inc]) 73 contains display and policy functions. 74 The display function is: 76 75 {{{ 77 76 function job_show($job, $inst, $user) { … … 93 92 }}} 94 93 95 The second is called when a job is issued:94 The policy functions are as follows. 96 95 97 96 {{{ … … 101 100 }}} 102 101 102 This is called when a job is issued. 103 103 It sets the job's priority to zero so that no further instances will be issued 104 104 (unless this one times) out. 105 105 106 The next function is called when a job instance is finished.107 It gets the user's response to the job,108 and stores it in the instance's app data field.109 106 {{{ 110 107 function job_finished($job, $inst) { … … 121 118 }}} 122 119 123 The next function is called when a job times out. 124 It restores the priority to one so that the job will 125 be issued to another volunteer. 120 This is called when a job instance is finished. 121 It gets the user's response to the job, 122 and stores it in the instance's app data field. 123 126 124 {{{ 127 125 function job_timed_out($job, $inst, $user) { … … 129 127 } 130 128 }}} 129 This is called when a job times out. 130 It restores the priority to one so that the job will 131 be issued to another volunteer. 131 132 132 133 The remaining functions return short strings 133 that show the app data for jobs, instances, and users 134 on the Admin page: 134 that show the app data for jobs, instances, and users on the Admin page: 135 135 {{{ 136 136 function job_summary($job) {