burningpony/phd_checker

View on GitHub
app/views/essays/index.haml

Summary

Maintainability
Test Coverage
-content_for :page_title do
    Experiment

:javascript
    window.path_to_controller = "/#{params[:controller]}";
    window.option = "#{@option}";
    window.available_payments = #{@available_payments.to_json};
    window.job = "#{@job}";

-if controller.show_quota_items
    :javascript
        window.__show_quota_items = true;

-if controller.show_other_student_actions
    :javascript
        window.__show_other_student_actions = true;
-else
    :javascript
        window.__show_other_student_actions = false;

.error-modal
    %h4.text-center System Error, Please Wait
    %a.close-modal.btn.btn-danger.btn-block
        Retry

.participant
    %h4.text-center
        Group

    .form-group
        %label.sr-only{:for => "group_id"} Group
        %input#group_id.form-control{:placeholder => "Enter Group", :type => "text"}/
    %br
    %h4.text-center
        Participant ID
    .form-group
        %label.sr-only{:for => "participant_id"} Group
        %input#participant_id.form-control{:placeholder => "Enter Participant ID", :type => "text"}/


    %input{:type=>'button', :value=>'start', :class=> 'btn btn-success btn-block'}
    .error

.instructions
    %a.btn.btn-lg.btn-block.btn-success.simplemodal-close{href: '#' }
        Start

-# shown prompting us to finish or not, when we click finish
.confirm_quit
    .well
        .h4
            Are you sure you want to continue to next phase?

    %input{:type=> 'button', :value => 'Confirm', :class => 'btn btn-block btn-success quit_button'}
    %input{:type=> 'button', :value => 'Cancel', :class => 'btn btn-block btn-default cancel_button'}
.score_card
    .msg

    .body

    .done
        -#finish viewing score card
        %input{:type=> 'button', :value => 'Done', :class => 'btn btn-block btn-primary done_button'}
-# shown after we are completely finished
.finished
    -# note when this loads, turn off the unload handler
    %h4.text-center
        Thank you for Participating
    .msg

    -# body will contain the scores from russell's stuff
    .body

    .continue
        %hr
        Now that you have finished your task, we would like you to complete a brief survey before your final payment. To complete the survey, please click on the following link. When you have completed the survey, please bring all of your paper materials with you for final payment.
        %br
        %h3.text-center=link_to "Survey Link", url_for("https://asu.co1.qualtrics.com/SE/?SID=SV_6PbXAOSph7cEyz3"), :target => "_blank"
        %br
        .text-center=link_to "Prepare this computer for the next trial", root_path, class: ""

.other_participants
    -# injected
    .body

    .button
        Done
.container
    .row
        .col-xs-1
            .menu
                .well.well-sm
                    %ul.nav.nav-pills.nav-stacked
                        -@essays.each_with_index do |essay, i|
                            %li
                                %a{:href=> '#', :class=>'essay_link hide', data: {round: essay[:round], essay: essay[:essay], type: essay[:type]} }
                                    #{essay[:type].to_s.capitalize + ' ' + essay[:essay].to_s}

                        %li
                            %a{:class=>'quit', :href=> '#'}
                                Finish
        .col-xs-9
            .content
        .col-xs-2
            .col-spacer
                .timer

                .round