Skip to content

Commit

Permalink
Merge pull request #19 from pacoorozco/dev
Browse files Browse the repository at this point in the history
New release 0.2.1
  • Loading branch information
pacoorozco committed Apr 12, 2016
2 parents 4715146 + 6d89923 commit e066166
Show file tree
Hide file tree
Showing 14 changed files with 205 additions and 181 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.2.0
current_version = 0.2.1
commit = True
tag = False

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ It's a Laravel 5.1 application, based on the PHP5 & mysql original [gamify](http

As much as possible, we have tried to keep a clean code to work everywhere out of the box. You are not obliged to use our tools and are free to change the code in order to use it at your own feeling.

## Disclaimer - It's working but NOT ready for production
## Disclaimer - It's ready for production, but no doc

> This is not, yet, **production code**. It's fully working and you can play with it, but some features are not yet included. I'm working in order to finish ASAP, in my personal free time, so be patient or contact me in order to give me your help.
> It's fully working and you can play with it, but it lacks of some documentation. I'm working in order to improve it, in my personal free time, so be patient or contact me in order to give me your help.
## Changelog

Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Admin/AdminQuestionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ public function data(Request $request, Datatables $dataTable)
])->orderBy('name', 'ASC');

$statusLabel = [
'draft' => '<span class="label label-default">'.trans('admin/question/model.draft').'</span>',
'publish' => '<span class="label label-success">'.trans('admin/question/model.publish').'</span>',
'unpublish' => '<span class="label label-warning">'.trans('admin/question/model.unpublish').'</span>',
'draft' => '<span class="label label-default">'.trans('admin/question/model.status_list.draft').'</span>',
'publish' => '<span class="label label-success">'.trans('admin/question/model.status_list.publish').'</span>',
'unpublish' => '<span class="label label-warning">'.trans('admin/question/model.status_list.unpublish').'</span>',
];

return $dataTable->of($question)
Expand Down
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
|
*/

'version' => '0.2.0',
'version' => '0.2.1',

