PluginProbe
Watu Quiz / trunk
Watu Quiz vtrunk
3.4.8 trunk 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.5.3 3.4.6 3.4.7
watu / views / exams.html.php

exams.html.php in Watu Quiz trunk, at views/exams.html.php

104 lines 5.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <style type="text/css">
2 <?php watu_resp_table_css(800);?>
3 </style>
4
5 <div class="wrap">
6 <h2><?php printf(__("Manage %s", 'watu'), ucfirst(WATU_QUIZ_WORD_PLURAL)); ?></h2>
7
8 <div class="postbox-container" style="width:65%;margin-right:2%;">
9
10 <p><strong><?php _e('Watu for WordPress is a light version of', 'watu')?> <a href="http://calendarscripts.info/watupro" target="_blank">WatuPRO</a>.</strong></p>
11
12 <p><?php _e('Go to', 'watu')?> <a href="admin.php?page=watu_options"><?php _e('Watu Settings', 'watu')?></a>
13 &nbsp;|&nbsp;
14 <a href="admin.php?page=watu_exam&amp;action=new"><?php printf(__("Create New %s", 'watu'), ucfirst(WATU_QUIZ_WORD))?></a>
15 &nbsp;|&nbsp;
16 <a href="admin.php?page=watu_social_sharing"><?php _e('Social Sharing Options', 'watu');?></a></p>
17
18 <p><b><?php printf(__('To publish a %s copy its shortcode and place it in a post or page. Use only one %s shortcode in each post or page.','watu'), WATU_QUIZ_WORD, WATU_QUIZ_WORD)?></b></p>
19
20
21 <form method="get" action="admin.php">
22 <input type="hidden" name="page" value="watu_exams">
23 <p>
24 <?php _e('Filter by title (contains):', 'watu')?> <input type="text" name="title" value="<?php echo empty($_GET['title']) ? '' : esc_attr($_GET['title'])?>">
25 <?php _e('ID is:', 'watu')?> <input type="text" name="exam_id" value="<?php echo empty($_GET['exam_id']) ? '' : intval($_GET['exam_id'])?>" size="4">
26 <input type="submit" value="<?php printf(__('Filter %s', 'watu'), WATU_QUIZ_WORD_PLURAL);?>" class="button button-primary">
27
28 <?php if(!empty($filter_sql)):?><input type="button" value="<?php _e('Clear filters', 'watu')?>" onclick="window.location='admin.php?page=watu_exams'" class="button"><?php endif;?></p>
29 </form>
30
31 <p><a href="admin.php?page=watu_exam&amp;action=new"><?php printf(__("Create New %s", 'watu'), ucfirst(WATU_QUIZ_WORD))?></a></p>
32
33
34 <table class="widefat watu-table">
35 <thead>
36 <tr>
37 <th scope="col"><div style="text-align: center;"><?php _e('ID', 'watu') ?></div></th>
38 <th scope="col"><a href="admin.php?page=watu_exams&dir=<?php echo $odir?>&ob=Q.name<?php echo $filter_params?>"><?php _e('Title', 'watu') ?></a></th>
39 <th scope="col"><?php _e('Shortcode', 'watu') ?></th>
40 <th scope="col"><a href="admin.php?page=watu_exams&dir=<?php echo $odir?>&ob=question_count<?php echo $filter_params?>"><?php _e('No. Questions', 'watu') ?></a></th>
41 <th scope="col"><?php _e('View Results', 'watu') ?></th>
42 <th scope="col" colspan="3"><?php _e('Action', 'watu') ?></th>
43 </tr>
44 </thead>
45
46 <tbody id="the-list">
47 <?php
48 if(count($exams)):
49 foreach($exams as $quiz):
50 $class = ('alternate' == @$class) ? '' : 'alternate';
51
52 print "<tr id='quiz-{$quiz->ID}' class='$class'>\n";
53 ?>
54 <td scope="row" style="text-align: center;"><?php echo $quiz->ID ?></td>
55 <td><?php if(!empty($quiz->post)) echo "<a href='".get_permalink($quiz->post->ID)."' target='_blank'>";
56 echo stripslashes($quiz->name);
57 if(!empty($quiz->post)) echo "</a>";?></td>
58 <td><input type="text" size="8" readonly onclick="this.select()" value="[WATU <?php echo $quiz->ID ?>]"></td>
59 <td><?php echo $quiz->question_count ?></td>
60 <td><a href="admin.php?page=watu_takings&exam_id=<?php echo $quiz->ID?>"><?php printf(__('Taken %d times', 'watu'), $quiz->taken)?></a></td>
61 <td><a href='admin.php?page=watu_questions&amp;quiz=<?php echo $quiz->ID?>' class='edit'><?php _e('Manage Questions', 'watu')?></a><br>
62 <a href='admin.php?page=watu_grades&amp;quiz_id=<?php echo $quiz->ID?>' class='edit'><?php _e('Manage Grades', 'watu')?></a></td>
63 <td><a href='admin.php?page=watu_exam&amp;quiz=<?php echo $quiz->ID?>&amp;action=edit' class='edit'><?php _e('Edit', 'watu'); ?></a></td>
64 <td><a href="<?php echo wp_nonce_url('admin.php?page=watu_exams&amp;action=delete&amp;quiz='.$quiz->ID, 'watu_exams');?>" class='delete' onclick="return confirm('<?php echo addslashes(sprintf(__("You are about to delete this %s? This will delete all the questions and answers within this quiz. Press 'OK' to delete and 'Cancel' to stop.", 'watu'), WATU_QUIZ_WORD))?>');"><?php _e('Delete', 'watu')?></a></td>
65 </tr>
66 <?php endforeach;
67 else:?>
68 <tr>
69 <td colspan="5"><?php printf(__('No %s found.', 'watu'), WATU_QUIZ_WORD_PLURAL) ?></td>
70 </tr>
71 <?php endif;?>
72 </tbody>
73 </table>
74
75 <p align="center"><?php if($offset>0):?><a href="admin.php?page=watu_exams&offset=<?php echo ($offset-$page_limit)?><?php echo $filter_params?>"><?php _e('Previous page', 'watu')?></a><?php endif;?>
76 &nbsp;
77 <?php if($offset + $page_limit < $count):?> <a href="admin.php?page=watu_exams&offset=<?php echo ($offset+$page_limit)?><?php echo $filter_params?>"><?php _e('Next page', 'watu')?></a> <?php endif;?></p>
78
79 <p><a href="admin.php?page=watu_exam&amp;action=new"><?php printf(__("Create New %s", 'watu'), ucfirst(WATU_QUIZ_WORD))?></a></p>
80
81 <?php if(get_option('watu_rated') != 1):?>
82 <div id="ratingInvite">
83 <h3 align="center"><a href="https://wordpress.org/support/plugin/watu/reviews/" target="_blank"><?php _e("Please don't forget to rate us!", 'watu');?> &starf;&starf;&starf;&starf;&starf;</a></h3>
84 <p align="center"><a href="#" onclick="watuRated();return false;"><?php _e("Already done / Hide this", 'watu');?></a></p>
85 </div>
86 <?php endif;?>
87
88
89 </div>
90 <div id="watu-sidebar">
91 <?php include(WATU_PATH."/views/sidebar.php");?>
92 </div>
93 </div>
94
95 <script type="text/javascript">
96 <?php watu_resp_table_js();?>
97 function watuRated() {
98 url = watu_i18n.ajax_url;
99 jQuery.post(url, {'action' : 'watu_rated'}, function(msg){
100 jQuery('#ratingInvite').hide();
101 });
102 }
103 </script>
104