Compare commits
14 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2798ba9a72 | |||
| 67b1cd8e24 | |||
| ce976909c0 | |||
| f039f2f06d | |||
| 05bc1a4f49 | |||
| c7b7b26958 | |||
| fb404964f8 | |||
| 18ac849317 | |||
| dee9632ebd | |||
| fe70cd65ea | |||
| 38de3b234c | |||
| 0919217fdf | |||
| 254e8bbdeb | |||
| 13a318b231 |
9 changed files with 489 additions and 136 deletions
|
|
@ -57,6 +57,10 @@ function quiztech_theme_enqueue_scripts() {
|
|||
}
|
||||
|
||||
// Only enqueue the script on our specific template pages
|
||||
// Enqueue Google Fonts (Sora & Inter)
|
||||
wp_enqueue_style( 'quiztech-google-fonts', 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Sora:wght@600&display=swap', array(), null );
|
||||
|
||||
|
||||
if ( $is_quiztech_template ) {
|
||||
$script_path = get_stylesheet_directory() . '/js/quiztech-theme.js';
|
||||
$script_url = get_stylesheet_directory_uri() . '/js/quiztech-theme.js';
|
||||
|
|
|
|||
414
style.css
414
style.css
|
|
@ -9,7 +9,9 @@
|
|||
*/
|
||||
|
||||
|
||||
|
||||
#content {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* Assessment Builder Styles */
|
||||
.quiztech-assessment-builder-area .entry-content {
|
||||
|
|
@ -52,16 +54,73 @@
|
|||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
/* Add some basic styling for list items (placeholders) */
|
||||
/* Styling for list items in Assessment Builder */
|
||||
.library-question-item,
|
||||
.selected-question-item {
|
||||
padding: 8px;
|
||||
border-bottom: 1px solid #eee;
|
||||
padding: 10px 12px; /* Increased padding */
|
||||
border-bottom: 1px solid var(--quiztech-border-light); /* Use theme border */
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 10px; /* Add gap between text and button */
|
||||
font-size: 13px; /* Consistent font size */
|
||||
color: var(--quiztech-text-secondary); /* Default to secondary color */
|
||||
}
|
||||
|
||||
.library-question-item span,
|
||||
.selected-question-item span {
|
||||
flex-grow: 1; /* Allow text span to take available space */
|
||||
}
|
||||
|
||||
.library-question-item strong,
|
||||
.selected-question-item strong {
|
||||
font-weight: 600; /* Make title bolder */
|
||||
color: var(--quiztech-text-primary); /* Use primary text color for title */
|
||||
display: inline; /* Keep on same line */
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.library-question-item .add-question-to-assessment,
|
||||
.selected-question-item .remove-question-from-assessment {
|
||||
/* Apply button styles - inherit from .quiztech-button */
|
||||
padding: 4px 8px; /* Smaller padding */
|
||||
font-size: 11px; /* Smaller font size */
|
||||
flex-shrink: 0; /* Prevent button from shrinking */
|
||||
}
|
||||
/* Specific styling for Add button (can inherit secondary) */
|
||||
.library-question-item .add-question-to-assessment {
|
||||
/* Use secondary button style by default */
|
||||
background-color: var(--quiztech-widget-bg);
|
||||
color: var(--quiztech-text-secondary);
|
||||
border-color: var(--quiztech-border-light);
|
||||
}
|
||||
.library-question-item .add-question-to-assessment:hover {
|
||||
background-color: #f0f0f0;
|
||||
border-color: #cccccc;
|
||||
color: var(--quiztech-text-primary);
|
||||
}
|
||||
.library-question-item .add-question-to-assessment:disabled {
|
||||
background-color: var(--quiztech-border-light);
|
||||
color: var(--quiztech-text-secondary);
|
||||
border-color: var(--quiztech-border-light);
|
||||
cursor: not-allowed;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/* Specific styling for Remove button (can inherit secondary, maybe make red later) */
|
||||
.selected-question-item .remove-question-from-assessment {
|
||||
/* Use secondary button style by default */
|
||||
background-color: var(--quiztech-widget-bg);
|
||||
color: var(--quiztech-text-secondary);
|
||||
border-color: var(--quiztech-border-light);
|
||||
}
|
||||
.selected-question-item .remove-question-from-assessment:hover {
|
||||
background-color: #f0f0f0;
|
||||
border-color: #cccccc;
|
||||
color: var(--quiztech-text-primary);
|
||||
}
|
||||
|
||||
|
||||
.library-question-item:last-child,
|
||||
.selected-question-item:last-child {
|
||||
border-bottom: none;
|
||||
|
|
@ -119,6 +178,19 @@
|
|||
|
||||
|
||||
/* Quiztech Dashboard Styles */
|
||||
|
||||
:root {
|
||||
--quiztech-widget-bg: #FFFEFE;
|
||||
--quiztech-widget-shadow: 0px 2px 50px rgba(0, 0, 0, 0.05);
|
||||
--quiztech-widget-radius: 8px;
|
||||
--quiztech-text-primary: #1E1F27;
|
||||
--quiztech-text-secondary: #696A6F;
|
||||
--quiztech-accent-primary: #0F41D2;
|
||||
--quiztech-font-heading: 'Sora', sans-serif; /* Ensure font is loaded */
|
||||
--quiztech-font-body: 'Inter', sans-serif; /* Ensure font is loaded */
|
||||
--quiztech-border-light: #EAEAEB;
|
||||
}
|
||||
|
||||
.quiztech-dashboard-widgets {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive grid */
|
||||
|
|
@ -127,25 +199,31 @@
|
|||
}
|
||||
|
||||
.dashboard-widget {
|
||||
border: 1px solid #e0e0e0;
|
||||
padding: 15px 20px;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 1px 1px rgba(0,0,0,.04);
|
||||
border: none; /* Removed border, rely on shadow */
|
||||
padding: 20px; /* Adjusted padding */
|
||||
background-color: var(--quiztech-widget-bg);
|
||||
box-shadow: var(--quiztech-widget-shadow);
|
||||
border-radius: var(--quiztech-widget-radius);
|
||||
}
|
||||
|
||||
.dashboard-widget h2 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 15px;
|
||||
font-size: 1.2em;
|
||||
border-bottom: 1px solid #eee;
|
||||
padding-bottom: 10px;
|
||||
margin-bottom: 20px; /* Adjusted margin */
|
||||
font-family: var(--quiztech-font-heading);
|
||||
font-weight: 600;
|
||||
font-size: 16px; /* Adjusted size */
|
||||
color: var(--quiztech-text-primary);
|
||||
border-bottom: none; /* Removed border */
|
||||
padding-bottom: 0; /* Removed padding */
|
||||
}
|
||||
|
||||
.dashboard-widget h3 {
|
||||
margin-top: 15px;
|
||||
margin-bottom: 10px;
|
||||
font-size: 1em;
|
||||
color: #555;
|
||||
font-family: var(--quiztech-font-body); /* Changed font */
|
||||
font-weight: 600; /* Adjusted weight */
|
||||
font-size: 14px; /* Adjusted size */
|
||||
color: var(--quiztech-text-primary); /* Adjusted color */
|
||||
}
|
||||
|
||||
/* Quick Links Widget */
|
||||
|
|
@ -162,38 +240,54 @@
|
|||
margin: 0;
|
||||
}
|
||||
|
||||
.quick-links a.button,
|
||||
.quick-links span.button.disabled {
|
||||
.quick-links a.button {
|
||||
display: inline-block;
|
||||
padding: 8px 15px;
|
||||
padding: 10px 15px; /* Adjusted padding */
|
||||
text-decoration: none;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
background-color: #f7f7f7;
|
||||
color: #555;
|
||||
border: none; /* Removed border */
|
||||
border-radius: 6px; /* Adjusted radius */
|
||||
background-color: var(--quiztech-accent-primary);
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
font-family: var(--quiztech-font-body);
|
||||
font-weight: 500;
|
||||
transition: background-color 0.2s ease; /* Added transition */
|
||||
}
|
||||
|
||||
.quick-links a.button:hover {
|
||||
background-color: #f0f0f0;
|
||||
border-color: #999;
|
||||
color: #333;
|
||||
background-color: #0d36a8; /* Darker blue for hover */
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.quick-links span.button.disabled {
|
||||
background-color: #eee;
|
||||
color: #aaa;
|
||||
display: inline-block;
|
||||
padding: 10px 15px; /* Adjusted padding */
|
||||
text-decoration: none;
|
||||
border: none; /* Removed border */
|
||||
border-radius: 6px; /* Adjusted radius */
|
||||
background-color: var(--quiztech-border-light); /* Use light border color */
|
||||
color: var(--quiztech-text-secondary); /* Use secondary text color */
|
||||
text-align: center;
|
||||
font-family: var(--quiztech-font-body);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
/* Statistics Widget */
|
||||
.statistics p {
|
||||
margin: 0 0 10px 0;
|
||||
font-size: 0.95em;
|
||||
margin: 0 0 8px 0; /* Adjusted margin */
|
||||
font-size: 12px; /* Adjusted size */
|
||||
font-family: var(--quiztech-font-body);
|
||||
color: var(--quiztech-text-primary);
|
||||
line-height: 1.3; /* Added line-height for clarity */
|
||||
}
|
||||
|
||||
.statistics strong {
|
||||
margin-right: 5px;
|
||||
display: block; /* Place label above value */
|
||||
margin: 0 0 4px 0; /* Adjusted margin */
|
||||
font-family: var(--quiztech-font-body);
|
||||
font-size: 10px; /* Adjusted size */
|
||||
color: var(--quiztech-text-secondary);
|
||||
font-weight: 400; /* Adjusted weight */
|
||||
}
|
||||
|
||||
/* Recent Activity Widget */
|
||||
|
|
@ -205,14 +299,16 @@
|
|||
list-style: none;
|
||||
margin: 0 0 10px 0;
|
||||
padding: 0;
|
||||
font-size: 0.9em;
|
||||
color: #333;
|
||||
/* font-size and color handled by li */
|
||||
}
|
||||
|
||||
.recent-activity li {
|
||||
padding: 5px 0;
|
||||
border-bottom: 1px dotted #eee;
|
||||
padding: 8px 0; /* Adjusted padding */
|
||||
border-bottom: 1px solid var(--quiztech-border-light); /* Adjusted border */
|
||||
margin: 0;
|
||||
font-family: var(--quiztech-font-body);
|
||||
font-size: 12px; /* Adjusted size */
|
||||
color: var(--quiztech-text-secondary); /* Adjusted color */
|
||||
}
|
||||
|
||||
.recent-activity li:last-child {
|
||||
|
|
@ -220,10 +316,258 @@
|
|||
}
|
||||
|
||||
.recent-activity strong {
|
||||
color: #0073aa;
|
||||
color: var(--quiztech-text-primary); /* Adjusted color */
|
||||
font-weight: 500; /* Adjusted weight */
|
||||
}
|
||||
|
||||
.recent-activity em {
|
||||
color: #555;
|
||||
color: var(--quiztech-text-secondary); /* Adjusted color */
|
||||
font-style: normal; /* Removed italics */
|
||||
}
|
||||
|
||||
|
||||
/* --- Global Quiztech Theme Styles --- */
|
||||
|
||||
/* General Content Area */
|
||||
.quiztech-content-area {
|
||||
font-family: var(--quiztech-font-body);
|
||||
color: var(--quiztech-text-primary);
|
||||
}
|
||||
|
||||
/* Page Title */
|
||||
.quiztech-page-title {
|
||||
font-family: var(--quiztech-font-heading);
|
||||
font-weight: 600;
|
||||
color: var(--quiztech-text-primary);
|
||||
margin-bottom: 25px; /* Consistent spacing */
|
||||
}
|
||||
|
||||
/* Section Title */
|
||||
.quiztech-section-title {
|
||||
font-family: var(--quiztech-font-heading);
|
||||
font-weight: 600;
|
||||
font-size: 18px; /* Slightly smaller than page title */
|
||||
color: var(--quiztech-text-primary);
|
||||
margin-top: 30px;
|
||||
margin-bottom: 15px;
|
||||
padding-bottom: 5px;
|
||||
border-bottom: 1px solid var(--quiztech-border-light);
|
||||
}
|
||||
|
||||
/* Tables */
|
||||
.quiztech-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 20px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.quiztech-table th,
|
||||
.quiztech-table td {
|
||||
padding: 12px 15px;
|
||||
text-align: left;
|
||||
border: 1px solid var(--quiztech-border-light);
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.quiztech-table th {
|
||||
background-color: var(--quiztech-widget-bg); /* Use widget bg for header */
|
||||
font-weight: 600;
|
||||
color: var(--quiztech-text-primary);
|
||||
}
|
||||
|
||||
.quiztech-table tbody tr:nth-child(odd) td {
|
||||
/* Optional alternating row color - use widget bg for subtle difference */
|
||||
/* background-color: var(--quiztech-widget-bg); */
|
||||
}
|
||||
|
||||
.quiztech-table tbody tr:hover td {
|
||||
background-color: rgba(0, 0, 0, 0.02); /* Subtle hover */
|
||||
}
|
||||
|
||||
/* Forms */
|
||||
.quiztech-form p {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.quiztech-label {
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
font-weight: 500;
|
||||
font-size: 13px;
|
||||
color: var(--quiztech-text-secondary);
|
||||
}
|
||||
|
||||
.quiztech-input,
|
||||
.quiztech-textarea,
|
||||
.quiztech-select {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
border: 1px solid var(--quiztech-border-light);
|
||||
border-radius: 4px;
|
||||
background-color: var(--quiztech-widget-bg);
|
||||
color: var(--quiztech-text-primary);
|
||||
font-family: var(--quiztech-font-body);
|
||||
font-size: 14px;
|
||||
box-sizing: border-box; /* Include padding and border in element's total width and height */
|
||||
transition: border-color 0.2s ease;
|
||||
}
|
||||
|
||||
.quiztech-input:focus,
|
||||
.quiztech-textarea:focus,
|
||||
.quiztech-select:focus {
|
||||
outline: none;
|
||||
border-color: var(--quiztech-accent-primary);
|
||||
box-shadow: 0 0 0 1px var(--quiztech-accent-primary);
|
||||
}
|
||||
|
||||
.quiztech-textarea {
|
||||
min-height: 100px;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
.quiztech-button {
|
||||
display: inline-block;
|
||||
padding: 10px 20px;
|
||||
text-decoration: none;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 6px;
|
||||
font-family: var(--quiztech-font-body);
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
margin-right: 5px; /* Spacing between adjacent buttons */
|
||||
}
|
||||
|
||||
.quiztech-button-primary {
|
||||
background-color: var(--quiztech-accent-primary);
|
||||
color: #FFFFFF;
|
||||
border-color: var(--quiztech-accent-primary);
|
||||
}
|
||||
|
||||
.quiztech-button-primary:hover {
|
||||
background-color: #0d36a8; /* Darker blue */
|
||||
border-color: #0d36a8;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.quiztech-button-secondary {
|
||||
background-color: var(--quiztech-widget-bg);
|
||||
color: var(--quiztech-text-secondary);
|
||||
border-color: var(--quiztech-border-light);
|
||||
}
|
||||
|
||||
.quiztech-button-secondary:hover {
|
||||
background-color: #f0f0f0; /* Slightly darker background */
|
||||
border-color: #cccccc;
|
||||
color: var(--quiztech-text-primary);
|
||||
}
|
||||
|
||||
.quiztech-button-small {
|
||||
padding: 5px 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/* Links */
|
||||
.quiztech-link {
|
||||
color: var(--quiztech-accent-primary);
|
||||
text-decoration: none;
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
|
||||
.quiztech-link:hover {
|
||||
color: #0d36a8; /* Darker blue */
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* Inline Forms (like Send Invite row) */
|
||||
.quiztech-form-inline {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px; /* Spacing between elements */
|
||||
flex-wrap: wrap; /* Allow wrapping */
|
||||
}
|
||||
|
||||
.quiztech-form-inline .quiztech-label {
|
||||
margin-bottom: 0; /* Remove bottom margin for inline */
|
||||
}
|
||||
|
||||
.quiztech-form-inline .quiztech-input {
|
||||
width: auto; /* Allow input to size based on content/size attribute */
|
||||
flex-grow: 1; /* Allow input to take available space */
|
||||
}
|
||||
|
||||
/* Status Messages */
|
||||
.quiztech-status-message {
|
||||
font-size: 13px;
|
||||
font-style: italic;
|
||||
color: var(--quiztech-text-secondary);
|
||||
}
|
||||
|
||||
/* Grid Container (for widget-like elements) */
|
||||
.quiztech-grid-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Adjust minmax as needed */
|
||||
gap: 20px;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
/* Widget-like boxes (e.g., Credit Packages) */
|
||||
.quiztech-widget-like {
|
||||
border: none; /* Remove default border if any */
|
||||
padding: 20px;
|
||||
background-color: var(--quiztech-widget-bg);
|
||||
box-shadow: var(--quiztech-widget-shadow);
|
||||
border-radius: var(--quiztech-widget-radius);
|
||||
text-align: center; /* Center content for packages */
|
||||
}
|
||||
|
||||
.quiztech-widget-like h3 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 10px;
|
||||
font-family: var(--quiztech-font-heading);
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
color: var(--quiztech-text-primary);
|
||||
}
|
||||
|
||||
.quiztech-widget-like p {
|
||||
margin-bottom: 15px;
|
||||
font-size: 14px;
|
||||
color: var(--quiztech-text-secondary);
|
||||
}
|
||||
|
||||
.quiztech-widget-like form {
|
||||
margin-top: auto; /* Push button to bottom if needed in flex context */
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Dark Mode Styles */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--quiztech-widget-bg: #2a2a2e; /* Dark grey background */
|
||||
--quiztech-widget-shadow: 0px 2px 20px rgba(0, 0, 0, 0.2); /* Subtle shadow on dark */
|
||||
--quiztech-text-primary: #e0e0e0; /* Light grey primary text */
|
||||
--quiztech-text-secondary: #a0a0a0; /* Medium grey secondary text */
|
||||
--quiztech-accent-primary: #2868e7; /* Slightly brighter blue for contrast */
|
||||
--quiztech-border-light: #444444; /* Darker border color */
|
||||
}
|
||||
|
||||
.quick-links a.button:hover {
|
||||
background-color: #1c54c4; /* Slightly darker blue for hover */
|
||||
}
|
||||
|
||||
.quick-links span.button.disabled {
|
||||
color: #777; /* Adjust disabled text color for better contrast */
|
||||
background-color: #3f3f44; /* Darker disabled background */
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,20 +12,20 @@
|
|||
// Replace with a more specific capability like 'manage_quiztech_assessments' if defined.
|
||||
if ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) {
|
||||
// Redirect to login page or show an error message.
|
||||
wp_safe_redirect( wp_login_url( get_permalink() ) );
|
||||
exit;
|
||||
// wp_safe_redirect( wp_login_url( get_permalink() ) );
|
||||
// exit;
|
||||
// Alternatively, display an error message:
|
||||
// wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'quiztech' ), 403 );
|
||||
}
|
||||
|
||||
get_header(); ?>
|
||||
|
||||
<div id="primary" class="content-area quiztech-assessment-builder-area">
|
||||
<div id="primary" class="content-area quiztech-content-area quiztech-assessment-builder-area">
|
||||
<main id="main" class="site-main">
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<header class="entry-header">
|
||||
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
|
||||
<?php the_title( '<h1 class="entry-title quiztech-page-title">', '</h1>' ); ?>
|
||||
</header><!-- .entry-header -->
|
||||
|
||||
<div class="entry-content">
|
||||
|
|
@ -33,8 +33,8 @@ get_header(); ?>
|
|||
<div id="assessment-builder-container" style="display: flex; gap: 20px;">
|
||||
|
||||
<!-- Left Pane: Question Library -->
|
||||
<div id="assessment-builder-library" style="flex: 1; border: 1px solid #ccc; padding: 15px;">
|
||||
<h2><?php esc_html_e( 'Question Library', 'quiztech' ); ?></h2>
|
||||
<div id="assessment-builder-library" class="quiztech-widget-like" style="flex: 1; border: 1px solid #ccc; padding: 15px;">
|
||||
<h2 class="quiztech-section-title"><?php esc_html_e( 'Question Library', 'quiztech' ); ?></h2>
|
||||
<p><?php esc_html_e( 'Search/filter controls will go here.', 'quiztech' ); ?></p>
|
||||
<div id="library-questions-list">
|
||||
<?php esc_html_e( 'Questions will be loaded here via AJAX.', 'quiztech' ); ?>
|
||||
|
|
@ -46,19 +46,19 @@ get_header(); ?>
|
|||
-->
|
||||
</div>
|
||||
<hr>
|
||||
<h3><?php esc_html_e( 'Create New Question', 'quiztech' ); ?></h3>
|
||||
<h3 class="quiztech-section-title"><?php esc_html_e( 'Create New Question', 'quiztech' ); ?></h3>
|
||||
<p><?php esc_html_e( 'Form for creating a new question will go here.', 'quiztech' ); ?></p>
|
||||
</div>
|
||||
|
||||
<!-- Right Pane: Current Assessment -->
|
||||
<div id="assessment-builder-current" style="flex: 2; border: 1px solid #ccc; padding: 15px;">
|
||||
<h2><?php esc_html_e( 'Current Assessment', 'quiztech' ); ?></h2>
|
||||
<div id="assessment-builder-current" class="quiztech-widget-like" style="flex: 2; border: 1px solid #ccc; padding: 15px;">
|
||||
<h2 class="quiztech-section-title"><?php esc_html_e( 'Current Assessment', 'quiztech' ); ?></h2>
|
||||
<p>
|
||||
<label for="assessment-title"><?php esc_html_e( 'Assessment Title:', 'quiztech' ); ?></label><br>
|
||||
<input type="text" id="assessment-title" name="assessment_title" style="width: 100%;">
|
||||
<label class="quiztech-label" for="assessment-title"><?php esc_html_e( 'Assessment Title:', 'quiztech' ); ?></label><br>
|
||||
<input class="quiztech-input" type="text" id="assessment-title" name="assessment_title" style="width: 100%;">
|
||||
</p>
|
||||
<div id="current-assessment-questions">
|
||||
<h3><?php esc_html_e( 'Selected Questions', 'quiztech' ); ?></h3>
|
||||
<h3 class="quiztech-section-title"><?php esc_html_e( 'Selected Questions', 'quiztech' ); ?></h3>
|
||||
<?php esc_html_e( 'Questions added from the library will appear here.', 'quiztech' ); ?>
|
||||
<!-- Example Selected Question Item Structure (for planning)
|
||||
<div class="selected-question-item" data-question-id="123">
|
||||
|
|
@ -73,9 +73,9 @@ get_header(); ?>
|
|||
<span id="assessment-total-cost">0</span> <?php esc_html_e( 'credits', 'quiztech' ); ?>
|
||||
</div>
|
||||
<p>
|
||||
<button id="save-assessment-button" class="button button-primary"><?php esc_html_e( 'Save Assessment', 'quiztech' ); ?></button>
|
||||
<button id="save-assessment-button" class="quiztech-button quiztech-button-primary"><?php esc_html_e( 'Save Assessment', 'quiztech' ); ?></button>
|
||||
<span class="spinner" style="float: none; vertical-align: middle;"></span>
|
||||
<span id="save-status" style="margin-left: 10px;"></span>
|
||||
<span id="save-status" class="quiztech-status-message" style="margin-left: 10px;"></span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ $required_capability = 'edit_assessments'; // Corresponds to 'assessment' CPT ca
|
|||
|
||||
if ( ! is_user_logged_in() || ! current_user_can( $required_capability ) ) {
|
||||
// Redirect to login page or show an error message.
|
||||
wp_safe_redirect( wp_login_url( get_permalink() ) );
|
||||
exit;
|
||||
// wp_safe_redirect( wp_login_url( get_permalink() ) );
|
||||
// exit;
|
||||
// Alternatively, display an error message:
|
||||
// wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'quiztech' ), 403 );
|
||||
}
|
||||
|
|
@ -25,23 +25,25 @@ $builder_url = $builder_page ? get_permalink( $builder_page->ID ) : '';
|
|||
|
||||
get_header(); ?>
|
||||
|
||||
<div id="primary" class="content-area">
|
||||
<div id="primary" class="content-area quiztech-content-area">
|
||||
<main id="main" class="site-main">
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<header class="entry-header">
|
||||
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
|
||||
<?php the_title( '<h1 class="entry-title quiztech-page-title">', '</h1>' ); ?>
|
||||
</header><!-- .entry-header -->
|
||||
|
||||
<div class="entry-content">
|
||||
|
||||
|
||||
<h2 class="quiztech-section-title"><?php esc_html_e( 'Existing Assessments', 'quiztech' ); ?></h2>
|
||||
<?php if ( $builder_url ) : ?>
|
||||
<p><a href="<?php echo esc_url( $builder_url ); ?>" class="button"><?php esc_html_e( 'Create New Assessment', 'quiztech' ); ?></a></p>
|
||||
<p style="margin-bottom: 20px;"><a href="<?php echo esc_url( $builder_url ); ?>" class="quiztech-button quiztech-button-primary"><?php esc_html_e( 'Create New Assessment', 'quiztech' ); ?></a></p>
|
||||
<?php else : ?>
|
||||
<p><?php esc_html_e( 'Assessment Builder page not found. Please ensure a page with the slug "assessment-builder" exists and uses the correct template.', 'quiztech' ); ?></p>
|
||||
<p style="margin-bottom: 20px;"><?php esc_html_e( 'Assessment Builder page not found. Please ensure a page with the slug \"assessment-builder\" exists and uses the correct template.', 'quiztech' ); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<h2><?php esc_html_e( 'Existing Assessments', 'quiztech' ); ?></h2>
|
||||
|
||||
|
||||
<?php
|
||||
$args = array(
|
||||
|
|
@ -55,7 +57,7 @@ get_header(); ?>
|
|||
?>
|
||||
|
||||
<?php if ( $assessments_query->have_posts() ) : ?>
|
||||
<table class="wp-list-table widefat fixed striped">
|
||||
<table class="quiztech-table wp-list-table widefat fixed striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php esc_html_e( 'Title', 'quiztech' ); ?></th>
|
||||
|
|
@ -68,7 +70,7 @@ get_header(); ?>
|
|||
<td><?php the_title(); ?></td>
|
||||
<td>
|
||||
<?php if ( $builder_url ) : ?>
|
||||
<a href="<?php echo esc_url( add_query_arg( 'assessment_id', get_the_ID(), $builder_url ) ); ?>"><?php esc_html_e( 'Edit', 'quiztech' ); ?></a>
|
||||
<a class="quiztech-link" href="<?php echo esc_url( add_query_arg( 'assessment_id', get_the_ID(), $builder_url ) ); ?>"><?php esc_html_e( 'Edit', 'quiztech' ); ?></a>
|
||||
<?php endif; ?>
|
||||
<?php // Add delete link/action later if needed ?>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ $required_capability = 'read';
|
|||
|
||||
if ( ! is_user_logged_in() || ! current_user_can( $required_capability ) ) {
|
||||
// Redirect to login page or show an error message.
|
||||
wp_safe_redirect( wp_login_url( get_permalink() ) );
|
||||
exit;
|
||||
// wp_safe_redirect( wp_login_url( get_permalink() ) );
|
||||
// exit;
|
||||
// Alternatively, display an error message:
|
||||
// wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'quiztech' ), 403 );
|
||||
}
|
||||
|
|
@ -26,24 +26,24 @@ $current_balance = function_exists('\Quiztech\AssessmentPlatform\Includes\quizte
|
|||
|
||||
get_header(); ?>
|
||||
|
||||
<div id="primary" class="content-area">
|
||||
<div id="primary" class="content-area quiztech-content-area">
|
||||
<main id="main" class="site-main">
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<header class="entry-header">
|
||||
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
|
||||
<?php the_title( '<h1 class="entry-title quiztech-page-title">', '</h1>' ); ?>
|
||||
</header><!-- .entry-header -->
|
||||
|
||||
<div class="entry-content">
|
||||
|
||||
<h2><?php esc_html_e( 'Your Credit Balance', 'quiztech' ); ?></h2>
|
||||
<h2 class="quiztech-section-title"><?php esc_html_e( 'Your Credit Balance', 'quiztech' ); ?></h2>
|
||||
<p class="quiztech-credit-balance" style="font-size: 1.5em; font-weight: bold;">
|
||||
<?php echo esc_html( $current_balance ); ?> <?php esc_html_e( 'Credits', 'quiztech' ); ?>
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><?php esc_html_e( 'Purchase Credits', 'quiztech' ); ?></h2>
|
||||
<h2 class="quiztech-section-title"><?php esc_html_e( 'Purchase Credits', 'quiztech' ); ?></h2>
|
||||
<p><?php esc_html_e( 'Select a package below to add credits to your account.', 'quiztech' ); ?></p>
|
||||
|
||||
<?php
|
||||
|
|
@ -55,9 +55,9 @@ get_header(); ?>
|
|||
);
|
||||
?>
|
||||
|
||||
<div class="quiztech-credit-packages" style="display: flex; gap: 20px; flex-wrap: wrap;">
|
||||
<div class="quiztech-credit-packages quiztech-grid-container" style="display: flex; gap: 20px; flex-wrap: wrap;">
|
||||
<?php foreach ( $credit_packages as $package_id => $package ) : ?>
|
||||
<div class="quiztech-credit-package" style="border: 1px solid #eee; padding: 15px; text-align: center;">
|
||||
<div class="quiztech-credit-package quiztech-widget-like" style="border: 1px solid #eee; padding: 15px; text-align: center;">
|
||||
<h3><?php printf( esc_html__( '%d Credits', 'quiztech' ), intval( $package['amount'] ) ); ?></h3>
|
||||
<p><?php printf( esc_html__( 'Price: %s %s', 'quiztech' ), esc_html( $package['price'] ), esc_html( $package['currency'] ) ); ?></p>
|
||||
<form method="post" action="<?php echo esc_url( get_permalink() ); ?>">
|
||||
|
|
@ -67,7 +67,7 @@ get_header(); ?>
|
|||
<input type="hidden" name="credit_amount" value="<?php echo esc_attr( $package['amount'] ); ?>">
|
||||
<input type="hidden" name="price" value="<?php echo esc_attr( $package['price'] ); ?>">
|
||||
<input type="hidden" name="currency" value="<?php echo esc_attr( $package['currency'] ); ?>">
|
||||
<button type="submit" class="button button-primary"><?php esc_html_e( 'Buy Now', 'quiztech' ); ?></button>
|
||||
<button type="submit" class="quiztech-button quiztech-button-primary"><?php esc_html_e( 'Buy Now', 'quiztech' ); ?></button>
|
||||
</form>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
|
@ -77,14 +77,14 @@ get_header(); ?>
|
|||
// Display feedback messages if any (e.g., from the purchase initiation)
|
||||
if ( isset( $_GET['purchase_status'] ) ) {
|
||||
if ( $_GET['purchase_status'] === 'initiated' ) {
|
||||
echo '<div class="notice notice-info is-dismissible"><p>' . esc_html__( 'Redirecting to payment gateway...', 'quiztech' ) . '</p></div>';
|
||||
echo '<div class="notice notice-info is-dismissible quiztech-notice"><p>' . esc_html__( 'Redirecting to payment gateway...', 'quiztech' ) . '</p></div>';
|
||||
} elseif ( $_GET['purchase_status'] === 'error' ) {
|
||||
$error_message = isset( $_GET['message'] ) ? sanitize_text_field( urldecode( $_GET['message'] ) ) : __( 'An unknown error occurred.', 'quiztech' );
|
||||
echo '<div class="notice notice-error is-dismissible"><p>' . esc_html( $error_message ) . '</p></div>';
|
||||
echo '<div class="notice notice-error is-dismissible quiztech-notice"><p>' . esc_html( $error_message ) . '</p></div>';
|
||||
} elseif ( $_GET['purchase_status'] === 'success' ) {
|
||||
echo '<div class="notice notice-success is-dismissible"><p>' . esc_html__( 'Credits successfully added!', 'quiztech' ) . '</p></div>';
|
||||
echo '<div class="notice notice-success is-dismissible quiztech-notice"><p>' . esc_html__( 'Credits successfully added!', 'quiztech' ) . '</p></div>';
|
||||
} elseif ( $_GET['purchase_status'] === 'cancelled' ) {
|
||||
echo '<div class="notice notice-warning is-dismissible"><p>' . esc_html__( 'Payment cancelled.', 'quiztech' ) . '</p></div>';
|
||||
echo '<div class="notice notice-warning is-dismissible quiztech-notice"><p>' . esc_html__( 'Payment cancelled.', 'quiztech' ) . '</p></div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -12,24 +12,26 @@
|
|||
// Replace with a more specific capability like 'manage_quiztech_jobs' if defined.
|
||||
if ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) {
|
||||
// Redirect to login page or show an error message.
|
||||
wp_safe_redirect( wp_login_url( get_permalink() ) );
|
||||
exit;
|
||||
// wp_safe_redirect( wp_login_url( get_permalink() ) );
|
||||
// exit;
|
||||
// Alternatively, display an error message:
|
||||
// wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'quiztech' ), 403 );
|
||||
}
|
||||
|
||||
get_header(); ?>
|
||||
|
||||
<div id="primary" class="content-area">
|
||||
<div id="primary" class="content-area quiztech-content-area">
|
||||
<main id="main" class="site-main">
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<header class="entry-header">
|
||||
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
|
||||
<?php the_title( '<h1 class="entry-title quiztech-page-title">', '</h1>' ); ?>
|
||||
</header><!-- .entry-header -->
|
||||
|
||||
<div class="entry-content">
|
||||
<h2><?php esc_html_e( 'Your Job Postings', 'quiztech' ); ?></h2>
|
||||
<h2 class="quiztech-section-title"><?php esc_html_e( 'Your Job Postings', 'quiztech' ); ?></h2>
|
||||
<p style="margin-bottom: 20px;"><a href="#add-new-job-form" class="quiztech-button quiztech-button-primary add-new-job-button"><?php esc_html_e( 'Add New Job', 'quiztech' ); ?></a></p>
|
||||
|
||||
<?php
|
||||
// Query args to get jobs for the current user
|
||||
$current_user_id = get_current_user_id();
|
||||
|
|
@ -46,7 +48,7 @@ get_header(); ?>
|
|||
|
||||
if ( $user_jobs_query->have_posts() ) :
|
||||
?>
|
||||
<table class="quiztech-manage-table wp-list-table widefat fixed striped">
|
||||
<table class="quiztech-table wp-list-table widefat fixed striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><?php esc_html_e( 'Title', 'quiztech' ); ?></th>
|
||||
|
|
@ -64,20 +66,20 @@ get_header(); ?>
|
|||
<td><?php echo esc_html( get_post_status( get_the_ID() ) ); ?></td>
|
||||
<td>
|
||||
<?php $results_url = '#view-results-' . get_the_ID(); // Placeholder ?>
|
||||
<button class="button button-small quiztech-edit-job-btn" data-job-id="<?php echo esc_attr( get_the_ID() ); ?>"><?php esc_html_e( 'Edit', 'quiztech' ); ?></button> |
|
||||
<a href="<?php echo esc_url( $results_url ); ?>"><?php esc_html_e( 'View Results', 'quiztech' ); ?></a> |
|
||||
<a href="#send-invite" class="send-job-invite" data-job-id="<?php echo esc_attr( get_the_ID() ); ?>"><?php esc_html_e( 'Send Invite', 'quiztech' ); ?></a>
|
||||
<button class="quiztech-button quiztech-button-secondary quiztech-button-small quiztech-edit-job-btn" data-job-id="<?php echo esc_attr( get_the_ID() ); ?>"><?php esc_html_e( 'Edit', 'quiztech' ); ?></button> |
|
||||
<a href="<?php echo esc_url( $results_url ); ?>" class="quiztech-link"><?php esc_html_e( 'View Results', 'quiztech' ); ?></a> |
|
||||
<a href="#send-invite" class="quiztech-link send-job-invite" data-job-id="<?php echo esc_attr( get_the_ID() ); ?>"><?php esc_html_e( 'Send Invite', 'quiztech' ); ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="send-invite-form-row" id="send-invite-row-<?php echo esc_attr( get_the_ID() ); ?>" style="display: none;">
|
||||
<tr class="send-invite-form-row quiztech-form-row" id="send-invite-row-<?php echo esc_attr( get_the_ID() ); ?>" style="display: none;">
|
||||
<td colspan="3">
|
||||
<div class="send-invite-form-wrapper" style="padding: 10px; background-color: #f9f9f9;">
|
||||
<label for="applicant_email_<?php echo esc_attr( get_the_ID() ); ?>"><?php esc_html_e( 'Applicant Email:', 'quiztech' ); ?></label>
|
||||
<input type="email" id="applicant_email_<?php echo esc_attr( get_the_ID() ); ?>" name="applicant_email" size="40" />
|
||||
<button class="button button-primary send-invite-submit" data-job-id="<?php echo esc_attr( get_the_ID() ); ?>"><?php esc_html_e( 'Send', 'quiztech' ); ?></button>
|
||||
<button class="button cancel-invite"><?php esc_html_e( 'Cancel', 'quiztech' ); ?></button>
|
||||
<div class="send-invite-form-wrapper quiztech-form-inline" style="padding: 10px; background-color: #f9f9f9;">
|
||||
<label class="quiztech-label" for="applicant_email_<?php echo esc_attr( get_the_ID() ); ?>"><?php esc_html_e( 'Applicant Email:', 'quiztech' ); ?></label>
|
||||
<input class="quiztech-input" type="email" id="applicant_email_<?php echo esc_attr( get_the_ID() ); ?>" name="applicant_email" size="40" />
|
||||
<button class="quiztech-button quiztech-button-primary send-invite-submit" data-job-id="<?php echo esc_attr( get_the_ID() ); ?>"><?php esc_html_e( 'Send', 'quiztech' ); ?></button>
|
||||
<button class="quiztech-button quiztech-button-secondary cancel-invite"><?php esc_html_e( 'Cancel', 'quiztech' ); ?></button>
|
||||
<span class="spinner" style="float: none; vertical-align: middle;"></span>
|
||||
<div class="invite-status" style="display: inline-block; margin-left: 10px;"></div>
|
||||
<div class="invite-status quiztech-status-message" style="display: inline-block; margin-left: 10px;"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -93,30 +95,29 @@ get_header(); ?>
|
|||
wp_reset_postdata();
|
||||
?>
|
||||
|
||||
<p style="margin-top: 20px;"><a href="#add-new-job-form" class="button add-new-job-button"><?php esc_html_e( 'Add New Job', 'quiztech' ); ?></a></p>
|
||||
|
||||
<div id="add-new-job-form" style="margin-top: 20px; padding-top: 20px; border-top: 1px solid #ccc; display: none;"> <!-- Initially hidden -->
|
||||
<h2><?php esc_html_e( 'Add New Job Details', 'quiztech' ); ?></h2>
|
||||
<form id="new-job-form" method="post" action="">
|
||||
<div id="add-new-job-form" class="quiztech-section" style="margin-top: 20px; padding-top: 20px; border-top: 1px solid #ccc; display: none;"> <!-- Initially hidden -->
|
||||
<h2 class="quiztech-section-title"><?php esc_html_e( 'Add New Job Details', 'quiztech' ); ?></h2>
|
||||
<form id="new-job-form" class="quiztech-form" method="post" action="">
|
||||
<?php wp_nonce_field( 'quiztech_add_new_job_action', 'quiztech_add_new_job_nonce' ); ?>
|
||||
|
||||
<p>
|
||||
<label for="job_title"><?php esc_html_e( 'Job Title:', 'quiztech' ); ?></label><br />
|
||||
<input type="text" id="job_title" name="job_title" value="" required style="width: 100%;" />
|
||||
<label class="quiztech-label" for="job_title"><?php esc_html_e( 'Job Title:', 'quiztech' ); ?></label><br />
|
||||
<input class="quiztech-input" type="text" id="job_title" name="job_title" value="" required style="width: 100%;" />
|
||||
<input type="hidden" id="quiztech-job-id" name="job_id" value="">
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="job_description"><?php esc_html_e( 'Job Description:', 'quiztech' ); ?></label><br />
|
||||
<label class="quiztech-label" for="job_description"><?php esc_html_e( 'Job Description:', 'quiztech' ); ?></label><br />
|
||||
<?php
|
||||
// Basic textarea for now. Replace with wp_editor in a later refinement step if needed.
|
||||
// wp_editor( '', 'job_description', array('textarea_rows' => 10) );
|
||||
?>
|
||||
<textarea id="job_description" name="job_description" rows="10" style="width: 100%;"></textarea>
|
||||
<textarea class="quiztech-textarea" id="job_description" name="job_description" rows="10" style="width: 100%;"></textarea>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="quiztech_associated_assessment_id"><?php esc_html_e( 'Linked Assessment:', 'quiztech' ); ?></label><br />
|
||||
<label class="quiztech-label" for="quiztech_associated_assessment_id"><?php esc_html_e( 'Linked Assessment:', 'quiztech' ); ?></label><br />
|
||||
<?php
|
||||
// Query published assessments
|
||||
$assessments_query = new WP_Query( [
|
||||
|
|
@ -127,7 +128,7 @@ get_header(); ?>
|
|||
'order' => 'ASC',
|
||||
] );
|
||||
|
||||
echo '<select name="quiztech_associated_assessment_id" id="quiztech_associated_assessment_id" style="width: 100%;">';
|
||||
echo '<select class="quiztech-select" name="quiztech_associated_assessment_id" id="quiztech_associated_assessment_id" style="width: 100%;">';
|
||||
echo '<option value="">' . esc_html__( '-- None --', 'quiztech' ) . '</option>';
|
||||
|
||||
if ( $assessments_query->have_posts() ) {
|
||||
|
|
@ -150,10 +151,10 @@ get_header(); ?>
|
|||
|
||||
|
||||
<p>
|
||||
<input type="submit" name="submit_new_job" class="button button-primary" value="<?php esc_attr_e( 'Save Job', 'quiztech' ); ?>" />
|
||||
<button type="button" class="button cancel-add-job"><?php esc_html_e( 'Cancel', 'quiztech' ); ?></button>
|
||||
<input type="submit" name="submit_new_job" class="quiztech-button quiztech-button-primary" value="<?php esc_attr_e( 'Save Job', 'quiztech' ); ?>" />
|
||||
<button type="button" class="quiztech-button quiztech-button-secondary cancel-add-job"><?php esc_html_e( 'Cancel', 'quiztech' ); ?></button>
|
||||
<span class="spinner" style="float: none; vertical-align: middle;"></span>
|
||||
<div class="add-job-status" style="display: inline-block; margin-left: 10px;"></div>
|
||||
<div class="add-job-status quiztech-status-message" style="display: inline-block; margin-left: 10px;"></div>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ $required_capability = 'edit_questions'; // Corresponds to 'question' CPT capabi
|
|||
|
||||
if ( ! is_user_logged_in() || ! current_user_can( $required_capability ) ) {
|
||||
// Redirect to login page or show an error message.
|
||||
wp_safe_redirect( wp_login_url( get_permalink() ) );
|
||||
exit;
|
||||
// wp_safe_redirect( wp_login_url( get_permalink() ) );
|
||||
// exit;
|
||||
// Alternatively, display an error message:
|
||||
// wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'quiztech' ), 403 );
|
||||
}
|
||||
|
|
@ -31,39 +31,38 @@ $question_types = [
|
|||
|
||||
get_header(); ?>
|
||||
|
||||
<div id="primary" class="content-area">
|
||||
<div id="primary" class="content-area quiztech-content-area">
|
||||
<main id="main" class="site-main">
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<header class="entry-header">
|
||||
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
|
||||
<?php the_title( '<h1 class="entry-title quiztech-page-title">', '</h1>' ); ?>
|
||||
</header><!-- .entry-header -->
|
||||
|
||||
<div class="entry-content">
|
||||
|
||||
<p><button id="quiztech-add-new-question-btn" class="button"><?php esc_html_e( 'Add New Question', 'quiztech' ); ?></button></p>
|
||||
|
||||
<div id="quiztech-add-edit-question-form" style="display: none; border: 1px solid #ccc; padding: 15px; margin-bottom: 20px;">
|
||||
<h3><?php esc_html_e( 'Add/Edit Question', 'quiztech' ); ?></h3>
|
||||
<div id="quiztech-add-edit-question-form" class="quiztech-section" style="display: none; border: 1px solid #ccc; padding: 15px; margin-bottom: 20px;">
|
||||
<h3 class="quiztech-section-title"><?php esc_html_e( 'Add/Edit Question', 'quiztech' ); ?></h3>
|
||||
<p style="font-weight: bold;"><?php esc_html_e( 'Credits:', 'quiztech' ); ?> 3</p> <?php // TODO: Make credit cost dynamic ?>
|
||||
|
||||
<form id="question-form">
|
||||
<form id="question-form" class="quiztech-form">
|
||||
<?php wp_nonce_field( 'quiztech_save_question_action', 'quiztech_question_nonce' ); ?>
|
||||
<input type="hidden" id="quiztech-question-id" name="question_id" value="">
|
||||
|
||||
<p>
|
||||
<label for="quiztech-question-title"><?php esc_html_e( 'Question Title (for reference):', 'quiztech' ); ?></label><br>
|
||||
<input type="text" id="quiztech-question-title" name="question_title" class="widefat" required>
|
||||
<label class="quiztech-label" for="quiztech-question-title"><?php esc_html_e( 'Question Title (for reference):', 'quiztech' ); ?></label><br>
|
||||
<input class="quiztech-input widefat" type="text" id="quiztech-question-title" name="question_title" required>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="quiztech-question-content"><?php esc_html_e( 'Question Text:', 'quiztech' ); ?></label><br>
|
||||
<textarea id="quiztech-question-content" name="question_content" class="widefat" rows="4" required></textarea>
|
||||
<label class="quiztech-label" for="quiztech-question-content"><?php esc_html_e( 'Question Text:', 'quiztech' ); ?></label><br>
|
||||
<textarea class="quiztech-textarea widefat" id="quiztech-question-content" name="question_content" rows="4" required></textarea>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="quiztech-question-type"><?php esc_html_e( 'Question Type:', 'quiztech' ); ?></label><br>
|
||||
<select id="quiztech-question-type" name="question_type" required>
|
||||
<label class="quiztech-label" for="quiztech-question-type"><?php esc_html_e( 'Question Type:', 'quiztech' ); ?></label><br>
|
||||
<select class="quiztech-select" id="quiztech-question-type" name="question_type" required>
|
||||
<option value=""><?php esc_html_e( '-- Select Type --', 'quiztech' ); ?></option>
|
||||
<?php foreach ( $question_types as $value => $label ) : ?>
|
||||
<option value="<?php echo esc_attr( $value ); ?>"><?php echo esc_html( $label ); ?></option>
|
||||
|
|
@ -72,18 +71,19 @@ get_header(); ?>
|
|||
</p>
|
||||
|
||||
<p id="quiztech-question-options-wrapper" style="display: none;">
|
||||
<label for="quiztech-question-options"><?php esc_html_e( 'Options (one per line, mark correct with *):', 'quiztech' ); ?></label><br>
|
||||
<textarea id="quiztech-question-options" name="question_options" class="widefat" rows="5"></textarea>
|
||||
<label class="quiztech-label" for="quiztech-question-options"><?php esc_html_e( 'Options (one per line, mark correct with *):', 'quiztech' ); ?></label><br>
|
||||
<textarea class="quiztech-textarea widefat" id="quiztech-question-options" name="question_options" rows="5"></textarea>
|
||||
<small><?php esc_html_e('Example: Option A*'); ?></small> <?php // TODO: Clarify correct answer format for checkboxes ?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="quiztech-question-category"><?php esc_html_e( 'Category:', 'quiztech' ); ?></label><br>
|
||||
<label class="quiztech-label" for="quiztech-question-category"><?php esc_html_e( 'Category:', 'quiztech' ); ?></label><br>
|
||||
<?php
|
||||
wp_dropdown_categories( array(
|
||||
'taxonomy' => 'quiztech_category',
|
||||
'name' => 'question_category',
|
||||
'id' => 'quiztech-question-category',
|
||||
'class' => 'quiztech-select', // Add class here
|
||||
'show_option_none'=> __( '-- Select Category --', 'quiztech' ),
|
||||
'hide_empty' => 0,
|
||||
'hierarchical' => 1,
|
||||
|
|
@ -92,21 +92,23 @@ get_header(); ?>
|
|||
</p> <?php // Closing </p> was missing here ?>
|
||||
|
||||
<p>
|
||||
<label for="quiztech-question-points"><?php esc_html_e( 'Question Points:', 'quiztech' ); ?></label><br>
|
||||
<input type="number" id="quiztech-question-points" name="question_points" class="small-text" min="0" step="1" value="1">
|
||||
<label class="quiztech-label" for="quiztech-question-points"><?php esc_html_e( 'Question Points:', 'quiztech' ); ?></label><br>
|
||||
<input class="quiztech-input small-text" type="number" id="quiztech-question-points" name="question_points" min="0" step="1" value="1">
|
||||
<small><?php esc_html_e('Points awarded for a correct answer.', 'quiztech'); ?></small>
|
||||
</p>
|
||||
|
||||
<?php // Removed extra closing </p> tag from line 97 of original ?>
|
||||
|
||||
<p>
|
||||
<button type="submit" class="button button-primary"><?php esc_html_e( 'Save Question', 'quiztech' ); ?></button>
|
||||
<button type="button" id="quiztech-cancel-edit-question-btn" class="button" style="display: none;"><?php esc_html_e( 'Cancel', 'quiztech' ); ?></button>
|
||||
<button type="submit" class="quiztech-button quiztech-button-primary"><?php esc_html_e( 'Save Question', 'quiztech' ); ?></button>
|
||||
<button type="button" id="quiztech-cancel-edit-question-btn" class="quiztech-button quiztech-button-secondary" style="display: none;"><?php esc_html_e( 'Cancel', 'quiztech' ); ?></button>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<h2><?php esc_html_e( 'Question Library', 'quiztech' ); ?></h2>
|
||||
<h2 class="quiztech-section-title"><?php esc_html_e( 'Question Library', 'quiztech' ); ?></h2>
|
||||
|
||||
<p style="margin-bottom: 20px;"><button id="quiztech-add-new-question-btn" class="quiztech-button quiztech-button-primary"><?php esc_html_e( 'Add New Question', 'quiztech' ); ?></button></p>
|
||||
|
||||
<?php
|
||||
$args = array(
|
||||
|
|
@ -120,7 +122,7 @@ get_header(); ?>
|
|||
?>
|
||||
|
||||
<?php if ( $questions_query->have_posts() ) : ?>
|
||||
<table class="wp-list-table widefat fixed striped">
|
||||
<table class="quiztech-table wp-list-table widefat fixed striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php esc_html_e( 'Title', 'quiztech' ); ?></th>
|
||||
|
|
@ -144,8 +146,8 @@ get_header(); ?>
|
|||
<td><?php echo esc_html( $q_type_label ); ?></td>
|
||||
<td><?php echo esc_html( $category_name ); ?></td>
|
||||
<td>
|
||||
<button class="button quiztech-edit-question-btn" data-question-id="<?php echo esc_attr( $question_id ); ?>"><?php esc_html_e( 'Edit', 'quiztech' ); ?></button>
|
||||
<button class="button quiztech-delete-question-btn" data-question-id="<?php echo esc_attr( $question_id ); ?>"><?php esc_html_e( 'Delete', 'quiztech' ); ?></button>
|
||||
<button class="quiztech-button quiztech-button-secondary quiztech-button-small quiztech-edit-question-btn" data-question-id="<?php echo esc_attr( $question_id ); ?>"><?php esc_html_e( 'Edit', 'quiztech' ); ?></button>
|
||||
<button class="quiztech-button quiztech-button-secondary quiztech-button-small quiztech-delete-question-btn" data-question-id="<?php echo esc_attr( $question_id ); ?>"><?php esc_html_e( 'Delete', 'quiztech' ); ?></button>
|
||||
<?php // Add nonces and JS handlers later ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
// Replace with a more specific capability like 'manage_quiztech_options' if defined.
|
||||
if ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) {
|
||||
// Redirect to login page or show an error message.
|
||||
wp_safe_redirect( wp_login_url( get_permalink() ) );
|
||||
exit;
|
||||
// wp_safe_redirect( wp_login_url( get_permalink() ) );
|
||||
// exit;
|
||||
// Alternatively, display an error message:
|
||||
// wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'quiztech' ), 403 );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ $required_capability = 'edit_jobs'; // Or a more specific 'view_results' capabil
|
|||
|
||||
if ( ! is_user_logged_in() || ! current_user_can( $required_capability ) ) {
|
||||
// Redirect to login page or show an error message.
|
||||
wp_safe_redirect( wp_login_url( get_permalink() ) );
|
||||
exit;
|
||||
// wp_safe_redirect( wp_login_url( get_permalink() ) );
|
||||
// exit;
|
||||
// Alternatively, display an error message:
|
||||
// wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'quiztech' ), 403 );
|
||||
}
|
||||
|
|
@ -41,21 +41,21 @@ if ( ! $job_id ) {
|
|||
|
||||
get_header(); ?>
|
||||
|
||||
<div id="primary" class="content-area">
|
||||
<div id="primary" class="content-area quiztech-content-area">
|
||||
<main id="main" class="site-main">
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<header class="entry-header">
|
||||
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
|
||||
<?php the_title( '<h1 class="entry-title quiztech-page-title">', '</h1>' ); ?>
|
||||
</header><!-- .entry-header -->
|
||||
|
||||
<div class="entry-content">
|
||||
|
||||
<?php if ( $error_message ) : ?>
|
||||
<div class="notice notice-error"><p><?php echo esc_html( $error_message ); ?></p></div>
|
||||
<p><a href="<?php echo esc_url( get_post_type_archive_link('job') ?: home_url('/manage-jobs/') ); ?>"><?php esc_html_e('« Back to Jobs', 'quiztech'); ?></a></p> <?php // Link back to job list ?>
|
||||
<div class="notice notice-error quiztech-notice"><p><?php echo esc_html( $error_message ); ?></p></div>
|
||||
<p><a class="quiztech-link" href="<?php echo esc_url( get_post_type_archive_link('job') ?: home_url('/manage-jobs/') ); ?>"><?php esc_html_e('« Back to Jobs', 'quiztech'); ?></a></p> <?php // Link back to job list ?>
|
||||
<?php elseif ( $job_post ) : ?>
|
||||
<h2><?php printf( esc_html__( 'Results for Job: %s', 'quiztech' ), esc_html( get_the_title( $job_post ) ) ); ?></h2>
|
||||
<h2 class="quiztech-section-title"><?php printf( esc_html__( 'Results for Job: %s', 'quiztech' ), esc_html( get_the_title( $job_post ) ) ); ?></h2>
|
||||
|
||||
<?php
|
||||
$args = array(
|
||||
|
|
@ -77,7 +77,7 @@ get_header(); ?>
|
|||
?>
|
||||
|
||||
<?php if ( $evaluations_query->have_posts() ) : ?>
|
||||
<table class="wp-list-table widefat fixed striped">
|
||||
<table class="quiztech-table wp-list-table widefat fixed striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php esc_html_e( 'Applicant Email', 'quiztech' ); ?></th>
|
||||
|
|
@ -104,7 +104,7 @@ get_header(); ?>
|
|||
<td><?php echo esc_html( get_the_date() ); ?></td>
|
||||
<td>
|
||||
<?php if ( $edit_link ) : ?>
|
||||
<a href="<?php echo esc_url( $edit_link ); ?>" target="_blank"><?php esc_html_e( 'View Details', 'quiztech' ); ?></a>
|
||||
<a class="quiztech-link" href="<?php echo esc_url( $edit_link ); ?>" target="_blank"><?php esc_html_e( 'View Details', 'quiztech' ); ?></a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue