403Webshell
Server IP : 104.21.28.229  /  Your IP : 216.73.216.142
Web Server : Apache/2
System : Linux hosting8537.lvs 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : mienphi ( 1014)
PHP Version : 8.2.14
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/mienphi/public_html/wp-content/plugins/learnpress/inc/admin/views/question/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/mienphi/public_html/wp-content/plugins/learnpress/inc/admin/views/question/option.php
<?php
/**
 * Admin question editor: question answer template.
 *
 * @since 3.0.0
 */
?>

<script type="text/x-template" id="tmpl-lp-question-answer-option">
	<tr class="answer-option" :class="[isNew() || isUpdating() ? 'new-option' : '']" :data-answer-id="id">
		<td class="sort lp-sortable-handle"><?php learn_press_admin_view( 'svg-icon' ); ?></td>
		<td class="answer-text">
			<form @submit.prevent="">
				<input type="text" v-model="answer.title" @change="changeTitle" @blur="updateTitle" @keyup.enter="updateTitle"/>
			</form>
		</td>
		<td class="answer-correct lp-answer-check">
			<input :type="radio ? 'radio' : 'checkbox'" :checked="correct ? 'checked' : ''" :value="answer.value" :name="name" @change="changeCorrect">
		</td>
		<td class="actions lp-toolbar-buttons">
			<div v-if="deletable" class="lp-toolbar-btn lp-btn-remove remove-answer">
				<a class="lp-btn-icon dashicons dashicons-trash" @click="deleteAnswer" title="<?php esc_attr_e( 'Delete', 'learnpress' ); ?>"></a>
			</div>
		</td>
	</tr>
</script>

<script type="text/javascript">
	jQuery( function($) {
		var $store = window.LP_Question_Store;
		window.$Vue = window.$Vue || Vue;

		$Vue.component('lp-question-answer-option', {
			template: '#tmpl-lp-question-answer-option',
			props: ['answer', 'index', 'type', 'radio', 'number'],
			data: function() {
				return {
					changed: false,
					updating: false
				}
			},
			computed: {
				// answer id
				id: function() {
					return this.answer.question_answer_id;
				},
				// check correct answer
				correct: function() {
					return this.answer.is_true === 'yes';
				},
				// input correct form name
				name: function() {
					return 'answer_question[' + $store.getters['id'] + ']'
				},
				// deletable answer
				deletable: function() {
					return !(this.number < 3 || (this.correct && $store.getters['numberCorrect'] === 1) || this.type === 'true_or_false');
				},
				status: function() {
					return $store.getters['status'];
				}
			},
			watch: {
				status: function(s) {
					if (s !== 'loading') {
						this.updating = false;
					}
					return s;
				}
			},
			mounted: function() {
				if (this.isNew()) {
					this.changed = true;
					this.updateTitle();

					setTimeout(() => {
						$(this.$el).find('.answer-text input').focus();
					}, 300)
				}
			},
			methods: {
				changeTitle: function() {
					this.changed = true;
				},
				updateTitle: function() {
					if (this.changed) {
						this.updating = true;
						this.$emit('updateTitle', this.answer);
					}
				},
				changeCorrect: function (e) {
					this.updating = true;

					this.answer.is_true = (e.target.checked) ? 'yes' : '';
					this.$emit('changeCorrect', this.answer);
				},
				deleteAnswer: function () {
					this.$emit('deleteAnswer', {
						id: this.id,
						order: this.answer.order
					});
				},
				isNew: function () {
					return isNaN(this.answer.question_answer_id);
				},
				isUpdating: function () {
					return this.updating;
				}
			}
		})
	});
</script>

Youez - 2016 - github.com/yon3zu
LinuXploit