/*
|--------------------------------------------------------------------------
Expand Down
62 changes: 0 additions & 62 deletions public/js/gamify.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,68 +50,6 @@ Gamify = {
event.preventDefault();
$(this).closest('.cloneable').remove();
});

$(function () {
$(".tags-input").select2({
tags: true,
placeholder: 'Put your tags here',
tokenSeparators: [','],
allowClear: true,
theme: "bootstrap",
matcher: function (params, data) {
// If there are no search terms, return all of the data
if ($.trim(params.term) === '') {
return data;
}

// `params.term` should be the term that is used for searching
// `data.text` is the text that is displayed for the data object
if (data.text.toLowerCase().indexOf(params.term.toLowerCase()) > -1) {
return data;
}

// Return `null` if the term should not be displayed
return null;
},
createTag: function (params) {
var term = $.trim(params.term);
if (term === "") {
return null;
}

var optionsMatch = false;

this.$element.find("option").each(function () {
if (this.value.toLowerCase().indexOf(term.toLowerCase()) > -1) {
optionsMatch = true;
}
});

if (optionsMatch) {
return null;
}
return {id: term, text: term};
}
});
});

$('.date-picker').datepicker({
format: 'yyyy-mm-dd',
autoclose: true
});

tinymce.init({
selector: "textarea.tinymce",
width: '100%',
height: 270,
statusbar: false,
menubar: false,
plugins: [
"link",
"code"
],
toolbar: "bold italic underline strikethrough | removeformat | undo redo | bullist numlist | link code"
});
}
};

3 changes: 0 additions & 3 deletions resources/lang/en/admin/question/messages.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<?php

return [
'already_exists' => 'Question already exists!',
'does_not_exist' => 'Question does not exist.',
'name_required' => 'The name field is required',
'publish' => [
'error' => 'This question can\'t be published. You must give two or more answer choices and at least one of them must be correct.',
],
Expand Down
59 changes: 42 additions & 17 deletions resources/lang/en/admin/question/model.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,48 @@

return [

'shortname' => 'Short Name',
'name' => 'Name',
'question' => 'Question Text',
'solution' => 'Detailed Answer Text',
'type' => 'Question Type',
'single' => 'Single Answer',
'multi' => 'Multiple Answers',
'hidden' => 'Visibility',
'hidden_yes' => 'Hidden',
'hidden_no' => 'Public',
'status' => 'Status',
'draft' => 'Draft',
'publish' => 'Published',
'unpublish' => 'Retired',
'actions' => 'Actions',
'tags' => 'Tags',
'choice_text' => 'Answer Text',
// General
'shortname' => 'Short name',
'name' => 'Question name',
'name_help' => 'This is an internal name, users will never see this name.',
'question' => 'Question text',
'question_help' => 'This is the text user will see as a question.',
'solution' => 'General feedback',
'solution_help' => 'General feedback is shown to the user after they have completed the question. You can use to give users a fully worked answer and perhaps a link to more information.',
'type' => 'One or multiple answers?',
'type_list' => [
'single' => 'One answer only',
'multi' => 'Multiple answers allowed',
],
'shuffle_choices' => 'Shuffle the choices?',
'shuffle_choices_help' => 'If enabled, the order of the answers is randomly shuffled for each attempt.',

'hidden' => 'Visible',
'hidden_help' => 'Hidden questions can be only accessed via its URL.',
'hidden_yes' => 'Hide',
'hidden_no' => 'Show',

'status' => 'Status',
'status_list' => [
'draft' => 'Draft',
'publish' => 'Published',
'unpublish' => 'Retired',
],

// Tags
'tags' => 'Tags',
'tags_help' => 'Enter tags separated by commas',
'tags_none' => 'None',

// Answers
'choice_text' => 'Answer Text',
'choice_text_help' => 'Put here the text of this choice',
'choice_points' => 'Points',
'choice_points_help' => 'Choices with positive points are considered as correct.',
'choice_correct' => 'Is correct?',

// Created / last saved
'created_by' => 'Created by :who on :when',
'updated_by' => 'Last saved by :who on :when',

];
14 changes: 0 additions & 14 deletions resources/lang/en/admin/question/table.php

This file was deleted.

19 changes: 14 additions & 5 deletions resources/lang/en/admin/question/title.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
<?php

return [
'question_management' => 'Question Management',
'question_show' => 'Question Details',
'create_a_new_question' => 'Create New Question',
'question_edit' => 'Edit Question',
'question_delete' => 'Delete Question',
'question_management' => 'Question management',
'question_management_subtitle' => 'create and edit questions',

'question_show' => 'Question details',
'create_a_new_question' => 'Create new question',
'question_edit' => 'Edit question',
'question_delete' => 'Delete question',

'general_section' => 'General',
'answer_section' => 'Answers',
'publish_section' => 'Publish',
'tags_section' => 'Tags',
'badges_section' => 'Associated badges',
'other_section' => 'Other information',
];
27 changes: 14 additions & 13 deletions resources/lang/en/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@

return [

'yes' => 'Yes',
'no' => 'No',
'yes' => 'Yes',
'no' => 'No',
'must_login' => 'Must be logged in.',
'logout' => 'Sign out',
'all' => 'All',
'show' => 'Show',
'edit' => 'Edit',
'delete' => 'Delete',
'search' => 'Search',
'actions' => 'Actions',
'add' => 'Add',
'remove' => 'Remove',
'back' => 'Back',
'close' => 'Close',
'logout' => 'Sign out',
'all' => 'All',
'show' => 'Show',
'edit' => 'Edit',
'delete' => 'Delete',
'search' => 'Search',
'actions' => 'Actions',
'add' => 'Add',
'remove' => 'Remove',
'back' => 'Back',
'close' => 'Close',
'none' => 'None',

];
38 changes: 23 additions & 15 deletions resources/views/admin/question/_details.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="box box-solid box-default">
<div class="box box-solid {{ ($action == 'show') ? 'box-default' : 'box-danger' }}">
<div class="box-header">
<h3 class="box-title">{{ $question->name }}
<span class="badge">{{ $question->status }}</span>
<span class="badge">{{ trans('admin/question/model.status_list.' . $question->status) }}</span>
@if ($question->hidden)
<span class="badge">hidden</span>
@endif
Expand All @@ -18,20 +18,19 @@
</div>

<!-- choices -->

<div class="panel panel-default">
<div class="panel-heading">
{{ trans('admin/choice/title.current_choices') }}
{{ trans('admin/question/title.answer_section') }}
</div><!-- ./ panel-header -->
<div class="panel-body">
@if (count($question->choices) > 0)
{!! Form::label('type', trans('admin/question/model.type'), array('class' => 'control-label')) !!}
{{ $question->type }}
{{ trans('admin/question/model.type_list.' . $question->type) }}
<table class="table table-hover">
<tr>
<th>{{ trans('admin/choice/table.text') }}</th>
<th>{{ trans('admin/choice/table.points') }}</th>
<th>{{ trans('admin/choice/table.correct') }}</th>
<th>{{ trans('admin/question/model.choice_text') }}</th>
<th>{{ trans('admin/question/model.choice_points') }}</th>
<th>{{ trans('admin/question/model.choice_correct') }}</th>
</tr>
@foreach ($question->choices as $choice)
<tr>
Expand All @@ -50,7 +49,6 @@

<div class="panel panel-default">
<div class="panel-heading">

{{ trans('admin/question/model.solution') }}
</div>
<div class="panel-body">
Expand All @@ -60,17 +58,27 @@

<div class="panel panel-default">
<div class="panel-heading">
{{ trans('admin/question/title.tags_section') }}
</div>
<div class="panel-body">
@forelse($question->tagList as $tag)
<span class="label label-info">#{{ $tag }}</span>
@empty
{{ trans('admin/question/model.tags_none') }}
@endforelse
</div>
</div>

{{ trans('admin/question/model.tags') }}
<div class="panel panel-default">
<div class="panel-heading">
{{ trans('admin/question/title.other_section') }}
</div>
<div class="panel-body">
<ul>
@foreach($question->tagList as $tag)
<li>{{ $tag }}</li>
@endforeach
</ul>
<p>{{ trans('admin/question/model.created_by', ['who' => $question->created_by, 'when' => $question->created_at->toDayDateTimeString()]) }}</p>
<p>{{ trans('admin/question/model.updated_by', ['who' => $question->updated_by, 'when' => $question->updated_at->toDayDateTimeString()]) }}</p>
</div>
</div>

</div>
<div class="box-footer">
<a href="{{ route('admin.questions.index') }}">
Expand Down
Loading

0 comments on commit e066166

Please sign in to comment.